name
stringlengths
12
178
code_snippet
stringlengths
8
36.5k
score
float64
3.26
3.68
hudi_SparkPreCommitValidator_m0_rdh
/** * Publish pre-commit validator run stats for a given commit action. */ private void m0(String instantTime, long duration) { // Record validator duration metrics. if (getWriteConfig().isMetricsOn()) { HoodieTableMetaClient metaClient = getHoodieTable().getMetaClient(); O...
3.26
hudi_SparkPreCommitValidator_validate_rdh
/** * Verify the data written as part of specified instant. * Throw HoodieValidationException if any unexpected data is written (Example: data files are not readable for some reason). */ public void validate(String instantTime, HoodieWriteMetadata<O> writeResult, Dataset<Row> before, Dataset<Row> after) throws Hoodi...
3.26
hudi_UpsertPartitioner_getPartitionPathToPendingClusteringFileGroupsId_rdh
/** * Get the in pending clustering fileId for each partition path. * * @return partition path to pending clustering file groups id */ private Map<String, Set<String>> getPartitionPathToPendingClusteringFileGroupsId() { Map<String, Set<String>> partitionPathToInPendingClusteringFileId = table.getFileSystemView(...
3.26
hudi_UpsertPartitioner_getSmallFiles_rdh
/** * Returns a list of small files in the given partition path. */ protected List<SmallFile> getSmallFiles(String partitionPath) { // smallFiles only for partitionPath List<SmallFile> smallFileLocations = new ArrayList<>(); HoodieTimeline commitTimeline = table.getMetaClient().getCommitsTimeline().filter...
3.26
hudi_UpsertPartitioner_filterSmallFilesInClustering_rdh
/** * Exclude small file handling for clustering since update path is not supported. * * @param pendingClusteringFileGroupsId * pending clustering file groups id of partition * @param smallFiles * small files of partition * @return smallFiles not in clustering */ private List<SmallFile> filterSmallFilesInCl...
3.26
hudi_UpsertPartitioner_averageBytesPerRecord_rdh
/** * Obtains the average record size based on records written during previous commits. Used for estimating how many * records pack into one file. */ protected static long averageBytesPerRecord(HoodieTimeline commitTimeline, HoodieWriteConfig hoodieWriteConfig) { long avgSize = hoodieWriteConfig.getCopyOnWri...
3.26
hudi_BaseClusterer_updateWriteClient_rdh
/** * Update the write client used by async clustering. * * @param writeClient */ public void updateWriteClient(BaseHoodieWriteClient<T, I, K, O> writeClient) {this.clusteringClient = writeClient; }
3.26
hudi_HoodieBigQuerySyncClient_updateTableSchema_rdh
/** * Updates the schema for the given table if the schema has changed. The schema passed in will not have the partition columns defined, * so we add them back to the schema with the values read from the existing BigQuery table. This allows us to keep the partition * field type in sync with how it is registered in B...
3.26
hudi_HoodieBigQuerySyncClient_tableNotExistsOrDoesNotMatchSpecification_rdh
/** * Checks for the existence of a table that uses the manifest file approach and matches other requirements. * * @param tableName * name of the table * @return Returns true if the table does not exist or if the table does exist but does not use the manifest file. False otherwise. *...
3.26
hudi_HoodieTableMetadataUtil_metadataPartitionExists_rdh
/** * Check if the given metadata partition exists. * * @param basePath * base path of the dataset * @param context * instance of {@link HoodieEngineContext}. */ public static boolean metadataPartitionExists(String basePath, HoodieEngineContext context, MetadataPartitionType partitionType) { final String...
3.26
hudi_HoodieTableMetadataUtil_isIndexingCommit_rdh
/** * Checks if a delta commit in metadata table is written by async indexer. * <p> * TODO(HUDI-5733): This should be cleaned up once the proper fix of rollbacks in the * metadata table is landed. * * @param instantTime * Instant time to check. * @return {@code true} if from async indexer; {@code false} othe...
3.26
hudi_HoodieTableMetadataUtil_convertMetadataToBloomFilterRecords_rdh
/** * Convert clean metadata to bloom filter index records. * * @param cleanMetadata * - Clean action metadata * @param engineContext * - Engine context * @param instantTime * - Clean action instant time * @param recordsGenerationParams * - Parameters for bloom filter record generation * @return List...
3.26
hudi_HoodieTableMetadataUtil_getPartitionLatestMergedFileSlices_rdh
/** * Get the latest file slices for a Metadata Table partition. If the file slice is * because of pending compaction instant, then merge the file slice with the one * just before the compaction instant time. The list of file slices returned is * sorted in the correct order of file group name. * * @param metaClie...
3.26
hudi_HoodieTableMetadataUtil_convertFilesToColumnStatsRecords_rdh
/** * Convert added and deleted action metadata to column stats index records. */ public static HoodieData<HoodieRecord> convertFilesToColumnStatsRecords(HoodieEngineContext engineContext, Map<String, List<String>> partitionToDeletedFiles, Map<String, Map<String, Long>> partitionToAppendedFiles, MetadataRecordsG...
3.26
hudi_HoodieTableMetadataUtil_convertMetadataToColumnStatsRecords_rdh
/** * Convert clean metadata to column stats index records. * * @param cleanMetadata * - Clean action metadata * @param engineContext * - Engine context * @param recordsGenerationParams * - Parameters for bloom filter record generation * @return List of column stats index records for the clean metadata ...
3.26
hudi_HoodieTableMetadataUtil_deleteMetadataTable_rdh
/** * Delete the metadata table for the dataset and backup if required. * * @param dataMetaClient * {@code HoodieTableMetaClient} of the dataset for which...
3.26
hudi_HoodieTableMetadataUtil_deleteMetadataTablePartition_rdh
/** * Delete a partition within the metadata table. * <p> * This can be used to delete a partition so that it can be re-bootstrapped. * * @param dataMetaClient * {@code HoodieTableMetaClient} of the dataset for which metadata table is to be deleted * @param context * instance of {@code HoodieEngineContext}....
3.26
hudi_HoodieTableMetadataUtil_convertMetadataToRecords_rdh
/** * Convert rollback action metadata to metadata table records. * <p> * We only need to handle FILES partition here as HUDI rollbacks on MOR table may end up adding a new log file. All other partitions * are handled by actual rollback of the deltacommit which added records to those partitions. */ public static M...
3.26
hudi_HoodieTableMetadataUtil_createLogCompactionTimestamp_rdh
/** * Create the timestamp for a compaction operation on the metadata table. */ public static String createLogCompactionTimestamp(String timestamp) { return timestamp + OperationSuffix.LOG_COMPACTION.getSuffix(); }
3.26
hudi_HoodieTableMetadataUtil_coerceToComparable_rdh
/** * Given a schema, coerces provided value to instance of {@link Comparable<?>} such that * it could subsequently used in column stats * * NOTE: This method has to stay compatible with the semantic of * {@link ParquetUtils#readRangeFromParquetMetadata} as they are used in tandem */ private static Comparabl...
3.26
hudi_HoodieTableMetadataUtil_convertFilesToBloomFilterRecords_rdh
/** * Convert added and deleted files metadata to bloom filter index records. */ public static HoodieData<HoodieRecord> convertFilesToBloomFilterRecords(HoodieEngineContext engineContext, Map<String, List<String>> partitionToDeletedFiles, Map<String, Map<String, Long>> partitionToAppendedFiles, MetadataRecordsGenerat...
3.26
hudi_HoodieTableMetadataUtil_convertColumnStatsRecordToColumnRangeMetadata_rdh
/** * Converts instance of {@link HoodieMetadataColumnStats} to {@link HoodieColumnRangeMetadata} */ public static HoodieColumnRangeMetadata<Comparable> convertColumnStatsRecordToColumnRangeMetadata(HoodieMetadataColumnStats columnStats) { return HoodieColumnRangeMetadata.<Comparable>create(columnStats.getFileNam...
3.26
hudi_HoodieTableMetadataUtil_convertMetadataToRollbackRecords_rdh
/** * Convert rollback action metadata to files partition records. * Consider only new log files added. */ private static List<HoodieRecord> convertMetadataToRollbackRecords(HoodieRollbackMetadata rollbackMetadata, String instantTime, HoodieTableMetaClient dataTableMetaClient) { Map<String, Map<String, Long>>...
3.26
hudi_HoodieTableMetadataUtil_getRollbackedCommits_rdh
/** * Returns a list of commits which were rolled back as part of a Rollback or Restore operation. * * @param instant * The Rollback operation to read * @param timeline * instant of timeline from dataset. */ private static List<String> getRollbackedCommits(HoodieInstant instant, HoodieActiveTimeline timeline...
3.26
hudi_HoodieTableMetadataUtil_readRecordKeysFromFileSlices_rdh
/** * Reads the record keys from the given file slices and returns a {@link HoodieData} of {@link HoodieRecord} to be updated in the metadata table. * If file slice does not have any base file, then...
3.26
hudi_HoodieTableMetadataUtil_estimateFileGroupCount_rdh
/** * Estimates the file group count to use for a MDT partition. * * @param partitionType * Type of the partition for which the file group count is to be estimated. * @param recordCount * The number of records expected to be written. * @param averageRecordSize * Average size of each record to be writen. ...
3.26
hudi_HoodieTableMetadataUtil_deleteMetadataPartition_rdh
/** * Deletes the metadata partition from the file system. * * @param basePath * - base path of the dataset * @param context * - instance of {@link HoodieEngineContext} * @param partitionType * - {@link MetadataPartitionType} of the partition to delete */public static void deleteMetadataPartition(String ...
3.26
hudi_HoodieTableMetadataUtil_getLocationFromRecordIndexInfo_rdh
/** * Gets the location from record index content. * Note that, a UUID based fileId is stored as 3 pieces in record index (fileIdHighBits, * fileIdLowBits and fileIndex). FileID format is {UUID}-{fileIndex}. * The arguments are consistent with what {@link HoodieRecordIndexInfo} contains. * * @param partition * ...
3.26
hudi_HoodieTableMetadataUtil_getFileSystemView_rdh
/** * Get metadata table file system view. * * @param metaClient * - Metadata table meta client * @return Filesystem view for the metadata table */ public static HoodieTableFileSystem...
3.26
hudi_HoodieTableMetadataUtil_processRollbackMetadata_rdh
/** * Extracts information about the deleted and append files from the {@code HoodieRollbackMetadata}. * <p> * During a rollback files may be deleted (COW, MOR) or rollback blocks be appended (MOR only) to files. This * function will extract this change file for each partition. * * @param rollbackMetadata * {@...
3.26
hudi_HoodieTableMetadataUtil_createIndexInitTimestamp_rdh
/** * Create the timestamp for an index initialization operation on the metadata table. * <p> * Since many MDT partitions can be initialized one after other the offset parameter controls generating a * unique timestamp. */ public static String createIndexInitTimestamp(String timestamp, int offset) { return Str...
3.26
hudi_HoodieTableMetadataUtil_getColumnsToIndex_rdh
/** * Get the list of columns for the table for column stats indexing */ private static List<String> getColumnsToIndex(MetadataRecordsGenerationParams recordsGenParams, Lazy<Option<Schema>> lazyWriterSchemaOpt) { checkState(recordsGenParams.isColumnStatsIndexEnabled()); List<String> targetColumns = recordsGen...
3.26
hudi_HoodieTableMetadataUtil_createCleanTimestamp_rdh
/** * Create the timestamp for a clean operation on the metadata table. */ public static String createCleanTimestamp(String timestamp) { return timestamp + OperationSuffix.CLEAN.getSuffix(); }
3.26
hudi_HoodieTableMetadataUtil_convertMetadataToFilesPartitionRecords_rdh
/** * Finds all files that were deleted as part of a clean and creates metadata table records for them. * * @param cleanMetadata * @param instantTime * @return a list of metadata table records */ public static List<HoodieRecord> convertMetadataToFilesPartitionRecords(HoodieCleanMetadata cleanMetadata, String inst...
3.26
hudi_HoodieTableMetadataUtil_m0_rdh
/** * Delete the metadata table for the dataset. This will be invoked during upgrade/downgrade operation during which * no other * process should be running. * * @param basePath * base path of the dataset * @param context * instance of {@link HoodieEngineContext}. */public static void m0(String basePath, H...
3.26
hudi_HoodieTableMetadataUtil_getFileGroupIndexFromFileId_rdh
/** * Extract the index from the fileID of a file group in the MDT partition. See {@code getFileIDForFileGroup} for the format of the fileID. * * @param fileId * fileID of a file group. * @return The index of file group */ public static int getFileGroupIndexFromFileId(String fileId) { final int endIndex ...
3.26
hudi_HoodieTableMetadataUtil_mapRecordKeyToFileGroupIndex_rdh
/** * Map a record key to a file group in partition of interest. * <p> * Note: For hashing, the algorithm is same as String.hashCode() but is being defined here as hashCode() * implementation is not guaranteed by the JVM to be consistent across JVM versions and implementations. * * @param recordKey * record ke...
3.26
hudi_HoodieTableMetadataUtil_getPartitionLatestFileSlicesIncludingInflight_rdh
/** * Get the latest file slices for a given partition including the inflight ones. * * @param metaClient * - instance of {@link HoodieTableMetaClient} * @param fileSystemView * - hoodie table file system view, which will be fetched from meta client if not already present * @param partition * - name of th...
3.26
hudi_HoodieTableMetadataUtil_getPartitionIdentifier_rdh
/** * Returns partition name for the given path. */ public static String getPartitionIdentifier(@Nonnull String relativePartitionPath) { return EMPTY_PARTITION_NAME.equals(relativePartitionPath) ? NON_PARTITIONED_NAME : relativePartitionPath; }
3.26
hudi_HoodieTableMetadataUtil_m1_rdh
/** * Returns the length of the fileID ignoring the fileIndex suffix * <p> * 0.10 version MDT code added -0 (0th fileIndex) to the fileID. This was removed later. * <p> * Examples: * 0.11+ version: fileID: files-0000 returns 10 * 0.10 version: fileID: files-0000-0 returns 10 * * @param fileId * The f...
3.26
hudi_HoodieTableMetadataUtil_isValidInstant_rdh
/** * Checks if the Instant is a delta commit and has a valid suffix for operations on MDT. * * @param instant * {@code HoodieInstant} to check. * @return {@code true} if the instant is valid. */ public static boolean isValidInstant(HoodieInstant instant) { // Should be a deltacommit if (!instant.getAct...
3.26
hudi_HoodieTableMetadataUtil_tryUpcastDecimal_rdh
/** * Does an upcast for {@link BigDecimal} instance to align it with scale/precision expected by * the {@link org.apache.avro.LogicalTypes.Decimal} Avro logical type */ public static BigDecimal tryUpcastDecimal(BigDecimal value, final LogicalTypes.Decimal decimal) { final int scale = decimal.getScale(); fi...
3.26
hudi_HoodieTableMetadataUtil_getMetadataPartitionsNeedingWriteStatusTracking_rdh
/** * Returns true if any enabled metadata partition in the given hoodie table requires WriteStatus to track the written records. * * @param config * MDT config * @param metaClient * {@code HoodieTableMetaClient} of the data table * @return true if WriteStatus should track the written records else false. */...
3.26
hudi_HoodieTableMetadataUtil_getFileGroupPrefix_rdh
/** * Extract the fileID prefix from the fileID of a file group in the MDT partition. See {@code getFileIDForFileGroup} for the format of the fileID. * * @param fileId * fileID of a file group. * @return The fileID without the file index */ public static String getFileGroupPrefix(String fileId) { return fil...
3.26
hudi_AppendWriteFunction_initWriterHelper_rdh
// ------------------------------------------------------------------------- // Utilities // ------------------------------------------------------------------------- private void initWriterHelper() { final String instant = instantToWrite(true); if (instant == null) { // in case there are empty checkp...
3.26
hudi_AppendWriteFunction_endInput_rdh
/** * End input action for batch source. */ public void endInput() { super.endInput(); flushData(true); this.writeStatuses.clear(); }
3.26
hudi_AppendWriteFunction_m0_rdh
// ------------------------------------------------------------------------- // GetterSetter // ------------------------------------------------------------------------- @VisibleForTestingpublic BulkInsertWriterHelper m0() { return this.writerHelper; }
3.26
hudi_BaseSparkCommitActionExecutor_buildProfile_rdh
/** * Count the number of updates/inserts for each file in each partition. */ private Pair<HashMap<String, WorkloadStat>, WorkloadStat> buildProfile(HoodieData<HoodieRecord<T>> inputRecords) { HashMap<String, WorkloadStat> partitionPathStatMap = new HashMap<>(); WorkloadStat globalStat = new WorkloadStat(); ...
3.26
hudi_HoodieTableConfig_getTableVersion_rdh
/** * * @return the hoodie.table.version from hoodie.properties file. */ public HoodieTableVersion getTableVersion() { return contains(VERSION) ? HoodieTableVersion.versionFromCode(getInt(VERSION)) : VERSION.defaultValue(); }
3.26
hudi_HoodieTableConfig_getIndexDefinitionPath_rdh
/** * * @returns the index definition path. */ public Option<String> getIndexDefinitionPath() { return Option.ofNullable(getString(INDEX_DEFINITION_PATH)); }
3.26
hudi_HoodieTableConfig_getLogFileFormat_rdh
/** * Get the log Storage Format. * * @return HoodieFileFormat for the log Storage format */ public HoodieFileFormat getLogFileFormat() { return HoodieFileFormat.valueOf(getStringOrDefault(LOG_FILE_FORMAT)); }
3.26
hudi_HoodieTableConfig_getTableType_rdh
/** * Read the table type from the table properties and if not found, return the default. */ public HoodieTableType getTableType() { return HoodieTableType.valueOf(getStringOrDefault(TYPE)); }
3.26
hudi_HoodieTableConfig_setMetadataPartitionsInflight_rdh
/** * Enables the specified metadata table partition as inflight. * * @param partitionTypes * The list of partitions to enable as inflight. */ public void setMetadataPartitionsInflight(HoodieTableMetaClient metaClient, List<MetadataPartitionType> partitionTypes) { Set<String> partitionsInflight = getMeta...
3.26
hudi_HoodieTableConfig_getTableChecksum_rdh
/** * Read the table checksum. */ private Long getTableChecksum() { return getLong(TABLE_CHECKSUM); }
3.26
hudi_HoodieTableConfig_create_rdh
/** * Initialize the hoodie meta directory and any necessary files inside the meta (including the hoodie.properties). */ public static void create(FileSystem fs, Path metadataFolder, Properties properties) throws IOException { if (!fs.exists(metadataFolder)) { fs.mkdirs(metadataFolder); } HoodieConfig hoodieConfig = ...
3.26
hudi_HoodieTableConfig_m0_rdh
/** * Read the payload class for HoodieRecords from the table properties. */ public String m0() { return getStringOrDefault(RECORD_MERGER_STRATEGY); }
3.26
hudi_HoodieTableConfig_storeProperties_rdh
/** * Write the properties to the given output stream and return the table checksum. * * @param props * - properties to be written * @param outputStream * - output stream to which properties will be written * @return return the table checksum * @throws IOException */ private static String storeProperties(P...
3.26
hudi_HoodieTableConfig_update_rdh
/** * Upserts the table config with the set of properties passed in. We implement a fail-safe backup protocol * here for safely updating with recovery and also ensuring the table config continues to be readable. */ public static void update(FileSystem fs, Path metadataFolder, Properties updatedProps) { modify(fs, ...
3.26
hudi_HoodieTableConfig_clearMetadataPartitions_rdh
/** * Clear {@link HoodieTableConfig#TABLE_METADATA_PARTITIONS} * {@link HoodieTableConfig#TABLE_METADATA_PARTITIONS_INFLIGHT}. */ public void clearMetadataPartitions(HoodieTableMetaClient metaClient) { setMetadataPartitionState(metaClient, MetadataPartitionType.FILES, false); }
3.26
hudi_HoodieTableConfig_getBaseFileFormat_rdh
/** * Get the base file storage format. * * @return HoodieFileFormat for the base file Storage format */ public HoodieFileFormat getBaseFileFormat() { return HoodieFileFormat.valueOf(getStringOrDefault(BASE_FILE_FORMAT)); }
3.26
hudi_HoodieTableConfig_populateMetaFields_rdh
/** * * @returns true is meta fields need to be populated. else returns false. */ public boolean populateMetaFields() { return Boolean.parseBoolean(getStringOrDefault(POPULATE_META_FIELDS)); }
3.26
hudi_HoodieTableConfig_getRawRecordKeyFieldProp_rdh
/** * * @returns the record key field prop. */ public String getRawRecordKeyFieldProp() {return getStringOrDefault(RECORDKEY_FIELDS, null); }
3.26
hudi_HoodieTableConfig_setMetadataPartitionState_rdh
/** * Enables or disables the specified metadata table partition. * * @param partitionType * The partition * @param enabled * If true, the partition is enabled, else disabled */ public void setMetadataPartitionState(HoodieTableMetaClient metaClient, MetadataPartitionType partitionType, boolean enabled) { ...
3.26
hudi_HoodieTableConfig_getDatabaseName_rdh
/** * Read the database name. */ public String getDatabaseName() { return getString(DATABASE_NAME); }
3.26
hudi_HoodieTableConfig_getPayloadClass_rdh
/** * Read the payload class for HoodieRecords from the table properties. */ public String getPayloadClass() { return RecordPayloadType.getPayloadClassName(this); }
3.26
hudi_HoodieTableConfig_getBootstrapIndexClass_rdh
/** * Read the payload class for HoodieRecords from the table properties. */ public String getBootstrapIndexClass() { if (!props.getBoolean(BOOTSTRAP_INDEX_ENABLE.key(), BOOTSTRAP_INDEX_ENABLE.defaultValue())) { return BootstrapIndexType.NO_OP.getClassName(); } String bootstrapIndexClassName; if (contains(BOOTSTRAP_...
3.26
hudi_HoodieTableConfig_getPartitionMetafileFormat_rdh
/** * Returns the format to use for partition meta files. */ public Option<HoodieFileFormat> getPartitionMetafileFormat() { if (getBooleanOrDefault(PARTITION_METAFILE_USE_BASE_FORMAT)) { return Option.of(getBaseFileFormat()); } return Option.empty(); }
3.26
hudi_HoodieTableConfig_getArchivelogFolder_rdh
/** * Get the relative path of archive log folder under metafolder, for this table. */ public String getArchivelogFolder() { return getStringOrDefault(ARCHIVELOG_FOLDER);}
3.26
hudi_HoodieTableConfig_isMetadataPartitionAvailable_rdh
/** * Checks if metadata table is enabled and the specified partition has been initialized. * * @param partition * The partition to check * @returns true if the specific partition has been initialized, else returns false. */ public boolean isMetadataPartitionAvailable(MetadataPartitionType partition) { retu...
3.26
hudi_HoodieTableConfig_m2_rdh
/** * * @returns the partition field prop. * @deprecated please use {@link #getPartitionFields()} instead */ @Deprecated public String m2() { // NOTE: We're adding a stub returning empty string to stay compatible w/ pre-existing // behavior until this method is fully deprecated return Option.ofNullable(getString(PA...
3.26
hudi_HoodieTableConfig_getRecordKeyFieldProp_rdh
/** * * @returns the record key field prop. */ public String getRecordKeyFieldProp() { return getStringOrDefault(RECORDKEY_FIELDS, HoodieRecord.RECORD_KEY_METADATA_FIELD); }
3.26
hudi_HoodieRecord_setNewLocation_rdh
/** * Sets the new currentLocation of the record, after being written. This again should happen exactly-once. */ public void setNewLocation(HoodieRecordLocation location) { checkState(); assert newLocation == null; this.newLocation = location; }
3.26
hudi_HoodieRecord_read_rdh
/** * NOTE: This method is declared final to make sure there's no polymorphism and therefore * JIT compiler could perform more aggressive optimizations */ @Override public final void read(Kryo kryo, Input input) { this.key = kryo.readObjectOrNull(input, HoodieKey.class); this.operation = kryo.readObjec...
3.26
hudi_HoodieRecord_write_rdh
/** * NOTE: This method is declared final to make sure there's no polymorphism and therefore * JIT compiler could perform more aggressive optimizations */ @Override public final void write(Kryo kryo, Output output) { kryo.writeObjectOrNull(output, key, HoodieKey.class);kryo.writeObjectOrNull(output, operat...
3.26
hudi_HoodieRecord_clearNewLocation_rdh
/** * Clears the new currentLocation of the record. * * This is required in the delete path so that Index can track that this record was deleted. */ public void clearNewLocation() { checkState(); this.newLocation = null; }
3.26
hudi_HoodieRecord_deflate_rdh
/** * Release the actual payload, to ease memory pressure. To be called after the record has been written to storage. * Once deflated, cannot be inflated. */ public void deflate() { this.data = null;}
3.26
hudi_HoodieFlinkCopyOnWriteTable_bulkInsertPrepped_rdh
/** * Bulk inserts the given prepared records into the Hoodie table, at the supplied instantTime. * * <p>This implementation requires that the input records are already tagged, and de-duped if needed. * * <p>Specifies the write handle explicitly in order to have fine-grained control with * the underneath file. *...
3.26
hudi_HoodieFlinkCopyOnWriteTable_handleUpdate_rdh
// ------------------------------------------------------------------------- // Used for compaction // ------------------------------------------------------------------------- @Override public Iterator<List<WriteStatus>> handleUpdate(String instantTime, String partitionPath, String fileId, Map<String, HoodieRecord<T>...
3.26
hudi_HoodieFlinkCopyOnWriteTable_deletePrepped_rdh
/** * Delete the given prepared records from the Hoodie table, at the supplied instantTime. * * <p>This implementation requires that the input records are already tagged, and de-duped if needed. * * <p>Specifies the write handle explicitly in order to have fine-grained control with * the underneath file. * * @p...
3.26
hudi_HoodieFlinkCopyOnWriteTable_upsert_rdh
/** * Upsert a batch of new records into Hoodie table at the supplied instantTime. * * <p>Specifies the write handle explicitly in order to have fine-grained control with * the underneath file. * * @param context * HoodieEngineContext * @param writeHandle * The write handle * @param instantTime * Insta...
3.26
hudi_HoodieFlinkCopyOnWriteTable_delete_rdh
/** * Deletes a list of {@link HoodieKey}s from the Hoodie table, at the supplied instantTime {@link HoodieKey}s will be * de-duped and non existent keys will be removed before deleting. * * <p>Specifies the write handle explicitly in order to have fine-grained control with * the underneath file. * * @param cont...
3.26
hudi_HoodieFlinkCopyOnWriteTable_upsertPrepped_rdh
/** * Upserts the given prepared records into the Hoodie table, at the supplied instantTime. * * <p>This implementation requires that the input records are already tagged, and de-duped if needed. * * <p>Specifies the write handle explicitly in order to have fine-grained control with * the underneath file. * * @...
3.26
hudi_HoodieFlinkCopyOnWriteTable_insert_rdh
/** * Insert a batch of new records into Hoodie table at the supplied instantTime. * * <p>Specifies the write handle explicitly in order to have fine-grained control with * the underneath file. * * @param context * HoodieEngineContext * @param writeHandle * The write handle * @param instantTime * Insta...
3.26
hudi_HoodieFlinkCopyOnWriteTable_insertPrepped_rdh
/** * Inserts the given prepared records into the Hoodie table, at the supplied instantTime. * * <p>This implementation requires that the input records are already tagged, and de-duped if needed. * * <p>Specifies the write handle explicitly in order to have fine-grained control with * the underneath file. * * @...
3.26
hudi_HoodieFlinkCopyOnWriteTable_scheduleCleaning_rdh
/** * * @param context * HoodieEngineContext * @param instantTime * Instant Time for scheduling cleaning * @param extraMetadata * additional metadata to write into plan * @return */ @Override public Option<HoodieCleanerPlan> scheduleCleaning(HoodieEngineContext context, String instantTime, Option<Map<Str...
3.26
hudi_SparkUtil_initLauncher_rdh
/** * TODO: Need to fix a bunch of hardcoded stuff here eg: history server, spark distro. */public static SparkLauncher initLauncher(String propertiesFile) throws URISyntaxException { String currentJar = new File(SparkUtil.class.getProtectionDomain().getCodeSource().getLocation().toURI().getPath()).getAbsolutePa...
3.26
hudi_SparkUtil_getDefaultConf_rdh
/** * Get the default spark configuration. * * @param appName * - Spark application name * @param sparkMaster * - Spark master node name * @return Spark configuration */ public static SparkConf getDefaultConf(final String appName, final Option<String> sparkMaster) { final Properties properties = Syst...
3.26
hudi_HoodieWrapperFileSystem_createImmutableFileInPath_rdh
/** * Creates a new file with overwrite set to false. This ensures files are created * only once and never rewritten, also, here we take care if the content is not * empty, will first write the content to a temp file if {needCreateTempFile} is * true, and then rename it back after the content is written. * * @par...
3.26
hudi_HoodieColumnProjectionUtils_supportTimestamp_rdh
/** * If schema contains timestamp columns, this method is used for compatibility when there is no timestamp fields. * * <p>We expect to use parquet-avro reader {@link org.apache.hudi.hadoop.avro.HoodieAvroParquetReader} to read * timestamp column when read columns contain timestamp type. */ public static boolean ...
3.26
hudi_HoodieColumnProjectionUtils_getReadColumnIDs_rdh
/** * Returns an array of column ids(start from zero) which is set in the given * parameter <tt>conf</tt>. */ public static List<Integer> getReadColumnIDs(Configuration conf) { String skips = conf.get(READ_COLUMN_IDS_CONF_STR, READ_COLUMN_IDS_CONF_STR_DEFAULT); String[] list = StringUtils.split(skips); L...
3.26
hudi_HoodieDeltaWriteStat_setRecordsStats_rdh
// keep for serialization efficiency public void setRecordsStats(Map<String, HoodieColumnRangeMetadata<Comparable>> stats) { recordsStats = Option.of(stats); }
3.26
hudi_MetadataCommand_setMetadataBaseDirectory_rdh
/** * Sets the directory to store/read Metadata Table. * <p> * This can be used to store the metadata table away from the dataset directory. * - Useful for testing as well as for using via the HUDI CLI so that the actual dataset is not written to. * - Useful for testing Metadata Table performance and operations on...
3.26
hudi_BaseHoodieTableServiceClient_scheduleClusteringAtInstant_rdh
/** * Schedules a new clustering instant with passed-in instant time. * * @param instantTime * clustering Instant Time * @param extraMetadata * Extra Metadata to be stored */ public boolean scheduleClusteringAtInstant(String instantTime, Option<Map<String, String>> extraMetadata) throws HoodieIOException...
3.26
hudi_BaseHoodieTableServiceClient_inlineScheduleCompaction_rdh
/** * Schedules compaction inline. * * @param extraMetadata * extra metadata to be used. * @return compaction instant if scheduled. */ protected Option<String> inlineScheduleCompaction(Option<Map<String, String>> extraMetadata) { return scheduleCompaction(extraMetadata); }
3.26
hudi_BaseHoodieTableServiceClient_getInflightTimelineExcludeCompactionAndClustering_rdh
/** * Get inflight timeline excluding compaction and clustering. * * @param metaClient * @return */ private HoodieTimeline getInflightTimelineExcludeCompactionAndClustering(HoodieTableMetaClient metaClient) { HoodieTimeline inflightTimelineWithReplaceCommit = metaClient.getCommitsTimeline().filterPendingExclud...
3.26
hudi_BaseHoodieTableServiceClient_clean_rdh
/** * Clean up any stale/old files/data lying around (either on file storage or index storage) based on the * configurations and CleaningPolicy used. (typically files that no longer can be used by a running query can be * cleaned). This API provides the flexibility to schedule clean instant asynchronously via * {@l...
3.26
hudi_BaseHoodieTableServiceClient_completeLogCompaction_rdh
/** * Commit Log Compaction and track metrics. */ protected void completeLogCompaction(HoodieCommitMetadata metadata, HoodieTable table, String logCompactionCommitTime) { this.context.setJobStatus(this.getClass().getSimpleName(), "Collect log compaction write status and commit compaction"); List<HoodieWriteSt...
3.26
hudi_BaseHoodieTableServiceClient_archive_rdh
/** * Trigger archival for the table. This ensures that the number of commits do not explode * and keep increasing unbounded over time. * * @param table * table to commit on. */ protected void archive(HoodieTable table) { if (!tableServicesEnabled(config)) { return; } try { final Tim...
3.26
hudi_BaseHoodieTableServiceClient_scheduleCompaction_rdh
/** * Schedules a new compaction instant. * * @param extraMetadata * Extra Metadata to be stored */ public Option<String> scheduleCompaction(Option<Map<String, String>> extraMetadata) throws HoodieIOException { String instantTime = createNewInstantTime(); return scheduleCompactionAtInstant(instantTime, ...
3.26
hudi_BaseHoodieTableServiceClient_completeCompaction_rdh
/** * Commit Compaction and track metrics. */ protected void completeCompaction(HoodieCommitMetadata metadata, HoodieTable table, String compactionCommitTime) { this.context.setJobStatus(this.getClass().getSimpleName(), "Collect compaction write status and commit compaction: " + config.getTableName()); List<...
3.26