name
stringlengths
12
178
code_snippet
stringlengths
8
36.5k
score
float64
3.26
3.68
flink_FileOutputFormat_initDefaultsFromConfiguration_rdh
/** * Initialize defaults for output format. Needs to be a static method because it is configured * for local cluster execution. * * @param configuration * The configuration to load defaults from */ public static void initDefaultsFromConfiguration(Configuration configuration) { final boolean overwrite = co...
3.26
flink_FileOutputFormat_configure_rdh
// ---------------------------------------------------------------- @Override public void configure(Configuration parameters) { // get the output file path, if it was not yet set if (this.outputFilePath == null) { // get the file parameter String filePath = parameters.getString(FILE_PARAMETER_K...
3.26
flink_FileOutputFormat_initializeGlobal_rdh
/** * Initialization of the distributed file system if it is used. * * @param parallelism * The task parallelism. */ @Override public void initializeGlobal(int parallelism) throws IOException { final Path path = getOutputFilePath(); final FileSystem fs = path.getFileSystem();// only distributed file syst...
3.26
flink_FlinkS3PrestoFileSystem_deleteObject_rdh
/** * Deletes the object referenced by the passed {@code path}. This method is used to work around * the fact that Presto doesn't allow us to differentiate between deleting a non-existing object * and some other errors. Therefore, a final check for existence is necessary in case of an * error or false return value....
3.26
flink_Bucket_getNew_rdh
// --------------------------- Static Factory Methods ----------------------------- /** * Creates a new empty {@code Bucket}. * * @param subtaskIndex * the index of the subtask creating the bucket. * @param bucketId * the identifier of the bucket, as returned by the {@link BucketAssigner}. * @param bucketPa...
3.26
flink_Bucket_assembleNewPartPath_rdh
/** * Constructor a new PartPath and increment the partCounter. */ private Path assembleNewPartPath() {long currentPartCounter = partCounter++; return new Path(bucketPath, ((((outputFileConfig.getPartPrefix() + '-') + subtaskIndex) + '-') + currentPartCounter) + outputFileConfig.getPartSuffix()); }
3.26
flink_Bucket_getPendingFileRecoverablesPerCheckpoint_rdh
// --------------------------- Testing Methods ----------------------------- @VisibleForTesting Map<Long, List<InProgressFileWriter.PendingFileRecoverable>> getPendingFileRecoverablesPerCheckpoint() {return pendingFileRecoverablesPerCheckpoint; }
3.26
flink_Bucket_restore_rdh
/** * Restores a {@code Bucket} from the state included in the provided {@link BucketState}. * * @param subtaskIndex * the index of the subtask creating the bucket. * @param initialPartCounter * the initial counter for the part files of the bucket. * @param bucketWriter * the {@link BucketWriter} used to ...
3.26
flink_FlinkRelMdCollation_window_rdh
/** * Helper method to determine a {@link org.apache.calcite.rel.core.Window}'s collation. * * <p>A Window projects the fields of its input first, followed by the output from each of its * windows. Assuming (quite reasonably) that the implementation does not re-order its input * rows, then any collations of its in...
3.26
flink_FlinkRelMdCollation_mergeJoin_rdh
/** * Helper method to determine a {@link Join}'s collation assuming that it uses a merge-join * algorithm. * * <p>If the inputs are sorted on other keys <em>in addition to</em> the join key, the result * preserves those collations too. */ public static List<RelCollation> mergeJoin(RelMetadataQuery mq, RelNode ...
3.26
flink_FlinkRelMdCollation_table_rdh
// Helper methods /** * Helper method to determine a {@link org.apache.calcite.rel.core.TableScan}'s collation. */ public static List<RelCollation> table(RelOptTable table) { // Behavior change since CALCITE-4215: the default collations is null. // In Flink, the...
3.26
flink_FlinkRelMdCollation_filter_rdh
/** * Helper method to determine a {@link org.apache.calcite.rel.core.Filter}'s collation. */ public static List<RelCollation> filter(RelMetadataQuery mq, RelNode input) { return mq.collations(input); }
3.26
flink_FlinkRelMdCollation_values_rdh
/** * Helper method to determine a {@link org.apache.calcite.rel.core.Values}'s collation. * * <p>We actually under-report the collations. A Values with 0 or 1 rows - an edge case, but * legitimate and very common - is ordered by every permutation of every subset of the columns. * * <p>So, our algorithm aims to: ...
3.26
flink_FlinkRelMdCollation_project_rdh
/** * Helper method to determine a {@link Project}'s collation. */ public static List<RelCollation> project(RelMetadataQuery mq, RelNode input, List<? extends RexNode> projects) { final SortedSet<RelCollation> collations = new TreeSet<>(); final List<RelCollation> inputCollations = mq.collations(input); ...
3.26
flink_FlinkRelMdCollation_sort_rdh
/** * Helper method to determine a {@link org.apache.calcite.rel.core.Sort}'s collation. */ public static List<RelCollation> sort(RelCollation collation) { return ImmutableList.of(collation); }
3.26
flink_FlinkRelMdCollation_enumerableHashJoin_rdh
/** * Returns the collation of {@link EnumerableHashJoin} based on its inputs and the join type. */ public static List<RelCollation> enumerableHashJoin(RelMetadataQuery mq, RelNode left, RelNode right, JoinRelType joinType) { if (joinType == JoinRelType.SEMI) {return enumerableSemiJoin(mq, left, right); } els...
3.26
flink_FlinkRelMdCollation_getDef_rdh
// ~ Methods ---------------------------------------------------------------- public MetadataDef<BuiltInMetadata.Collation> getDef() { return Collation.DEF; }
3.26
flink_FlinkRelMdCollation_enumerableNestedLoopJoin_rdh
/** * Returns the collation of {@link EnumerableNestedLoopJoin} based on its inputs and the join * type. */ public static List<RelCollation> enumerableNestedLoopJoin(RelMetadataQuery mq, RelNode left, RelNode right, JoinRelType joinType) { return enumerableJoin0(mq, left, right, joinType); }
3.26
flink_FlinkRelMdCollation_match_rdh
/** * Helper method to determine a {@link org.apache.calcite.rel.core.Match}'s collation. */ public static List<RelCollation> match(RelMetadataQuery mq, RelNode input, RelDataType rowType, RexNode pattern, boolean strictStart, boolean strictEnd, Map<String, RexNode> patternDefinitions, Map<String, RexNode> measures,...
3.26
flink_FlinkRelMdCollation_collations_rdh
/** * Catch-all implementation for {@link BuiltInMetadata.Collation#collations()}, invoked using * reflection, for any relational expression not handled by a more specific method. * * <p>{@link org.apache.calcite.rel.core.Union}, {@link org.apache.calcite.rel.core.Intersect}, * {@link org.apache.calcite.rel.core.M...
3.26
flink_FlinkRelMdCollation_snapshot_rdh
/** * Helper method to determine a {@link org.apache.calcite.rel.core.Snapshot}'s collation. */ public static List<RelCollation> snapshot(RelMetadataQuery mq, RelNode input) { return mq.collations(input); }
3.26
flink_FlinkRelMdCollation_calc_rdh
/** * Helper method to determine a {@link org.apache.calcite.rel.core.Calc}'s collation. */ public static List<RelCollation> calc(RelMetadataQuery mq, RelNode input, RexProgram program) { final List<RexNode> projects = program.getProjectList().stream().map(program::expandLocalRef).collect(Collectors.toList()); ...
3.26
flink_CheckpointStorageWorkerView_toFileMergingStorage_rdh
/** * Return {@link org.apache.flink.runtime.state.filesystem.FsMergingCheckpointStorageAccess} if * file merging is enabled Otherwise, return itself. File merging is supported by subclasses of * {@link org.apache.flink.runtime.state.filesystem.AbstractFsCheckpointStorageAccess}. */ default CheckpointStorageWorkerV...
3.26
flink_RpcServiceUtils_createRandomName_rdh
/** * Creates a random name of the form prefix_X, where X is an increasing number. * * @param prefix * Prefix string to prepend to the monotonically increasing name offset number * @return A random name of the form prefix_X where X is an increasing number */ public static String createRandomName(String prefix...
3.26
flink_RpcServiceUtils_createWildcardName_rdh
/** * Creates a wildcard name symmetric to {@link #createRandomName(String)}. * * @param prefix * prefix of the wildcard name * @return wildcard name starting with the prefix */ public static String createWildcardName(String prefix) { return prefix + "_*"; }
3.26
flink_ModuleManager_useModules_rdh
/** * Enable modules in use with declared name order. Modules that have been loaded but not exist * in names varargs will become unused. * * @param names * module names to be used * @throws ValidationException * when module names contain an unloaded name */ public void useModules(String... names) { chec...
3.26
flink_ModuleManager_loadModule_rdh
/** * Load a module under a unique name. Modules will be kept in the loaded order, and new module * will be added to the left before the unused module and turn on use by default. * * @param name * name of the module * @param module * the module instance * @throws ValidationException * when there already ...
3.26
flink_ModuleManager_unloadModule_rdh
/** * Unload a module with given name. * * @param name * name of the module * @throws ValidationException * when there is no module with the given name */ public void unloadModule(String name) { if (loadedModules.containsKey(name)) { loadedModules.remove(name); boolean used = usedModules....
3.26
flink_ModuleManager_getFunctionDefinition_rdh
/** * Get an optional of {@link FunctionDefinition} by a given name. Function will be resolved to * modules in the used order, and the first match will be returned. If no match is found in all * modules, return an optional. * * <p>It includes hidden functions even though not listed in {@link #listFunctions()}. * ...
3.26
flink_ModuleManager_getFactory_rdh
/** * Returns the first factory found in the loaded modules given a selector. * * <p>Modules are checked in the order in which they have been loaded. The first factory * returned by a module will be used. If no loaded module provides a factory, {@link Optional#empty()} is returned. */ @...
3.26
flink_ModuleManager_listFunctions_rdh
/** * Get names of all functions from used modules. It excludes hidden functions. * * @return a set of function names of used modules */ public Set<String> listFunctions() { return usedModules.stream().map(name -> loadedModules.get(name).listFunctions(false)).flatMap(Collection::stream).collect(Collectors.toSet...
3.26
flink_ModuleManager_listFullModules_rdh
/** * Get all loaded modules with use status. Modules in use status are returned in resolution * order. * * @return a list of module entries with module name and use status */ public List<ModuleEntry> listFullModules() { // keep the order for used modules List<ModuleEntry> moduleEntries = usedModules.strea...
3.26
flink_AbstractMetricGroup_counter_rdh
// ----------------------------------------------------------------------------------------------------------------- // Metrics // ----------------------------------------------------------------------------------------------------------------- @Override public Counter counter(String name) { return counter(name, new Si...
3.26
flink_AbstractMetricGroup_putVariables_rdh
/** * Enters all variables specific to this {@link AbstractMetricGroup} and their associated values * into the map. * * @param variables * map to enter variables and their values into */ protected void putVariables(Map<String, String> variables) { }
3.26
flink_AbstractMetricGroup_addMetric_rdh
/** * Adds the given metric to the group and registers it at the registry, if the group is not yet * closed, and if no metric with the same name has been registered before. * * @param name * the name to register the metric under * @param metric * the metric to register */ protected void addMetric(String nam...
3.26
flink_AbstractMetricGroup_getMetricIdentifier_rdh
/** * Returns the fully qualified metric name using the configured delimiter for the reporter with * the given index, for example {@code "host-7.taskmanager-2.window_word_count.my-mapper.metricName"}. * * @param metricName * metric name * @param filter * character filter which is applied to the scope compone...
3.26
flink_AbstractMetricGroup_addGroup_rdh
// ------------------------------------------------------------------------ // Groups // ------------------------------------------------------------------------ @Override public MetricGroup addGroup(String name) { return addGroup(name, ChildType.GENERIC); }
3.26
flink_AbstractMetricGroup_getLogicalScope_rdh
/** * Returns the logical scope of this group, for example {@code "taskmanager.job.task"}. * * @param filter * character filter which is applied to the scope components * @return logical scope */public String getLogicalScope(CharacterFilter filter) { return getLogicalScope(filter, registry.getDelimiter()); ...
3.26
flink_AbstractMetricGroup_close_rdh
// ------------------------------------------------------------------------ // Closing // ------------------------------------------------------------------------ public void close() { synchronized(this) { if (!closed) { closed = true; // close all subgroups for (Abstra...
3.26
flink_AbstractMetricGroup_getQueryServiceMetricInfo_rdh
/** * Returns the metric query service scope for this group. * * @param filter * character filter * @return query service scope */ public QueryScopeInfo getQueryServiceMetricInfo(CharacterFilter filter) { if (queryServiceScopeInfo == null) {queryServiceScopeInfo = createQueryServiceMetricInfo(filter); ...
3.26
flink_AbstractMetricGroup_m0_rdh
/** * Returns the logical scope of this group, for example {@code "taskmanager.job.task"}. * * @param filter * character filter which is applied to the scope components * @param delimiter * delimiter to use for concatenating scope components * @param reporterIndex * index of the reporter * @return logica...
3.26
flink_ProtoUtils_createUserDefinedDataStreamFunctionProto_rdh
// ------------------------------------------------------------------------ // DataStream API related utilities // ------------------------------------------------------------------------ public static UserDefinedDataStreamFunction createUserDefinedDataStreamFunctionProto(DataStreamPythonFunctionInfo dataStreamPython...
3.26
flink_ProtoUtils_parseStateTtlConfigFromProto_rdh
// ------------------------------------------------------------------------ // State related utilities // ------------------------------------------------------------------------ public static StateTtlConfig parseStateTtlConfigFromProto(FlinkFnApi.StateDescriptor.StateTTLConfig stateTTLConfigProto) { StateTtlConfig...
3.26
flink_ProtoUtils_createUserDefinedFunctionsProto_rdh
// function utilities public static UserDefinedFunctions createUserDefinedFunctionsProto(RuntimeContext runtimeContext, PythonFunctionInfo[] userDefinedFunctions, boolean isMetricEnabled, boolean isProfileEnabled) { FlinkFnApi.UserDefinedFunctions.Builder builder = FlinkFnApi.UserDefinedFunctions.newBuilder(); ...
3.26
flink_AbstractCatalogStore_close_rdh
/** * Closes the catalog store. */ @Override public void close() { isOpen = false; }
3.26
flink_AbstractCatalogStore_checkOpenState_rdh
/** * Checks whether the catalog store is currently open. * * @throws IllegalStateException * if the store is closed */ protected void checkOpenState() { Preconditions.checkState(isOpen, "CatalogStore is not opened yet.");}
3.26
flink_GenericWriteAheadSink_saveHandleInState_rdh
/** * Called when a checkpoint barrier arrives. It closes any open streams to the backend and marks * them as pending for committing to the external, third-party storage system. * * @param checkpointId * the id of the latest received checkpoint. * @throws ...
3.26
flink_GenericWriteAheadSink_cleanRestoredHandles_rdh
/** * Called at {@link #open()} to clean-up the pending handle list. It iterates over all restored * pending handles, checks which ones are already committed to the outside storage system and * removes them from the list. */ private void cleanRestoredHandles() throws Exception {synchronized(pendingCheckpoints) { ...
3.26
flink_Tuple5_setFields_rdh
/** * Sets new values to all fields of the tuple. * * @param f0 * The value for field 0 * @param f1 * The value for field 1 * @param f2 * The value for field 2 * @param f3 * The value for field 3 * @param f4 * The value for field 4 */ public void setFields(T0 f0, T1 f1, T2 f2, T3 f3, T4 f4) { ...
3.26
flink_Tuple5_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
flink_Tuple5_equals_rdh
/** * Deep equality for tuples by calling equals() on the tuple members. * * @param o * the object checked for equality * @return true if this is equal to o. */ @Override public boolean equals(Object o) { if (this == o) { return true; } if (!(o instanceof Tuple5)) { return false; ...
3.26
flink_AbstractPartialSolutionNode_copyEstimates_rdh
// -------------------------------------------------------------------------------------------- protected void copyEstimates(OptimizerNode node) { this.estimatedNumRecords = node.estimatedNumRecords; this.estimatedOutputSize = node.estimatedOutputSize; }
3.26
flink_AbstractPartialSolutionNode_isOnDynamicPath_rdh
// -------------------------------------------------------------------------------------------- public boolean isOnDynamicPath() { return true; }
3.26
flink_ReOpenableHashPartition_restorePartitionBuffers_rdh
/** * This method is called every time a multi-match hash map is opened again for a new probe * input. * * @param ioManager * @param availableMemory * @throws IOException */ void restorePartitionBuffers(IOManager ioManager, List<MemorySegment> availableMemory) throws IOException { final BulkBlockChannelReade...
3.26
flink_ReOpenableHashPartition_spillInMemoryPartition_rdh
/** * Spills this partition to disk. This method is invoked once after the initial open() method * * @return Number of memorySegments in the writeBehindBuffers! */ int spillInMemoryPartition(FileIOChannel.ID targetChannel, IOManager ioManager, LinkedBlockingQueue<MemorySegment> writeBehindBuffers) throws IOExceptio...
3.26
flink_SortMergeSubpartitionReader_unsynchronizedGetNumberOfQueuedBuffers_rdh
// suppress warning as this method is only for unsafe purpose. @SuppressWarnings("FieldAccessNotGuarded") @Override public int unsynchronizedGetNumberOfQueuedBuffers() { return buffersRead.size(); }
3.26
flink_HiveParserProjectWindowTrimmer_trimProjectWindow_rdh
/** * Remove the redundant nodes from the project node which contains over window node. * * @param selectProject * the project node contains selected fields in top of the project node * with window * @param projectWithWindow * the project node which contains windows in the end of project * expressions. ...
3.26
flink_ShortSummaryAggregator_max_rdh
/** * Like Math.max() except for shorts. */ public static Short max(Short a, Short b) { return a >= b ? a : b; }
3.26
flink_ShortSummaryAggregator_min_rdh
/** * Like Math.min() except for shorts. */ public static Short min(Short a, Short b) { return a <= b ? a : b; }
3.26
flink_RocksDBHeapTimersFullRestoreOperation_restore_rdh
/** * Restores all key-groups data that is referenced by the passed state handles. */ @Override public RocksDBRestoreResult restore() throws IOException, StateMigrationException, RocksDBException { rocksHandle.openDB(); try (ThrowingIterator<SavepointRestoreResult> restore = savepointRestoreOperation.rest...
3.26
flink_RocksDBHeapTimersFullRestoreOperation_restoreKVStateData_rdh
/** * Restore the KV-state / ColumnFamily data for all key-groups referenced by the current state * handle. */ private void restoreKVStateData(ThrowingIterator<KeyGroup> keyGroups, Map<Integer, ColumnFamilyHandle> columnFamilies, Map<Integer, HeapPriorityQueueSnapshotRestoreWrapper<?>> restoredPQ...
3.26
flink_OperatorInfo_getIds_rdh
// ------------------------------------------------------------------------ // utils // ------------------------------------------------------------------------ static Collection<OperatorID> getIds(Collection<? extends OperatorInfo> infos) { return infos.stream().map(OperatorInfo::operatorId).collect(Collectors.toL...
3.26
flink_Plugin_configure_rdh
/** * Optional method for plugins to pick up settings from the configuration. * * @param config * The configuration to apply to the plugin. */ default void configure(Configuration config) { }
3.26
flink_KvStateService_start_rdh
// -------------------------------------------------------------------------------------------- // Start and shut down methods // -------------------------------------------------------------------------------------------- public void start() { synchronized(lock) { Preconditions.c...
3.26
flink_KvStateService_getKvStateRegistry_rdh
// -------------------------------------------------------------------------------------------- // Getter/Setter // -------------------------------------------------------------------------------------------- public KvStateRegistry getKvStateRegistry() { return kvStateRegistry; }
3.26
flink_KvStateService_m0_rdh
// -------------------------------------------------------------------------------------------- // Static factory methods for kvState service // -------------------------------------------------------------------------------------------- /** * Creates and returns the KvState service. * * @param taskManagerServicesCo...
3.26
flink_CoGroupNode_getOperator_rdh
// -------------------------------------------------------------------------------------------- /** * Gets the operator for this CoGroup node. * * @return The CoGroup operator. */ @Override public CoGroupOperatorBase<?, ?, ?, ?> getOperator() { return ((CoGroupOperatorBase<?, ?, ?, ?>) (super.getOperator())); }
3.26
flink_FunctionCatalogOperatorTable_verifyFunctionKind_rdh
/** * Verifies which kinds of functions are allowed to be returned from the catalog given the * context information. */ private boolean verifyFunctionKind(@Nullable SqlFunctionCategory category, ContextResolvedFunction resolvedFunction) { final FunctionDefinit...
3.26
flink_HadoopInputSplit_m0_rdh
// ------------------------------------------------------------------------ // Properties // ------------------------------------------------------------------------ public InputSplit m0() { return mapreduceInputSplit; }
3.26
flink_HadoopInputSplit_writeObject_rdh
// ------------------------------------------------------------------------ // Serialization // ------------------------------------------------------------------------ private void writeObject(ObjectOutputStream out) throws IOException { // serialize the parent fields and the final fields out.defaultWriteObjec...
3.26
flink_TaskKvStateRegistry_unregisterAll_rdh
/** * Unregisters all registered KvState instances from the KvStateRegistry. */ public void unregisterAll() { for (KvStateInfo kvState : registeredKvStates) { registry.unregisterKvState(jobId, jobVertexId, kvState.keyGroupRange, kvState.registrationName, kvState.f0); } }
3.26
flink_TaskKvStateRegistry_registerKvState_rdh
/** * Registers the KvState instance at the KvStateRegistry. * * @param keyGroupRange * Key group range the KvState instance belongs to * @param registrationName * The registration name (not necessarily the same as the KvState name * defined in the state descriptor used to create the KvState instance) * @...
3.26
flink_DCounter_getMetricValue_rdh
/** * Returns the count of events since the last report. * * @return the number of events since the last retrieval */ @Override public Number getMetricValue() { long currentCount = counter.getCount(); long difference = currentCount - f0; currentReportCount = currentCount; return difference; }
3.26
flink_JavaFieldPredicates_ofType_rdh
/** * Match the {@link Class} of the {@link JavaField}. * * @return A {@link DescribedPredicate} returning true, if and only if the tested {@link JavaField} has the same type of the given {@code clazz}. */ public static DescribedPredicate<JavaField> ofType(String fqClassName) { String className = getClassSimpl...
3.26
flink_JavaFieldPredicates_isPublic_rdh
/** * Fine-grained predicates focus on the JavaField. * * <p>NOTE: it is recommended to use methods that accept fully qualified class names instead of * {@code Class} objects to reduce the risks of introducing circular dependencies between the * project submodules. */public class JavaFieldPredicates { /** ...
3.26
flink_JavaFieldPredicates_isStatic_rdh
/** * Match the static modifier of the {@link JavaField}. * * @return A {@link DescribedPredicate} returning true, if and only if the tested {@link JavaField} has the static modifier. */ public static DescribedPredicate<JavaField> isStatic() { return DescribedPredicate.describe("static", field -> field.getMod...
3.26
flink_JavaFieldPredicates_annotatedWith_rdh
/** * Match the single Annotation of the {@link JavaField}. * * @return A {@link DescribedPredicate} returning true, if and only if the tested {@link JavaField} has exactly the given Annotation {@code annotationType}. */ public static DescribedPredicate<JavaField> annotatedWith(Class<? extends Annotation> annotatio...
3.26
flink_JavaFieldPredicates_isNotStatic_rdh
/** * Match none static modifier of the {@link JavaField}. * * @return A {@link DescribedPredicate} returning true, if and only if the tested {@link JavaField} has no static modifier. */ public static DescribedPredicate<JavaField> isNotStatic() { return DescribedPredicate.describe("not static", field -> !field....
3.26
flink_JavaFieldPredicates_isAssignableTo_rdh
/** * Match the {@link Class} of the {@link JavaField}'s assignability. * * @param clazz * the Class type to check for assignability * @return a {@link DescribedPredicate} that returns {@code true}, if the respective {@link JavaField} is assignable to the supplied {@code clazz}. */ public static DescribedPredic...
3.26
flink_CatalogCalciteSchema_getSubSchema_rdh
/** * Look up a sub-schema (database) by the given sub-schema name. * * @param schemaName * name of sub-schema to look up * @return the sub-schema with a given database name, or null */ @Override public Schema getSubSchema(String schemaName) { if (catalogManager.schemaExists(catalogName, schemaName)) { ...
3.26
flink_ProducerMergedPartitionFileReader_lazyInitializeFileChannel_rdh
/** * Initialize the file channel in a lazy manner, which can reduce usage of the file descriptor * resource. */ private void lazyInitializeFileChannel() { if (fileChannel == null) { try { fileChannel = FileChannel.open(dataFilePath, StandardOpenOption.READ); } catch (IOException e) {...
3.26
flink_LastDatedValueFunction_accumulate_rdh
/** * Generic runtime function that will be called with different kind of instances for {@code input} depending on actual call in the query. */ public void accumulate(Accumulator<T> acc, T input, LocalDate date) { if ((input != null) && ((acc.date == null) || date.isAfter(acc.date))) { acc.value = inp...
3.26
flink_LastDatedValueFunction_getTypeInference_rdh
// Planning // -------------------------------------------------------------------------------------------- /** * Declares the {@link TypeInference} of this function. It specifies: * * <ul> * <li>which argument types are supported when calling this function, * <li>which {@link DataType#getConversionClass()} sh...
3.26
flink_DynamicEventTimeSessionWindows_mergeWindows_rdh
/** * Merge overlapping {@link TimeWindow}s. */ @Override public void mergeWindows(Collection<TimeWindow> windows, MergeCallback<TimeWindow> c) { TimeWindow.mergeWindows(windows, c); }
3.26
flink_DynamicEventTimeSessionWindows_withDynamicGap_rdh
/** * Creates a new {@code SessionWindows} {@link WindowAssigner} that assigns elements to sessions * based on the element timestamp. * * @param sessionWindowTimeGapExtractor * The extractor to use to extract the time gap from the * input elements * @return The policy. */public static <T> DynamicEventTime...
3.26
flink_TaskManagerOptions_loadFromConfiguration_rdh
/** * The method is mainly to load the {@link TaskManagerOptions#TASK_MANAGER_LOAD_BALANCE_MODE} from {@link Configuration}, which is * compatible with {@link ClusterOptions#EVENLY_SPREAD_OUT_SLOTS_STRATEGY}. */ public static TaskManagerLoadBalanceMode loadFromConfiguration(@Nonnull Configuration configuration) { ...
3.26
flink_StateAssignmentOperation_extractIntersectingState_rdh
/** * Extracts certain key group ranges from the given state handles and adds them to the * collector. */ @VisibleForTesting public static void extractIntersectingState(Collection<? extends KeyedStateHandle> originalSubtaskStateHandles, KeyGroupRange rangeToExtract, List<KeyedStateHandle> extractedStateCollector) { ...
3.26
flink_StateAssignmentOperation_checkParallelismPreconditions_rdh
/** * Verifies conditions in regards to parallelism and maxParallelism that must be met when * restoring state. * * @param operatorState * state to restore * @param executionJobVertex * task for which the state should be restored */ private static void checkParallelismPreconditions(OperatorState operatorSta...
3.26
flink_StateAssignmentOperation_createKeyGroupPartitions_rdh
/** * Groups the available set of key groups into key group partitions. A key group partition is * the set of key groups which is assigned to the same task. Each set of the returned list * constitutes a key group partition. * * <p><b>IMPORTANT</b>: The assignment of key groups to partitions has to be in sync with ...
3.26
flink_StateAssignmentOperation_getRawKeyedStateHandles_rdh
/** * Collect {@link KeyGroupsStateHandle rawKeyedStateHandles} which have intersection with given * {@link KeyGroupRange} from {@link TaskState operatorState}. * * @param operatorState * all state handles of a operator * @param subtaskKeyGroupRange * the KeyGroupRange of a subtask * @return all rawKeyedSta...
3.26
flink_StateAssignmentOperation_reAssignSubKeyedStates_rdh
// TODO rewrite based on operator id private Tuple2<List<KeyedStateHandle>, List<KeyedStateHandle>> reAssignSubKeyedStates(OperatorState operatorState, List<KeyGroupRange> keyGroupPartitions, int subTaskIndex, int newParallelism, int oldParallelism) {List<KeyedStateHandle> subManagedKeyedState; List<KeyedStateHandle> ...
3.26
flink_StateAssignmentOperation_getManagedKeyedStateHandles_rdh
/** * Collect {@link KeyGroupsStateHandle managedKeyedStateHandles} which have intersection with * given {@link KeyGroupRange} from {@link TaskState operatorState}. * * @param operatorState * all state handles of a operator * @param subtaskKeyGroupRange * the KeyGroupRange of a subtask * @return all managed...
3.26
flink_StateAssignmentOperation_applyRepartitioner_rdh
/** * Repartitions the given operator state using the given {@link OperatorStateRepartitioner} with * respect to the new parallelism. * * @param opStateRepartitioner * partitioner to use * @param chainOpParallelStates * state to repartition * @param oldParallelism * parallelism with which the state is cu...
3.26
flink_StateAssignmentOperation_m1_rdh
/** * Verifies that all operator states can be mapped to an execution job vertex. * * @param allowNonRestoredState * if false an exception will be thrown if a state could not be * mapped * @param operatorStates * operator states to map * @param tasks * task to map to */ private static void m1(boolea...
3.26
flink_Conditions_fulfill_rdh
/** * Generic condition to check fulfillment of a predicate. */ public static <T extends HasName> ArchCondition<T> fulfill(DescribedPredicate<T> predicate) { return new ArchCondition<T>(predicate.getDescription()) { @Override public void check(T item, ConditionEvents e...
3.26
flink_Conditions_haveLeafExceptionTypes_rdh
/** * Tests leaf exception types of a method against the given predicate. * * <p>See {@link #haveLeafTypes(DescribedPredicate)} for details. */ public static ArchCondition<JavaMethod> haveLeafExceptionTypes(DescribedPredicate<JavaClass> typePredicate) { return new ArchCondition<JavaMethod>("have leaf exception type...
3.26
flink_Conditions_haveLeafReturnTypes_rdh
/** * Tests leaf return types of a method against the given predicate. * * <p>See {@link #haveLeafTypes(DescribedPredicate)} for details. */ public static ArchCondition<JavaMethod> haveLeafReturnTypes(DescribedPredicate<JavaClass> typePredicate) { return new ArchCondition<JavaMethod>("have leaf return types" + ...
3.26
flink_Conditions_haveLeafArgumentTypes_rdh
/** * Tests leaf argument types of a method against the given predicate. * * <p>See {@link #haveLeafTypes(DescribedPredicate)} for details. */ public static ArchCondition<JavaMethod> haveLeafArgumentTypes(DescribedPredicate<JavaClass> typePredicate) { return new ArchCondition<JavaMethod>("have leaf argument types" ...
3.26
flink_Conditions_haveLeafTypes_rdh
/** * Tests leaf types of a method against the given predicate. * * <p>Given some {@link JavaType}, "leaf" types are recursively determined as described below. * Leaf types are taken from argument, return, and (declared) exception types. * * <ul> * <li>If the type is an array type, check its base component typ...
3.26
flink_PurgingTrigger_of_rdh
/** * Creates a new purging trigger from the given {@code Trigger}. * * @param nestedTrigger * The trigger that is wrapped by this purging trigger */ public static <T, W extends Window> PurgingTrigger<T, W> of(Trigger<T, W> nestedTrigger) { return new PurgingTrigger<>(nestedTrigger); }
3.26