name
stringlengths
12
178
code_snippet
stringlengths
8
36.5k
score
float64
3.26
3.68
hudi_BaseHoodieTableServiceClient_rollbackFailedWrites_rdh
/** * Rollback all failed writes. * * @return true if rollback was triggered. false otherwise. */ protected Boolean rollbackFailedWrites() { HoodieTable table = createTable(config, hadoopConf); List<String> instantsToRollback = getInstantsToRollback(table.getMetaClient(), config.getFailedWritesCleanPolicy...
3.26
hudi_BaseHoodieTableServiceClient_scheduleLogCompaction_rdh
/** * Schedules a new log compaction instant. * * @param extraMetadata * Extra Metadata to be stored */ public Option<String> scheduleLogCompaction(Option<Map<String, String>> extraMetadata) throws HoodieIOException { String instantTime = createNewInstantTime(); return scheduleLogCompactionAtInstant(inst...
3.26
hudi_BaseHoodieTableServiceClient_compact_rdh
/** * Ensures compaction instant is in expected state and performs Compaction for the workload stored in instant-time. * * @param compactionInstantTime * Compaction Instant Time * @return Collection of Write Status */ protected HoodieWriteMetadata<O> compact(String compactionInstantTime, boolean shouldComplete)...
3.26
hudi_BaseHoodieTableServiceClient_scheduleLogCompactionAtInstant_rdh
/** * Schedules a new log compaction instant with passed-in instant time. * * @param instantTime * Log Compaction Instant Time * @param extraMetadata * Extra Metadata to be stored */ public boolean scheduleLogCompactionAtInstant(String instantTime, Option<Map<String, String>> extraMetadata) throws HoodieIOE...
3.26
hudi_BaseHoodieTableServiceClient_writeTableMetadata_rdh
/** * Write the HoodieCommitMetadata to metadata table if available. * * @param table * {@link HoodieTable} of interest. * @param instantTime * instant time of the commit. * @param metadata * instance of {@link HoodieCommitMetadata}. * @param writeStatuses * Write statuses of the commit */ protected ...
3.26
hudi_BaseHoodieTableServiceClient_logCompact_rdh
/** * Performs Log Compaction for the workload stored in instant-time. * * @param logCompactionInstantTime * Log Compaction Instant Time * @return Collection of WriteStatus to inspect errors and counts */public HoodieWriteMetadata<O> logCompact(String logCompactionInstantTime) { return logCompact(logCompac...
3.26
hudi_BaseHoodieTableServiceClient_getPendingRollbackInfos_rdh
/** * Fetch map of pending commits to be rolled-back to {@link HoodiePendingRollbackInfo}. * * @param metaClient * instance of {@link HoodieTableMetaClient} to use. * @return map of pending commits to be rolled-back instants to Rollback Inst...
3.26
hudi_BaseHoodieTableServiceClient_inlineCompaction_rdh
/** * Performs a compaction operation on a table, serially before or after an insert/upsert action. * Scheduling and execution is done inline. */ protected Option<String> inlineCompaction(Option<Map<String, String>> extraMetadata) { Option<String> compactionInstantTimeOpt = inlineScheduleC...
3.26
hudi_BaseHoodieTableServiceClient_rollbackFailedBootstrap_rdh
/** * Main API to rollback failed bootstrap. */ public void rollbackFailedBootstrap() { LOG.info("Rolling back pending bootstrap if present"); HoodieTable table = createTable(config, hadoopConf); HoodieTimeline inflightTimeline = table.getMetaClient().getCommitsTimeline().filterPendingExcludingMajorAndMinorCompacti...
3.26
hudi_BaseHoodieTableServiceClient_scheduleClustering_rdh
/** * Schedules a new clustering instant. * * @param extraMetadata * Extra Metadata to be stored */ public Option<String> scheduleClustering(Option<Map<String, String>> extraMetadata) throws HoodieIOException { String instantTime = createNewInstantTime(); return scheduleClusteringAtInstant(instantTime, ...
3.26
hudi_BaseHoodieTableServiceClient_scheduleCompactionAtInstant_rdh
/** * Schedules a new compaction instant with passed-in instant time. * * @param instantTime * Compaction Instant Time * @param extraMetadata * Extra Metadata to be stored */ public boolean scheduleCompactionAtInstant(String instantTime, Option<Map<String, String>> extraMetadata) throws HoodieIOException { ...
3.26
hudi_BaseHoodieTableServiceClient_rollbackFailedIndexingCommits_rdh
/** * Rolls back the failed delta commits corresponding to the indexing action. * Such delta commits are identified based on the suffix `METADATA_INDEXER_TIME_SUFFIX` ("004"). * <p> * TODO(HUDI-5733): This should be cleaned up once the proper fix of rollbacks * in t...
3.26
hudi_BaseHoodieTableServiceClient_cluster_rdh
/** * Ensures clustering instant is in expected state and performs clustering for the plan stored in metadata. * * @param clusteringInstant * Clustering Instant Time * @return Collection of Write Status */ public HoodieWriteMetadata<O> cluster(String clusteringInstant, boolean shouldComplete) { HoodieTable...
3.26
hudi_BaseHoodieTableServiceClient_scheduleTableService_rdh
/** * Schedule table services such as clustering, compaction & cleaning. * * @param extraMetadata * Metadata to pass onto the scheduled service instant * @param tableServiceType * Type of table service to schedule * @return */ public Option<String> scheduleTableService(String instantTime, Option<Map<String,...
3.26
hudi_BaseHoodieTableServiceClient_inlineScheduleClustering_rdh
/** * Schedules clustering inline. * * @param extraMetadata * extra metadata to use. * @return clustering instant if scheduled. */ protected Option<String> inlineScheduleClustering(Option<Map<String, String>> extraMetadata) { return scheduleClustering(extraMetadata); }
3.26
hudi_BaseHoodieTableServiceClient_commitCompaction_rdh
/** * Commit a compaction operation. Allow passing additional meta-data to be stored in commit instant file. * * @param compactionInstantTime * Compaction Instant Time * @param metadata * All the metadata that gets stored along with a commit * @param extraMetadata * Extra Metadata to be stored */ public ...
3.26
hudi_BaseHoodieTableServiceClient_inlineClustering_rdh
/** * Executes a clustering plan on a table, serially before or after an insert/upsert action. * Schedules and executes clustering inline. */ protected Option<String> inlineClustering(Option<Map<String, String>> extraMetadata) { Option<String> clusteringInstantOpt = inlineScheduleClustering(extraMetadata); c...
3.26
hudi_BaseHoodieTableServiceClient_inlineLogCompact_rdh
/** * Performs a log compaction operation on a table, serially before or after an insert/upsert action. */ protected Option<String> inlineLogCompact(Option<Map<String, String>> extraMetadata) { Option<String> logCompactionInstantTimeOpt = scheduleLogCompaction(extraMetadata); logCompactionInstantTimeOpt.ifPre...
3.26
hudi_BaseHoodieTableServiceClient_preCommit_rdh
/** * Any pre-commit actions like conflict resolution goes here. * * @param metadata * commit metadata for which pre commit is being invoked. */ protected void preCommit(HoodieCommitMetadata metadata) { // Create a Hoodie table after startTxn which encapsulated the commits and files visible. // Important...
3.26
hudi_BaseHoodieTableServiceClient_isPreCommitRequired_rdh
/** * Some writers use SparkAllowUpdateStrategy and treat replacecommit plan as revocable plan. * In those cases, their ConflictResolutionStrategy implementation should run conflict resolution * even for clustering operations. * * @return boolean */ protected boolean isPreCommitRequired() { return this.config.ge...
3.26
hudi_HoodieInternalConfig_getBulkInsertIsPartitionRecordsSorted_rdh
/** * Returns if partition records are sorted or not. * * @param propertyValue * value for property BULKINSERT_ARE_PARTITIONER_RECORDS_SORTED. * @return the property value. */ public static Boolean getBulkInsertIsPartitionRecordsSorted(String propertyValue) { return propertyValue != null ? Boolean.parseBool...
3.26
hudi_HoodieColumnRangeMetadata_merge_rdh
/** * Merges the given two column range metadata. */ public static HoodieColumnRangeMetadata<Comparable> merge(HoodieColumnRangeMetadata<Comparable> left, HoodieColumnRangeMetadata<Comparable> right) { String filePath = left.getFilePath(); String columnName = left.getColumnName(); Comparable min = minV...
3.26
hudi_InternalSchemaBuilder_refreshNewId_rdh
/** * Assigns new ids for all fields in a Type, based on initial id. * * @param type * a type. * @param nextId * initial id which used to fresh ids for all fields in a type * @return a new type with new ids */ public Type refreshNewId(Type type, AtomicInteger nextId) ...
3.26
hudi_InternalSchemaBuilder_m0_rdh
/** * Build a mapping from id to field for a internal Type. * * @param type * hoodie internal type * @return a mapping from id to field */ public Map<Integer, Types.Field> m0(Type type) { Map<Integer, Types.Field> idToField = new HashMap<>(); visitIdToField(type, idToField); return idToField; }
3.26
hudi_InternalSchemaBuilder_index2Parents_rdh
/** * Build a mapping which maintain the relation between child field id and it's parent field id. * if a child field y(which id is 9) belong to a nest field x(which id is 6), then (9 -> 6) will be added to the result map. * if a field has no parent field, nothings will be added. * * @param record * hoodie reco...
3.26
hudi_InternalSchemaBuilder_buildIdToName_rdh
/** * Build a mapping from id to full field name for a internal Type. * if a field y belong to a struct filed x, then the full name of y is x.y * * @param type * hoodie internal type * @return a mapping from id to full field name */ public Map<Integer, String> buildIdToName(Type type) { Map<Integer, String...
3.26
hudi_InternalSchemaBuilder_buildNameToId_rdh
/** * Build a mapping from full field name to id for a internal Type. * if a field y belong to a struct filed x, then the full name of y is x.y * * @param type * hoodie internal type * @return a mapping from full field name to id */ public Map<String, Integer> buildNameToId(Type type) { return visit(type, ...
3.26
hudi_InternalSchemaBuilder_visit_rdh
/** * Use to traverse all types in internalSchema with visitor. * * @param schema * hoodie internal schema * @return visitor expected result. */ public <T> T visit(InternalSchema schema, InternalSchemaVisitor<T> visitor) { return visitor.schema(schema, visit(schema.getRecord(), visitor)); }
3.26
hudi_ClusteringCommand_runClustering_rdh
/** * Run clustering table service. * <p> * Example: * > connect --path {path to hudi table} * > clustering scheduleAndExecute --sparkMaster local --sparkMemory 2g */ @ShellMethod(key = "clustering scheduleAndExecute", value = "Run Clustering. Make a cluster plan first and execute that plan immediately") public S...
3.26
hudi_ClusteringCommand_scheduleClustering_rdh
/** * Schedule clustering table service. * <p> * Example: * > connect --path {path to hudi table} * > clustering schedule --sparkMaster local --sparkMemory 2g */ @ShellMethod(key = "clustering schedule", value = "Schedule Clustering") public String scheduleClustering(@ShellOption(value = "--sparkMaster", defaultV...
3.26
hudi_HoodieBloomIndex_tagLocationBacktoRecords_rdh
/** * Tag the <rowKey, filename> back to the original HoodieRecord List. */ protected <R> HoodieData<HoodieRecord<R>> tagLocationBacktoRecords(HoodiePairData<HoodieKey, HoodieRecordLocation> keyFilenamePair, HoodieData<HoodieRecord<R>> records, HoodieTable hoodieTable) { HoodiePairData<HoodieKey, HoodieRecord<R>> key...
3.26
hudi_HoodieBloomIndex_lookupIndex_rdh
/** * Lookup the location for each record key and return the pair<record_key,location> for all record keys already * present and drop the record keys if not present. */ private HoodiePairData<HoodieKey, HoodieRecordLocation> lookupIndex(HoodiePairData<String, String> partitionRecordKeyPairs, final HoodieEngineContex...
3.26
hudi_HoodieBloomIndex_explodeRecordsWithFileComparisons_rdh
/** * For each incoming record, produce N output records, 1 each for each file against which the record's key needs to be * checked. For tables, where the keys have a definite insert order (e.g: timestamp as prefix), the number of files * to be compared gets cut down a lot from range pruning. * <p> * Sub-partition...
3.26
hudi_HoodieBloomIndex_isGlobal_rdh
/** * This is not global, since we depend on the partitionPath to do the lookup. */ @Override public boolean isGlobal() { return false; }
3.26
hudi_HoodieBloomIndex_canIndexLogFiles_rdh
/** * No indexes into log files yet. */ @Override public boolean canIndexLogFiles() { return false; }
3.26
hudi_HoodieBloomIndex_getFileInfoForLatestBaseFiles_rdh
/** * Get BloomIndexFileInfo for all the latest base files for the requested partitions. * * @param partitions * - List of partitions to get the base files for * @param context * - Engine context * @param hoodieTable * - Hoodie Table * @return List of partition and file column range info pairs */ privat...
3.26
hudi_HoodieBloomIndex_loadColumnRangesFromMetaIndex_rdh
/** * Load the column stats index as BloomIndexFileInfo for all the involved files in the partition. * * @param partitions * - List of partitions for which column stats need to be loaded * @param context * - Engine context * @param hoodieTable * - Hoodie table * @return List of partition and file column ...
3.26
hudi_HoodieBloomIndex_isImplicitWithStorage_rdh
/** * Bloom filters are stored, into the same data files. */ @Override public boolean isImplicitWithStorage() { return true; }
3.26
hudi_HoodieBloomIndex_loadColumnRangesFromFiles_rdh
/** * Load all involved files as <Partition, filename> pair List. */ List<Pair<String, BloomIndexFileInfo>> loadColumnRangesFromFiles(List<String> partitions, final HoodieEngineContext context, final HoodieTable hoodieTable) { // Obtain the latest data files from all the partitions. List<Pair<String, Pair<Str...
3.26
hudi_FlinkConcatAndReplaceHandle_write_rdh
/** * Write old record as is w/o merging with incoming record. */ @Override public void write(HoodieRecord oldRecord) { Schema oldSchema = (config.populateMetaFields()) ? writeSchemaWithMetaFields : writeSchema; String v1 = oldRecord.getRecordKey(oldSchema, keyGeneratorOpt); try { fileWriter.wr...
3.26
hudi_HoodieTimer_start_rdh
/** * Creates an instance of {@link HoodieTimer} already started */ public static HoodieTimer start() { return new HoodieTimer(true); }
3.26
hudi_HoodieTimer_create_rdh
/** * Creates an instance of {@link HoodieTimer} that is NOT started */ public static HoodieTimer create() { return new HoodieTimer(false); }
3.26
hudi_HoodieGlobalBloomIndex_loadColumnRangesFromFiles_rdh
/** * Load all involved files as <Partition, filename> pairs from all partitions in the table. */ @Override List<Pair<String, BloomIndexFileInfo>> loadColumnRangesFromFiles(List<String> partitions, final HoodieEngineContext context, final HoodieTable hoodieTable) { HoodieTableMetaClient metaClient = hoodieTable.g...
3.26
hudi_HoodieGlobalBloomIndex_tagLocationBacktoRecords_rdh
/** * Tagging for global index should only consider the record key. */ @Override protected <R> HoodieData<HoodieRecord<R>> tagLocationBacktoRecords(HoodiePairData<HoodieKey, HoodieRecordLocation> keyLocationPairs, HoodieData<HoodieRecord<R>> records, HoodieTable hoodieTable) { HoodiePairData<String, HoodieRecordG...
3.26
hudi_HoodieGlobalBloomIndex_explodeRecordsWithFileComparisons_rdh
/** * For each incoming record, produce N output records, 1 each for each file against which the record's key needs to be * checked. For tables, where the keys have a definite insert order (e.g: timestamp as prefix), the number of files * to be compared gets cut down a lot from range pruning. * <p> * Sub-partition...
3.26
hudi_PostgresDebeziumSource_processDataset_rdh
/** * Debezium Kafka Payload has a nested structure (see https://debezium.io/documentation/reference/1.4/connectors/postgresql.html#postgresql-create-events). * This function flattens this nested structure for the Postgres data, and also extracts a subset of Debezium metadata fields. * * @param rowDataset * Data...
3.26
hudi_HoodieJavaWriteClient_initializeMetadataTable_rdh
/** * Initialize the metadata table if needed. Creating the metadata table writer * will trigger the initial bootstrapping from the data table. * * @param inFlightInstantTimestamp * - The in-flight action responsible for the metadata table initialization */ private void initializeMetadataTable(Option<String> in...
3.26
hudi_HoodieCLI_getTableMetaClient_rdh
/** * Get tableMetadata, throw NullPointerException when it is null. * * @return tableMetadata which is instance of HoodieTableMetaClient */ public static HoodieTableMetaClient getTableMetaClient() { if (tableMetadata == null) { throw new NullPointerException("There is no hudi table. Please use connect ...
3.26
hudi_WriteProfile_reload_rdh
/** * Reload the write profile, should do once for each checkpoint. * * <p>We do these things: i). reload the timeline; ii). re-construct the record profile; * iii) clean the small files cache. * * <p>Note: This method should be thread safe. */ public synchronized void reload(long checkpointId) { if (this.reload...
3.26
hudi_WriteProfile_cleanMetadataCache_rdh
/** * Remove the overdue metadata from the cache * whose instant does not belong to the given instants {@code instants}. */ private void cleanMetadataCache(Stream<HoodieInstant> instants) { Set<String> timestampSet = instants.map(HoodieInstant::getTimestamp).collect(Collectors.toSet()); this.metadataCache.keySet()...
3.26
hudi_WriteProfile_getSmallFiles_rdh
/** * Returns a list of small files in the given partition path. * * <p>Note: This method should be thread safe. */ public synchronized List<SmallFile> getSmallFiles(String partitionPath) { // lookup the cache first if (smallFilesMap.containsKey(partitionPath)) { return smallFilesMap.get(partition...
3.26
hudi_WriteProfile_averageBytesPerRecord_rdh
/** * Obtains the average record size based on records written during previous commits. Used for estimating how many * records pack into one file. */ private long averageBytesPerRecord() { long avgSize = config.getCopyOnWriteRecordSizeEstimate(); long fileSizeThreshold = ((long) (...
3.26
hudi_WriteProfile_smallFilesProfile_rdh
/** * Returns a list of small files in the given partition path from the latest filesystem view. */ protected List<SmallFile> smallFilesProfile(String partitionPath) { // smallFiles only for partitionPath List<SmallFile> smallFileLocations = new ArrayList<>(); HoodieTimeline commitTimeline = metaClient.ge...
3.26
hudi_Hive3Shim_getTimestampWriteable_rdh
/** * Get timestamp writeable object from long value. * Hive3 use TimestampWritableV2 to build timestamp objects and Hive2 use TimestampWritable. * So that we need to initialize timestamp according to the version of Hive. */ public Writable getTimestampWriteable(long value, boolean timestampMillis) { try { ...
3.26
hudi_Hive3Shim_m0_rdh
/** * Get date writeable object from int value. * Hive3 use DateWritableV2 to build date objects and Hive2 use DateWritable. * So that we need to initialize date according to the version of Hive. */public Writable m0(int value) { try { return ((Writable) (DATE_WRITEABLE_V2_CONSTRUCTOR.newInstance(va...
3.26
hudi_HashFunction_hash_rdh
/** * Hashes a specified key into several integers. * * @param k * The specified key. * @return The array of hashed values. */ public int[] hash(Key k) { byte[] b = k.getBytes(); if (b == null) { throw new NullPointerException("buffer reference is null"); } if (b.length == 0) { t...
3.26
hudi_HashFunction_clear_rdh
/** * Clears <i>this</i> hash function. A NOOP */public void clear() { }
3.26
hudi_BaseHoodieQueueBasedExecutor_execute_rdh
/** * Main API to run both production and consumption. */@Override public E execute() { try { checkState(this.consumer.isPresent()); setUp(); // Start consuming/producing asynchronously this.consumingFuture = startConsumingAsync(); this.producingFuture = startProducingAs...
3.26
hudi_BaseHoodieQueueBasedExecutor_startConsumingAsync_rdh
/** * Start consumer */ private CompletableFuture<Void> startConsumingAsync() { return consumer.map(consumer -> CompletableFuture.supplyAsync(() -> { doConsume(queue, consumer); return ((Void) (null)); }, consumerExecutorService)).orElse(CompletableFuture.completedFuture(null)); }
3.26
hudi_BaseHoodieQueueBasedExecutor_startProducingAsync_rdh
/** * Start producing */ public final CompletableFuture<Void> startProducingAsync() { return allOf(producers.stream().map(producer -> CompletableFuture.supplyAsync(() -> { doProduce(queue, producer); return ((Void) (null)); }, producerExecutorService)).collect(Collectors.toList())).thenApp...
3.26
hudi_ParquetSchemaConverter_toParquetType_rdh
/** * Converts Flink Internal Type to Parquet schema. * * @param typeInformation * Flink type information * @param legacyMode * is standard LIST and MAP schema or back-compatible schema * @return Parquet schema */ public static MessageType toParquetType(TypeInformation<?> typeInformation, boolean legacyMod...
3.26
hudi_ParquetSchemaConverter_fromParquetType_rdh
/** * Converts Parquet schema to Flink Internal Type. * * @param type * Parquet schema * @return Flink type information */ public static TypeInformation<?> fromParquetType(MessageType type) { return convertFields(type.getFields()); }
3.26
hudi_TableChangesHelper_applyAddChange2Fields_rdh
/** * Apply add operation and column position change operation. * * @param fields * origin column fields. * @param adds * column fields to be added. * @param pchanges * a wrapper class hold all the position change operations. * @return column fields after adjusting...
3.26
hudi_AvroSchemaEvolutionUtils_reconcileSchema_rdh
/** * Support reconcile from a new avroSchema. * 1) incoming data has missing columns that were already defined in the table –> null values will be injected into missing columns * 2) incoming data contains new columns not defined yet in the table -> columns will be added to the table schema (incoming dataframe?) * ...
3.26
hudi_AvroSchemaEvolutionUtils_reconcileSchemaRequirements_rdh
/** * Reconciles nullability and datatype requirements b/w {@code source} and {@code target} schemas, * by adjusting these of the {@code source} schema to be in-line with the ones of the * {@code target} one. Source is considered to be new incoming schema, while target could refer to prev table schema. * For exampl...
3.26
hudi_BinaryUtil_compareTo_rdh
/** * Lexicographically compare two arrays. * copy from hbase * * @param buffer1 * left operand * @param buffer2 * right operand * @param offset1 * Where to start comparing in the left buffer * @param offset2 * Where to start comparing in the right buffer * @param length1 * How much to compare fr...
3.26
hudi_BinaryUtil_toBytes_rdh
/** * Copies {@link ByteBuffer} into allocated {@code byte[]} array */public static byte[] toBytes(ByteBuffer buffer) {byte[] bytes = new byte[buffer.remaining()]; buffer.get(bytes); return bytes; }
3.26
hudi_BinaryUtil_generateChecksum_rdh
/** * Generate a checksum for a given set of bytes. */ public static long generateChecksum(byte[] data) { CRC32 crc = new CRC32(); crc.update(data); return crc.getValue(); }
3.26
hudi_BinaryUtil_interleaving_rdh
/** * Interleaving array bytes. * Interleaving means take one bit from the first matrix element, one bit * from the next, etc, then take the second bit from the first matrix * element, second bit from the second, all the way to the last bit of the * last element. Combine those bits in that order into a single BigI...
3.26
hudi_HFileBootstrapIndex_writeNextSourceFileMapping_rdh
/** * Write next source file to hudi file-id. Entries are expected to be appended in hudi file-group id * order. * * @param mapping * bootstrap source file mapping. */ private void writeNextSourceFileMapping(BootstrapFileMapping mapping) { try { HoodieBootstrapFilePartitionInfo srcFilePartitionInfo ...
3.26
hudi_HFileBootstrapIndex_m2_rdh
/** * Commit bootstrap index entries. Appends Metadata and closes write handles. */ private void m2() { try { if (!closed) { HoodieBootstrapIndexInfo partitionIndexInfo = HoodieBootstrapIndexInfo.newBuilder().setCreatedTimestamp(new Date().getTime()).setNumKeys(numPa...
3.26
hudi_HFileBootstrapIndex_getUserKeyFromCellKey_rdh
/** * HFile stores cell key in the format example : "2020/03/18//LATEST_TIMESTAMP/Put/vlen=3692/seqid=0". * This API returns only the user key part from it. * * @param cellKey * HFIle Cell Key * @return */ private static String getUserKeyFromCellKey(String cellKey) { int hfileSuffixBeginIndex = cellKey.lastIn...
3.26
hudi_HFileBootstrapIndex_getFileGroupKey_rdh
/** * Returns file group key to be used in HFile. * * @param fileGroupId * File Group Id. * @return */ private static String getFileGroupKey(HoodieFileGroupId fileGroupId) { return (getPartitionKey(fileGroupId.getPartitionPath()) + KEY_PARTS_SEPARATOR) + getKeyValueString(FILE_ID_KEY_PREFIX, fileGroupId.get...
3.26
hudi_HFileBootstrapIndex_getPartitionKey_rdh
/** * Returns partition-key to be used in HFile. * * @param partition * Partition-Path * @return */ private static String getPartitionKey(String partition) { return getKeyValueString(PARTITION_KEY_PREFIX, partition); }
3.26
hudi_HFileBootstrapIndex_writeNextPartition_rdh
/** * Append bootstrap index entries for next partitions in sorted order. * * @param partitionPath * Hudi Partition Path * @param bootstrapPartitionPath * Source Partition Path * @param bootstrapFileMappings * Bootstrap Source File to Hudi File Id mapping */private void writeNextPartition(String partitio...
3.26
hudi_HFileBootstrapIndex_close_rdh
/** * Close Writer Handles. */ public void close() { try { if (!closed) { indexByPartitionWriter.close(); indexByFileIdWriter.close(); closed = true; } } catch (IOException ioe) { throw new HoodieIOException(ioe.getMessage(), ioe);} }
3.26
hudi_HFileBootstrapIndex_createReader_rdh
/** * Helper method to create HFile Reader. * * @param hFilePath * File Path * @param conf * Configuration * @param fileSystem * File System */ private static Reader createReader(String hFilePath, Configuration conf, FileSystem fileSystem) { LOG.info("Opening HFile for reading :" + hFilePath); return Hoo...
3.26
hudi_OverwriteWithLatestAvroPayload_overwriteField_rdh
/** * Return true if value equals defaultValue otherwise false. */ public Boolean overwriteField(Object value, Object defaultValue) { if (JsonProperties.NULL_VALUE.equals(defaultValue)) { return value == null; } return Objects.equals(value, defaultValue);}
3.26
hudi_TableOptionProperties_m0_rdh
/** * Initialize the {@link #FILE_NAME} meta file. */ public static void m0(String basePath, Configuration hadoopConf, Map<String, String> options) throws IOException { Path propertiesFilePath = getPropertiesFilePath(basePath); FileSystem fs = FSUtils.getFs(basePath, hadoopCon...
3.26
hudi_TableOptionProperties_loadFromProperties_rdh
/** * Read table options map from the given table base path. */ public static Map<String, String> loadFromProperties(String basePath, Configuration hadoopConf) { Path propertiesFilePath = getPropertiesFilePath(basePath); Map<String, String> options = new HashMap<>(); Properties props = new Properties(); ...
3.26
hudi_SparkHoodieBackedTableMetadataWriter_create_rdh
/** * Return a Spark based implementation of {@code HoodieTableMetadataWriter} which can be used to * write to the metadata table. * <p> * If the metadata table does not exist, an attempt is made to bootstrap it but there is no guaranteed that * table will end up bootstrapping at this time. * * @param conf * @p...
3.26
hudi_SixToFiveDowngradeHandler_runCompaction_rdh
/** * Utility method to run compaction for MOR table as part of downgrade step. */ private void runCompaction(HoodieTable table, HoodieEngineContext context, HoodieWriteConfig config, SupportsUpgradeDowngrade upgradeDowngradeHelper) { try { if (table.getMetaClient().getTableType() == HoodieTableType.MERGE_ON_R...
3.26
hudi_SixToFiveDowngradeHandler_syncCompactionRequestedFileToAuxiliaryFolder_rdh
/** * See HUDI-6040. */ private static void syncCompactionRequestedFileToAuxiliaryFolder(HoodieTable table) { HoodieTableMetaClient metaClient = table.getMetaClient(); HoodieTimeline compactionTimeline = new HoodieActiveTimeline(metaClient, false).filterPendingCompactionTimeline().filter(instant -> insta...
3.26
hudi_ExpressionPredicates_fromExpression_rdh
/** * Converts specific call expression to the predicate. * * <p>Two steps to bind the call: * 1. map the predicate instance; * 2. bind the field reference; * * <p>Normalize the expression to simplify the subsequent decision logic: * always put the literal expression in the RHS. * * @param callExpression * ...
3.26
hudi_ExpressionPredicates_bindValueLiteral_rdh
/** * Binds value literal to create a column predicate. * * @param valueLiteral * The value literal to negate. * @return A column predicate. */ public ColumnPredicate bindValueLiteral(ValueLiteralExpression valueLiteral) { Object literalObject = getValueFromLiteral(valueLiteral); // validate that li...
3.26
hudi_ExpressionPredicates_bindPredicate_rdh
/** * Binds predicate to create a NOT predicate. * * @param predicate * The predicate to negate. * @return A NOT predicate. */ public Predicate bindPredicate(Predicate predicate) { this.predicate = predicate; return this; }
3.26
hudi_ExpressionPredicates_bindFieldReference_rdh
/** * Binds field reference to create a column predicate. * * @param fieldReference * The field reference to negate. * @return A column predicate. */ public ColumnPredicate bindFieldReference(FieldReferenceExpression fieldReference) { this.f0 = fieldReference.getOutputDataType().getLogicalType(); this....
3.26
hudi_ExpressionPredicates_bindPredicates_rdh
/** * Binds predicates to create an OR predicate. * * @param predicates * The disjunctive predicates. * @return An OR predicate. */ public Predicate bindPredicates(Predicate... predicates) { this.predicates = predicates; return this; }
3.26
hudi_ExpressionPredicates_bindValueLiterals_rdh
/** * Binds value literals to create an IN predicate. * * @param valueLiterals * The value literals to negate. * @return An IN predicate. */ public ColumnPredicate bindValueLiterals(List<ValueLiteralExpression> valueLiterals) { this.literals = valueLiterals.stream().map(valueLiteral -> { Object literalObj...
3.26
hudi_ExpressionPredicates_m0_rdh
/** * Binds predicates to create an AND predicate. * * @param predicates * The disjunctive predicates. * @return An AND predicate. */ public Predicate m0(Predicate... predicates) { this.predicates = predicates; return this; }
3.26
hudi_ExpressionPredicates_getInstance_rdh
/** * Returns an OR predicate. */ public static Or getInstance() { return new Or(); }
3.26
hudi_ExpressionPredicates_getFunctionDefinition_rdh
/** * Returns function definition of predicate. * * @return A function definition of predicate. */ public FunctionDefinition getFunctionDefinition() { return null; }
3.26
hudi_HoodieBaseFile_getFileIdAndCommitTimeFromFileName_rdh
/** * Parses the file ID and commit time from the fileName. * * @param fileName * Name of the file * @return String array of size 2 with fileId as the first and commitTime as the second element. */ private static String[] getFileIdAndCommitTimeFromFileName(String fileName) { return ExternalFilePathUtil.isEx...
3.26
hudi_HoodieBaseFile_maybeHandleExternallyGeneratedFileName_rdh
/** * If the file was created externally, the original file path will have a '_[commitTime]_hudiext' suffix when stored in the metadata table. That suffix needs to be removed from the FileStatus so * that the actual file can be found and read. * * @param fileStatus * an input file status that may require updatin...
3.26
hudi_ObjectSizeCalculator_getObjectSize_rdh
/** * Given an object, returns the total allocated size, in bytes, of the object and all other objects reachable from it. * Attempts to detect the current JVM memory layout, but may fail with {@link UnsupportedOperationException}; * * @param obj * the object; can be null. Passing in a {@link java.lang.Class} obj...
3.26
hudi_HoodieArchivedTimeline_loadInstants_rdh
/** * Loads the instants from the timeline. * * @param metaClient * The meta client. * @param filter * The time range filter where the target instant belongs to. * @param loadMode * The load mode. * @param commitsFilter * Filter of the instant type. * @param recordConsumer * Consumer of the instan...
3.26
hudi_HoodieArchivedTimeline_readObject_rdh
/** * This method is only used when this object is deserialized in a spark executor. * * @deprecated */ private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException { in.defaultReadObject(); }
3.26
hudi_ParquetUtils_readAvroRecords_rdh
/** * NOTE: This literally reads the entire file contents, thus should be used with caution. */ @Override public List<GenericRecord> readAvroRecords(Configuration configuration, Path filePath) { List<GenericRecord> records = new ArrayList<>(); try (ParquetReader reader = AvroParquetReader.builder(filePath...
3.26
hudi_ParquetUtils_m0_rdh
/** * Returns a closable iterator for reading the given parquet file. * * @param configuration * configuration to build fs object * @param filePath * The parquet file path * @param keyGeneratorOpt * instance of KeyGenerator * @return {@link ClosableIterator} of {@link HoodieKey}s for reading the parquet ...
3.26
hudi_ParquetUtils_readSchema_rdh
/** * Get the schema of the given parquet file. */ public MessageType readSchema(Configuration configuration, Path parquetFilePath) { return readMetadata(configuration, parquetFilePath).getFileMetaData().getSchema(); }
3.26