name
stringlengths
12
178
code_snippet
stringlengths
8
36.5k
score
float64
3.26
3.68
flink_SavepointWriter_changeOperatorIdentifier_rdh
/** * Changes the identifier of an operator. * * <p>This method is comparatively cheap since it only modifies savepoint metadata without * reading the entire savepoint data. * * <p>Use-cases include, but are not limited to: * * <ul> * <li>assigning a UID to an operator that did not have a UID assigned before...
3.26
flink_SavepointWriter_withConfiguration_rdh
/** * Sets a configuration that will be applied to the stream operators used to bootstrap a new * savepoint. * * @param option * metadata information * @param value * value to be stored * @param <T> * type of the value to be stored * @return The modified savepoint. */ public <T> SavepointWriter withCon...
3.26
flink_SavepointWriter_withOperator_rdh
/** * Adds a new operator to the savepoint. * * @param identifier * The identifier of the operator. * @param transformation * The operator to be included. * @return The modified savepoint. */ public <T> SavepointWriter withOperator(OperatorIdentifier identifier, StateBootstrapTransformation<T> transformatio...
3.26
flink_PartitionedFileReader_getPriority_rdh
/** * Gets read priority of this file reader. Smaller value indicates higher priority. */ long getPriority() { return nextOffsetToRead; }
3.26
flink_PartitionedFileReader_readCurrentRegion_rdh
/** * Reads a buffer from the current region of the target {@link PartitionedFile} and moves the * read position forward. * * <p>Note: The caller is responsible for recycling the target buffer if any exception occurs. * * @param freeSegments * The free {@link MemorySegment}s to read data to. * @param recycler...
3.26
flink_NetworkBufferPool_requestUnpooledMemorySegments_rdh
/** * Unpooled memory segments are requested directly from {@link NetworkBufferPool}, as opposed to * pooled segments, that are requested through {@link BufferPool} that was created from this * {@link NetworkBufferPool} (see {@link #createBufferPool}). They are used for example for * exclusive {@link RemoteInputCha...
3.26
flink_NetworkBufferPool_recyclePooledMemorySegment_rdh
/** * Corresponding to {@link #requestPooledMemorySegmentsBlocking} and {@link #requestPooledMemorySegment}, this method is for pooled memory segments recycling. */ public void recyclePooledMemorySegment(MemorySegment segment) { // Adds the segment back to the queue, which does not immediately free the memory ...
3.26
flink_NetworkBufferPool_createBufferPool_rdh
// ------------------------------------------------------------------------ // BufferPoolFactory // ------------------------------------------------------------------------ @Override public BufferPool createBufferPool(int numRequiredBuffers, int maxUsedBuffers) throws IOException { return internalCreateBufferPool(n...
3.26
flink_NetworkBufferPool_destroyAllBufferPools_rdh
/** * Destroys all buffer pools that allocate their buffers from this buffer pool (created via * {@link #createBufferPool(int, int)}). */ public void destroyAllBufferPools() { synchronized(factoryLock) { // create a copy to avoid concurrent modifica...
3.26
flink_NetworkBufferPool_getAvailableFuture_rdh
/** * Returns a future that is completed when there are free segments in this pool. */ @Override public CompletableFuture<?> getAvailableFuture() { return availabilityHelper.getAvailableFuture(); }
3.26
flink_NetworkBufferPool_redistributeBuffers_rdh
// Must be called from synchronized block private void redistributeBuffers() { assert Thread.holdsLock(factoryLock); if (resizableBufferPools.isEmpty()) { return; } // All buffers, which are not among the required ones final int numAvailableMemorySegment = totalNumberOfMemor...
3.26
flink_NetworkBufferPool_tryRedistributeBuffers_rdh
// Must be called from synchronized block private void tryRedistributeBuffers(int numberOfSegmentsToRequest) throws IOException { assert Thread.holdsLock(factoryLock); if ((numTotalRequiredBuffers + numberOfSegmentsToRequest) > totalNumberOfMemorySegments) { throw new IOException(String.format("Insuffi...
3.26
flink_MapStateDescriptor_getValueSerializer_rdh
/** * Gets the serializer for the values in the state. * * @return The serializer for the values in the state. */ public TypeSerializer<UV> getValueSerializer() { final TypeSerializer<Map<UK, UV>> rawSerializer = getSerializer(); if (!(rawSerializer instanceof MapSerializer)) { throw new IllegalSta...
3.26
flink_MapStateDescriptor_getKeySerializer_rdh
/** * Gets the serializer for the keys in the state. * * @return The serializer for the keys in the state. */ public TypeSerializer<UK> getKeySerializer() {final TypeSerializer<Map<UK, UV>> rawSerializer = getSerializer(); if (!(rawSerializer instanceof MapSerializer)) {throw new IllegalStateException("Unexpect...
3.26
flink_RefCountedBufferingFileStream_openNew_rdh
// ------------------------- Factory Methods ------------------------- public static RefCountedBufferingFileStream openNew(final FunctionWithException<File, RefCountedFileWithStream, IOException> tmpFileProvider) throws IOException { return new RefCountedBufferingFileStream(tmpFileProvider.apply(nul...
3.26
flink_JobConfUtils_getDefaultPartitionName_rdh
/** * Gets the {@link HiveConf.ConfVars#DEFAULTPARTITIONNAME} value from the {@link JobConf}. */ public static String getDefaultPartitionName(JobConf jobConf) { return jobConf.get(DEFAULTPARTITIONNAME.varname, DEFAULTPARTITIONNAME.defaultStrVal); }
3.26
flink_PythonConfigUtil_alignTransformation_rdh
/** * Configure the {@link AbstractExternalOneInputPythonFunctionOperator} to be chained with the * upstream/downstream operator by setting their parallelism, slot sharing group, co-location * group to be the same, and applying a {@link ForwardPartitioner}. 1. operator with name * "_keyed_stream...
3.26
flink_PythonConfigUtil_processSideOutput_rdh
/** * Process {@link SideOutputTransformation}s, set the {@link OutputTag}s into the Python * corresponding operator to make it aware of the {@link OutputTag}s. */ private static void processSideOutput(List<Transformation<?>> transformations) {final Set<Transformation<?>> visitedTransforms = Sets.newIdentityHashSet(...
3.26
flink_PythonConfigUtil_extractPythonConfiguration_rdh
/** * Extract the configurations which is used in the Python operators. */ public static Configuration extractPythonConfiguration(List<Tuple2<String, DistributedCache.DistributedCacheEntry>> cachedFiles, ReadableConfig config) { final Configuration pythonDependencyConfig = PythonDependencyUtils.configurePythonDep...
3.26
flink_DataStreamUtils_collectWithClient_rdh
/** * Starts the execution of the program and returns an iterator to read the result of the given * data stream, plus a {@link JobClient} to interact with the application execution. * * @deprecated Please use {@link DataStream#executeAndCollect()}. */ @Deprecated public static <OUT> ClientAndIterator<OUT> collectW...
3.26
flink_DataStreamUtils_collectUnboundedStream_rdh
/** * Triggers execution of the DataStream application and collects the given number of records * from the stream. After the records are received, the execution is canceled. * * @deprecated Please use {@link DataStream#executeAndCollect()}. */ @Deprecated public static <E> List<E> collectUnboundedStream(DataStream...
3.26
flink_DataStreamUtils_collectRecordsFromUnboundedStream_rdh
/** * * @deprecated Please use {@link DataStream#executeAndCollect()}. */ @Deprecatedpublic static <E> List<E> collectRecordsFromUnboundedStream(final ClientAndIterator<E> client, final int numElements) { checkNotNull(client, "client"); checkArgument(numElements > 0, "numElement must be > 0"); final A...
3.26
flink_DataStreamUtils_m0_rdh
// ------------------------------------------------------------------------ // Deriving a KeyedStream from a stream already partitioned by key // without a shuffle // ------------------------------------------------------------------------ /** * Reinterprets the given {@link DataStream} as a {@...
3.26
flink_DataStreamUtils_collectBoundedStream_rdh
/** * Collects contents the given DataStream into a list, assuming that the stream is a bounded * stream. * * <p>This method blocks until the job execution is complete. By the time the method returns, * the job will have reached its FINISHED status. * * <p>Note that if the stream is unbounded, this method will n...
3.26
flink_DataStreamUtils_reinterpretAsKeyedStream_rdh
/** * Reinterprets the given {@link DataStream} as a {@link KeyedStream}, which extracts keys with * the given {@link KeySelector}. * * <p>IMPORTANT: For every partition of the base stream, the keys of events in the base stream * must be partitioned exactly in the same way as if it was created through a {@link Dat...
3.26
flink_DataStreamUtils_collect_rdh
/** * Triggers the distributed execution of the streaming dataflow and returns an iterator over the * elements of the given DataStream. * * <p>The DataStream application is executed in the regular distributed manner on the target * environment, and the events from the stream are polled back...
3.26
flink_FsCheckpointMetadataOutputStream_write_rdh
// I/O // ------------------------------------------------------------------------ @Override public final void write(int b) throws IOException { outputStreamWrapper.getOutput().write(b); }
3.26
flink_FsCheckpointMetadataOutputStream_isClosed_rdh
// ------------------------------------------------------------------------ // Closing // ------------------------------------------------------------------------ public boolean isClosed() { return closed; }
3.26
flink_SuperstepBarrier_onEvent_rdh
/** * Barrier will release the waiting thread if an event occurs. */ @Override public void onEvent(TaskEvent event) { if (event instanceof TerminationEvent) { terminationSignaled = true; } else if (event instanceof AllWorkersDoneEvent) { AllWorkersDoneEvent wde...
3.26
flink_SuperstepBarrier_setup_rdh
/** * Setup the barrier, has to be called at the beginning of each superstep. */ public void setup() { latch = new CountDownLatch(1); }
3.26
flink_SuperstepBarrier_waitForOtherWorkers_rdh
/** * Wait on the barrier. */ public void waitForOtherWorkers() throws InterruptedException { latch.await(); }
3.26
flink_HiveParserRexNodeConverter_convertIN_rdh
// converts IN for constant value list, RexSubQuery won't get here private RexNode convertIN(ExprNodeGenericFuncDesc func) throws SemanticException { List<RexNode> childRexNodes = new ArrayList<>(); for (ExprNodeDesc childExpr : func.getChildren()) {childRexNodes.add(convert(childExpr)); } if (funcConverter.hasOverload...
3.26
flink_PostVersionedIOReadableWritable_read_rdh
/** * We do not support reading from a {@link DataInputView}, because it does not support pushing * back already read bytes. */ @Override public final void read(DataInputView in) throws IOException { throw new UnsupportedOperationException("PostVersionedIOReadableWritable cannot read from a DataInputView."); }
3.26
flink_SimpleSplitAssigner_getNext_rdh
// ------------------------------------------------------------------------ @Override public Optional<FileSourceSplit> getNext(String hostname) { final int size = splits.size(); return size == 0 ? Optional.empty() : Optional.of(splits.remove(size - 1)); }
3.26
flink_SimpleSplitAssigner_toString_rdh
// ------------------------------------------------------------------------ @Override public String toString() { return "SimpleSplitAssigner " + splits; }
3.26
flink_SortMergeFullOuterJoinIterator_bufferRows2_rdh
/** * Buffer rows from iterator2 with same key. */ private void bufferRows2() throws IOException { BinaryRowData copy = key2.copy(); buffer2.reset(); do { buffer2.add(row2); } while (nextRow2() && (keyComparator.compare(key2, copy) == 0) ); buffer2.complete(); }
3.26
flink_SortMergeFullOuterJoinIterator_bufferRows1_rdh
/** * Buffer rows from iterator1 with same key. */ private void bufferRows1() throws IOException { BinaryRowData copy = key1.copy(); buffer1.reset(); do { buffer1.add(row1); } while (nextRow1() && (keyComparator.compare(key1, copy) == 0) ); buffer1.complete(); }
3.26
flink_KeyContextHandler_hasKeyContext_rdh
/** * Whether the {@link Input} has "KeyContext". If false, we can omit the call of {@link Input#setKeyContextElement} for each record. * * @return True if the {@link Input} has "KeyContext", false otherwise. */ default boolean hasKeyContext() { return hasKeyContext1(); }
3.26
flink_KeyContextHandler_hasKeyContext1_rdh
/** * Whether the first input of {@link StreamOperator} has "KeyContext". If false, we can omit the * call of {@link StreamOperator#setKeyContextElement1} for each record arrived on the first * input. * * @return True if the first input has "KeyContext", false otherwise. */ default boolean hasKeyContext1() { ...
3.26
flink_EventAnnouncement_write_rdh
// ------------------------------------------------------------------------ // Serialization // ------------------------------------------------------------------------ // // These methods are inherited form the generic serialization of AbstractEvent // but would require the CheckpointBarrier to be mutable. Since all ...
3.26
flink_EventAnnouncement_hashCode_rdh
// ------------------------------------------------------------------------ @Override public int hashCode() { return Objects.hash(announcedEvent, sequenceNumber); }
3.26
flink_FunctionTemplate_createResultTemplate_rdh
/** * Creates an instance of {@link FunctionResultTemplate} from a {@link DataTypeHint}. */ @Nullable static FunctionResultTemplate createResultTemplate(DataTypeFactory typeFactory, @Nullable DataTypeHint hint) { if (hint == null) { return null; } final DataTypeTemplate template; try { ...
3.26
flink_FunctionTemplate_fromAnnotation_rdh
/** * Creates an instance using the given {@link ProcedureHint}. It resolves explicitly defined * data types. */ static FunctionTemplate fromAnnotation(DataTypeFactory typeFactory, ProcedureHint hint) { return new FunctionTemplate(createSignatureTemplate(typeFactory, defaultAsNull(hint, ProcedureHint::input), de...
3.26
flink_JvmShutdownSafeguard_installAsShutdownHook_rdh
/** * Installs the safeguard shutdown hook. The maximum time that the JVM is allowed to spend on * shutdown before being killed is the given number of milliseconds. * * @param logger * The logger to log errors to. * @param delayMillis * The delay (in milliseconds) to wait after clean shutdown was stared, * ...
3.26
flink_ScanReuser_applyPhysicalAndMetadataPushDown_rdh
/** * Generate sourceAbilitySpecs and newProducedType by projected physical fields and metadata * keys. */ private static RowType applyPhysicalAndMetadataPushDown(DynamicTableSource source, RowType originType, List<SourceAbilitySpec> sourceAbilitySpecs, int[][] physicalAndMetaFields, int[][] projectedPhysicalFields,...
3.26
flink_ExecNodeUtil_setManagedMemoryWeight_rdh
/** * An Utility class that helps translating {@link ExecNode} to {@link Transformation}. */public class ExecNodeUtil { /** * Sets {Transformation#declareManagedMemoryUseCaseAtOperatorScope(ManagedMemoryUseCase, int)} * using the given bytes for {@link ManagedMemoryUseCase#OPERATOR}. */ public ...
3.26
flink_ExecNodeUtil_createOneInputTransformation_rdh
/** * Create a {@link OneInputTransformation} with memoryBytes. */ public static <I, O> OneInputTransformation<I, O> createOneInputTransformation(Transformation<I> input, TransformationMetadata transformationMeta, StreamOperatorFactory<O> operatorFactory, TypeInformation<O> outputType, int parallelism, long memory...
3.26
flink_ExecNodeUtil_m0_rdh
/** * Create a {@link TwoInputTransformation} with memoryBytes. */ public static <IN1, IN2, O> TwoInputTransformation<IN1, IN2, O> m0(Transformation<IN1> input1, Transformation<IN2> input2, TransformationMetadata transformationMeta, TwoInputStreamOperator<IN1, IN2, O> operator, TypeInformation<O> outputType, int par...
3.26
flink_ExecNodeUtil_createTwoInputTransformation_rdh
/** * Create a {@link TwoInputTransformation} with memoryBytes. */ public static <I1, I2, O> TwoInputTransformation<I1, I2, O> createTwoInputTransformation(Transformation<I1> input1, Transformation<I2> input2, String name, String desc, StreamOperatorFactory<O> operatorFactory, TypeInformation<O> outputType, int para...
3.26
flink_ExecNodeUtil_makeLegacySourceTransformationsBounded_rdh
/** * The planner might have more information than expressed in legacy source transformations. This * enforces planner information about boundedness to the affected transformations. */ public static void makeLegacySourceTransformationsBounded(Transformation<?> transformation) { if (transformation instanceof Leg...
3.26
flink_ExecNodeUtil_getMultipleInputDescription_rdh
/** * Return description for multiple input node. */ public static String getMultipleInputDescription(ExecNode<?> rootNode, List<ExecNode<?>> inputNodes, List<InputProperty> inputProperties) { String members = ExecNodePlanDumper.treeToString(rootNode, inputNodes, true).replace("\n", "\\n"); StringBuilder s...
3.26
flink_RocksDBKeyedStateBackend_getInstanceBasePath_rdh
/** * Only visible for testing, DO NOT USE. */ File getInstanceBasePath() { return instanceBasePath; }
3.26
flink_RocksDBKeyedStateBackend_snapshot_rdh
/** * Triggers an asynchronous snapshot of the keyed state backend from RocksDB. This snapshot can * be canceled and is also stopped when the backend is closed through {@link #dispose()}. For * each backend, this method must always be called by the same thread. * * @param checkpointId * The Id of the checkpoint...
3.26
flink_RocksDBKeyedStateBackend_tryRegisterKvStateInformation_rdh
/** * Registers a k/v state information, which includes its state id, type, RocksDB column family * handle, and serializers. * * <p>When restoring from a snapshot, we don’t restore the individual k/v states, just the * global RocksDB database and the list of k/v state information. When a k/v state is first * requ...
3.26
flink_RocksDBKeyedStateBackend_dispose_rdh
/** * Should only be called by one thread, and only after all accesses to the DB happened. */ @Override public void dispose() { if (this.disposed) { return; } super.dispose(); // This call will block until all clients that still acquire access to the RocksDB instance // have released it, ...
3.26
flink_RocksDBKeyedStateBackend_getKeyGroupPrefixBytes_rdh
// ------------------------------------------------------------------------ // Getters and Setters // ------------------------------------------------------------------------ public int getKeyGroupPrefixBytes() { return keyGroupPrefixBytes; }
3.26
flink_RocksDBKeyedStateBackend_migrateStateValues_rdh
/** * Migrate only the state value, that is the "value" that is stored in RocksDB. We don't migrate * the key here, which is made up of key group, key, namespace and map key (in case of * MapState). */ @SuppressWarnings("unchecked") private <N, S extends State, SV> void migrateStateValues(StateDescriptor<S, SV> sta...
3.26
flink_HiveParserSqlFunctionConverter_getName_rdh
// TODO: this is not valid. Function names for built-in UDFs are specified in // FunctionRegistry, and only happen to match annotations. For user UDFs, the // name is what user specifies at creation time (annotation can be absent, // different, or duplicate some other function). private static String getName(GenericUDF...
3.26
flink_SortMergeResultPartitionReadScheduler_release_rdh
/** * Releases this read scheduler and returns a {@link CompletableFuture} which will be completed * when all resources are released. */ CompletableFuture<?> release() {List<SortMergeSubpartitionReader> pendingReaders; synchronized(lock) { if (isReleased) { return releaseFuture; } isReleased = true; failedReaders.ad...
3.26
flink_HiveParserASTNode_setUnknownTokenBoundaries_rdh
/** * For every node in this subtree, make sure it's start/stop token's are set. Walk depth first, * visit bottom up. Only updates nodes with at least one token index < 0. * * <p>In contrast to the method in the parent class, this method is iterative. */ @Override public void setUnknownTokenBoundaries() { Dequ...
3.26
flink_UserDefinedFunctionHelper_validateImplementationMethod_rdh
/** * Validates an implementation method such as {@code eval()} or {@code accumulate()}. */ private static void validateImplementationMethod(Class<? extends UserDefinedFunction> clazz, boolean rejectStatic, boolean isOptional, String... methodNameOptions) { final Set<String> nameSet = new HashSet<>(Arrays.asList(me...
3.26
flink_UserDefinedFunctionHelper_validateClass_rdh
/** * Validates a {@link UserDefinedFunction} class for usage in the API. */ private static void validateClass(Class<? extends UserDefinedFunction> functionClass, boolean requiresDefaultConstructor) { if (TableFunction.class.isAssignableFrom(functionClass)) { validateNotSingleton(functionClass); } validateInstantiat...
3.26
flink_UserDefinedFunctionHelper_isClassNameSerializable_rdh
/** * Returns whether a {@link UserDefinedFunction} can be easily serialized and identified by only * a fully qualified class name. It must have a default constructor and no serializable fields. * * <p>Other properties (such as checks for abstract classes) are validated at the entry points * of the API, see {@link...
3.26
flink_UserDefinedFunctionHelper_validateImplementationMethods_rdh
/** * Validates the implementation methods such as {@link #SCALAR_EVAL} or {@link #AGGREGATE_ACCUMULATE} depending on the {@link UserDefinedFunction} subclass. * * <p>This method must be kept in sync with the code generation requirements and the individual * docs of each function. */ private static void validateIm...
3.26
flink_UserDefinedFunctionHelper_getAccumulatorTypeOfAggregateFunction_rdh
/** * Tries to infer the TypeInformation of an AggregateFunction's accumulator type. * * @param aggregateFunction * The AggregateFunction for which the accumulator type is inferred. * @param scalaType * The implicitly inferred type of the accumulator type. * @return The inferred accumulator type of the Aggre...
3.26
flink_UserDefinedFunctionHelper_createSpecializedFunction_rdh
/** * Creates the runtime implementation of a {@link FunctionDefinition} as an instance of {@link UserDefinedFunction}. * * @see SpecializedFunction */ public static UserDefinedFunction createSpecializedFunction(String functionName, FunctionDefinition definition, CallContext callContext, ClassLoader builtInClassLo...
3.26
flink_UserDefinedFunctionHelper_validateInstantiation_rdh
/** * Checks if a user-defined function can be easily instantiated. */ private static void validateInstantiation(Class<?> clazz, boolean requiresDefaultConstructor) { if (!InstantiationUtil.isPublic(clazz)) { throw new ValidationException(String.format("Function class '%s' is not public.", clazz.getName())); } else...
3.26
flink_UserDefinedFunctionHelper_validateNotSingleton_rdh
/** * Check whether this is a Scala object. Using Scala objects can lead to concurrency issues, * e.g., due to a shared collector. */ private static void validateNotSingleton(Class<?> clazz) { if (Arrays.stream(clazz.getFields()).anyMatch(f -> f.getName().equals("MODULE$"))) { throw new ValidationException(String.fo...
3.26
flink_UserDefinedFunctionHelper_cleanFunction_rdh
/** * Modifies a function instance by removing any reference to outer classes. This enables * non-static inner function classes. */ private static void cleanFunction(ReadableConfig config, UserDefinedFunction function) { final ClosureCleanerLevel level = config.get(PipelineOptions.CLOSURE_CLEANER_LEVEL); try { Clos...
3.26
flink_UserDefinedFunctionHelper_validateClassForRuntime_rdh
/** * Validates a {@link UserDefinedFunction} class for usage in the runtime. * * <p>Note: This is for the final validation when actual {@link DataType}s for arguments and * result are known. */ public static void validateClassForRuntime(Class<? extends UserDefinedFunction> functionClass, String methodName, Class<...
3.26
flink_UserDefinedFunctionHelper_getReturnTypeOfAggregateFunction_rdh
/** * Tries to infer the TypeInformation of an AggregateFunction's accumulator type. * * @param aggregateFunction * The AggregateFunction for which the accumulator type is inferred. * @return The inferred accumulator type of the AggregateFunction. */ public static <T, ACC> TypeInformation<T> getReturnTypeOfAggr...
3.26
flink_UserDefinedFunctionHelper_prepareInstance_rdh
/** * Prepares a {@link UserDefinedFunction} instance for usage in the API. */ public static void prepareInstance(ReadableConfig config, UserDefinedFunction function) { validateClass(function.getClass(), false); cleanFunction(config, function); }
3.26
flink_UserDefinedFunctionHelper_m0_rdh
/** * Tries to infer the TypeInformation of an AggregateFunction's accumulator type. * * @param aggregateFunction * The AggregateFunction for which the accumulator type is inferred. * @param scalaType * The implicitly inferred type of the accumulator type. * @return The inferr...
3.26
flink_UserDefinedFunctionHelper_instantiateFunction_rdh
/** * Instantiates a {@link UserDefinedFunction} assuming a JVM function with default constructor. */ @SuppressWarnings({ "unchecked", "rawtypes" }) public static UserDefinedFunction instantiateFunction(Class<?> functionClass) { if (!UserDefinedFunction.class.isAssignableFrom(functionClass)) { throw new ValidationExc...
3.26
flink_UserDefinedFunctionHelper_getReturnTypeOfTableFunction_rdh
/** * Tries to infer the TypeInformation of an AggregateFunction's accumulator type. * * @param tableFunction * The TableFunction for which the accumulator type is inferred. * @param scalaType * The implicitly inferred type of the accumulator type. * @return The inferred accumulator type of the AggregateFunc...
3.26
flink_UserDefinedFunctionHelper_generateInlineFunctionName_rdh
/** * Name for anonymous, inline functions. */ public static String generateInlineFunctionName(UserDefinedFunction function) { // use "*...*" to indicate anonymous function similar to types at other locations return String.format("*%s*", function.functionIdentifier()); }
3.26
flink_FlinkMatchers_futureFailedWith_rdh
// ------------------------------------------------------------------------ // factories // ------------------------------------------------------------------------ /** * Checks whether {@link CompletableFuture} completed already exceptionally with a specific * exception type. */ public static <T, E extends Throwabl...
3.26
flink_FlinkMatchers_findThrowable_rdh
// copied from flink-core to not mess up the dependency design too much, just for a little // utility method private static Optional<Throwable> findThrowable(Throwable throwable, Predicate<Throwable> predicate) { if ((throwable == null) || (predicate == null)) { return Optional.empty(); } Throwable v9 = throwable; wh...
3.26
flink_FlinkMatchers_m0_rdh
/** * Checks for a {@link Throwable} that contains the expected error message. */ public static Matcher<Throwable> m0(String errorMessage) { return new ContainsMessageMatcher(errorMessage); } /** * Checks that a {@link CompletableFuture}
3.26
flink_FlinkMatchers_futureWillCompleteExceptionally_rdh
/** * Checks whether {@link CompletableFuture} will completed exceptionally within a certain time. */ public static <T> FutureWillFailMatcher<T> futureWillCompleteExceptionally(Duration timeout) { return futureWillCompleteExceptionally(Throwable.class, timeout); }
3.26
flink_FlinkMatchers_containsCause_rdh
/** * Checks for a {@link Throwable} that matches by class. */ public static Matcher<Throwable> containsCause(Class<? extends Throwable> failureCause) { return new ContainsCauseMatcher(failureCause); } /** * Checks for a {@link Throwable}
3.26
flink_DriverUtils_isNullOrWhitespaceOnly_rdh
/** * Checks if the string is null, empty, or contains only whitespace characters. A whitespace * character is defined via {@link Character#isWhitespace(char)}. * * @param str * The string to check * @return True, if the string is null or blank, false otherwise. */ public static boolean isNullOrWhitespaceOnl...
3.26
flink_DriverUtils_checkArgument_rdh
/** * Checks the given boolean condition, and throws an {@code IllegalArgumentException} if the * condition is not met (evaluates to {@code false}). The exception will have the given error * message. * * @param condition * The condition to check * @param errorMessage * The message for the {@code IllegalArgu...
3.26
flink_DriverUtils_fromProperties_rdh
/** * Generate map from given properties. * * @param properties * the given properties * @return the result map */ public static Map<String, String> fromProperties(Properties properties) { Map<String, String> map = new HashMap<>(); Enumeration<?> e = properties.propertyNames(); while (e.hasMoreElem...
3.26
flink_DriverUtils_checkNotNull_rdh
/** * Ensures that the given object reference is not null. Upon violation, a {@code NullPointerException} with the given message is thrown. * * @param reference * The object reference * @param errorMessage * The message for the {@code NullPointerException} that is thrown if the * check fails. * @return Th...
3.26
flink_PartitionWriter_createNewOutputFormat_rdh
/** * Create a new output format with path, configure it and open it. */ OutputFormat<T> createNewOutputFormat(Path path) throws IOException { OutputFormat<T> format = factory.createOutputFormat(path); format.configure(conf); // Here we just think of it as a single file format, so there can only be a sin...
3.26
flink_CsvOutputFormat_setInputType_rdh
/** * The purpose of this method is solely to check whether the data type to be processed is in * fact a tuple type. */ @Override public void setInputType(TypeInformation<?> type, ExecutionConfig executionConfig) { if (!type.isTupleType()) { throw new InvalidProgramException(("The " + CsvOutputFormat.class.getSi...
3.26
flink_CsvOutputFormat_setCharsetName_rdh
/** * Sets the charset with which the CSV strings are written to the file. If not specified, the * output format uses the systems default character encoding. * * @param charsetName * The name of charset to use for encoding the output. */ public void setCharsetName(String charsetName) { this.charsetName = ch...
3.26
flink_CsvOutputFormat_toString_rdh
// -------------------------------------------------------------------------------------------- @Override public String toString() { return ((("CsvOutputFormat (path: " + this.getOutputFilePath()) + ", delimiter: ") + this.fieldDelimiter) + ")"; }
3.26
flink_CsvOutputFormat_open_rdh
// -------------------------------------------------------------------------------------------- @Override public void open(int taskNumber, int numTasks) throws IOException { super.open(taskNumber, numTasks); this.wrt = (this.charsetName == null) ? new OutputStreamWriter(new BufferedOutputStream(this.stream, 409...
3.26
flink_CsvOutputFormat_setAllowNullValues_rdh
/** * Configures the format to either allow null values (writing an empty field), or to throw an * exception when encountering a null field. * * <p>by default, null values are disallowed. * * @param allowNulls * Flag to indicate whether the output format should accept null values. */ public void setAllowNullV...
3.26
flink_CsvOutputFormat_setQuoteStrings_rdh
/** * Configures whether the output format should quote string values. String values are fields of * type {@link java.lang.String} and {@link org.apache.flink.types.StringValue}, as well as all * subclasses of the latter. * * <p>By default, strings are not quoted. * * @param quoteStrings * Flag indicating whe...
3.26
flink_EventTimeSessionWindows_mergeWindows_rdh
/** * Merge overlapping {@link TimeWindow}s. */ @Override public void mergeWindows(Collection<TimeWindow> windows, MergingWindowAssigner.MergeCallback<TimeWindow> c) { TimeWindow.mergeWindows(windows, c); }
3.26
flink_EventTimeSessionWindows_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. */ @PublicEvolving public static <T> D...
3.26
flink_EventTimeSessionWindows_withGap_rdh
/** * Creates a new {@code SessionWindows} {@link WindowAssigner} that assigns elements to sessions * based on the element timestamp. * * @param size * The session timeout, i.e. the time gap between sessions * @return The policy. */ public static EventTimeSessionWindows withGap(Time size) { return new Even...
3.26
flink_JaasModule_generateDefaultConfigFile_rdh
/** * Generate the default JAAS config file. */ private static File generateDefaultConfigFile(String workingDir) { checkArgument(workingDir != null, "working directory should not be null."); final File jaasConfFile; try { Path path = Paths.get(workingDir); if (Files.notExists(path)) ...
3.26
flink_PythonFunction_takesRowAsInput_rdh
/** * Returns Whether the Python function takes row as input instead of each columns of a row. */ default boolean takesRowAsInput() { return false; }
3.26
flink_PythonFunction_getPythonFunctionKind_rdh
/** * Returns the kind of the user-defined python function. */ default PythonFunctionKind getPythonFunctionKind() { return PythonFunctionKind.GENERAL; }
3.26
flink_QueryableStateClient_getKvState_rdh
/** * Returns a future holding the serialized request result. * * @param jobId * JobID of the job the queryable state belongs to * @param queryableStateName * Name under which the state is queryable * @param keyHashCode * Integer hash code of the key (result of a call to {@link Object#hashCode()} * @para...
3.26
flink_QueryableStateClient_shutdownAndWait_rdh
/** * Shuts down the client and waits until shutdown is completed. * * <p>If an exception is thrown, a warning is logged containing the exception message. */ public void shutdownAndWait() { try { client.shutdown().get(); LOG.info("The Queryable State Client was shutdown successfully."); } c...
3.26