name stringlengths 12 178 | code_snippet stringlengths 8 36.5k | score float64 3.26 3.68 |
|---|---|---|
hudi_BaseHoodieWriteClient_preWrite_rdh | /**
* Common method containing steps to be performed before write (upsert/insert/...
*
* @param instantTime
* @param writeOperationType
* @param metaClient
*/
public void preWrite(String instantTime, WriteOperationType writeOperationType, HoodieTableMetaClient metaClient) {setOperationType(writeOperationType);
... | 3.26 |
hudi_BaseHoodieWriteClient_renameColumn_rdh | /**
* rename col name for hudi table.
*
* @param colName
* col name to be renamed. if we want to rename col from a nested filed, the fullName should be specified
* @param newName
* new name for current col. no need to specify fullName.
*/
public void renameColumn(String colName, String newName) {
Pair<Inte... | 3.26 |
hudi_BaseHoodieWriteClient_clean_rdh | /**
* Triggers clean for the table. This refers to Clean up any stale/old files/data lying around (either on file storage or index storage) based on the
* * configurations and CleaningPolicy used.
*
* @param skipLocking
* if this is triggered by another parent transaction, locking can be skipped.
* @return i... | 3.26 |
hudi_BaseHoodieWriteClient_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, extraMeta... | 3.26 |
hudi_BaseHoodieWriteClient_setWriteSchemaForDeletes_rdh | /**
* Sets write schema from last instant since deletes may not have schema set in the config.
*/
protected void setWriteSchemaForDeletes(HoodieTableMetaClient metaClient) {
try {
HoodieActiveTimeline activeTimeline = metaClient.getActiveTimeline();
Option<HoodieInstant> lastInstant = activeTimeline.filterCompleted... | 3.26 |
hudi_BaseHoodieWriteClient_runAnyPendingCompactions_rdh | /**
* Run any pending compactions.
*/
public void runAnyPendingCompactions() {
tableServiceClient.runAnyPendingCompactions(createTable(config,
hadoopConf));
} | 3.26 |
hudi_BaseHoodieWriteClient_initMetadataTable_rdh | /**
* Bootstrap the metadata table.
*
* @param instantTime
* current inflight instant time
*/protected void initMetadataTable(Option<String> instantTime) {
// by default do nothing.
} | 3.26 |
hudi_BaseHoodieWriteClient_scheduleAndGetRestorePlan_rdh | /**
* Check if there is a failed restore with the same savepointToRestoreTimestamp. Reusing the commit instead of
* creating a new one will prevent causing some issues with the metadata table.
*/
private Pair<String, Option<HoodieRestorePlan>> scheduleAndGetRestorePlan(final String savepointToRestoreTimestamp, Hoodi... | 3.26 |
hudi_BaseHoodieWriteClient_lazyRollbackFailedIndexing_rdh | /**
* Rolls back the failed delta commits corresponding to the indexing action.
* <p>
* TODO(HUDI-5733): This should be cleaned up once the proper fix of rollbacks
* in the metadata table is landed.
*
* @return {@code true} if rollback happens; {@code false} otherwise.
*/
public boolean lazyRollbackFailedIndexi... | 3.26 |
hudi_BaseHoodieWriteClient_m4_rdh | /**
* NOTE : This action requires all writers (ingest and compact) to a table to be stopped before proceeding. Revert
* the (inflight/committed) record changes for all commits after the provided instant time.
*
* @param savepointToRestoreTimestamp
* savepoint instant time to which restoration is requested
*/
pu... | 3.26 |
hudi_BaseHoodieWriteClient_startCommitWithTime_rdh | /**
* Completes a new commit time for a write operation (insert/update/delete) with specified action.
*/
private void startCommitWithTime(String instantTime, String actionType, HoodieTableMetaClient metaClient) {
CleanerUtils.rollbackFailedWrites(config.getFailedWritesCleanPolicy(), HoodieTimeline.COMMIT_ACTION, () -... | 3.26 |
hudi_BaseHoodieWriteClient_rollbackFailedWrites_rdh | /**
* Rollback failed writes if any.
*
* @return true if rollback happened. false otherwise.
*/
public boolean rollbackFailedWrites() {
return tableServiceClient.rollbackFailedWrites();
} | 3.26 |
hudi_BaseHoodieWriteClient_deleteColumns_rdh | /**
* delete columns to table.
*
* @param colNames
* col name to be deleted. if we want to delete col from a nested filed, the fullName should be specified
*/
public void deleteColumns(String... colNames) {
Pair<InternalSchema, HoodieTableMetaClient> v81 = getInternalSchemaAndMetaClient();
InternalSchema newSche... | 3.26 |
hudi_BaseHoodieWriteClient_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 shouldComplet... | 3.26 |
hudi_BaseHoodieWriteClient_commit_rdh | /**
* Commit changes performed at the given instantTime marker.
*/
public boolean commit(String instantTime, O writeStatuses, Option<Map<String, String>> extraMetadata) {
HoodieTableMetaClient metaClient = createMetaClient(false);
String actionType = metaClient.getCommitActionType();
return commit(instantTime, writeS... | 3.26 |
hudi_BaseHoodieWriteClient_releaseResources_rdh | /**
* Called after each write, to release any resources used.
*/
protected void releaseResources(String instantTime) {// do nothing here
} | 3.26 |
hudi_CompactionCommand_readCompactionPlanForActiveTimeline_rdh | /**
* TBD Can we make this part of HoodieActiveTimeline or a utility class.
*/
private HoodieCompactionPlan readCompactionPlanForActiveTimeline(HoodieActiveTimeline activeTimeline, HoodieInstant instant) {try {
if (!HoodieTimeline.COMPACTION_ACTION.equals(instant.getActio... | 3.26 |
hudi_CompactionCommand_compactionPlanReader_rdh | /**
* Compaction reading is different for different timelines. Create partial function to override special logic.
* We can make these read methods part of HoodieDefaultTimeline and override where necessary. But the
* BiFunction below has 'hacky' exception blocks, so restricting it to CLI.
*/
private <T extends Hood... | 3.26 |
hudi_CompactionCommand_printAllCompactions_rdh | /**
* Prints all compaction details.
*/
private static String printAllCompactions(HoodieDefaultTimeline timeline, Function<HoodieInstant, HoodieCompactionPlan> compactionPlanReader, boolean includeExtraMetadata, String sortByField, boolean descending, int limit, boolean headerOnly) {
Stream<HoodieInstant> instant... | 3.26 |
hudi_HoodieRowDataCreateHandle_canWrite_rdh | /**
* Returns {@code true} if this handle can take in more writes. else {@code false}.
*/
public boolean canWrite() {
return fileWriter.canWrite();
} | 3.26 |
hudi_HoodieRowDataCreateHandle_write_rdh | /**
* Writes an {@link RowData} to the underlying {@link HoodieRowDataFileWriter}.
* Before writing, value for meta columns are computed as required
* and wrapped in {@link HoodieRowData}. {@link HoodieRowData} is what gets written to HoodieRowDataFileWriter.
*
* @param recordKey
* The record key
* @param part... | 3.26 |
hudi_HoodieRowDataCreateHandle_close_rdh | /**
* Closes the {@link HoodieRowDataCreateHandle} and returns an instance of {@link WriteStatus} containing the stats and
* status of the writes to this handle.
*
* @return the {@link WriteStatus} containing the stats and status of the writes to this handle.
* @throws IOException
*/
... | 3.26 |
hudi_HoodieRowDataCreateHandle_createMarkerFile_rdh | /**
* Creates an empty marker file corresponding to storage writer path.
*
* @param partitionPath
* Partition path
*/
private void createMarkerFile(String partitionPath, String dataFileName) {
WriteMarkers writeMarkers = WriteMarkersFactory.get(writeConfig.getMarkersType(), table, instantTime);
writeMark... | 3.26 |
hudi_RocksDbDiskMap_iterator_rdh | /**
* Custom iterator to iterate over values written to disk.
*/
@Override
public Iterator<R> iterator() {
return getRocksDb().iterator(ROCKSDB_COL_FAMILY);
} | 3.26 |
hudi_HoodieTableMetadata_getDatasetBasePath_rdh | /**
* Return the base path of the dataset.
*
* @param metadataTableBasePath
* The base path of the metadata table
*/
static String getDatasetBasePath(String metadataTableBasePath) {
int endPos = metadataTableBasePath.lastIndexOf(Path.SEPARATOR + HoodieTableMetaClient.METADATA_TABLE_FOLDER_PATH);
checkSta... | 3.26 |
hudi_HoodieTableMetadata_getMetadataTableBasePath_rdh | /**
* Return the base-path of the Metadata Table for the given Dataset identified by base-path
*/static Path getMetadataTableBasePath(Path dataTableBasePath) {return new Path(dataTableBasePath, HoodieTableMetaClient.METADATA_TABLE_FOLDER_PATH);
} | 3.26 |
hudi_HoodieTableMetadata_getDataTableBasePathFromMetadataTable_rdh | /**
* Returns the base path of the Dataset provided the base-path of the Metadata Table of this
* Dataset
*/
static String getDataTableBasePathFromMetadataTable(String metadataTableBasePath) {
checkArgument(isMetadataTable(metadataTableBasePath));
return metadataTableBasePath.substring(0, metadataTableBasePa... | 3.26 |
hudi_HoodieTableMetadata_isMetadataTable_rdh | /**
* Returns {@code True} if the given path contains a metadata table.
*
* @param basePath
* The base path to check
*/
static boolean isMetadataTable(String
basePath) {
if ((basePath == null) || basePath.isEmpty()) {
return false;
}
if (basePath.endsWith(Path.SEPARATOR)) {
basePath... | 3.26 |
hudi_AvroSchemaConverter_convertToSchema_rdh | /**
* Converts Flink SQL {@link LogicalType} (can be nested) into an Avro schema.
*
* <p>The "{rowName}." is used as the nested row type name prefix in order to generate the right
* schema. Nested record type that only differs with type name is still compatible.
*
* @param logicalType
* logical type
* @param ... | 3.26 |
hudi_AvroSchemaConverter_convertToDataType_rdh | /**
* Converts an Avro schema {@code schema} into a nested row structure with deterministic field order and
* data types that are compatible with Flink's Table & SQL API.
*
* @param schema
* Avro schema definition
* @return data type matching the schema
*/
public static Data... | 3.26 |
hudi_AvroSchemaConverter_nullableSchema_rdh | /**
* Returns schema with nullable true.
*/
private static Schema nullableSchema(Schema schema) {
return schema.isNullable() ? schema : Schema.createUnion(SchemaBuilder.builder().nullType(), schema);} | 3.26 |
hudi_LSMTimeline_latestSnapshotVersion_rdh | /**
* Returns the latest snapshot version.
*/
public static int latestSnapshotVersion(HoodieTableMetaClient metaClient) throws IOException {
Path
versionFilePath = getVersionFilePath(metaClient);
if (metaClient.getFs().exists(versionFilePath)) {
try {
Option<byte[]> content = FileIOUti... | 3.26 |
hudi_LSMTimeline_isFileFromLayer_rdh | /**
* Returns whether a file belongs to the specified layer {@code layer} within the LSM layout.
*/
public static boolean isFileFromLayer(String fileName, int layer) {
return getFileLayer(fileName) == layer;
} | 3.26 |
hudi_LSMTimeline_getVersionFilePath_rdh | /**
* Returns the full version file path with given version number.
*/
public static Path getVersionFilePath(HoodieTableMetaClient metaClient) {
return new Path(metaClient.getArchivePath(), VERSION_FILE_NAME);
} | 3.26 |
hudi_LSMTimeline_getMaxInstantTime_rdh | /**
* Parse the maximum instant time from the file name.
*/
public static String getMaxInstantTime(String fileName) {
Matcher fileMatcher = ARCHIVE_FILE_PATTERN.matcher(fileName);
if (fileMatcher.matches()) {
return ... | 3.26 |
hudi_LSMTimeline_getMinInstantTime_rdh | /**
* Parse the minimum instant time from the file name.
*/
public static String getMinInstantTime(String fileName) {
Matcher fileMatcher = ARCHIVE_FILE_PATTERN.matcher(fileName);
if (fileMatcher.matches()) {
return fileMatcher.group(1);
} else {
throw new HoodieException("Unexpected arc... | 3.26 |
hudi_LSMTimeline_latestSnapshotManifest_rdh | /**
* Reads the file list from the manifest file for the latest snapshot.
*/
public static HoodieLSMTimelineManifest latestSnapshotManifest(HoodieTableMetaClient metaClient, int latestVersion) {
if (latestVersion < 0) {// there is no valid snapshot of the timeline.
return HoodieLSMTimelineManifest.EMPTY;
... | 3.26 |
hudi_LSMTimeline_getReadSchema_rdh | // -------------------------------------------------------------------------
// Utilities
// -------------------------------------------------------------------------
public static Schema getReadSchema(HoodieArchivedTimeline.LoadMode loadMode) {
switch (loadMode) {
case SLIM :
return ArchivedIns... | 3.26 |
hudi_LSMTimeline_m0_rdh | /**
* Returns all the valid snapshot versions.
*/
public static List<Integer> m0(HoodieTableMetaClient metaClient) throws IOException {
return Arrays.stream(metaClient.getFs().listStatus(new Path(metaClient.getArchivePath()), getManifestFilePathFilter())).map(fileStatus ... | 3.26 |
hudi_LSMTimeline_getManifestFilePath_rdh | /**
* Returns the full manifest file path with given version number.
*/
public static Path getManifestFilePath(HoodieTableMetaClient metaClient, int snapshotVersion) {
return new Path(metaClient.getArchivePath(), MANIFEST_FILE_PREFIX + snapshotVersion);
} | 3.26 |
hudi_LSMTimeline_getManifestFilePathFilter_rdh | /**
* Returns a path filter for the manifest files.
*/
public static PathFilter getManifestFilePathFilter() {
return path -> path.getName().startsWith(MANIFEST_FILE_PREFIX) && (!path.getName().endsWith(TEMP_FILE_SUFFIX));
} | 3.26 |
hudi_LSMTimeline_listAllMetaFiles_rdh | /**
* List all the parquet metadata files.
*/
public static FileStatus[] listAllMetaFiles(HoodieTableMetaClient metaClient) throws IOException {
return metaClient.getFs().globStatus(new Path(metaClient.getArchivePath() + "/*.parquet"));
} | 3.26 |
hudi_LSMTimeline_getFileLayer_rdh | /**
* Parse the layer number from the file name.
*/
public static int getFileLayer(String fileName) {
try {
Matcher fileMatcher = ARCHIVE_FILE_PATTERN.matcher(fileName);
if (fileMatcher.matches()) {
... | 3.26 |
hudi_LSMTimeline_getManifestVersion_rdh | /**
* Parse the snapshot version from the manifest file name.
*/
public static int getManifestVersion(String fileName) {
return Integer.parseInt(fileName.split("_")[1]);
} | 3.26 |
hudi_LSMTimeline_isFileInRange_rdh | /**
* Returns whether the given file is located in the filter.
*/
public static boolean isFileInRange(HoodieArchivedTimeline.TimeRangeFilter filter, String fileName) {
String minInstant = getMinInstantTime(fileName);
String maxInstant = getMaxInstantTime(fileName);
return filter.isInRange(minInstant) || ... | 3.26 |
hudi_LSMTimeline_listAllManifestFiles_rdh | /**
* List all the parquet manifest files.
*/
public static FileStatus[] listAllManifestFiles(HoodieTableMetaClient metaClient) throws IOException {
return metaClient.getFs().listStatus(new Path(metaClient.getArchivePath()), getManifestFilePathFilter());
} | 3.26 |
hudi_DFSPathSelector_getNextFilePathsAndMaxModificationTime_rdh | /**
* Get the list of files changed since last checkpoint.
*
* @param lastCheckpointStr
* the last checkpoint time string, empty if first run
* @param sourceLimit
* max bytes to read each time
* @return the list of files concatenated and their latest modified time
*/
... | 3.26 |
hudi_DFSPathSelector_listEligibleFiles_rdh | /**
* List files recursively, filter out illegible files/directories while doing so.
*/
protected List<FileStatus> listEligibleFiles(FileSystem fs, Path
path, long lastCheckpointTime) throws IOException {
// skip files/dirs whose names start with (_, ., etc)
FileStatus[] statuses = fs.listStatus(path, file ->... | 3.26 |
hudi_DFSPathSelector_m0_rdh | /**
* Factory method for creating custom DFSPathSelector. Default selector
* to use is {@link DFSPathSelector}
*/
public static DFSPathSelector m0(TypedProperties props, Configuration conf) {
String sourceSelectorClass = getStringWithAltKeys(props, DFSPathSelectorConfig.SOURCE_INPUT_SELECTOR, DFSPathSelector.c... | 3.26 |
hudi_HoodieMetadataLogRecordReader_getRecordsByKeys_rdh | /**
* Fetches records identified by the provided list of keys in case these are present in
* the delta-log blocks
*/
@SuppressWarnings("unchecked")
public Map<String, HoodieRecord<HoodieMetadataPayload>> getRecordsByKeys(List<String> sortedKeys) {
if (sortedKeys.isEmpty()) {return Collections.emptyMap();
}
... | 3.26 |
hudi_HoodieMetadataLogRecordReader_newBuilder_rdh | /**
* Returns the builder for {@code HoodieMetadataMergedLogRecordScanner}.
*/
public static HoodieMetadataLogRecordReader.Builder newBuilder() {
return new HoodieMetadataLogRecordReader.Builder();
} | 3.26 |
hudi_BitCaskDiskMap_sizeOfFileOnDiskInBytes_rdh | /**
* Number of bytes spilled to disk.
*/
@Override
public long sizeOfFileOnDiskInBytes() {
return filePosition.get();
} | 3.26 |
hudi_BitCaskDiskMap_m0_rdh | /**
* RandomAccessFile is not thread-safe. This API opens a new file handle per thread and returns.
*
* @return */
private BufferedRandomAccessFile m0() {
try {
BufferedRandomAccessFile readHandle = randomAccessFile.get();
if (readHandle == null) {
readHandle = new BufferedRandomAcc... | 3.26 |
hudi_HoodieFunctionalIndexConfig_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
*/
private static String storeProperties(Properties props, FSData... | 3.26 |
hudi_TwoToOneDowngradeHandler_convertToDirectMarkers_rdh | /**
* Converts the markers in new format(timeline server based) to old format of direct markers,
* i.e., one marker file per data file, without MARKERS.type file.
* This needs to be idempotent.
* 1. read all markers from timeline server based marker files
* 2. create direct style markers
* 3. delete marker type f... | 3.26 |
hudi_HoodieInstant_getFileName_rdh | /**
* Get the filename for this instant.
*/
public String getFileName() {
if (isCompleted()) {
return getCompleteFileName(completionTime);
}
return getPendingFileName();
} | 3.26 |
hudi_HoodieInstant_m0_rdh | /**
* Get the filename for this instant.
*/
public String m0(String completionTime) {
ValidationUtils.checkState(isCompleted());
return getCompleteFileName(completionTime);
} | 3.26 |
hudi_SchemaChangeUtils_applyTableChange2Type_rdh | /**
* Apply all the DDL update operations to type to produce a new internalSchema.
* do not call this method directly. expose this method only for UT.
*
* @param type
* origin internalSchema.
* @param updates
* a wrapper class for all the DDL update operations.
* @return a new internalSchema.
*/
private s... | 3.26 |
hudi_SchemaChangeUtils_isTypeUpdateAllow_rdh | /**
* Whether to allow the column type to be updated.
* now only support:
* int => long/float/double/String/Decimal
* long => float/double/String/Decimal
* float => double/String/Decimal
* double => String/Decimal
* Decimal => Decimal/String
* String => date/decimal
* date => String
* TODO: support more type ... | 3.26 |
hudi_SchemaChangeUtils_applyTableChanges2Schema_rdh | /**
* Apply all the DDL update operations to internalSchema to produce a new internalSchema.
*
* @param internalSchema
* origin internalSchema.
* @param updates
* a wrapper class for all the DDL update operations.
* @return a new internalSchema.
*/
public static InternalSchema applyTableChanges2Schema(Inte... | 3.26 |
hudi_LazyIterableIterator_start_rdh | /**
* Called once, before any elements are processed.
*/
protected void start() {
} | 3.26 |
hudi_LazyIterableIterator_end_rdh | /**
* Called once, after all elements are processed.
*/
protected void end() {
} | 3.26 |
hudi_LazyIterableIterator_invokeStartIfNeeded_rdh | // ////////////////
// iterable implementation
private void invokeStartIfNeeded() {
if (!startCalled) {
startCalled = true;
try {
start();
} catch (Exception e) {
throw new RuntimeException("Error in start()");
}
}
} | 3.26 |
hudi_LazyIterableIterator_hasNext_rdh | // ////////////////
// inputItr implementation
@Override
public boolean hasNext() {
boolean ret = inputItr.hasNext();
// make sure, there is exactly one call to start()
invokeStartIfNeeded();
if (!ret) {
// if we are out of elements, and end has not been called yet
invokeEndIfNeeded();
... | 3.26 |
hudi_LegacyArchivedMetaEntryReader_loadInstants_rdh | /**
* This is method to read selected instants. Do NOT use this directly use one of the helper methods above
* If loadInstantDetails is set to true, this would also update 'readCommits' map with commit details
* If filter is specified, only the filtered instants are loaded
* If commitsFilter is... | 3.26 |
hudi_LegacyArchivedMetaEntryReader_getRecordIterator_rdh | /**
* Returns the avro record iterator with given file statuses.
*/
private ClosableIterator<HoodieRecord<IndexedRecord>> getRecordIterator(FileStatus[] fsStatuses) throws IOException {
return new ClosableIterator<HoodieRecord<IndexedRecord>>() {
final Iterator<FileStatus> fsItr =... | 3.26 |
hudi_LegacyArchivedMetaEntryReader_readInstant_rdh | /**
* Reads the avro record for instant and details.
*/
private Pair<HoodieInstant, Option<byte[]>> readInstant(GenericRecord record) {
final String instantTime = record.get(HoodiePartitionMetadata.COMMIT_TIME_KEY).toString();
final String action = record.get(ACTION_TYPE_KEY).toString();
final String st... | 3.26 |
hudi_MiniBatchHandle_finalizeWrite_rdh | /**
* Finalize the write of one mini-batch. Usually these mini-bathes
* come from one checkpoint interval. The file handle may roll over to new name
* if the name conflicts, give a chance to clean the intermediate file.
*/default void finalizeWrite() {
} | 3.26 |
hudi_HoodieJavaPairRDD_of_rdh | /**
*
* @param pairRDDData
* a {@link JavaPairRDD} of pairs.
* @param <K>
* type of key.
* @param <V>
* type of value.
* @return a new instance containing the {@link JavaPairRDD<K, V>} reference.
*/
public static <K, V> HoodieJavaPairRDD<K, V> of(JavaPairRDD<K, V> pairRDDData) {
return new HoodieJava... | 3.26 |
hudi_HoodieJavaPairRDD_getJavaPairRDD_rdh | /**
*
* @param hoodiePairData
* {@link HoodieJavaPairRDD <K, V>} instance containing the {@link JavaPairRDD} of pairs.
* @param <K>
* type of key.
* @param <V>
* type of value.
* @return the {@link JavaPairRDD} of pairs.
*/
public static <K, V> JavaPairRDD<K, V> getJavaPairRDD(HoodiePairData<K, V> hoodie... | 3.26 |
hudi_Base64CodecUtil_encode_rdh | /**
* Encodes all bytes from the specified byte array into String using StandardCharsets.UTF_8.
*
* @param data
* byte[] source data
* @return base64 encoded data
*/
public static String encode(byte[] data) {
return new String(Base64.getEncoder().encode(data), StandardCharsets.UTF_8);
} | 3.26 |
hudi_Base64CodecUtil_m0_rdh | /**
* Decodes data from the input string into using the encoding scheme.
*
* @param encodedString
* - Base64 encoded string to decode
* @return A newly-allocated byte array containing the decoded bytes.
*/
public static byte[] m0(String encodedString) {return Base64.getDecoder().decode(getUTF8Bytes(encodedStrin... | 3.26 |
hudi_HoodieMetaserver_getMetaserverStorage_rdh | // only for test
public static MetaserverStorage getMetaserverStorage() {
return metaserverStorage;
} | 3.26 |
hudi_HoodieDropPartitionsTool_printDeleteFilesInfo_rdh | /**
* Prints the delete data files info.
*
* @param partitionToReplaceFileIds
*/
private void printDeleteFilesInfo(Map<String, List<String>> partitionToReplaceFileIds) {
LOG.info("Data files and partitions to delete : ");
for (Map.Entry<String, List<String>> entry : partitionToReplaceFileIds.entrySet()) {
... | 3.26 |
hudi_HoodieDropPartitionsTool_readConfigFromFileSystem_rdh | /**
* Reads config from the file system.
*
* @param jsc
* {@link JavaSparkContext} instance.
* @param cfg
* {@link Config} instance.
* @return the {@link TypedProperties} instance.
*/
private TypedProperties readConfigFromFileSystem(JavaSparkContext jsc, Config cfg) {
return UtilHelpers.readConfig(jsc.h... | 3.26 |
hudi_TableServicePipeline_add_rdh | /**
* Add a table service task to the end of table service pipe. The task will be executed in FIFO manner.
*
* @param task
* table service task to run in pipeline.
*/
public void add(TableServiceTask task) {
tableServiceTasks.add(task);
} | 3.26 |
hudi_TableServicePipeline_execute_rdh | /**
* Run all table services task sequentially.
*/
public void execute() {
tableServiceTasks.forEach(TableServiceTask::run);
} | 3.26 |
hudi_ExternalSpillableMap_m0_rdh | /**
* Number of bytes spilled to disk.
*/
public long m0() {
return getDiskBasedMap().sizeOfFileOnDiskInBytes();
} | 3.26 |
hudi_ExternalSpillableMap_getInMemoryMapNumEntries_rdh | /**
* Number of entries in InMemoryMap.
*/
public int getInMemoryMapNumEntries() {
return inMemoryMap.size();
} | 3.26 |
hudi_ExternalSpillableMap_getDiskBasedMapNumEntries_rdh | /**
* Number of entries in BitCaskDiskMap.
*/
public int getDiskBasedMapNumEntries() {
return getDiskBasedMap().size();
} | 3.26 |
hudi_ExternalSpillableMap_getCurrentInMemoryMapSize_rdh | /**
* Approximate memory footprint of the in-memory map.
*/
public long getCurrentInMemoryMapSize() {
return f1;
} | 3.26 |
hudi_ExternalSpillableMap_iterator_rdh | /**
* A custom iterator to wrap over iterating in-memory + disk spilled data.
*/
public Iterator<R> iterator() {
return new IteratorWrapper<>(inMemoryMap.values().iterator(), getDiskBasedMap().iterator());
} | 3.26 |
hudi_FileIOUtils_getConfiguredLocalDirs_rdh | /**
* Return the configured local directories where hudi can write files. This
* method does not create any directories on its own, it only encapsulates the
* logic of locating the local directories according to deployment mode.
*/
public static String[] getConfiguredLocalDirs() {
if (m0()) {
// If we are in ya... | 3.26 |
hudi_FileIOUtils_copy_rdh | /**
* Copies the file content from source path to destination path.
*
* @param fileSystem
* {@link FileSystem} instance.
* @param sourceFilePath
* Source file path.
* @param destFilePath
* Destination file path.
*/
public static void copy(FileSystem fileSystem, Path sourceFilePath, Path destFilePath) {
... | 3.26 |
hudi_FileIOUtils_readAsUTFStringLines_rdh | /**
* Reads the input stream into String lines.
*
* @param input
* {@code InputStream} instance.
* @return String lines in a list.
*/
public static List<String> readAsUTFStringLines(InputStream input) {
List<String> lines = new ArrayList<>();
BufferedReader bufferedReader = new BufferedReader(new InputS... | 3.26 |
hudi_FileIOUtils_getYarnLocalDirs_rdh | /**
* Get the Yarn approved local directories.
*/
private static String getYarnLocalDirs() {
String localDirs = System.getenv("LOCAL_DIRS");
if (localDirs == null) {
throw new HoodieIOException("Yarn Local dirs can't be empty");
}
return localDirs;
} | 3.26 |
hudi_FileIOUtils_closeQuietly_rdh | /**
* Closes {@code Closeable} quietly.
*
* @param closeable
* {@code Closeable} to close
*/
public static void closeQuietly(Closeable closeable) {
if (closeable == null) {
return;
}
try {
closeable.close();
} catch (IOExcept... | 3.26 |
hudi_HoodieTable_maybeDeleteMetadataTable_rdh | /**
* Deletes the metadata table if the writer disables metadata table with hoodie.metadata.enable=false
*/
public void maybeDeleteMetadataTable() {
if (shouldExecuteMetadataTableDeletion()) {
try {
LOG.info("Deleting metadata table because it is disabled in writer.");
deleteMeta... | 3.26 |
hudi_HoodieTable_rollbackInflightLogCompaction_rdh | /**
* Rollback failed compactions. Inflight rollbacks for compactions revert the .inflight file
* to the .requested file.
*
* @param inflightInstant
* Inflight Compaction Instant
*/
public void rollbackInflightLogCompaction(HoodieInstant inflightInstant, Function<String, Option<HoodiePendingRollbackInfo>> getPe... | 3.26 |
hudi_HoodieTable_rollbackInflightClustering_rdh | /**
* Rollback inflight clustering instant to requested clustering instant
*
* @param inflightInstant
* Inflight clustering instant
* @param getPendingRollbackInstantFunc
* Function to get rollback instant
*/
public void rollbackInflightClustering(HoodieInstant inflightInstant, Function<String, Option<Hoodie... | 3.26 |
hudi_HoodieTable_m3_rdh | /**
* Get only the completed (no-inflights) savepoint timeline.
*/
public HoodieTimeline m3() {
return getActiveTimeline().getSavePointTimeline().filterCompletedInstants();
} | 3.26 |
hudi_HoodieTable_getMetadataWriter_rdh | /**
* Gets the metadata writer for regular writes.
*
* @param triggeringInstantTimestamp
* The instant that is triggering this metadata write.
* @return An instance of {@link HoodieTableMetadataWriter}.
*/
/**
* Get Table metadata writer.
* <p>
* Note:
* Get the metadata writer for the conf. If the metadata... | 3.26 |
hudi_HoodieTable_getInvalidDataPaths_rdh | /**
* Returns the possible invalid data file name with given marker files.
*/
protected Set<String> getInvalidDataPaths(WriteMarkers markers) throws IOException {
return markers.createdAndMergedDataPaths(f0, config.getFinalizeWriteParallelism());
} | 3.26 |
hudi_HoodieTable_waitForAllFiles_rdh | /**
* Ensures all files passed either appear or disappear.
*
* @param context
* HoodieEngineContext
* @param groupByPartition
* Files grouped by partition
* @param visibility
* Appear/Disappear
*/
private void waitForAllFiles(HoodieEngineContext
context, Map<String,
List<Pair<String, String>>> groupByPar... | 3.26 |
hudi_HoodieTable_scheduleLogCompaction_rdh | /**
* Schedule log compaction for the instant time.
*
* @param context
* HoodieEngineContext
* @param instantTime
* Instant Time for scheduling log compaction
* @param extraMetadata
* additional metadata to write into plan
* @return */
public Option<HoodieCompactionPlan> scheduleLogCompaction(HoodieEngi... | 3.26 |
hudi_HoodieTable_getCompletedCleanTimeline_rdh | /**
* Get only the completed (no-inflights) clean timeline.
*/
public HoodieTimeline getCompletedCleanTimeline() {
return getActiveTimeline().getCleanerTimeline().filterCompletedInstants();
} | 3.26 |
hudi_HoodieTable_clean_rdh | /**
* Executes a new clean action.
*
* @return information on cleaned file slices
*/
@Deprecated
public HoodieCleanMetadata clean(HoodieEngineContext context, String cleanInstantTime, boolean skipLocking) {
return clean(context, cleanInstantTime);
} | 3.26 |
hudi_HoodieTable_getRestoreTimeline_rdh | /**
* Get restore timeline.
*/
public HoodieTimeline getRestoreTimeline() {
return getActiveTimeline().getRestoreTimeline();
} | 3.26 |
hudi_HoodieTable_getRollbackTimeline_rdh | /**
* Get rollback timeline.
*/
public HoodieTimeline getRollbackTimeline() {
return getActiveTimeline().getRollbackTimeline();
} | 3.26 |
hudi_HoodieTable_getFileSystemView_rdh | /**
* Get the view of the file system for this table.
*/
public TableFileSystemView getFileSystemView() {
return new HoodieTableFileSystemView(metaClient, getCompletedCommitsTimeline());
} | 3.26 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.