name stringlengths 12 178 | code_snippet stringlengths 8 36.5k | score float64 3.26 3.68 |
|---|---|---|
hudi_CompactionUtils_m0_rdh | /**
* Generate compaction operation from file-slice.
*
* @param partitionPath
* Partition path
* @param fileSlice
* File Slice
* @param metricsCaptureFunction
* Metrics Capture function
* @return Compaction Operation
*/
public static HoodieCompactionOperation m0(String partitionPath, FileSlice fileSlic... | 3.26 |
hudi_CompactionUtils_getLogCompactionPlan_rdh | /**
* This method will serve only log compaction instants,
* because we use same HoodieCompactionPlan for both the operations.
*/
public static HoodieCompactionPlan getLogCompactionPlan(HoodieTableMetaClient metaClient, String logCompactionInstant) {
HoodieInstant logCompactionRequestedInstant = HoodieTimeline.... | 3.26 |
hudi_CompactionUtils_getCompactionPlan_rdh | /**
* Util method to fetch both compaction and log compaction plan from requestedInstant.
*/
public static HoodieCompactionPlan getCompactionPlan(HoodieTableMetaClient metaClient, Option<byte[]> planContent) {
CompactionPlanMigrator migrator = new CompactionPlanMigrator(metaClient);
try {
HoodieCompac... | 3.26 |
hudi_CompactionUtils_getAllPendingLogCompactionPlans_rdh | /**
* Get all pending logcompaction plans along with their instants.
*
* @param metaClient
* Hoodie Meta Client
*/
public static List<Pair<HoodieInstant, HoodieCompactionPlan>> getAllPendingLogCompactionPlans(HoodieTableMetaClient metaClient) {
// This function returns pending logcompaction timeline.
F... | 3.26 |
hudi_CompactionUtils_getPendingCompactionOperations_rdh | /**
* Get pending compaction operations for both major and minor compaction.
*/
public static Stream<Pair<HoodieFileGroupId, Pair<String, HoodieCompactionOperation>>> getPendingCompactionOperations(HoodieInstant instant, HoodieCompactionPlan compactionPlan) {
List<HoodieCompactionOperation> ops = compactionPl... | 3.26 |
hudi_HoodieRealtimeRecordReader_constructRecordReader_rdh | /**
* Construct record reader based on job configuration.
*
* @param split
* File Split
* @param jobConf
* Job Configuration
* @param realReader
* Parquet Record Reader
* @return Realtime Reader
*/
private static RecordReader<NullWritable, ArrayWritable> constructRecordReader(RealtimeSplit split, JobCon... | 3.26 |
hudi_HoodieFlinkTableServiceClient_initMetadataWriter_rdh | /**
* Initialize the table metadata writer, for e.g, bootstrap the metadata table
* from the filesystem if it does not exist.
*/
private HoodieBackedTableMetadataWriter initMetadataWriter(Option<String> latestPendingInstant) {
return ((HoodieBackedTableMetadataWriter)
(FlinkHoodieBackedTableMetadataWriter.c... | 3.26 |
hudi_HoodieROTablePathFilter_safeGetParentsParent_rdh | /**
* Obtain the path, two levels from provided path.
*
* @return said path if available, null otherwise
*/
private Path safeGetParentsParent(Path path) {
if (((path.getParent() != null) && (path.getParent().getParent() != null))
&& (path.getParent().getParent().getParent() != null)) {
return path.g... | 3.26 |
hudi_FormatUtils_getRowKindSafely_rdh | /**
* Returns the RowKind of the given record, never null.
* Returns RowKind.INSERT when the given field value not found.
*/
public static RowKind getRowKindSafely(IndexedRecord record, int index) {
if (index == (-1)) {
return RowKind.INSERT;
}
return getRowKind(record, index);
} | 3.26 |
hudi_FormatUtils_getParallelProducers_rdh | /**
* Setup log and parquet reading in parallel. Both write to central buffer.
*/
private List<HoodieProducer<HoodieRecord<?>>> getParallelProducers(HoodieUnMergedLogRecordScanner.Builder scannerBuilder) {
List<HoodieProducer<HoodieRecord<?>>> producers = new ArrayList<>();
producers.add(new FunctionBasedQueu... | 3.26 |
hudi_FormatUtils_setRowKind_rdh | /**
* Sets up the row kind to the row data {@code rowData} from the resolved operation.
*/
public static void setRowKind(RowData rowData, IndexedRecord record, int index) {
if (index == (-1))
{
return;
}
rowData.setRowKind(getRowKind(record, index));
} | 3.26 |
hudi_FormatUtils_getRawValueWithAltKeys_rdh | /**
* Gets the raw value for a {@link ConfigProperty} config from Flink configuration. The key and
* alternative keys are used to fetch the config.
*
* @param flinkConf
* Configs in Flink {@link org.apache.flink.configuration.Configuration}.
* @param configProperty
* {@link ConfigProperty} config to fetch.
... | 3.26 |
hudi_FormatUtils_getRowKind_rdh | /**
* Returns the RowKind of the given record, never null.
* Returns RowKind.INSERT when the given field value not found.
*/
private static RowKind getRowKind(IndexedRecord record, int index) {
Object val = record.get(index);
if (val == null) {
return RowKind.INSERT;
... | 3.26 |
hudi_CompactionUtil_scheduleCompaction_rdh | /**
* Schedules a new compaction instant.
*
* @param writeClient
* The write client
* @param deltaTimeCompaction
* Whether the compaction is trigger by elapsed delta time
* @param committed
* Whether the last instant was committed successfully
*/
public static void scheduleCompaction(HoodieFlinkWriteClie... | 3.26 |
hudi_CompactionUtil_setPreCombineField_rdh | /**
* Sets up the preCombine field into the given configuration {@code conf}
* through reading from the hoodie table metadata.
* <p>
* This value is non-null as compaction can only be performed on MOR tables.
* Of which, MOR tables will have non-null precombine fields.
*
* @param conf
* The configuration
*/
... | 3.26 |
hudi_CompactionUtil_inferChangelogMode_rdh | /**
* Infers the changelog mode based on the data file schema(including metadata fields).
*
* <p>We can improve the code if the changelog mode is set up as table config.
*
* @param conf
* The configuration
* @param metaClient
* The meta client
*/
public static void inferChangelogMode(Configuration conf, Ho... | 3.26 |
hudi_CompactionUtil_inferMetadataConf_rdh | /**
* Infers the metadata config based on the existence of metadata folder.
*
* <p>We can improve the code if the metadata config is set up as table config.
*
* @param conf
* The configuration
* @param metaClient
* The meta client
*/
public static void inferMetadataConf(Configuration conf, HoodieTableMetaC... | 3.26 |
hudi_CompactionUtil_rollbackCompaction_rdh | /**
* Force rolls back all the inflight compaction instants, especially for job failover restart.
*
* @param table
* The hoodie table
*/
public static void rollbackCompaction(HoodieFlinkTable<?> table) {
HoodieTimeline inflightCompactionTimeline = table.getActiveTimeline().filterPendingCompactionTimeline()... | 3.26 |
hudi_CompactionUtil_setAvroSchema_rdh | /**
* Sets up the avro schema string into the HoodieWriteConfig {@code HoodieWriteConfig}
* through reading from the hoodie table metadata.
*
* @param writeConfig
* The HoodieWriteConfig
*/
public static void setAvroSchema(HoodieWriteConfig writeConfig, HoodieTableMetaClient metaClient) throws Exception {
T... | 3.26 |
hudi_CompactionUtil_rollbackEarliestCompaction_rdh | /**
* Rolls back the earliest compaction if there exists.
*
* <p>Makes the strategy not that radical: firstly check whether there exists inflight compaction instants,
* rolls back the first inflight instant only if it has timed out. That means, if there are
* multiple timed out instants on the timeline, we only ro... | 3.26 |
hudi_HoodieActiveTimeline_saveToPendingIndexAction_rdh | /**
* Save content for inflight/requested index instant.
*/
public void saveToPendingIndexAction(HoodieInstant instant, Option<byte[]> content) {
ValidationUtils.checkArgument(instant.getAction().equals(HoodieTimeline.INDEXING_ACTION), String.format("%s is not equal to %s action", instant.getAction(), INDEXING_ACTION... | 3.26 |
hudi_HoodieActiveTimeline_transitionCompactionInflightToComplete_rdh | /**
* Transition Compaction State from inflight to Committed.
*
* @param shouldLock
* Whether to hold the lock when performing transition
* @param inflightInstant
* Inflight instant
* @param data
* Extra Metadata
* @return commit instant
*/
public HoodieInstant transitionCompactionInflightToComplete(boo... | 3.26 |
hudi_HoodieActiveTimeline_createNewInstant_rdh | /**
* Create a pending instant and save to storage.
*
* @param instant
* the pending instant.
*/
public void createNewInstant(HoodieInstant instant) {
LOG.info("Creating a new instant " + instant);
ValidationUtils.checkArgument(!instant.isCompleted());
// Create the in-flight file
createFileInMet... | 3.26 |
hudi_HoodieActiveTimeline_createCompleteInstant_rdh | /**
* Create a complete instant and save to storage with a completion time.
*
* @param instant
* the complete instant.
*/
public void createCompleteInstant(HoodieInstant instant) {
LOG.info("Creating a new complete instant " + instant);
createCompleteFileInMetaPath(true, instant, Option.empty());
} | 3.26 |
hudi_HoodieActiveTimeline_parseDateFromInstantTimeSafely_rdh | /**
* The same parsing method as above, but this method will mute ParseException.
* If the given timestamp is invalid, returns {@code Option.empty}.
* Or a corresponding Date value if these timestamp strings are provided
* {@link org.apache.hudi.common.table.timeline.HoodieTimeline#INIT_INSTANT_TS},
* {@link org... | 3.26 |
hudi_HoodieActiveTimeline_saveToPendingReplaceCommit_rdh | /**
* Saves content for requested REPLACE instant.
*/
public void saveToPendingReplaceCommit(HoodieInstant instant, Option<byte[]> content) {ValidationUtils.checkArgument(instant.getAction().equals(HoodieTimeline.REPLACE_COMMIT_ACTION));
createFileInMetaPath(instant.getFileName(), content, false);
} | 3.26 |
hudi_HoodieActiveTimeline_revertInstantFromInflightToRequested_rdh | /**
* Revert instant state from inflight to requested.
*
* @param inflightInstant
* Inflight Instant
* @return requested instant
*/
public HoodieInstant revertInstantFromInflightToRequested(HoodieInstant inflightInstant) {
ValidationUtils.checkArgument(inflightInstant.isInflight());
HoodieInstant requestedInst... | 3.26 |
hudi_HoodieActiveTimeline_getCommitMetadataStream_rdh | /**
* Returns stream of {@link HoodieCommitMetadata} in order reverse to chronological (ie most
* recent metadata being the first element)
*/
private Stream<Pair<HoodieInstant, HoodieCommitMetadata>> getCommitMetadataStream() {
// NOTE: Streams are lazy
return getCommitsTimeline().filterCompletedInstants().getInstan... | 3.26 |
hudi_HoodieActiveTimeline_m4_rdh | /**
* Transition Rollback State from inflight to Committed.
*
* @param shouldLock
* Whether to hold the lock when performing transition
* @param inflightInstant
* Inflight instant
* @param data
* Extra Metadata
* @return commit instant
*/
public HoodieInstant m4(boolean shouldLock, HoodieInstant infligh... | 3.26 |
hudi_HoodieActiveTimeline_createNewInstantTime_rdh | /**
* Returns next instant time in the correct format.
* Ensures each instant time is at least 1 millisecond apart since we create instant times at millisecond granularity.
*
* @param shouldLock
* whether the lock should be enabled to get the instant time.
* @param timeGenerator
* TimeGenerator used to gener... | 3.26 |
hudi_HoodieActiveTimeline_revertLogCompactionInflightToRequested_rdh | /**
* TODO: This method is not needed, since log compaction plan is not a immutable plan.
* Revert logcompaction State from inflight to requested.
*
* @param inflightInstant
* Inflight Instant
* @return requested instant
*/public HoodieInstant revertLogCompactionInflightToRequested(HoodieInstant inflightInstan... | 3.26 |
hudi_HoodieActiveTimeline_transitionCleanInflightToComplete_rdh | // -----------------------------------------------------------------
// END - COMPACTION RELATED META-DATA MANAGEMENT
// -----------------------------------------------------------------
/**
* Transition Clean State from inflight to Committed.
*
* @param shouldLock
* Whether to hold the lock when performing trans... | 3.26 |
hudi_HoodieActiveTimeline_transitionReplaceRequestedToInflight_rdh | /**
* Transition replace requested file to replace inflight.
*
* @param requestedInstant
* Requested instant
* @param data
* Extra Metadata
* @return inflight instant
*/
public HoodieInstant transitionReplaceRequestedToInflight(HoodieInstant requestedInstant, Option<byte[]> data) {
ValidationUtils.checkArgu... | 3.26 |
hudi_HoodieActiveTimeline_revertIndexInflightToRequested_rdh | /**
* Revert index instant state from inflight to requested.
*
* @param inflightInstant
* Inflight Instant
* @return requested instant
*/
public HoodieInstant revertIndexInflightToRequested(HoodieInstant inflightInstant) {
ValidationUtils.checkArgument(inflightInstant.getAction().equals(HoodieTimeline.INDEXING_... | 3.26 |
hudi_HoodieActiveTimeline_deleteInstantFileIfExists_rdh | /**
* Note: This method should only be used in the case that delete requested/inflight instant or empty clean instant,
* and completed commit instant in an archive operation.
*/
public void deleteInstantFileIfExists(HoodieInstant instant) {
LOG.info("Deleting instant " + instant);
Path commitFilePath
= getInstantFil... | 3.26 |
hudi_HoodieActiveTimeline_getInstantFileName_rdh | /**
* Many callers might not pass completionTime, here we have to search
* timeline to get completionTime, the impact should be minor since
* 1. It appeals only tests pass instant without completion time
* 2. we already holds all instants in memory, the cost should be minor.
*
* <p>TODO: [HUDI-6885] Depreciate Ho... | 3.26 |
hudi_HoodieActiveTimeline_transitionCleanRequestedToInflight_rdh | /**
* Transition Clean State from requested to inflight.
*
* @param requestedInstant
* requested instant
* @param data
* Optional data to be stored
* @return commit instant
*/
public HoodieInstant transitionCleanRequestedToInflight(HoodieInstant requestedInstant, Option<byte[]> data) {
ValidationUtils.check... | 3.26 |
hudi_HoodieActiveTimeline_parseDateFromInstantTime_rdh | /**
* Parse the timestamp of an Instant and return a {@code Date}.
* Throw ParseException if timestamp is not valid format as
* {@link org.apache.hudi.common.table.timeline.HoodieInstantTimeGenerator#SECS_INSTANT_TIMESTAMP_FORMAT}.
*
* @param timestamp
* a timestamp String which follow pattern as
* {@link o... | 3.26 |
hudi_HoodieActiveTimeline_transitionRestoreRequestedToInflight_rdh | /**
* Transition Restore State from requested to inflight.
*
* @param requestedInstant
* requested instant
* @return commit instant
*/
public HoodieInstant transitionRestoreRequestedToInflight(HoodieInstant requestedInstant) {
ValidationUtils.checkArgument(requestedInstant.getAction().equals(HoodieTimeline.REST... | 3.26 |
hudi_HoodieActiveTimeline_m3_rdh | // -----------------------------------------------------------------
// BEGIN - COMPACTION RELATED META-DATA MANAGEMENT.
// -----------------------------------------------------------------
public Option<byte[]> m3(HoodieInstant instant) {
return readDataFromPath(new Path(metaClient.getMetaPath(), getInstantFileName(in... | 3.26 |
hudi_HoodieActiveTimeline_transitionIndexInflightToComplete_rdh | /**
* Transition index instant state from inflight to completed.
*
* @param shouldLock
* Whether to hold the lock when performing transition
* @param inflightInstant
* Inflight Instant
* @return completed instant
*/
public HoodieInstant transitionIndexInflightToComplete(boolean shouldLock, HoodieInstant inf... | 3.26 |
hudi_HoodieActiveTimeline_formatDate_rdh | /**
* Format the Date to a String representing the timestamp of a Hoodie Instant.
*/
public static String formatDate(Date timestamp) {
return HoodieInstantTimeGenerator.formatDate(timestamp);
} | 3.26 |
hudi_HoodieActiveTimeline_transitionCompactionRequestedToInflight_rdh | /**
* Transition Compaction State from requested to inflight.
*
* @param requestedInstant
* Requested instant
* @return inflight instant
*/
public HoodieInstant transitionCompactionRequestedToInflight(HoodieInstant requestedInstant) {
ValidationUtils.checkArgument(requestedInstant.getAction().equals(HoodieTimel... | 3.26 |
hudi_HoodieActiveTimeline_transitionRollbackRequestedToInflight_rdh | /**
* Transition Rollback State from requested to inflight.
*
* @param requestedInstant
* requested instant
* @return commit instant
*/
public HoodieInstant
transitionRollbackRequestedToInflight(HoodieInstant requestedInstant) {
ValidationUtils.checkArgument(requestedInstant.getAction().equals(HoodieTimeline.RO... | 3.26 |
hudi_HoodieActiveTimeline_transitionLogCompactionRequestedToInflight_rdh | /**
* Transition LogCompaction State from requested to inflight.
*
* @param requestedInstant
* Requested instant
* @return inflight instant
*/public HoodieInstant transitionLogCompactionRequestedToInflight(HoodieInstant requestedInstant) {
ValidationUtils.checkArgument(requestedInstant.getAction().equals(Hoodie... | 3.26 |
hudi_HoodieActiveTimeline_transitionLogCompactionInflightToComplete_rdh | /**
* Transition Log Compaction State from inflight to Committed.
*
* @param shouldLock
* Whether to hold the lock when performing transition
* @param inflightInstant
* Inflight instant
* @param data
* Extra Metadata
* @return commit instant
*/
public HoodieInstant transitionLogCompactionInflightToCompl... | 3.26 |
hudi_HoodieActiveTimeline_transitionIndexRequestedToInflight_rdh | /**
* Transition index instant state from requested to inflight.
*
* @param requestedInstant
* Inflight Instant
* @return inflight instant
*/
public HoodieInstant transitionIndexRequestedToInflight(HoodieInstant requestedInstant, Option<byte[]> data) {
ValidationUtils.checkArgument(requestedInstant.getAction().... | 3.26 |
hudi_HoodieActiveTimeline_getLastCommitMetadataWithValidSchema_rdh | /**
* Returns most recent instant having valid schema in its {@link HoodieCommitMetadata}
*/
public Option<Pair<HoodieInstant, HoodieCommitMetadata>> getLastCommitMetadataWithValidSchema() {
return Option.fromJavaOptional(getCommitMetadataStream().filter(instantCommitMetadataPair -> WriteOperationType.canUpdateSchema... | 3.26 |
hudi_HoodieActiveTimeline_readObject_rdh | /**
* This method is only used when this object is deserialized in a spark executor.
*
* @deprecated */
@Deprecated
private void readObject(ObjectInputStream in) throws
IOException, ClassNotFoundException {
in.defaultReadObject();
} | 3.26 |
hudi_HoodieActiveTimeline_transitionReplaceInflightToComplete_rdh | /**
* Transition replace inflight to Committed.
*
* @param shouldLock
* Whether to hold the lock when performing transition
* @param inflightInstant
* Inflight instant
* @param data
* Extra Metadata
* @return commit instant
*/
public HoodieInstant transitionReplaceInflightToComplete(boolean shouldLock, ... | 3.26 |
hudi_ArchivalUtils_getMinAndMaxInstantsToKeep_rdh | /**
* getMinAndMaxInstantsToKeep is used by archival service to find the
* min instants and max instants to keep in the active timeline
*
* @param table
* table implementation extending org.apache.hudi.table.HoodieTable
* @param metaClient
* meta client
* @return Pair containing min instants and max instan... | 3.26 |
hudi_BoundedInMemoryQueue_expectMoreRecords_rdh | /**
* Checks if records are either available in the queue or expected to be written in future.
*/
private boolean expectMoreRecords() {
return (!isWriteDone.get()) || (isWriteDone.get() && (!queue.isEmpty()));
} | 3.26 |
hudi_BoundedInMemoryQueue_markAsFailed_rdh | /**
* API to allow producers and consumer to communicate termination due to failure.
*/
@Override
public void markAsFailed(Throwable e) {
this.hasFailed.set(e);
// release the permits so that if the queueing thread is waiting for permits then it will
// get it.
this.rateLimiter.release(f0 + 1);
} | 3.26 |
hudi_BoundedInMemoryQueue_adjustBufferSizeIfNeeded_rdh | /**
* Samples records with "RECORD_SAMPLING_RATE" frequency and computes average record size in bytes. It is used for
* determining how many maximum records to queue. Based on change in avg size it ma increase or decrease available
* permits.
*
* @param payload
* Payload to size
*/
private void
adjustBufferSiz... | 3.26 |
hudi_BoundedInMemoryQueue_seal_rdh | /**
* Puts an empty entry to queue to denote termination.
*/
@Override
public void seal() {
// done queueing records notifying queue-reader.
isWriteDone.set(true);
} | 3.26 |
hudi_BoundedInMemoryQueue_readNextRecord_rdh | /**
* Reader interface but never exposed to outside world as this is a single consumer queue. Reading is done through a
* singleton iterator for this queue.
*/
@Override
public Option<O> readNextRecord() {
if (this.isReadDone.get()) {
return Option.empty();
}
rateLimiter.release();
Option<O> ... | 3.26 |
hudi_BoundedInMemoryQueue_insertRecord_rdh | /**
* Inserts record into queue after applying transformation.
*
* @param t
* Item to be queued
*/
@Override
public void insertRecord(I t) throws Exception
{
// If already closed, throw exception
if (isWriteDone.get()) {
throw new IllegalStateException("Queue closed for enqueueing new entries");
... | 3.26 |
hudi_SparkValidatorUtils_readRecordsForBaseFiles_rdh | /**
* Get records from specified list of data files.
*/
public static Dataset<Row> readRecordsForBaseFiles(SQLContext sqlContext, List<String> baseFilePaths) {
return sqlContext.read().parquet(JavaConverters.asScalaBufferConverter(baseFilePaths).asScala());
} | 3.26 |
hudi_SparkValidatorUtils_getRecordsFromPendingCommits_rdh | /**
* Get reads from partitions modified including any inflight commits.
* Note that this only works for COW tables
*/
public static Dataset<Row> getRecordsFromPendingCommits(SQLContext sqlContext, Set<String> partitionsAffected, HoodieWriteMetadata<HoodieData<WriteStatus>> writeMetadata, HoodieTable table, String... | 3.26 |
hudi_SparkValidatorUtils_getRecordsFromCommittedFiles_rdh | /**
* Get records from partitions modified as a dataset.
* Note that this only works for COW tables.
*
* @param sqlContext
* Spark {@link SQLContext} instance.
* @param partitionsAffected
* A set of affected partitions.
* @param table
* {@link HoodieTable} instance.
* @param newStructTypeSchema
* The... | 3.26 |
hudi_SparkValidatorUtils_runValidatorAsync_rdh | /**
* Run validators in a separate thread pool for parallelism. Each of validator can submit a distributed spark job if needed.
*/
private static CompletableFuture<Boolean> runValidatorAsync(SparkPreCommitValidator validator, HoodieWriteMetadata<HoodieData<WriteStatus>> writeMetadata, Dataset<Row> beforeState, Datase... | 3.26 |
hudi_CommitsCommand_getCommitForInstant_rdh | /* Checks whether a commit or replacecommit action exists in the timeline. */
private Option<HoodieInstant> getCommitForInstant(HoodieTimeline timeline, String instantTime) {
List<HoodieInstant> instants = Arrays.asList(new HoodieInstant(false, HoodieTimeline.COMMIT_ACTION, instantTime), new HoodieInstant(false, H... | 3.26 |
hudi_CommitsCommand_printCommits_rdh | /**
* CLI command to display commits options.
*/
@ShellComponentpublic class CommitsCommand {
private String printCommits(HoodieDefaultTimeline timeline, final Integer limit, final String sortByField, final boolean descending, final boolean headerOnly, final String tempTableName) throws IOException {
fin... | 3.26 |
hudi_HoodieInMemoryHashIndex_canIndexLogFiles_rdh | /**
* Mapping is available in HBase already.
*/
@Override
public boolean canIndexLogFiles() {
return true;
} | 3.26 |
hudi_HoodieInMemoryHashIndex_isGlobal_rdh | /**
* Only looks up by recordKey.
*/
@Override
public boolean isGlobal() {
return true;
} | 3.26 |
hudi_CleanActionExecutor_runPendingClean_rdh | /**
* Executes the Cleaner plan stored in the instant metadata.
*/
HoodieCleanMetadata runPendingClean(HoodieTable<T, I, K, O> table, HoodieInstant cleanInstant) {
try {
HoodieCleanerPlan cleanerPlan = CleanerUtils.getCleanerPlan(table.getMetaClient(),
cleanInstant);
return runClean(table, cleanInstant, cleanerPlan... | 3.26 |
hudi_CleanActionExecutor_clean_rdh | /**
* Performs cleaning of partition paths according to cleaning policy and returns the number of files cleaned. Handles
* skews in partitions to clean by making files to clean as the unit of task distribution.
*
* @throws IllegalArgumentException
* if unknown cleaning policy is provided
*/
List<HoodieCleanStat... | 3.26 |
hudi_JavaExecutionStrategy_readRecordsForGroup_rdh | /**
* Get a list of all records for the group. This includes all records from file slice
* (Apply updates from log files, if any).
*/
private List<HoodieRecord<T>> readRecordsForGroup(HoodieClusteringGroup clusteringGroup, String instantTime) {
List<ClusteringOperation> clusteringOps = clusteringGroup.getSlices... | 3.26 |
hudi_JavaExecutionStrategy_runClusteringForGroup_rdh | /**
* Executes clustering for the group.
*/private List<WriteStatus> runClusteringForGroup(HoodieClusteringGroup
clusteringGroup, Map<String, String> strategyParams, boolean preserveHoodieMetadata, String instantTime) {
List<HoodieRecord<T>> inputRecords = readRecordsForGroup(clusteringGroup, instantTime);
... | 3.26 |
hudi_JavaExecutionStrategy_getPartitioner_rdh | /**
* Create {@link BulkInsertPartitioner} based on strategy params.
*
* @param strategyParams
* Strategy parameters containing columns to sort the data by when clustering.
* @param schema
* Schema of the data including metadata fields.
* @retur... | 3.26 |
hudi_JavaExecutionStrategy_readRecordsForGroupBaseFiles_rdh | /**
* Read records from baseFiles.
*/
private List<HoodieRecord<T>> readRecordsForGroupBaseFiles(List<ClusteringOperation> clusteringOps) {
List<HoodieRecord<T>> records = new ArrayList<>();clusteringOps.forEach(clusteringOp -> {
try (HoodieFileReader baseFileReader = HoodieFileReaderFactory.getReaderFact... | 3.26 |
hudi_JavaExecutionStrategy_readRecordsForGroupWithLogs_rdh | /**
* Read records from baseFiles and apply updates.
*/
private List<HoodieRecord<T>> readRecordsForGroupWithLogs(List<ClusteringOperation> clusteringOps, String instantTime) {
HoodieWriteConfig config = getWriteConfig();
HoodieTable table = getHoodieTable();
List<HoodieRecord<T>> v9 = new ArrayList<>(... | 3.26 |
hudi_AbstractColumnReader_supportLazyDecode_rdh | /**
* Support lazy dictionary ids decode. See more in {@link ParquetDictionary}.
* If return false, we will decode all the data first.
*/
protected boolean supportLazyDecode() {
return true;
} | 3.26 |
hudi_AbstractColumnReader_readToVector_rdh | /**
* Reads `total` values from this columnReader into column.
*/
@Override
public final void readToVector(int readNumber, V vector) throws IOException {
int rowId = 0;
WritableIntVector
dictionaryIds = null;
if (dictionary != null) {
dictionaryIds = vector.reserveDictionaryIds(readNumber);
}
while (readNumber... | 3.26 |
hudi_HoodieRecordGlobalLocation_copy_rdh | /**
* Copy the location with given partition path.
*/
public HoodieRecordGlobalLocation copy(String partitionPath) {
return new HoodieRecordGlobalLocation(partitionPath,
instantTime, fileId, position);
} | 3.26 |
hudi_HoodieRecordGlobalLocation_fromLocal_rdh | /**
* Returns the global record location from local.
*/
public static HoodieRecordGlobalLocation fromLocal(String partitionPath, HoodieRecordLocation localLoc) {return new HoodieRecordGlobalLocation(partitionPath, localLoc.getInstantTime(), localLoc.getFileId());
} | 3.26 |
hudi_HoodieRecordGlobalLocation_toLocal_rdh | /**
* Returns the record location as local.
*/
public HoodieRecordLocation toLocal(String instantTime) {
return new HoodieRecordLocation(instantTime, fileId, position);
} | 3.26 |
hudi_PostgresDebeziumAvroPayload_containsBytesToastedValues_rdh | /**
* Returns true if a column is either of type bytes or a union of one or more bytes that contain a debezium toasted value.
*
* @param incomingRecord
* The incoming avro record
* @param field
* the column of interest
* @return */
private boolean containsBytesToastedValues(IndexedRecord incomingRecord, Sch... | 3.26 |
hudi_PostgresDebeziumAvroPayload_containsStringToastedValues_rdh | /**
* Returns true if a column is either of type string or a union of one or more strings that contain a debezium toasted value.
*
* @param incomingRecord
* The incoming avro record
* @param field
* the column of interest
* @return */
private boolean containsStringToastedValues(IndexedRecord incomingRecord,... | 3.26 |
hudi_ClusteringOperator_endInput_rdh | /**
* End input action for batch source.
*/
public void endInput() {
// no operation
} | 3.26 |
hudi_ClusteringOperator_doClustering_rdh | // -------------------------------------------------------------------------
// Utilities
// -------------------------------------------------------------------------
private void doClustering(String instantTime, List<ClusteringOperation> clusteringOperations)
throws Exception {
BulkInsertWriterHelper writerHelper... | 3.26 |
hudi_ClusteringOperator_readRecordsForGroupWithLogs_rdh | /**
* Read records from baseFiles, apply updates and convert to Iterator.
*/
@SuppressWarnings("unchecked")
private Iterator<RowData> readRecordsForGroupWithLogs(List<ClusteringOperation> clusteringOps, String instantTime) {
List<Iterator<RowData>> recordIterators = new ArrayList<>();
long maxMemoryPerCompaction = IO... | 3.26 |
hudi_ClusteringOperator_m0_rdh | /**
* Transform IndexedRecord into HoodieRecord.
*/
private RowData m0(IndexedRecord indexedRecord) {
GenericRecord record = ((GenericRecord) (indexedRecord));
return ((RowData) (avroToRowDataConverter.convert(record)));
} | 3.26 |
hudi_ClusteringOperator_readRecordsForGroupBaseFiles_rdh | /**
* Read records from baseFiles and get iterator.
*/
private Iterator<RowData> readRecordsForGroupBaseFiles(List<ClusteringOperation> clusteringOps) {
List<Iterator<RowData>> iteratorsForPartition = clusteringOps.stream().map(clusteringOp -> {
Iterable<IndexedRecord> indexedRecords = () ->
{
... | 3.26 |
hudi_FileSystemBasedLockProvider_defaultLockPath_rdh | /**
* Returns the default lock file root path.
*
* <p>IMPORTANT: this path should be shared especially when there is engine cooperation.
*/
private static String defaultLockPath(String tablePath)
{
return (tablePath + Path.SEPARATOR) + AUXILIARYFOLDER_NAME;
} | 3.26 |
hudi_FileSystemBasedLockProvider_getLockConfig_rdh | /**
* Returns a filesystem based lock config with given table path.
*/
public static TypedProperties getLockConfig(String tablePath) {
TypedProperties props = new
TypedProperties();
props.put(HoodieLockConfig.LOCK_PROVIDER_CLASS_NAME.key(), FileSystemBasedLockProvider.class.getName());
props.put(Hood... | 3.26 |
hudi_EmbeddedTimelineService_getOrStartEmbeddedTimelineService_rdh | /**
* Returns an existing embedded timeline service if one is running for the given configuration and reuse is enabled, or starts a new one.
*
* @param context
* The {@link HoodieEngineContext} for the client
* @param embeddedTimelineServiceHostAddr
* The host address to use for the service (nullable)
* @par... | 3.26 |
hudi_EmbeddedTimelineService_stopForBasePath_rdh | /**
* Stops the embedded timeline service for the given base path. If a timeline service is managing multiple tables, it will only be shutdown once all tables have been stopped.
*
* @param basePath
* For the table to stop the service for
*/public void stopForBasePath(String basePath) {
synchronized(SERVICE_L... | 3.26 |
hudi_EmbeddedTimelineService_addBasePath_rdh | /**
* Adds a new base path to the set that are managed by this instance.
*
* @param basePath
* the new base path to add
*/
private void addBasePath(String basePath) {
basePaths.add(basePath);
} | 3.26 |
hudi_EmbeddedTimelineService_getRemoteFileSystemViewConfig_rdh | /**
* Retrieves proper view storage configs for remote clients to access this service.
*/
public FileSystemViewStorageConfig getRemoteFileSystemViewConfig() {
FileSystemViewStorageType viewStorageType = (writeConfig.getClientSpecifiedViewStorageConfig().shouldEnableBackupForRemoteFileSystemView()) ? FileSystemVi... | 3.26 |
hudi_HoodieRecordMerger_partialMerge_rdh | /**
* Merges records which can contain partial updates, i.e., only subset of fields and values are
* present in the record representing the updates, and absent fields are not updated. The fields
* exist in older and newer records indicate the fields with changed values. When merging, only
* the changed fields shoul... | 3.26 |
hudi_HoodieExampleDataGenerator_generateInserts_rdh | /**
* Generates new inserts, uniformly across the partition paths above. It also updates the list of existing keys.
*/
public List<HoodieRecord<T>> generateInserts(String commitTime, Integer n) {
return generateInsertsStream(commitTime, n).collect(Collectors.toList());
} | 3.26 |
hudi_HoodieExampleDataGenerator_generateInsertsOnPartition_rdh | /**
* Generates new inserts, across a single partition path. It also updates the list of existing keys.
*/
public List<HoodieRecord<T>> generateInsertsOnPartition(String commitTime, Integer n, String partitionPath) {
return generateInsertsStreamOnPartition(commitTime, n, partitionPath).collect(Collectors.toList... | 3.26 |
hudi_HoodieExampleDataGenerator_generateRandomValue_rdh | /**
* Generates a new avro record of the above schema format, retaining the key if optionally provided.
*/
@SuppressWarnings("unchecked")
public T generateRandomValue(HoodieKey key, String commitTime) {
GenericRecord rec = generateGenericRecord(key.getRecordKey(), "rider-" +
commitTime, "driver-" + commit... | 3.26 |
hudi_HoodieExampleDataGenerator_generateUniqueUpdates_rdh | /**
* Generates new updates, one for each of the keys above
* list
*
* @param commitTime
* Commit Timestamp
* @return list of hoodie record updates
*/
public List<HoodieRecord<T>> generateUniqueUpdates(String commitTime) {
List<HoodieRecord<T>> updates = new ArrayList<>();
for (int i = 0; i
< numEx... | 3.26 |
hudi_HoodieExampleDataGenerator_generateUpdates_rdh | /**
* Generates new updates, randomly distributed across the keys above. There can be duplicates within the returned
* list
*
* @param commitTime
* Commit Timestamp
* @param n
* Number of updates (including dups)
* @return list of hoodie record updates
*/
public List<HoodieRecord<T>> generateUpdates(String... | 3.26 |
hudi_HoodieExampleDataGenerator_generateInsertsStream_rdh | /**
* Generates new inserts, uniformly across the partition paths above. It also updates the list of existing keys.
*/
public Stream<HoodieRecord<T>> generateInsertsStream(String commitTime, Integer n) {
int currSize = getNumExistingKeys();
return
IntStream.range(0, n).boxed().... | 3.26 |
hudi_HoodieExampleDataGenerator_generateInsertsStreamOnPartition_rdh | /**
* Generates new inserts, across a single partition path. It also updates the list of existing keys.
*/
public Stream<HoodieRecord<T>> generateInsertsStreamOnPartition(String commitTime,
Integer n, String partitionPath) {
int currSize = getNumExistingKeys();
return IntStream.range(0, n).boxed().map(i -> ... | 3.26 |
hudi_HoodieRepairTool_undoRepair_rdh | /**
* Undoes repair for UNDO mode.
*
* @throws IOException
* upon errors.
*/
boolean undoRepair() throws IOException {
FileSystem fs = metaClient.getFs();String v28 = f1.backupPath;Path backupPath =
new Path(v28);
if (!fs.exists(backupPath)) {
f0.error("Cannot find backup path: " + backupPath... | 3.26 |
hudi_HoodieRepairTool_deleteFiles_rdh | /**
* Deletes files from table base path.
*
* @param context
* {@link HoodieEngineContext} instance.
* @param basePath
* Base path of the table.
* @param relativeFilePaths
* A {@link List} of relative file paths for deleting.
*/
static boolean deleteFiles(HoodieEngineContext context, String basePath, Lis... | 3.26 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.