name stringlengths 12 178 | code_snippet stringlengths 8 36.5k | score float64 3.26 3.68 |
|---|---|---|
flink_CliClient_printExecutionException_rdh | // --------------------------------------------------------------------------------------------
// Utils
// --------------------------------------------------------------------------------------------
private void printExecutionException(Throwable t) {
final String errorMessage = CliStrings.MESSAGE_SQL_EXECUTION_ER... | 3.26 |
flink_CliClient_executeInitialization_rdh | /**
* Initialize the Cli Client with the content.
*/
public boolean executeInitialization(String content) {
try {
OutputStream outputStream = new ByteArrayOutputStream(256);
terminal = TerminalUtils.createDumbTerminal(outputStream);
boolean v1 = executeFile(content, outputStream, Execution... | 3.26 |
flink_CliClient_close_rdh | /**
* Closes the CLI instance.
*/
public void close() {
if (terminal != null) {
closeTerminal();
}
} | 3.26 |
flink_CliClient_executeInteractive_rdh | // --------------------------------------------------------------------------------------------
/**
* Execute statement from the user input and prints status information and/or errors on the
* terminal.
*/private void executeInteractive(LineReader inputLineReader) {// make space from previous output and test the wr... | 3.26 |
flink_CliClient_executeFile_rdh | /**
* Execute content from Sql file and prints status information and/or errors on the terminal.
*
* @param content
* SQL file content
*/private boolean executeFile(String content, OutputStream outputStream, ExecutionMode mode) {
terminal.writer().println(CliStrings.messageInfo(CliStrings.MESSAGE_EXECUTE... | 3.26 |
flink_BashJavaUtils_getTmResourceParams_rdh | /**
* Generate and print JVM parameters and dynamic configs of task executor resources. The last
* two lines of the output should be JVM parameters and dynamic configs respectively.
*/
private static List<String> getTmResourceParams(Configuration configuration) {
Configuration v5 = TaskExecutorProcessUtils.getCo... | 3.26 |
flink_BashJavaUtils_getJmResourceParams_rdh | /**
* Generate and print JVM parameters of Flink Master resources as one line.
*/
@VisibleForTestingstatic List<String> getJmResourceParams(Configuration configuration) {
JobManagerProcessSpec jobManagerProcessSpec = JobManagerProcessUtils.processSpecFromConfigWithNewOptionToInterpretLegacyHeap(configuration, Job... | 3.26 |
flink_StreamGraphHasherV2_traverseStreamGraphAndGenerateHashes_rdh | /**
* Returns a map with a hash for each {@link StreamNode} of the {@link StreamGraph}. The hash is
* used as the {@link JobVertexID} in order to identify nodes across job submissions if they
* didn't change.
*
* <p>The complete {@link StreamGraph} is traversed. The hash is either computed from the
* transformati... | 3.26 |
flink_StreamGraphHasherV2_generateUserSpecifiedHash_rdh | /**
* Generates a hash from a user-specified ID.
*/
private byte[] generateUserSpecifiedHash(StreamNode node, Hasher hasher) {
hasher.putString(node.getTransformationUID(), Charset.forName("UTF-8"));
return hasher.hash().asBytes();
} | 3.26 |
flink_StreamGraphHasherV2_generateDeterministicHash_rdh | /**
* Generates a deterministic hash from node-local properties and input and output edges.
*/
private byte[] generateDeterministicHash(StreamNode node, Hasher hasher, Map<Integer, byte[]> hashes, boolean isChainingEnabled, StreamGraph streamGraph) {
// Include stream node to hash. We use the current size of the c... | 3.26 |
flink_StreamGraphHasherV2_generateNodeLocalHash_rdh | /**
* Applies the {@link Hasher} to the {@link StreamNode} . The hasher encapsulates the current
* state of the hash.
*
* <p>The specified ID is local to this node. We cannot use the {@link StreamNode#id}, because
* it is incremented in a static counter. Therefore, the IDs for identical jobs will otherwise
* be d... | 3.26 |
flink_BaseHybridHashTable_close_rdh | /**
* Closes the hash table. This effectively releases all internal structures and closes all open
* files and removes them. The call to this method is valid both as a cleanup after the complete
* inputs were properly processed, and as an cancellation call, which cleans up all resourc... | 3.26 |
flink_BaseHybridHashTable_findSmallerPrime_rdh | /**
* Let prime number be the numBuckets, to avoid partition hash and bucket hash congruences.
*/
private static int findSmallerPrime(int num) {
for (; num >
1; num--) {
if (isPrimeNumber(num)) {
return num;
}
}
return num;
} | 3.26 |
flink_BaseHybridHashTable_m0_rdh | /**
* Bulk memory acquisition. NOTE: Failure to get memory will throw an exception.
*/
public MemorySegment[] m0(int bufferSize) {
MemorySegment[] memorySegments = new MemorySegment[bufferSize];
for (int i = 0; i < bufferSize; i++)
{
MemorySegment nextBuffer = getNextBuffer(); if (nextBuffer == n... | 3.26 |
flink_BaseHybridHashTable_nextSegment_rdh | /**
* This is the method called by the partitions to request memory to serialize records. It
* automatically spills partitions, if memory runs out.
*
* @return The next available memory segment.
*/
@Override
public MemorySegment nextSegment() {
final MemorySegment seg = getNextBuffer();
if (seg != null) {
... | 3.26 |
flink_BaseHybridHashTable_getNextBuffer_rdh | /**
* Gets the next buffer to be used with the hash-table, either for an in-memory partition, or
* for the table buckets. This method returns <tt>null</tt>, if no more buffer is available.
* Spilling a partition may free new buffers then.
*
* @return The next buffer to be used by the hash-table, or null, if no buf... | 3.26 |
flink_BaseHybridHashTable_releaseMemoryCacheForSMJ_rdh | /**
* Due to adaptive hash join is introduced, the cached memory segments should be released to
* {@link MemoryManager} before switch to sort merge join. Otherwise, open sort merge join
* operator maybe fail because of insufficient memory.
*
* <p>Note: this method should only be invoked for sort merge join.
*/
pu... | 3.26 |
flink_BaseHybridHashTable_maxInitBufferOfBucketArea_rdh | /**
* Give up to one-sixth of the memory of the bucket area.
*/
public int maxInitBufferOfBucketArea(int
partitions) {
return Math.max(1, ((totalNumBuffers - 2) /
6) / partitions);
} | 3.26 |
flink_BaseHybridHashTable_ensureNumBuffersReturned_rdh | /**
* This method makes sure that at least a certain number of memory segments is in the list of
* free segments. Free memory can be in the list of free segments, or in the return-queue where
* segments used to write behind are put. The number of segments that are in that return-queue,
* but are actually reclaimabl... | 3.26 |
flink_BaseHybridHashTable_hash_rdh | /**
* The level parameter is needed so that we can have different hash functions when we
* recursively apply the partitioning, so that the working set eventually fits into memory.
*/
public static int hash(int hashCode, int level) {
final int rotation = level * 11;
int code = Integer.rotateLeft(hashCode, rotation... | 3.26 |
flink_BaseHybridHashTable_partitionLevelHash_rdh | /**
* Partition level hash again, for avoid two layer hash conflict.
*/
static int partitionLevelHash(int hash) {
return hash ^ (hash >>> 16);
} | 3.26 |
flink_BaseHybridHashTable_freeCurrent_rdh | /**
* Free the memory not used.
*/
public void freeCurrent() {
internalPool.cleanCache();
} | 3.26 |
flink_BaseHybridHashTable_getPartitioningFanOutNoEstimates_rdh | /**
* Gets the number of partitions to be used for an initial hash-table.
*/
private int getPartitioningFanOutNoEstimates() {
return Math.max(11, findSmallerPrime(((int) (Math.min((buildRowCount * avgRecordLen) / (10 * segmentSize),
MAX_NUM_PARTITIONS)))));
} | 3.26 |
flink_FineGrainedSlotManager_declareNeededResources_rdh | /**
* DO NOT call this method directly. Use {@link #declareNeededResourcesWithDelay()} instead.
*/
private void declareNeededResources() {Map<InstanceID, WorkerResourceSpec> unWantedTaskManagers = taskManagerTracker.getUnWantedTaskManager();
Map<WorkerResourceSpec, Set<InstanceID>> unWantedTaskManagerBySpec = un... | 3.26 |
flink_FineGrainedSlotManager_getNumberRegisteredSlots_rdh | // Legacy APIs
// ---------------------------------------------------------------------------------------------
@Override
public int getNumberRegisteredSlots() {
return taskManagerTracker.getNumberRegisteredSlots();
} | 3.26 |
flink_FineGrainedSlotManager_freeSlot_rdh | /**
* Free the given slot from the given allocation. If the slot is still allocated by the given
* allocation id, then the slot will be freed.
*
* @param slotId
* identifying the slot to free, will be ignored
* @param allocationId
* with which the slot is presumably allocated
*/
@Override
public void freeSl... | 3.26 |
flink_FineGrainedSlotManager_close_rdh | /**
* Closes the slot manager.
*
* @throws Exception
* if the close operation fails
*/
@Override
public void close() throws Exception {
LOG.info("Closing the slot manager.");
m0();
} | 3.26 |
flink_FineGrainedSlotManager_checkResourceRequirementsWithDelay_rdh | // ---------------------------------------------------------------------------------------------
// Requirement matching
// ---------------------------------------------------------------------------------------------
/**
* Depending on the implementation of {@link ResourceAllocationStrategy}, checking resource
* req... | 3.26 |
flink_FineGrainedSlotManager_checkClusterReconciliation_rdh | // ---------------------------------------------------------------------------------------------
// Internal periodic check methods
// ---------------------------------------------------------------------------------------------
private void checkClusterReconciliation() {
if (checkResourcesNeedReconcile()) {
... | 3.26 |
flink_FineGrainedSlotManager_reportSlotStatus_rdh | /**
* Reports the current slot allocations for a task manager identified by the given instance id.
*
* @param instanceId
* identifying the task manager for which to report the slot status
* @param slotReport
* containing the status for all of its slots
* @return true if the slot status has been updated succe... | 3.26 |
flink_FineGrainedSlotManager_checkInit_rdh | // ---------------------------------------------------------------------------------------------
// Internal utility methods
// ---------------------------------------------------------------------------------------------
private void checkInit() {
Preconditions.checkState(started, "The slot manager has not been ... | 3.26 |
flink_FineGrainedSlotManager_clearResourceRequirements_rdh | // ---------------------------------------------------------------------------------------------
// Public API
// ---------------------------------------------------------------------------------------------
@Override
public void clearResourceRequirements(JobID jobId) {
maybeReclaimInactiveSlots(jobId);
f2.... | 3.26 |
flink_FineGrainedSlotManager_start_rdh | // ---------------------------------------------------------------------------------------------
// Component lifecycle methods
// ---------------------------------------------------------------------------------------------
/**
* Starts the slot manager with the given leader id and resource manager actions.
*
* @pa... | 3.26 |
flink_FineGrainedSlotManager_allocateTaskManagersAccordingTo_rdh | /**
* Allocate pending task managers, returns the ids of pending task managers that can not be
* allocated.
*/private Set<PendingTaskManagerId> allocateTaskManagersAccordingTo(List<PendingTaskManager> pendingTaskManagers) {Preconditions.checkState(resourceAllocator.isSupported());
final Set<PendingTaskManagerId>... | 3.26 |
flink_FileBasedStateOutputStream_write_rdh | // ------------------------------------------------------------------------
// I/O
// ------------------------------------------------------------------------
@Override
public final void write(int b) throws IOException {
out.write(b);
} | 3.26 |
flink_FileBasedStateOutputStream_m0_rdh | // ------------------------------------------------------------------------
// Closing
// ------------------------------------------------------------------------
public boolean m0() {
return closed;
} | 3.26 |
flink_BinaryKVInMemorySortBuffer_getIterator_rdh | /**
* Gets an iterator over all KV records in this buffer in their logical order.
*
* @return An iterator returning the records in their logical order.
*/
public final MutableObjectIterator<Tuple2<BinaryRowData, BinaryRowData>> getIterator() {
return new MutableObjectIterator<Tuple2<BinaryRowData, BinaryRowData... | 3.26 |
flink_ProjectableDecodingFormat_supportsNestedProjection_rdh | /**
* Returns whether this format supports nested projection.
*/
default boolean
supportsNestedProjection() {
return false;} | 3.26 |
flink_TypeInferenceOperandChecker_castTo_rdh | /**
* Adopted from {@link org.apache.calcite.sql.validate.implicit.AbstractTypeCoercion}.
*/
private SqlNode castTo(SqlNode node, RelDataType type) {
return SqlStdOperatorTable.CAST.createCall(SqlParserPos.ZERO, node, SqlTypeUtil.convertTypeToSpec(type).withNullable(type.isNullable()));
} | 3.26 |
flink_TypeInferenceOperandChecker_checkOperandTypesOrError_rdh | // --------------------------------------------------------------------------------------------
private boolean checkOperandTypesOrError(SqlCallBinding callBinding, CallContext callContext) {
final CallContext adaptedCallContext;
try {
adaptedCallContext = adaptArguments(f0, callContext, null);
} ca... | 3.26 |
flink_TypeInferenceOperandChecker_updateInferredType_rdh | /**
* Adopted from {@link org.apache.calcite.sql.validate.implicit.AbstractTypeCoercion}.
*/
private void updateInferredType(SqlValidator validator, SqlNode node, RelDataType type) {
validator.setValidatedNodeType(node, type);
final SqlValidatorNamespace namespace = validator.getNamespace(node);
if (name... | 3.26 |
flink_StreamOperatorStateHandler_getPartitionedState_rdh | /**
* Creates a partitioned state handle, using the state backend configured for this task.
*
* @throws IllegalStateException
* Thrown, if the key/value state was already initialized.
* @throws Exception
* Thrown, if the state backend cannot create the key/value state.
*/
protected <S extends State, N> S get... | 3.26 |
flink_MurmurHashUtil_fmix_rdh | // Finalization mix - force all bits of a hash block to avalanche
private static int fmix(int h1, int length) {
h1 ^= length;
return fmix(h1);
} | 3.26 |
flink_MurmurHashUtil_hashUnsafeBytes_rdh | /**
* Hash unsafe bytes.
*
* @param base
* base unsafe object
* @param offset
* offset for unsafe object
* @param lengthInBytes
* length in bytes
* @return hash code
*/
public static int hashUnsafeBytes(Object base, long offset, int lengthInBytes) {
return hashUnsafeBytes(base, offset, lengthInBytes... | 3.26 |
flink_MurmurHashUtil_hashUnsafeBytesByWords_rdh | /**
* Hash unsafe bytes, length must be aligned to 4 bytes.
*
* @param base
* base unsafe object
* @param offset
* offset for unsafe object
* @param lengthInBytes
* length in bytes
* @return hash code
*/
public static int hashUnsafeBytesByWords(Object base, long offset, int lengthInBytes) {
return ... | 3.26 |
flink_MurmurHashUtil_hashBytes_rdh | /**
* Hash bytes in MemorySegment.
*
* @param segment
* segment.
* @param offset
* offset for MemorySegment
* @param lengthInBytes
* length in MemorySegment
* @return hash code
*/
public static int hashBytes(MemorySegment segment, int offset, int lengthInBytes) {
return hashBytes(segment, offset, le... | 3.26 |
flink_MurmurHashUtil_hashBytesByWords_rdh | /**
* Hash bytes in MemorySegment, length must be aligned to 4 bytes.
*
* @param segment
* segment.
* @param offset
* offset for MemorySegment
* @param lengthInBytes
* length in MemorySegment
* @return hash code
*/
public static int hashBytesByWords(MemorySegment segment, int offset, int lengthInBytes)... | 3.26 |
flink_OutputCollector_collect_rdh | /**
* Collects a record and emits it to all writers.
*/@Override
public void collect(T record)
{
if (record != null) {
this.delegate.setInstance(record);
try {
for (RecordWriter<SerializationDelegate<T>> writer : writers) {
writer.emit(this.delegate);
}
... | 3.26 |
flink_StreamTaskStateInitializerImpl_streamOperatorStateContext_rdh | // -----------------------------------------------------------------------------------------------------------------
@Override
public StreamOperatorStateContext streamOperatorStateContext(@Nonnull
OperatorID operatorID, @Nonnull
String operatorClassName, @Nonnull
ProcessingTimeService processingTimeService, @Nonnull
Ke... | 3.26 |
flink_TypeTransformation_transform_rdh | /**
* Transforms the given data type to a different data type.
*
* <p>This method provides a {@link DataTypeFactory} if available.
*/default DataType transform(@Nullable
DataTypeFactory factory, DataType typeToTransform) {
return transform(typeToTransform);
} | 3.26 |
flink_SplitsChange_splits_rdh | /**
*
* @return the list of splits.
*/
public List<SplitT> splits()
{
return
Collections.unmodifiableList(splits);
} | 3.26 |
flink_GSBlobIdentifier_fromBlobId_rdh | /**
* Construct an abstract blob identifier from a Google BlobId.
*
* @param blobId
* The Google BlobId
* @return The abstract blob identifier
*/public static GSBlobIdentifier fromBlobId(BlobId blobId) {
return new GSBlobIdentifier(blobId.getBucket(), blobId.getName());
} | 3.26 |
flink_OrcLegacyTimestampColumnVector_fromTimestamp_rdh | // converting from/to Timestamp is copied from Hive 2.0.0 TimestampUtils
private static long fromTimestamp(Timestamp timestamp) {
long v4 = timestamp.getTime();int nanos = timestamp.getNanos();
return (v4 * 1000000) + (nanos % 1000000);
} | 3.26 |
flink_OrcLegacyTimestampColumnVector_createFromConstant_rdh | // creates a Hive ColumnVector of constant timestamp value
public static ColumnVector createFromConstant(int batchSize, Object value) {
LongColumnVector res = new
LongColumnVector(batchSize);
if (value == null) {
res.noNulls = false;
res.isNull[0]
= true;
res.isRepeating = tr... | 3.26 |
flink_CompactFileUtils_doCompact_rdh | /**
* Do Compaction: - Target file exists, do nothing. - Can do compaction: - Single file, do
* atomic renaming, there are optimizations for FileSystem. - Multiple file, do reading and
* writing.
*/
@Nullable
public static <T> Path doCompact(FileSystem fileSystem, String partition, List<... | 3.26 |
flink_BatchExecOverAggregateBase_inferGroupMode_rdh | /**
* Infer the over window mode based on given group info.
*/
protected OverWindowMode inferGroupMode(GroupSpec group) {
AggregateCall aggCall = group.getAggCalls().get(0);
if (aggCall.getAggregation().getKind() == NTILE) {
return OverWindowMode.INSENSITIVE;
}
if (aggCall.ge... | 3.26 |
flink_FieldAccessor_getFieldType_rdh | /**
* Gets the TypeInformation for the type of the field. Note: For an array of a primitive type,
* it returns the corresponding basic type (Integer for int[]).
*/
@SuppressWarnings("unchecked")
public TypeInformation<F> getFieldType() {
return fieldType;
} | 3.26 |
flink_Tuple11_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
* @param f5
* The value for field 5
* @param f6
* The valu... | 3.26 |
flink_Tuple11_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_Tuple11_toString_rdh | // -------------------------------------------------------------------------------------------------
// standard utilities
// -------------------------------------------------------------------------------------------------
/**
* Creates a string representation of the tuple in the form (f0, f1, f2, f3, f4, f5, f6, f7,... | 3.26 |
flink_Tuple11_copy_rdh | /**
* Shallow tuple copy.
*
* @return A new Tuple with the same fields as this.
*/
@Override @SuppressWarnings("unchecked")public Tuple11<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10> copy() {
return new Tuple11<>(this.f0, this.f1, this.f2, this.f3, this.f4, this.f5, this.f6, this.f7, this.f8, this.f9, this.f10)... | 3.26 |
flink_FileWriter_m0_rdh | // --------------------------- Testing Methods -----------------------------
@VisibleForTesting
Map<String, FileWriterBucket<IN>> m0() {
return activeBuckets;
} | 3.26 |
flink_FileWriter_initializeState_rdh | /**
* Initializes the state after recovery from a failure.
*
* <p>During this process:
*
* <ol>
* <li>we set the initial value for part counter to the maximum value used before across all
* tasks and buckets. This guarantees that we do not overwrite valid data,
* <li>we commit any pending files for pr... | 3.26 |
flink_BaseTwoInputStreamOperatorWithStateRetention_onProcessingTime_rdh | /**
* The users of this class are not allowed to use processing time timers. See class javadoc.
*/
@Override
public final void onProcessingTime(InternalTimer<Object, VoidNamespace> timer) throws Exception {
if (stateCleaningEnabled) {
long v6 = timer.getTimestamp();
Long cleanupTime = latestRegi... | 3.26 |
flink_BaseTwoInputStreamOperatorWithStateRetention_registerProcessingCleanupTimer_rdh | /**
* If the user has specified a {@code minRetentionTime} and {@code maxRetentionTime}, this
* method registers a cleanup timer for {@code currentProcessingTime + minRetentionTime}.
*
* <p>When this timer fires, the {@link #cleanupState(long)} method is called.
*/
protected void registerProcessingCleanupTimer() t... | 3.26 |
flink_HadoopConfigLoader_mirrorCertainHadoopConfig_rdh | // mirror certain keys to make use more uniform across implementations
// with different keys
private Configuration mirrorCertainHadoopConfig(Configuration hadoopConfig) {
for (String[] mirrored : mirroredConfigKeys) {
String value = hadoopConfig.get(mirrored[0], null);
if (value != null) {
... | 3.26 |
flink_HadoopConfigLoader_loadHadoopConfigFromFlink_rdh | // add additional config entries from the Flink config to the Hadoop config
private Configuration loadHadoopConfigFromFlink()
{
Configuration hadoopConfig = new Configuration();
for (String key : flinkConfig.keySet()) {
for (String prefix : flinkConfigPrefixes) {
if (key.startsWith(prefix))... | 3.26 |
flink_HadoopConfigLoader_getOrLoadHadoopConfig_rdh | /**
* get the loaded Hadoop config (or fall back to one loaded from the classpath).
*/
public Configuration getOrLoadHadoopConfig() {
Configuration hadoopConfig = this.hadoopConfig;
if (hadoopConfig == null) {
if (flinkConfig != null) {
hado... | 3.26 |
flink_AbstractIterativeTask_createWorksetUpdateOutputCollector_rdh | // -----------------------------------------------------------------------------------------------------------------
// Iteration State Update Handling
// -----------------------------------------------------------------------------------------------------------------
/**
* Creates a new {@link WorksetUpdateOutputColl... | 3.26 |
flink_AbstractIterativeTask_initialize_rdh | // --------------------------------------------------------------------------------------------
// Main life cycle methods that implement the iterative behavior
// --------------------------------------------------------------------------------------------
@Override
protected void initialize() throws
Exception {
su... | 3.26 |
flink_AbstractIterativeTask_getOutputSerializer_rdh | /**
*
* @return output serializer of this task
*/
private TypeSerializer<OT>
getOutputSerializer() {
TypeSerializerFactory<OT> serializerFactory;
if ((serializerFactory = getLastTasksConfig().getOutputSerializer(getUserCodeClassLoader())) == null) {
throw new RuntimeException("Missing output seriali... | 3.26 |
flink_AbstractIterativeTask_inFirstIteration_rdh | // --------------------------------------------------------------------------------------------
// Utility Methods for Iteration Handling
// --------------------------------------------------------------------------------------------
protected boolean inFirstIteration() {
return this.superstepNum == 1;
} | 3.26 |
flink_AbstractIterativeTask_createSolutionSetUpdateOutputCollector_rdh | /**
* Creates a new solution set update output collector.
*
* <p>This collector is used by {@link IterationIntermediateTask} or {@link IterationTailTask}
* to update the solution set of workset iterations. Depending on the task configuration, either
* a fast (non-probing) {@link org.apache.flink.runtime.iterative.... | 3.26 |
flink_RowPartitionComputer_restorePartValueFromType_rdh | /**
* Restore partition value from string and type. This method is the opposite of method {@link #generatePartValues}.
*
* @param valStr
* string partition value.
* @param type
* type of partition field.
* @return partition value.
*/
... | 3.26 |
flink_MapViewSerializer_transformLegacySerializerSnapshot_rdh | /**
* We need to override this as a {@link LegacySerializerSnapshotTransformer} because in Flink
* 1.6.x and below, this serializer was incorrectly returning directly the snapshot of the
* nested map serializer as its own snapshot.
*
* <p>This method transforms the incorrect map serializer snapshot to be a proper ... | 3.26 |
flink_FullCachingLookupProvider_of_rdh | /**
* Build a {@link FullCachingLookupProvider} from the specified {@link ScanTableSource.ScanRuntimeProvider} and {@link CacheReloadTrigger}.
*/
static FullCachingLookupProvider of(ScanTableSource.ScanRuntimeProvider scanRuntimeProvider, CacheReloadTrigger cacheReloadTrigger) {
return new FullCachingLookupProvid... | 3.26 |
flink_MapMapConverter_toBinaryMapData_rdh | // --------------------------------------------------------------------------------------------
// Runtime helper methods
// --------------------------------------------------------------------------------------------
private MapData toBinaryMapData(Map<K, V> external) {
final int length = external.size();
key... | 3.26 |
flink_MapMapConverter_createForMapType_rdh | // --------------------------------------------------------------------------------------------
// Factory method
// --------------------------------------------------------------------------------------------
public static MapMapConverter<?, ?> createForMapType(DataType dataType) {
final DataType keyDataType = da... | 3.26 |
flink_BooleanWriter_forRow_rdh | /**
* {@link ArrowFieldWriter} for Boolean.
*/
@Internal
| 3.26 |
flink_RemoteInputChannel_setup_rdh | /**
* Setup includes assigning exclusive buffers to this input channel, and this method should be
* called only once after this input channel is created.
*/
@Override
void setup() throws IOException {
checkState(bufferManager.unsynchronizedGetAvailableExclusiveBuffers() == 0, "Bug in input channel setup logic: e... | 3.26 |
flink_RemoteInputChannel_notifyCreditAvailable_rdh | // ------------------------------------------------------------------------
// Credit-based
// ------------------------------------------------------------------------
/**
* Enqueue this input channel in the pipeline for notifying the producer of unannounced credit.
*/
private void notifyCreditAvailable() throws IOEx... | 3.26 |
flink_RemoteInputChannel_sendTaskEvent_rdh | // ------------------------------------------------------------------------
// Task events
// ------------------------------------------------------------------------
@Override
void sendTaskEvent(TaskEvent event) throws IOException {
checkState(!f1.get(), "Tried to send task event to producer after channel has been... | 3.26 |
flink_RemoteInputChannel_increaseBackoff_rdh | /**
* The remote task manager creates partition request listener and returns {@link PartitionNotFoundException} until the listener is timeout, so the backoff should add the
* timeout milliseconds if it exists.
*
* @return <code>true</code>, iff the operation was successful. Otherwise, <code>fals... | 3.26 |
flink_RemoteInputChannel_checkpointStarted_rdh | /**
* Spills all queued buffers on checkpoint start. If barrier has already been received (and
* reordered), spill only the overtaken buffers.
*/
public void checkpointStarted(CheckpointBarrier barrier) throws CheckpointException {
synchronized(receivedBuffers) {
if (barrier.getId() < lastBarrierId) {
... | 3.26 |
flink_RemoteInputChannel_retriggerSubpartitionRequest_rdh | /**
* Retriggers a remote subpartition request.
*/void retriggerSubpartitionRequest() throws IOException {
checkPartitionRequestQueueInitialized();if (increaseBackoff()) {
partitionRequestClient.requestSubpartition(partitionId, consumedSubpartitionIndex, this, 0);
} else {
failPartitionRequest... | 3.26 |
flink_RemoteInputChannel_getUnannouncedCredit_rdh | // ------------------------------------------------------------------------
// Network I/O notifications (called by network I/O thread)
// ------------------------------------------------------------------------
/**
* Gets the currently unannounced credit.
*
* @return Credit which was not announced to the sender yet... | 3.26 |
flink_RemoteInputChannel_m0_rdh | /**
* The unannounced credit is increased by the given amount and might notify increased credit to
* the producer.
*/
@Override
public void m0(int numAvailableBuffers) throws IOException {
if ((numAvailableBuffers > 0) && (unannouncedCredit.getAndAdd(numAvailableBuffers) == 0)) {
notifyCreditAvailable()... | 3.26 |
flink_RemoteInputChannel_onSenderBacklog_rdh | /**
* Receives the backlog from the producer's buffer response. If the number of available buffers
* is less than backlog + initialCredit, it will request floating buffers from the buffer
* manager, and then notify unannounced credits to the producer.
*
* @param bac... | 3.26 |
flink_RemoteInputChannel_requestBuffer_rdh | /**
* Requests buffer from input channel directly for receiving network data. It should always
* return an available buffer in credit-based mode unless the channel has been released.
*
* @return The available buffer.
*/
@Nullable
public Buffer requestBuffer() {
return bufferManager.requestBuffer();
} | 3.26 |
flink_RemoteInputChannel_requestSubpartition_rdh | // ------------------------------------------------------------------------
// Consume
// ------------------------------------------------------------------------
/**
* Requests a remote subpartition.
*/@VisibleForTesting
@Override
public void requestSubpartition() throws IOException, InterruptedException {
if (p... | 3.26 |
flink_RemoteInputChannel_isReleased_rdh | // ------------------------------------------------------------------------
// Life cycle
// ------------------------------------------------------------------------
@Override
public boolean isReleased() {
return f1.get();
} | 3.26 |
flink_RemoteInputChannel_releaseAllResources_rdh | /**
* Releases all exclusive and floating buffers, closes the partition request client.
*/
@Override
void releaseAllResources() throws IOException {
if (f1.compareAndSet(false, true)) {
final ArrayDeque<Buffer> releasedBuffers;
synchronized(receivedBuffers) {
releasedBuffers = receiv... | 3.26 |
flink_RemoteInputChannel_getInflightBuffersUnsafe_rdh | /**
* Returns a list of buffers, checking the first n non-priority buffers, and skipping all
* events.
*/
private List<Buffer> getInflightBuffersUnsafe(long checkpointId) {
assert Thread.holdsLock(receivedBuffers);checkState((checkpointId == lastBarrierId) || (lastBarrierId == f0));
final List<Buffer> inflig... | 3.26 |
flink_RemoteInputChannel_onBuffer_rdh | /**
* Handles the input buffer. This method is taking over the ownership of the buffer and is fully
* responsible for cleaning it up both on the happy path and in case of an error.
*/public void onBuffer(Buffer buffer, int sequenceNumber, int backlog) throws IOException {
boolean recycleBuffer = true;
try {
... | 3.26 |
flink_RemoteInputChannel_addPriorityBuffer_rdh | /**
*
* @return {@code true} if this was first priority buffer added.
*/
private boolean addPriorityBuffer(SequenceBuffer sequenceBuffer) {
receivedBuffers.addPriorityElement(sequenceBuffer);
return receivedBuffers.getNumPriorityElements() == 1;} | 3.26 |
flink_RemoteInputChannel_getNumberOfQueuedBuffers_rdh | /**
* Gets the current number of received buffers which have not been processed yet.
*
* @return Buffers queued for processing.
*/
public int getNumberOfQueuedBuffers() {
synchronized(receivedBuffers) {
return receivedBuffers.size();
}
} | 3.26 |
flink_RemoteInputChannel_getAndResetUnannouncedCredit_rdh | /**
* Gets the unannounced credit and resets it to <tt>0</tt> atomically.
*
* @return Credit which was not announced to the sender yet.
*/public int getAndResetUnannouncedCredit() {
return unannouncedCredit.getAndSet(0);
} | 3.26 |
flink_StateTtlConfig_cleanupInRocksdbCompactFilter_rdh | /**
* Cleanup expired state while Rocksdb compaction is running.
*
* <p>RocksDB compaction filter will query current timestamp, used to check expiration, from
* Flink every time after processing {@code queryTimeAfterNumEntries} number of state
* entries. Updating the timestamp more often can improve cleanup speed ... | 3.26 |
flink_StateTtlConfig_cleanupFullSnapshot_rdh | /**
* Cleanup expired state in full snapshot on checkpoint.
*/
@Nonnull
public Builder cleanupFullSnapshot() {
strategies.put(CleanupStrategies.Strategies.FULL_STATE_SCAN_SNAPSHOT, EMPTY_STRATEGY);
return this;
}
/**
* Cleanup expired state incrementally cleanup local state.
*
* <p>Upon every state access... | 3.26 |
flink_StateTtlConfig_setUpdateType_rdh | /**
* Sets the ttl update type.
*
* @param updateType
* The ttl update type configures when to update last access timestamp
* which prolongs state TTL.
*/
@Nonnull
public Builder setUpdateType(UpdateType updateType) {
this.updateType = updateType;
return this;
} | 3.26 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.