name
stringlengths
12
178
code_snippet
stringlengths
8
36.5k
score
float64
3.26
3.68
hudi_HoodieStreamerMetrics_updateStreamerHeartbeatTimestamp_rdh
/** * Update heartbeat from deltastreamer ingestion job when active for a table. * * @param heartbeatTimestampMs * the timestamp in milliseconds at which heartbeat is emitted. */ public void updateStreamerHeartbeatTimestamp(long heartbeatTimestampMs) { if (writeConfig.isMetricsOn()) { metrics.registe...
3.26
hudi_HoodieHBaseIndexConfig_hbaseIndexMaxQPSPerRegionServer_rdh
/** * <p> * Method to set maximum QPS allowed per Region Server. This should be same across various jobs. This is intended to * limit the aggregate QPS generated across various jobs to an HBase Region Server. * </p> * <p> * It is recommended to set this value based on your global indexing throughput needs and mos...
3.26
hudi_PartitionFilterGenerator_buildMinMaxPartitionExpression_rdh
/** * This method will extract the min value and the max value of each field, * and construct GreatThanOrEqual and LessThanOrEqual to build the expression. * * This method can reduce the Expression tree level a lot if each field has too many values. */ private static Expression buildMinMaxPartitionExpression(List<...
3.26
hudi_PartitionFilterGenerator_buildPartitionExpression_rdh
/** * Build expression from the Partition list. Here we're trying to match all partitions. * * ex. partitionSchema(date, hour) [Partition(2022-09-01, 12), Partition(2022-09-02, 13)] => * Or(And(Equal(Attribute(date), Literal(2022-09-01)), Equal(Attribute(hour), Literal(12))), * And(...
3.26
hudi_PartitionFilterGenerator_extractFieldValues_rdh
/** * Extract partition values from the {@param partitions}, and binding to * corresponding partition fieldSchemas. */ private static List<Pair<FieldSchema, String[]>> extractFieldValues(List<Partition> partitions, List<FieldSchema> partitionFields) { return IntStream.range(0, partitionFields.size()).mapToObj(i...
3.26
hudi_PartitionFilterGenerator_compare_rdh
/** * As HMS only accept DATE, INT, STRING, BIGINT to push down partition filters, here we only * do the comparison for these types. */ @Overridepublic int compare(String s1, String s2) { switch (valueType.toLowerCase(Locale.ROOT)) { case HiveSchemaUtil.INT_TYPE_NAME : int i1 = Integ...
3.26
hudi_HiveAvroSerializer_isNullableType_rdh
/** * Determine if an Avro schema is of type Union[T, NULL]. Avro supports nullable * types via a union of type T and null. This is a very common use case. * As such, we want to silently convert it to just T and allow the value to be null. * * When a Hive union type is used with AVRO, the schema type becomes * ...
3.26
hudi_HiveAvroSerializer_getOtherTypeFromNullableType_rdh
/** * If the union schema is a nullable union, get the schema for the non-nullable type. * This method does no checking that the provided Schema is nullable. If the provided * union schema is non-nullable, it simply returns the union schema */ public static Schema getOtherTypeFromNullableType(Schema unionSchema) { ...
3.26
hudi_BaseHoodieClient_m0_rdh
/** * Releases any resources used by the client. */ @Override public void m0() { stopEmbeddedServerView(true); this.context.setJobStatus("", ""); this.heartbeatClient.close(); this.txnManager.close(); }
3.26
hudi_BaseHoodieClient_resolveWriteConflict_rdh
/** * Resolve write conflicts before commit. * * @param table * A hoodie table instance created after transaction starts so that the latest commits and files are captured. * @param metadata * Current committing instant's metadata * @param pendingInflightAndRequestedInstants * Pending instants on the timel...
3.26
hudi_BaseHoodieClient_createNewInstantTime_rdh
/** * Returns next instant time in the correct format. * * @param shouldLock * Whether to lock the context to get the instant time. */ public String createNewInstantTime(boolean shouldLock) { return HoodieActiveTimeline.createNewInstantTime(shouldLock, timeGenerator); }
3.26
hudi_BaseHoodieClient_finalizeWrite_rdh
/** * Finalize Write operation. * * @param table * HoodieTable * @param instantTime * Instant Time * @param stats * Hoodie Write Stat */ protected void finalizeWrite(HoodieTable table, String instantTime, List<HoodieWriteStat> stats) { try { final Timer.Context finalizeCtx = metrics.getFinali...
3.26
hudi_RelationalDBBasedStorage_saveInstantMetadata_rdh
// todo: check correctness @Override public void saveInstantMetadata(long tableId, THoodieInstant instant, byte[] metadata) throws MetaserverStorageException { InstantBean instantBean = new InstantBean(tableId, instant); Map<String, Object> params = new HashMap<>(); params.put("instant", instantBean); ...
3.26
hudi_BootstrapExecutorUtils_syncHive_rdh
/** * Sync to Hive. */private void syncHive() { if (cfg.enableHiveSync) { TypedProperties metaProps = new TypedProperties(); metaProps.putAll(props); metaProps.put(META_SYNC_DATABASE_NAME.key(), cfg.database); metaProps.put(META_SYNC_TABLE_NAME.key(), cfg.tableName); metaPr...
3.26
hudi_BootstrapExecutorUtils_m0_rdh
/** * Executes Bootstrap. */ public void m0() throws IOException { initializeTable();try (SparkRDDWriteClient bootstrapClient = new SparkRDDWriteClient(new HoodieSparkEngineContext(jssc), bootstrapConfig)) { HashMap<String, String> checkpointCommitMetadata = new HashMap<>(); checkpointCommit...
3.26
hudi_FlinkHoodieIndexFactory_createIndex_rdh
/** * A factory to generate Flink {@link HoodieIndex}. */ public final class FlinkHoodieIndexFactory {public static HoodieIndex createIndex(HoodieFlinkEngineContext context, HoodieWriteConfig config) { // first use index class config to create index. if (!StringUtils.isNullOrEmpty(config.getIndexClass...
3.26
hudi_HiveIncrPullSource_findCommitToPull_rdh
/** * Finds the first commit from source, greater than the target's last commit, and reads it out. */ private Option<String> findCommitToPull(Option<String> latestTargetCommit) throws IOException {LOG.info("Looking for commits "); FileStatus[] commitTimePaths = fs.listStatus(new Path(incrPullRootPath)); List<...
3.26
hudi_UpgradeDowngrade_run_rdh
/** * Perform Upgrade or Downgrade steps if required and updated table version if need be. * <p> * Starting from version 0.6.0, this upgrade/downgrade step will be added in all write paths. * <p> * Essentially, if a dataset was created using an previous table version in an older release, ...
3.26
hudi_RowDataKeyGens_hasRecordKey_rdh
/** * Checks whether user provides any record key. */ private static boolean hasRecordKey(String recordKeys, List<String> fieldNames) { return (recordKeys.split(",").length != 1) || fieldNames.contains(recordKeys); }
3.26
hudi_RowDataKeyGens_instance_rdh
/** * Factory class for all kinds of {@link RowDataKeyGen}. */public class RowDataKeyGens { /** * Creates a {@link RowDataKeyGen} with given configuration. */ public static RowDataKeyGen instance(Configuration conf, RowType rowType, int taskId, String instantTime) { String recordKeys = con...
3.26
hudi_SparkRecordMergingUtils_getCachedFieldNameToIdMapping_rdh
/** * * @param avroSchema * Avro schema. * @return The field name to ID mapping. */ public static Map<String, Integer> getCachedFieldNameToIdMapping(Schema avroSchema) { return f0.computeIfAbsent(avroSchema, schema -> { StructType structType = HoodieInternalRowUtils.getCachedSchema(schema); M...
3.26
hudi_SparkRecordMergingUtils_mergePartialRecords_rdh
/** * Merges records which can contain partial updates. * <p> * For example, the reader schema is * {[ * {"name":"id", "type":"string"}, * {"name":"ts", "type":"long"}, * {"name":"name", "type":"string"}, * {"name":"price", "type":"double"}, * {"name":"tags", "type":"string"} * ]} * The older and newer recor...
3.26
hudi_SparkRecordMergingUtils_getCachedFieldIdToFieldMapping_rdh
/** * * @param avroSchema * Avro schema. * @return The field ID to {@link StructField} instance mapping. */ public static Map<Integer, StructField> getCachedFieldIdToFieldMapping(Schema avroSchema) { return FIELD_ID_TO_FIELD_MAPPING_CACHE.computeIfAbsent(avroSchema, schema -> { StructType structType...
3.26
hudi_SparkRecordMergingUtils_isPartial_rdh
/** * * @param schema * Avro schema to check. * @param mergedSchema * The merged schema for the merged record. * @return whether the Avro schema is partial compared to the merged schema. */ public static boolean isPartial(Schema schema, Schema mergedSchema) { return !schema.equals(mergedSchema); }
3.26
hudi_HoodieAdbJdbcClient_updateTableDefinition_rdh
/** * TODO align with {@link org.apache.hudi.sync.common.HoodieMetaSyncOperations#updateTableSchema} */ public void updateTableDefinition(String tableName, SchemaDifference schemaDiff) { LOG.info("Adding columns for table:{}", tableName); schemaDiff.getAddColumnTypes().forEach((columnName, columnType) -> exe...
3.26
hudi_HoodieAdbJdbcClient_scanTablePartitions_rdh
/** * TODO migrate to implementation of {@link #getAllPartitions(String)} */public Map<List<String>, String> scanTablePartitions(String tableName) { String sql = constructShowPartitionSql(tableName); Function<ResultSet, Map<List<String>, String>> transform = resultSet -> { Map<List<String>, String> pa...
3.26
hudi_HoodieAdbJdbcClient_getPartitionEvents_rdh
/** * TODO align with {@link HoodieSyncClient#getPartitionEvents} */ public List<PartitionEvent> getPartitionEvents(Map<List<String>, String> tablePartitions, List<String> partitionStoragePartitions) { Map<String, String> paths = new HashMap...
3.26
hudi_HoodieAdbJdbcClient_getPartitionClause_rdh
/** * Generate Hive Partition from partition values. * * @param partition * Partition path * @return partition clause */ private String getPartitionClause(String partition) { List<String> partitionValues = partitionValueExtractor.extractPartitionValuesInPath(partition); ValidationUtils.checkArgument(con...
3.26
hudi_HoodieListData_m0_rdh
/** * Creates instance of {@link HoodieListData} bearing *eager* execution semantic * * @param listData * a {@link List} of objects in type T * @param <T> * type of object * @return a new instance containing the {@link List<T>} reference */ public static <T> HoodieListData<T> m0(List<T> listData) { retu...
3.26
hudi_HoodieListData_lazy_rdh
/** * Creates instance of {@link HoodieListData} bearing *lazy* execution semantic * * @param listData * a {@link List} of objects in type T * @param <T> * type of object * @return a new instance containing the {@link List<T>} reference */ public static <T> HoodieListData<T> lazy(List<T> listData) { ret...
3.26
hudi_CLIUtils_getTimelineInRange_rdh
/** * Gets a {@link HoodieDefaultTimeline} instance containing the instants in the specified range. * * @param startTs * Start instant time. * @param endTs * End instant time. * @param includeArchivedTimeline * Whether to include intants from the archived timeline. ...
3.26
hudi_HoodieLazyInsertIterable_getTransformer_rdh
/** * Transformer function to help transform a HoodieRecord. This transformer is used by BufferedIterator to offload some * expensive operations of transformation to the reader thread. */ public <T> Function<HoodieRecord<T>, HoodieInsertValueGenResult<HoodieRecord>> getTransformer(Schema schema, HoodieWriteConfig wr...
3.26
hudi_TableSizeStats_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_BulkInsertWriteFunction_endInput_rdh
/** * End input action for batch source. */ public void endInput() { initWriterHelperIfNeeded(); final List<WriteStatus> writeStatus = this.writerHelper.getWriteStatuses(this.taskID); final WriteMetadataEvent event = WriteMetadataEvent.builder().taskID(taskID).instantTime(this.writerHelper.getInstantTime...
3.26
hudi_BulkInsertWriteFunction_setOperatorEventGateway_rdh
// ------------------------------------------------------------------------- // Getter/Setter // ------------------------------------------------------------------------- public void setOperatorEventGateway(OperatorEventGateway operatorEventGateway) { this.eventGateway = operatorEventGateway; }
3.26
hudi_BulkInsertWriteFunction_initWriterHelperIfNeeded_rdh
// ------------------------------------------------------------------------- // Utilities // ------------------------------------------------------------------------- private void initWriterHelperIfNeeded() { if (writerHelper == null) { String instant = instantToWrite(); this.writerHelper = Writ...
3.26
hudi_HoodieGlobalSimpleIndex_tagLocationInternal_rdh
/** * Tags records location for incoming records. * * @param inputRecords * {@link HoodieData} of incoming records * @param context * instance of {@link HoodieEngineContext} to use * @param hoodieTable * instance of {@link HoodieTable} to use * @return {@link HoodieData} of records with record locations ...
3.26
hudi_HoodieGlobalSimpleIndex_m0_rdh
/** * Load all files for all partitions as <Partition, filename> pair data. */ private List<Pair<String, HoodieBaseFile>> m0(final HoodieEngineContext context, final HoodieTable hoodieTable) { HoodieTableMetaClient metaClient = hoodieTable.getMetaClient(); List<String> allPartitionPaths = FSUtils.getAllParti...
3.26
hudi_KafkaConnectUtils_getDefaultHadoopConf_rdh
/** * Returns the default Hadoop Configuration. * * @return */ public static Configuration getDefaultHadoopConf(KafkaConnectConfigs connectConfigs) { Configuration v9 = new Configuration(); // add hadoop config files if ((!StringUtils.isNullOrEmpty(connectConfigs.getHadoopConfDi...
3.26
hudi_KafkaConnectUtils_getRecordKeyColumns_rdh
/** * Extract the record fields. * * @param keyGenerator * key generator Instance of the keygenerator. * @return Returns the record key columns separated by comma. */ public static String getRecordKeyColumns(KeyGenerator keyGenerator) { return String.join(",", keyGenerator.getRecordKeyFieldNames()); } /** * E...
3.26
hudi_KafkaConnectUtils_getWriteStatuses_rdh
/** * Unwrap the Hudi {@link WriteStatus} from the received Protobuf message. * * @param participantInfo * The {@link ControlMessage.ParticipantInfo} that contains the * underlying {@link WriteStatus} sent by the participants. * @return the list of {@link WriteStatus} returned by Hudi on a write transaction. ...
3.26
hudi_KafkaConnectUtils_getHadoopConfigFiles_rdh
/** * Get hadoop config files by HADOOP_CONF_DIR or HADOOP_HOME */ public static List<Path> getHadoopConfigFiles(String hadoopConfigPath, String hadoopHomePath) throws IOException { List<Path> hadoopConfigFiles = new ArrayList<>(); if (!StringUtils.isNullOrEmpty(hadoopConfigPath)) { hadoopConfigFiles....
3.26
hudi_KafkaConnectUtils_getCommitMetadataForLatestInstant_rdh
/** * Get the Metadata from the latest commit file. * * @param metaClient * The {@link HoodieTableMetaClient} to get access to the meta data. * @return An Optional {@link HoodieCommitMetadata} containing the meta data from the latest commit file. */ public static Option<HoodieCommitMetadata> getCommitMetadataFo...
3.26
hudi_Tuple3_of_rdh
/** * Creates a new tuple and assigns the given values to the tuple's fields. This is more * convenient than using the constructor, because the compiler can infer the generic type * arguments implicitly. For example: {@code Tuple3.of(n, x, s)} instead of {@code new * Tuple3<Integer, Double, String>(n, x, s)} */ pu...
3.26
hudi_HoodieFlinkClusteringJob_start_rdh
/** * Main method to start clustering service. */ public void start(boolean serviceMode) throws Exception { if (serviceMode) { clusteringScheduleService.start(null); try { clusteringScheduleService.waitForShutdown(); } catch (Exception e) { throw new HoodieException(e.getMessag...
3.26
hudi_HoodieFlinkClusteringJob_shutdownAsyncService_rdh
/** * Shutdown async services like compaction/clustering as DeltaSync is shutdown. */ public void shutdownAsyncService(boolean error) { LOG.info("Gracefully shutting down clustering job. Error ?" + error); executor.shutdown();writeClient.close(); }
3.26
hudi_HoodieFlinkClusteringJob_cluster_rdh
/** * Follows the same execution methodology of HoodieFlinkCompactor, where only one clustering job is allowed to be * executed at any point in time. * <p> * If there is an inflight clustering job, it will be rolled back and re-attempted. * <p> * A clustering plan will be generated if ...
3.26
hudi_PartialUpdateAvroPayload_mergeDisorderRecordsWithMetadata_rdh
/** * Merges the given disorder records with metadata. * * @param schema * The record schema * @param oldRecord * The current record from file * @param updatingRecord * The incoming record * @return the merged record option */ protected Option<IndexedRecord> mergeDisorderRecordsWithMetadata(Schema schem...
3.26
hudi_PartialUpdateAvroPayload_mergeOldRecord_rdh
// ------------------------------------------------------------------------- // Utilities // ------------------------------------------------------------------------- /** * Merge old record with new record. * * @param oldRecord * @param schema * @param isOldRecordNewer * @param isPreCombining * flag for delete...
3.26
hudi_PartialUpdateAvroPayload_isRecordNewer_rdh
/** * Returns whether the given record is newer than the record of this payload. * * @param orderingVal * @param record * The record * @param prop * The payload properties * @return true if the given record is newer */ private static boolean isRecordNewer(Comparable orderingVal, IndexedRecord record, Prope...
3.26
hudi_PartialUpdateAvroPayload_overwriteField_rdh
/** * Return true if value equals defaultValue otherwise false. */ public Boolean overwriteField(Object value, Object defaultValue) { return value == null; }
3.26
hudi_PartialUpdateAvroPayload_getInsertValue_rdh
/** * return itself as long as it called by preCombine * * @param schema * @param isPreCombining * @return * @throws IOException */ public Option<IndexedRecord> getInsertValue(Schema schema, boolean isPreCombining) throws IOException { if ((recordBytes.length == 0) || ((!isPreCombining) && isDeletedRecord)) {...
3.26
hudi_RestoreUtils_getSavepointToRestoreTimestamp_rdh
/** * Get the savepoint timestamp that this restore instant is restoring * * @param table * the HoodieTable * @param restoreInstant * Instant referring to restore action * @return timestamp of the savepoint we are restoring * @throws IOException */ public static String getSavepointToRestoreTimestamp(Hoodie...
3.26
hudi_RestoreUtils_m0_rdh
/** * Get Latest version of Restore plan corresponding to a restore instant. * * @param metaClient * Hoodie Table Meta Client * @param restoreInstant * Instant referring to restore action * @return Rollback plan corresponding to rollback instant * @throws IOException */ public static HoodieRestorePlan m0(H...
3.26
hudi_ConsistentBucketIdentifier_getLatterBucket_rdh
/** * Get the latter node of the given node (inferred from hash value). */ public ConsistentHashingNode getLatterBucket(int hashValue) { SortedMap<Integer, ConsistentHashingNode> tailMap = f0.tailMap(hashValue, false); return tailMap.isEmpty() ? f0.firstEntry().getValue() : tailMap.get(tailMap.firstKey()); }
3.26
hudi_ConsistentBucketIdentifier_initialize_rdh
/** * Initialize necessary data structure to facilitate bucket identifying. * Specifically, we construct: * - An in-memory tree (ring) to speed up range mapping searching. * - A hash table (fileIdToBucket) to allow lookup of bucket using fileId. * <p> * Children nodes are also considered, and will override the or...
3.26
hudi_ConsistentBucketIdentifier_m0_rdh
/** * Split bucket in the range middle, also generate the corresponding file ids * * TODO support different split criteria, e.g., distribute records evenly using statistics * * @param bucket * parent bucket * @return lists of children buckets */ public Option<List<ConsistentHashingNode>> m0(@NotNull Consisten...
3.26
hudi_ConsistentBucketIdentifier_getFormerBucket_rdh
/** * Get the former node of the given node (inferred from hash value). */ public ConsistentHashingNode getFormerBucket(int hashValue) { SortedMap<Integer, ConsistentHashingNode> headMap = f0.headMap(hashValue); return headMap.isEmpty() ? f0.lastEntry().getValue() : headMap.get(headMap.lastKey()); }
3.26
hudi_ConsistentBucketIdentifier_getBucketByFileId_rdh
/** * Get bucket of the given file group * * @param fileId * the file group id. NOTE: not filePrefix (i.e., uuid) */ public ConsistentHashingNode getBucketByFileId(String fileId) { return fileIdToBucket.get(fileId); }
3.26
hudi_HoodieCommitMetadata_fetchTotalPartitionsWritten_rdh
// Here the functions are named "fetch" instead of "get", to get avoid of the json conversion. public long fetchTotalPartitionsWritten() { return partitionToWriteStats.size(); }
3.26
hudi_HoodieCommitMetadata_getFileSliceForFileGroupFromDeltaCommit_rdh
/** * parse the bytes of deltacommit, and get the base file and the log files belonging to this * provided file group. */// TODO: refactor this method to avoid doing the json tree walking (HUDI-4822). public static Option<Pair<String, List<String>>> getFileSliceForFileGroupFromDeltaCommit(byte[] bytes, HoodieFileGro...
3.26
hudi_HoodieCommitMetadata_getFileIdToFileStatus_rdh
/** * Extract the file status of all affected files from the commit metadata. If a file has * been touched multiple times in the given commits, the return value will keep the one * from the latest commit by file group ID. * * <p>Note: different with {@link #getFullPathToFileStatus(Configuration, String)}, * only ...
3.26
hudi_HoodieCommitMetadata_getFullPathToFileStatus_rdh
/** * Extract the file status of all affected files from the commit metadata. If a file has * been touched multiple times in the given commits, the return value will keep the one * from the latest commit. * * @param had...
3.26
hudi_HoodieBaseFileGroupRecordBuffer_doProcessNextDataRecord_rdh
/** * Merge two log data records if needed. * * @param record * @param metadata * @param existingRecordMetadataPair * @return * @throws IOException */ protected Option<Pair<T, Map<String, Object>>> doProcessNextDataRecord(T record, Map<String, Object> metadata, Pair<Option<T>...
3.26
hudi_HoodieBaseFileGroupRecordBuffer_extractRecordPositions_rdh
/** * Extract the record positions from a log block header. * * @param logBlock * @return * @throws IOException */ protected static List<Long> extractRecordPositions(HoodieLogBlock logBlock) throws IOException { List<Long> blockPositions = new ArrayList<>(); Roaring64NavigableMap v12 = logBlock.getRecor...
3.26
hudi_HoodieBaseFileGroupRecordBuffer_merge_rdh
/** * Merge two records using the configured record merger. * * @param older * @param olderInfoMap * @param newer * @param newerInfoMap * @return * @throws IOException */ protected Option<T> merge(Option<T> older, Map<String, Object> olderInfoMap, Option<T> newer, Map<String, Object> newerInfoMap) throws IOExc...
3.26
hudi_HoodieBaseFileGroupRecordBuffer_shouldSkip_rdh
/** * Filter a record for downstream processing when: * 1. A set of pre-specified keys exists. * 2. The key of the record is not contained in the set. */ protected boolean shouldSkip(T record, String keyFieldName, boolean isFullKey, Set<String> keys) { String recordKey = readerContext.getValue(record, readerS...
3.26
hudi_HoodieBaseFileGroupRecordBuffer_doProcessNextDeletedRecord_rdh
/** * Merge a delete record with another record (data, or delete). * * @param deleteRecord * @param existingRecordMetadataPair * @return */ protected Option<DeleteRecord> doProcessNextDeletedRecord(DeleteRecord deleteRecord, Pair<Option<T>, Map<String, Object>> existingRecordMetadataPair) { if (existingRecordMe...
3.26
hudi_HoodieBaseFileGroupRecordBuffer_getRecordsIterator_rdh
/** * Create a record iterator for a data block. The records are filtered by a key set specified by {@code keySpecOpt}. * * @param dataBlock * @param keySpecOpt * @return * @throws IOException */ protected Pair<ClosableIterator<T>, Schema> getRecordsIterator(HoodieDataBlock dataBlock, Option<KeySpec> keySpecOpt)...
3.26
hudi_HoodieMergedLogRecordReader_scanByFullKeys_rdh
/** * Provides incremental scanning capability where only provided keys will be looked * up in the delta-log files, scanned and subsequently materialized into the internal * cache * * @param keys * to be looked up */ public void scanByFullKeys(List<String> keys) { // We can skip scanning in case reader is...
3.26
hudi_HoodieMergedLogRecordReader_scan_rdh
/** * Scans delta-log files processing blocks */ public final void scan() { scan(false); }
3.26
hudi_HoodieMergedLogRecordReader_scanByKeyPrefixes_rdh
/** * Provides incremental scanning capability where only keys matching provided key-prefixes * will be looked up in the delta-log files, scanned and subsequently materialized into * the internal cache * * @param keyPrefixes * to be looked up */ public void scanByKeyPrefixes...
3.26
hudi_HoodieMergedLogRecordReader_m0_rdh
/** * Returns the builder for {@code HoodieMergedLogRecordReader}. */ public static Builder m0() { return new Builder(); }
3.26
hudi_BaseKeyGenerator_getKey_rdh
/** * Generate a Hoodie Key out of provided generic record. */@Override public final HoodieKey getKey(GenericRecord record) { if ((getRecordKeyFieldNames() == null) || (getPartitionPathFields() == null)) { throw new HoodieKeyException("Unable to find field names for record key or partition path in c...
3.26
hudi_FlinkHoodieBackedTableMetadataWriter_validateTimelineBeforeSchedulingCompaction_rdh
/** * Validates the timeline for both main and metadata tables to ensure compaction on MDT can be scheduled. */ @Override protected boolean validateTimelineBeforeSchedulingCompaction(Option<String> inFlightInstantTimestamp, String latestDeltaCommitTimeInMetadataTable) { // Allows compaction of the metadata table...
3.26
hudi_InitialCheckPointProvider_init_rdh
/** * Initialize the class with the current filesystem. * * @param config * Hadoop configuration */ public void init(Configuration config) throws HoodieException { try { this.fs = FileSystem.get(config); } catch (IOException e) { throw new HoodieException("CheckpointProvider initializati...
3.26
hudi_MarkerUtils_readMarkerType_rdh
/** * Reads the marker type from `MARKERS.type` file. * * @param fileSystem * file system to use. * @param markerDir * marker directory. * @return the marker type, or empty if the marker type file does not exist. */ public static Option<MarkerType> readMarkerType(FileSystem fileSystem, String markerDir) { ...
3.26
hudi_MarkerUtils_markerDirToInstantTime_rdh
/** * Get instantTime from full marker path, for example: * /var/folders/t3/th1dw75d0yz2x2k2qt6ys9zh0000gp/T/junit6502909693741900820/dataset/.hoodie/.temp/003 * ==> 003 * * @param marker * @return */ public static String markerDirToInstantTime(String marker) { String[] ele = marker.split("/"); return...
3.26
hudi_MarkerUtils_deleteMarkerTypeFile_rdh
/** * Deletes `MARKERS.type` file. * * @param fileSystem * file system to use. * @param markerDir * marker directory. */ public static void deleteMarkerTypeFile(FileSystem fileSystem, String markerDir) { Path markerTypeFilePath = new Path(markerDir, MARKER_TYPE_FILENAME); try { fileSystem.de...
3.26
hudi_MarkerUtils_hasCommitConflict_rdh
/** * Whether there is write conflict with completed commit among multiple writers. * * @param activeTimeline * Active timeline. * @param currentFileIDs * Current set of file IDs. * @param completedCommitInstants * Completed commits. ...
3.26
hudi_MarkerUtils_writeMarkerTypeToFile_rdh
/** * Writes the marker type to the file `MARKERS.type`. * * @param markerType * marker type. * @param fileSystem * file system to use. * @param markerDir * marker directory. */ public static void writeMarkerTypeToFile(MarkerType markerType, FileSystem fileSystem, String markerDir) { Path markerTyp...
3.26
hudi_MarkerUtils_makerToPartitionAndFileID_rdh
/** * Get fileID from full marker path, for example: * 20210623/0/20210825/932a86d9-5c1d-44c7-ac99-cb88b8ef8478-0_85-15-1390_20220620181735781.parquet.marker.MERGE * ==> get 20210623/0/20210825/932a86d9-5c1d-44c7-ac99-cb88b8ef8478-0 * * @param marker * @return */ public static String makerToPartitionAndFileID...
3.26
hudi_MarkerUtils_getAllMarkerDir_rdh
/** * Gets all marker directories. * * @param tempPath * Temporary folder under .hoodie. * @param fs * File system to use. * @return All marker directories. * @throws IOException * upon error. */ public static List<Path> getAllMarkerDir(Path tempPath, FileSystem fs) throws IOException { return Array...
3.26
hudi_MarkerUtils_getCandidateInstants_rdh
/** * Get Candidate Instant to do conflict checking: * 1. Skip current writer related instant(currentInstantTime) * 2. Skip all instants after currentInstantTime * 3. Skip dead writers related instants based on heart-beat * 4. Skip pending compaction instant (For now we don' do early confli...
3.26
hudi_MarkerUtils_readTimelineServerBasedMarkersFromFileSystem_rdh
/** * Reads files containing the markers written by timeline-server-based marker mechanism. * * @param markerDir * marker directory. * @param fileSystem * file system to use. * @param context * instance of {@link HoodieEngineContext} to use * @param parallelism * parallelism to use * @return A {@code...
3.26
hudi_MarkerUtils_readMarkersFromFile_rdh
/** * Reads the markers stored in the underlying file. * * @param markersFilePath * File path for the markers. * @param conf * Serializable config. * @param ignoreException * Whether to ignore IOException. * @return Markers in a {@code Set} of String. */ public static Set<String> readMarkersFromFile(P...
3.26
hudi_MarkerUtils_stripMarkerFolderPrefix_rdh
/** * Strips the marker folder prefix of any file path under the marker directory. * * @param fullMarkerPath * the full path of the file * @param markerDir * marker directory * @return file name */ public static String stripMarkerFolderPrefix(String fullMarkerPath, String markerDir) { int begin = full...
3.26
hudi_MarkerUtils_doesMarkerTypeFileExist_rdh
/** * * @param fileSystem * file system to use. * @param markerDir * marker directory. * @return {@code true} if the MARKERS.type file exists; {@code false} otherwise. */ public static boolean doesMarkerTypeFileExist(FileSystem fileSystem, String markerDir) throws IOException { return fileSystem.exists...
3.26
hudi_BigQuerySchemaResolver_getTableSchema_rdh
/** * Get the BigQuery schema for the table. If the BigQuery table is configured with partitioning, the caller must pass in the partition fields so that they are not returned in the schema. * If the partition fields are in the schema, it will cause an error when querying the table since BigQuery will treat it as a du...
3.26
hudi_FileSystemViewManager_m1_rdh
/** * Main API to get the file-system view for the base-path. * * @param metaClient * HoodieTableMetaClient * @return */ public SyncableFileSystemView m1(HoodieTableMetaClient metaClient) { return globalViewMap.computeIfAbsent(metaClient.getBasePath(), path -> viewCreator.apply(metaClient, viewStorageCo...
3.26
hudi_FileSystemViewManager_createViewManager_rdh
/** * Main Factory method for building file-system views. */ public static FileSystemViewManager createViewManager(final HoodieEngineContext context, final HoodieMetadataConfig metadataConfig, final FileSystemViewStorageConfig config, final HoodieCommonConfig commonConfig, final SerializableFunctionUnchecked<Hoodie...
3.26
hudi_FileSystemViewManager_createInMemoryFileSystemView_rdh
/** * Create an in-memory file System view for a table. */ private static HoodieTableFileSystemView createInMemoryFileSystemView(HoodieMetadataConfig metadataConfig, FileSystemViewStorageConfig viewConf, HoodieTableMetaClient metaClient, SerializableFunctionUnchecked<HoodieTableMetaClient, HoodieTableMetadata> metada...
3.26
hudi_FileSystemViewManager_createRemoteFileSystemView_rdh
/** * Create a remote file System view for a table. * * @param conf * Hadoop Configuration * @param viewConf * View Storage Configuration * @param metaClient * Hoodie Table MetaClient for the table. * @return */ private static RemoteHoodieTableFileSystemView createRemoteFileSystemView(SerializableConfig...
3.26
hudi_FileSystemViewManager_close_rdh
/** * Closes all views opened. */ public void close() { if (!this.globalViewMap.isEmpty()) { this.globalViewMap.values().forEach(SyncableFileSystemView::close); this.globalViewMap.clear(); }}
3.26
hudi_FileSystemViewManager_m0_rdh
/** * Main API to get the file-system view for the base-path. * * @param basePath * @return */ public SyncableFileSystemView m0(String basePath) { return globalViewMap.computeIfAbsent(basePath, path -> { HoodieTableMetaClient metaClient = HoodieTableMetaClient.builder().setConf(conf.newCopy()).setBas...
3.26
hudi_FileSystemViewManager_clearFileSystemView_rdh
/** * Drops reference to File-System Views. Future calls to view results in creating a new view * * @param basePath */ public void clearFileSystemView(String basePath) { SyncableFileSystemView view = globalViewMap.remove(basePath); if (view != null) { view.close(); } }
3.26
hudi_FileSystemViewManager_createRocksDBBasedFileSystemView_rdh
// FACTORY METHODS FOR CREATING FILE-SYSTEM VIEWS /** * Create RocksDB based file System view for a table. * * @param conf * Hadoop Configuration * @param viewConf * View Storage Configuration * @param metaClient * HoodieTableMetaClient * @return */ private static RocksDbBasedFileSystemView createRocksD...
3.26
hudi_FileSystemViewManager_createSpillableMapBasedFileSystemView_rdh
/** * Create a spillable Map based file System view for a table. * * @param conf * Hadoop Configuration * @param viewConf * View Storage Configuration * @param metaClient * HoodieTableMetaClient * @return */ private static SpillableMapBasedFileSystemView createSpillableMapBasedFileSystemView(Serializabl...
3.26
hudi_HoodieMetaserverClientImp_isLocal_rdh
// used for test @Override public boolean isLocal() { return isLocal;}
3.26
hudi_HoodieParquetInputFormat_initAvroInputFormat_rdh
/** * Spark2 use `parquet.hadoopParquetInputFormat` in `com.twitter:parquet-hadoop-bundle`. * So that we need to distinguish the constructions of classes with * `parquet.hadoopParquetInputFormat` or `org.apache.parquet.hadoop.ParquetInputFormat`. * If we use `org.apache.parquet:parquet-hadoop`, we can use `HudiAvro...
3.26