name
stringlengths
12
178
code_snippet
stringlengths
8
36.5k
score
float64
3.26
3.68
flink_GlobalConfiguration_loadYAMLResource_rdh
/** * Loads a YAML-file of key-value pairs. * * <p>Colon and whitespace ": " separate key and value (one per line). The hash tag "#" starts a * single-line comment. * * <p>Example: * * <pre> * jobmanager.rpc.address: localhost # network address for communication with the job manager * jobmanager.rpc.port : ...
3.26
flink_SharedObjectsExtension_create_rdh
/** * Creates a new instance. Usually that should be done inside a JUnit test class as an * instance-field annotated with {@link org.junit.Rule}. */ public static SharedObjectsExtension create() { return new SharedObjectsExtension(LAST_ID.getAndIncrement()); }
3.26
flink_SharedObjectsExtension_add_rdh
/** * Adds a new object to this {@code SharedObjects}. Although not necessary, it is recommended to * only access the object through the returned {@link SharedReference}. */ public <T> SharedReference<T> add(T object) { SharedReference<T> tag = new SharedObjectsExtension.DefaultTag<>(id, objects.size());objects.put(...
3.26
flink_PrioritizedDeque_clear_rdh
/** * Removes all priority and non-priority elements. */ public void clear() { deque.clear(); numPriorityElements = 0; }
3.26
flink_PrioritizedDeque_poll_rdh
/** * Polls the first priority element or non-priority element if the former does not exist. * * @return the first element or null. */ @Nullable public T poll() { final T polled = deque.poll(); if ((polled != null) && (numPriorityElements > 0)) { numPriorityElements--; } return polled; }
3.26
flink_PrioritizedDeque_peekLast_rdh
/** * Returns the last non-priority element or priority element if the former does not exist. * * @return the last element or null. */ @Nullable public T peekLast() { return deque.peekLast(); }
3.26
flink_PrioritizedDeque_m0_rdh
/** * Returns whether the given element is contained in this list. Test is performed by identity. */ public boolean m0(T element) { if (deque.isEmpty()) { return false; } final Iterator<T> iterator = deque.iterator(); while (iterator.hasNext()) { if (iterator.next() == element) { return true; } } return false; ...
3.26
flink_PrioritizedDeque_addPriorityElement_rdh
/** * Adds a priority element to this deque, such that it will be polled after all existing * priority elements but before any non-priority element. * * @param element * the element to add */ public void addPriorityElement(T element) { // priority elements are rather rare an...
3.26
flink_PrioritizedDeque_size_rdh
/** * Returns the number of priority and non-priority elements. */ public int size() { return deque.size(); }
3.26
flink_PrioritizedDeque_getAndRemove_rdh
/** * Find first element matching the {@link Predicate}, remove it from the {@link PrioritizedDeque} and return it. * * @return removed element */ public T getAndRemove(Predicate<T> preCondition) { Iterator<T> iterator = deque.iterator(); for (int i = 0; iterator.hasNext(); i++) { T next = iterator.next(); ...
3.26
flink_PrioritizedDeque_peek_rdh
/** * Returns the first priority element or non-priority element if the former does not exist. * * @return the first element or null. */ @Nullable public T peek() { return deque.peek(); }
3.26
flink_PrioritizedDeque_prioritize_rdh
/** * Prioritizes an already existing element. Note that this method assumes identity. * * <p>{@implNote Since this method removes the element and reinserts it in a priority position * in general, some optimizations for special cases are used.} * * @param element * the element to prioritize. */ public void p...
3.26
flink_PrioritizedDeque_isEmpty_rdh
/** * Returns true if there are no elements. */ public boolean isEmpty() { return deque.isEmpty(); }
3.26
flink_PrioritizedDeque_getNumPriorityElements_rdh
/** * Returns the current number of priority elements ([0; {@link #size()}]). */ public int getNumPriorityElements() { return numPriorityElements;}
3.26
flink_PrioritizedDeque_asUnmodifiableCollection_rdh
/** * Returns an unmodifiable collection view. */ public Collection<T> asUnmodifiableCollection() { return Collections.unmodifiableCollection(deque); }
3.26
flink_PrioritizedDeque_iterator_rdh
/** * * @return read-only iterator */ public Iterator<T> iterator() { return Collections.unmodifiableCollection(deque).iterator(); }
3.26
flink_PrioritizedDeque_add_rdh
/** * Convenience method for adding an element with optional priority and prior removal. * * @param element * the element to add * @param priority * flag indicating if it's a priority or non-priority element * @param prioritize * flag that hints that the element is already in this deque, potentially as *...
3.26
flink_PrioritizedDeque_containsPriorityElement_rdh
/** * Returns whether the given element is a known priority element. Test is performed by identity. */ public boolean containsPriorityElement(T element) { if (numPriorityElements == 0) { return false; }final Iterator<T> iterator = deque.iterator(); for (int i = 0; (i < numPriorityElements) && iterator.hasNext(); ...
3.26
flink_FlinkContainers_m1_rdh
/** * Gets JobManager's port on the host machine. */ public int m1() { return jobManager.getMappedPort(this.conf.get(RestOptions.PORT)); }
3.26
flink_FlinkContainers_getJobManager_rdh
/** * Gets JobManager container. */ public GenericContainer<?> getJobManager() { return this.jobManager; }
3.26
flink_FlinkContainers_start_rdh
/** * Starts all containers. */ public void start() throws Exception { if (haService != null) { LOG.debug("Starting HA service container"); this.haService.start(); } LOG.debug("Starting JobManager container"); this.jobManager.start(); waitUntilJobManagerRESTReachable(jobManager); LOG.debug("Starting TaskMan...
3.26
flink_FlinkContainers_withFlinkContainersSettings_rdh
/** * Allows to optionally provide Flink containers settings. {@link FlinkContainersSettings} * based on defaults will be used otherwise. * * @param flinkContainersSettings * The Flink containers settings. * @return A reference to this Builder. */ public Builder withFlinkContainersSettings(FlinkContainersSetti...
3.26
flink_FlinkContainers_beforeAll_rdh
// ------------------------ JUnit 5 lifecycle management ------------------------ @Override public void beforeAll(ExtensionContext context) throws Exception { this.start(); }
3.26
flink_FlinkContainers_createClusterClient_rdh
// ----------------------------- Helper functions -------------------------------- private RestClusterClient<StandaloneClusterId> createClusterClient() throws Exception { checkState(jobManager.isRunning(), "JobManager should be running for creating a REST client");// Close potentially existing REST cluster client if (...
3.26
flink_FlinkContainers_m0_rdh
/** * Stops all containers. */ public void m0() { isStarted = false; if (restClusterClient != null) { restClusterClient.close(); } this.taskManagers.forEach(GenericContainer::stop); deleteJobManagerTemporaryFiles(); this.jobManager.stop();if (this.haService != null) { this.haService.stop(); } }
3.26
flink_FlinkContainers_submitSQLJob_rdh
/** * Submits an SQL job to the running cluster. * * <p><b>NOTE:</b> You should not use {@code '\t'}. */ public void submitSQLJob(SQLJobSubmission job) throws IOException, InterruptedException { checkState(isStarted(), "SQL job submission is only applicable for a running cluster"); // Create SQL script and copy it ...
3.26
flink_FlinkContainers_getRestClusterClient_rdh
/** * Gets REST client connected to JobManager. */ @Nullable public RestClusterClient<StandaloneClusterId> getRestClusterClient() { return this.restClusterClient; }
3.26
flink_FlinkContainers_withTestcontainersSettings_rdh
/** * Allows to optionally provide Testcontainers settings. {@link TestcontainersSettings} * based on defaults will be used otherwise. * * @param testcontainersSettings * The Testcontainers settings. * @return A reference to this Builder. */ public Builder withTestcontainersSettings(TestcontainersSettings test...
3.26
flink_FlinkContainers_restartTaskManager_rdh
/** * Restarts all TaskManager containers. */ public void restartTaskManager(RunnableWithException afterFailAction) throws Exception { taskManagers.forEach(GenericContainer::stop); afterFailAction.run(); taskManagers.forEach(GenericContainer::start); }
3.26
flink_FlinkContainers_submitJob_rdh
/** * Submits the given job to the cluster. * * @param job * job to submit */ public JobID submitJob(JobSubmission job) throws IOException, InterruptedException { final List<String> commands = new ArrayList<>();commands.add("bin/flink"); commands.add("run"); if (job.isDetached()) { commands.add("-d"); } if (jo...
3.26
flink_FlinkContainers_getJobManagerHost_rdh
/** * Gets JobManager's hostname on the host machine. */ public String getJobManagerHost() { return jobManager.getHost(); }
3.26
flink_FlinkContainers_restartJobManager_rdh
/** * Restarts JobManager container. * * <p>Note that the REST port will be changed because the new JM container will be mapped to * another random port. Please make sure to get the REST cluster client again after this method * is invoked. */ public void restartJobManager(RunnableWithException afterFailAction) t...
3.26
flink_FlinkContainers_getTaskManagers_rdh
/** * Gets TaskManager containers. */ public List<GenericContainer<?>> getTaskManagers() { return this.taskManagers; }
3.26
flink_FlinkContainers_isStarted_rdh
/** * Gets the running state of the cluster. */public boolean isStarted() { return isStarted; }
3.26
flink_AsynchronousFileIOChannel_checkErroneous_rdh
/** * Checks the exception state of this channel. The channel is erroneous, if one of its requests * could not be processed correctly. * * @throws IOException * Thrown, if the channel is erroneous. The thrown exception contains the * original exception that defined the erroneous state as its cause. */ public...
3.26
flink_AsynchronousFileIOChannel_m0_rdh
/** * Handles a processed <tt>Buffer</tt>. This method is invoked by the asynchronous IO worker * threads upon completion of the IO request with the provided buffer and/or an exception that * occurred while processing the request for that buffer. * * @param buffer ...
3.26
flink_AsynchronousFileIOChannel_closeAndDelete_rdh
/** * This method waits for all pending asynchronous requests to return. When the last request has * returned, the channel is closed and deleted. * * <p>Even if an exception interrupts the closing, such that not all request are handled, the * underlying <tt>FileChannel</tt> is closed and deleted. * * @throws IOE...
3.26
flink_AsynchronousFileIOChannel_registerAllRequestsProcessedListener_rdh
/** * Registers a listener to be notified when all outstanding requests have been processed. * * <p>New requests can arrive right after the listener got notified. Therefore, it is not safe * to assume that the number of outstanding requests is still zero after a notification unless * there was a close right before...
3.26
flink_AsynchronousFileIOChannel_close_rdh
/** * Closes the channel and waits until all pending asynchronous requests are processed. The * underlying <code>FileChannel</code> is closed even if an exception interrupts the closing. * * <p><strong>Important:</strong> the {@link #isClosed()} method returns <code>true</code> * immediately after this method has ...
3.26
flink_AsynchronousFileIOChannel_isClosed_rdh
// -------------------------------------------------------------------------------------------- @Override public boolean isClosed() {return this.closed; }
3.26
flink_SinkTransformationTranslator_addFailOverRegion_rdh
/** * Adds a batch exchange that materializes the output first. This is a no-op in STREAMING. */private <I> DataStream<I> addFailOverRegion(DataStream<I> input) { return new DataStream<>(executionEnvironment, new PartitionTransformation<>(input.getTransformation(), new ForwardPartiti...
3.26
flink_SinkTransformationTranslator_adjustTransformations_rdh
/** * Since user may set specific parallelism on sub topologies, we have to pay attention to * the priority of parallelism at different levels, i.e. sub topologies customized * parallelism > sinkTransformation customized parallelism > environment customized * parallelism. In order to satisfy this rule and keep thes...
3.26
flink_KubernetesCheckpointStoreUtil_checkpointIDToName_rdh
/** * Convert a checkpoint id into a ConfigMap key. * * @param checkpointId * to convert to the key * @return key created from the given checkpoint id */ @Override public String checkpointIDToName(long checkpointId) { return CHECKPOINT_ID_KEY_PREFIX + String.format("%019d", checkpointId); }
3.26
flink_KubernetesCheckpointStoreUtil_nameToCheckpointID_rdh
/** * Converts a key in ConfigMap to the checkpoint id. * * @param key * in ConfigMap * @return Checkpoint id parsed from the key */ @Override public long nameToCheckpointID(String key) { try { return Long.parseLong(key.substring(CHECKPOINT_ID_KEY_PREFIX.length())); } catch (NumberFormatExcepti...
3.26
flink_SolutionSetUpdateBarrierBroker_instance_rdh
/** * * @return singleton instance */ public static Broker<SolutionSetUpdateBarrier> instance() { return INSTANCE; }
3.26
flink_WebMonitorEndpoint_grantLeadership_rdh
// ------------------------------------------------------------------------- // LeaderContender // ------------------------------------------------------------------------- @Override public void grantLeadership(final UUID leaderSessionID) { log.info("{} was granted leadership with leaderSessionID={}", getRestBaseU...
3.26
flink_HiveParallelismInference_infer_rdh
/** * Infer parallelism by number of files and number of splits. If {@link HiveOptions#TABLE_EXEC_HIVE_INFER_SOURCE_PARALLELISM} is not set this method does nothing. */ HiveParallelismInference infer(SupplierWithException<Integer, IOException> numFiles, SupplierWithException<Integer, IOException> numSplits) { if ...
3.26
flink_HiveParallelismInference_limit_rdh
/** * Apply limit to calculate the parallelism. Here limit is the limit in query <code> * SELECT * FROM xxx LIMIT [limit]</code>. */ int limit(Long limit) { if (!f0) { return parallelism; } if (limit != null) { parallelism = Math.min(parallelism, ((int) (limit / 1000))); } // ma...
3.26
flink_JMXReporter_m0_rdh
// ------------------------------------------------------------------------ // adding / removing metrics // ------------------------------------------------------------------------ @Override public void m0(Metric metric, String metricName, MetricGroup group) { final String domain = generateJmxDomain(metricName, ...
3.26
flink_JMXReporter_open_rdh
// ------------------------------------------------------------------------ // life cycle // ------------------------------------------------------------------------ @Override public void open(MetricConfig config) { }
3.26
flink_JMXReporter_replaceInvalidChars_rdh
/** * Lightweight method to replace unsupported characters. If the string does not contain any * unsupported characters, this method creates no new string (and in fact no new objects at * all). * * <p>Replacements: * * <ul> * <li>{@code "} is removed * <li>{@code spa...
3.26
flink_JMXReporter_generateJmxTable_rdh
// ------------------------------------------------------------------------ // Utilities // ------------------------------------------------------------------------ static Hashtable<String, String> generateJmxTable(Map<String, String> variables) { Hashtable<String, String> ht = new Hashtable<>(variables.size());for...
3.26
flink_WriterProperties_getPendingFileRecoverableSerializer_rdh
/** * * @return the serializer for the {@link InProgressFileWriter.PendingFileRecoverable}. */ public SimpleVersionedSerializer<InProgressFileWriter.PendingFileRecoverable> getPendingFileRecoverableSerializer() { return pendingFileRecoverableSerializer; }
3.26
flink_WriterProperties_getInProgressFileRecoverableSerializer_rdh
/** * * @return the serializer for the {@link InProgressFileWriter.InProgressFileRecoverable}. */ public SimpleVersionedSerializer<InProgressFileWriter.InProgressFileRecoverable> getInProgressFileRecoverableSerializer() { return inProgressFileRecoverableSerializer; }
3.26
flink_RestClusterClient_requestJobStatus_rdh
// ------------------------------------------------------------------------- // RestClient Helper // ------------------------------------------------------------------------- private CompletableFuture<JobStatus> requestJobStatus(JobID jobId) { final JobStatusInfoHeaders jobStatusInfoHeaders = JobStatusInfoHeaders...
3.26
flink_RestClusterClient_getClusterOverview_rdh
/** * Get an overview of the Flink cluster. * * @return Future with the {@link ClusterOverviewWithVersion cluster overview}. */ public CompletableFuture<ClusterOverviewWithVersion> getClusterOverview() { return sendRequest(ClusterOverviewHeaders.getInstance(), EmptyMessageParameters.getInstance(), EmptyRequestB...
3.26
flink_RestClusterClient_updateJobResourceRequirements_rdh
/** * Update {@link JobResourceRequirements} of a given job. * * @param jobId * jobId specifies the job for which to change the resource requirements * @param jobResourceRequirements * new resource requirements for the provided job * @return Future which is completed upon successful operation. */ public Com...
3.26
flink_RestClusterClient_m0_rdh
/** * Requests the job details. * * @param jobId * The job id * @return Job details */ public CompletableFuture<JobDetailsInfo> m0(JobID jobId) { final JobDetailsHeaders detailsHeaders = JobDetailsHeaders.getInstance(); final JobMessageParameters params = new JobMessageParameters(); params.jobPathParameter.reso...
3.26
flink_RestClusterClient_pollResourceAsync_rdh
/** * Creates a {@code CompletableFuture} that polls a {@code AsynchronouslyCreatedResource} until * its {@link AsynchronouslyCreatedResource#queueStatus() QueueStatus} becomes {@link QueueStatus.Id#COMPLETED COMPLETED}. The future completes with the result of {@link AsynchronouslyCreatedResource#resource()}. * * @...
3.26
flink_RestClusterClient_getWebInterfaceURL_rdh
// ====================================== @Override public String getWebInterfaceURL() { try { return getWebMonitorBaseUrl().get().toString(); } catch (InterruptedException | ExecutionException e) { ExceptionUtils.checkInterrupted(e); LOG.warn("Could not retrieve the web interface URL ...
3.26
flink_Lockable_release_rdh
/** * Releases lock on this object. If no more locks are acquired on it, this method will return * true. * * @return true if no more locks are acquired */ boolean release() { if (refCounter <= 0) { return true; } refCounter -= 1; return refCounter == 0; }
3.26
flink_ArrowReader_getColumnVectors_rdh
/** * Gets the column vectors. */ public ColumnVector[] getColumnVectors() { return columnVectors; }
3.26
flink_ArrowReader_read_rdh
/** * Read the specified row from underlying Arrow format data. */ public RowData read(int rowId) { f0.setRowId(rowId); return f0; }
3.26
flink_ExecNodeMetadataUtil_latestAnnotation_rdh
/** * Returns the {@link ExecNodeMetadata} annotation of the class with the highest (most recent) * {@link ExecNodeMetadata#version()}. */ public static <T extends ExecNode<?>> ExecNodeMetadata latestAnnotation(Class<T> execNodeClass) { List<ExecNodeMetadata> sortedAnnotations = extractMetadataFromAnnotation(execNod...
3.26
flink_RetractableTopNFunction_processStateStaled_rdh
// ------------- ROW_NUMBER------------------------------- private void processStateStaled(Iterator<Map.Entry<RowData, Long>> sortedMapIterator) throws RuntimeException {// Sync with dataState first sortedMapIterator.remove(); stateStaledErrorHandle(); }
3.26
flink_RetractableTopNFunction_retractRecordWithoutRowNumber_rdh
/** * Retract the input record and emit updated records. This works for outputting without * row_number. * * @return true if the input record has been removed from {@link #dataState}. */ private boolean retractRecordWithoutRowNumber(SortedMap<RowData, Long> sortedMap, RowData sortKey, RowData inputRow, Collector...
3.26
flink_RetractableTopNFunction_retractRecordWithRowNumber_rdh
/** * Retract the input record and emit updated records. This works for outputting with row_number. * * @return true if the input record has been removed from {@link #dataState}. */ private boolean retractRecordWithRowNumber(SortedMap<RowData, Long> sortedMap, RowData sortKey, RowData inputRow, Collector<RowData> o...
3.26
flink_RetractableTopNFunction_stateStaledErrorHandle_rdh
/** * Handle state staled error by configured lenient option. If option is true, warning log only, * otherwise a {@link RuntimeException} will be thrown. */ private void stateStaledErrorHandle() { // Skip the data if it's state is cleared because of state ttl. if (lenient) { LOG.warn(STATE_CLEARED_...
3.26
flink_IntParser_parseField_rdh
/** * Static utility to parse a field of type int from a byte sequence that represents text * characters (such as when read from a file stream). * * @param bytes * The bytes containing the text data that should be parsed. * @param startPos * The offset to start the parsing. * @param length * The length o...
3.26
flink_DefaultLeaderElectionService_deregisterDriver_rdh
/** * Returns the driver as an {@link AutoCloseable} for the sake of closing the driver outside of * the lock. */ @GuardedBy("lock") private AutoCloseable deregisterDriver() { Preconditions.checkState(leaderContenderRegistry.isEmpty(), "No contender should be registered when deregistering the driver."); Pr...
3.26
flink_DefaultLeaderElectionService_getLeaderSessionID_rdh
/** * Returns the current leader session ID for the given {@code componentId} or {@code null}, if * the session wasn't confirmed. */ @VisibleForTesting @Nullable public UUID getLeaderSessionID(String componentId) { synchronized(lock) { return leaderContenderRegistry.containsKey(componentId) ? confirmedLeaderInformat...
3.26
flink_RawValueData_fromBytes_rdh
/** * Creates an instance of {@link RawValueData} from the given byte array. */ static <T> RawValueData<T> fromBytes(byte[] bytes) { return BinaryRawValueData.fromBytes(bytes); }
3.26
flink_RawValueData_fromObject_rdh
// ------------------------------------------------------------------------------------------ // Constructor Utilities // ------------------------------------------------------------------------------------------ /** * Creates an instance of {@link RawValueData} from a Java object. */ static <T> RawValueData<T> fromO...
3.26
flink_NFAStateSerializer_readObject_rdh
/* Backwards compatible deserializing of NFAStateSerializer. */ private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException { in.defaultReadObject(); // the nested serializer will be null if this was read from a savepoint taken with versions // lower than Flink 1.7; in this case...
3.26
flink_NFAStateSerializer_getVersionSerializer_rdh
/* Getters for internal serializers to use in NFAStateSerializerSnapshot. */ TypeSerializer<DeweyNumber> getVersionSerializer() { return versionSerializer; }
3.26
flink_NFAStateSerializer_m1_rdh
/* De/serialization methods */ private void m1(Queue<ComputationState> states, DataOutputView target) throws IOException { target.writeInt(states.size()); for (ComputationState computationState : states) { serializeSingleComputationState(computationState, target); } }
3.26
flink_AbstractWritableVector_hasDictionary_rdh
/** * Returns true if this column has a dictionary. */ @Override public boolean hasDictionary() { return this.dictionary != null; }
3.26
flink_AbstractWritableVector_setDictionary_rdh
/** * Update the dictionary. */ @Override public void setDictionary(Dictionary dictionary) { this.dictionary = dictionary; }
3.26
flink_CalciteParser_parseIdentifier_rdh
/** * Parses a SQL string as an identifier into a {@link SqlIdentifier}. * * @param identifier * a sql string to parse as an identifier * @return a parsed sql node * @throws SqlParserException * if an exception is thrown when parsing the identifier */ public SqlIdentifier parseIdentifier(String identifier) ...
3.26
flink_CalciteParser_parseSqlList_rdh
/** * Parses a SQL string into a {@link SqlNodeList}. The {@link SqlNodeList} is not yet validated. * * @param sql * a sql string to parse * @return a parsed sql node list * @throws SqlParserException * if an exception is thrown when parsing the statement * @throws SqlParserEOFException * if the statemen...
3.26
flink_CalciteParser_parseExpression_rdh
/** * Parses a SQL expression into a {@link SqlNode}. The {@link SqlNode} is not yet validated. * * @param sqlExpression * a SQL expression string to parse * @return a parsed SQL node * @throws SqlParserException * if an exception is thrown when parsing the statement */ public SqlNode parseExpression(String...
3.26
flink_CalciteParser_createFlinkParser_rdh
/** * Equivalent to {@link SqlParser#create(Reader, SqlParser.Config)}. The only difference is we * do not wrap the {@link FlinkSqlParserImpl} with {@link SqlParser}. * * <p>It is so that we can access specific parsing methods not accessible through the {@code SqlParser}. */ private SqlAbstractParserImpl createFl...
3.26
flink_CalciteParser_parse_rdh
/** * Parses a SQL statement into a {@link SqlNode}. The {@link SqlNode} is not yet validated. * * @param sql * a sql string to parse * @return a parsed sql node * @throws SqlParserException * if an exception is thrown when parsing the statement * @throws SqlParserEOFException * if the statement is incom...
3.26
flink_KvStateRegistry_getKvStateRegistryListener_rdh
// ------------------------------------------------------------------------ // Internal methods // ------------------------------------------------------------------------ private KvStateRegistryListener getKvStateRegistryListener(JobID jobId) { // first check whether we are running the legacy code which registers ...
3.26
flink_KvStateRegistry_m0_rdh
/** * Unregisters the listener with the registry. * * @param jobId * for which to unregister the {@link KvStateRegistryListener} */public void m0(JobID jobId) { f1.remove(jobId); }
3.26
flink_KvStateRegistry_registerListener_rdh
/** * Registers a listener with the registry. * * @param jobId * identifying the job for which to register a {@link KvStateRegistryListener} * @param listener * The registry listener. * @throws IllegalStateException * If there is a registered listener */ public void registerListener(JobID jobId, KvStateR...
3.26
flink_KvStateRegistry_unregisterKvState_rdh
/** * Unregisters the KvState instance identified by the given KvStateID. * * @param jobId * JobId the KvState instance belongs to * @param kvStateId * KvStateID to identify the KvState instance * @param keyGroupRange * Key group range the KvState instance belongs to */ public void unregisterKvState(JobI...
3.26
flink_KvStateRegistry_registerKvState_rdh
/** * Registers the KvState instance and returns the assigned ID. * * @param jobId * JobId the KvState instance belongs to * @param jobVertexId * JobVertexID the KvState instance belongs to * @param keyGroupRange * Key group range the KvState instance belongs to * @param registrationName * Name under ...
3.26
flink_KvStateRegistry_createTaskRegistry_rdh
// ------------------------------------------------------------------------ /** * Creates a {@link TaskKvStateRegistry} facade for the {@link Task} identified by the given * JobID and JobVertexID instance. * * @param jobId * JobID of the task * @param jobVertexId * JobVertexID of the task * @return A {@link...
3.26
flink_ResourceGuard_getLeaseCount_rdh
/** * Returns the current count of open leases. */ public int getLeaseCount() { return leaseCount; }
3.26
flink_ResourceGuard_m0_rdh
/** * Closed the resource guard. This method will block until all calls to {@link #acquireResource()} have seen their matching call to {@link #releaseResource()}. */ @Override public void m0() { closeUninterruptibly(); }
3.26
flink_ResourceGuard_releaseResource_rdh
/** * Releases access for one client of the guarded resource. This method must only be called after * a matching call to {@link #acquireResource()}. */ private void releaseResource() { synchronized(lock) { --leaseCount; if (closed && (leaseCount == 0)) { lock.notifyAll(); } } }
3.26
flink_ResourceGuard_isClosed_rdh
/** * Returns true if the resource guard is closed, i.e. after {@link #close()} was called. */ public boolean isClosed() { return closed; }
3.26
flink_ResourceGuard_acquireResource_rdh
/** * Acquired access from one new client for the guarded resource. * * @throws IOException * when the resource guard is already closed. */public Lease acquireResource() throws IOException { synchronized(lock) { if (closed) { throw new IOException("Resource guard was already closed.");...
3.26
flink_ResourceGuard_closeUninterruptibly_rdh
/** * If the current thread is {@linkplain Thread#interrupt interrupted} while waiting for the * close method to complete, then it will continue to wait. When the thread does return from * this method its interrupt status will be set. */ @SuppressWarnings("WeakerAccess") public void closeUninterruptibly() { boolean...
3.26
flink_ArrowUtils_createRowDataArrowWriter_rdh
/** * Creates an {@link ArrowWriter} for the specified {@link VectorSchemaRoot}. */ public static ArrowWriter<RowData> createRowDataArrowWriter(VectorSchemaRoot root, RowType rowType) { ArrowFieldWriter<RowData>[] fieldWriters = new ArrowFieldWriter[root.getFieldVectors().size()]; List<FieldVector> vectors = ...
3.26
flink_ArrowUtils_toArrowSchema_rdh
/** * Returns the Arrow schema of the specified type. */ public static Schema toArrowSchema(RowType rowType) { Collection<Field> fields = rowType.getFields().stream().map(f -> ArrowUtils.toArrowField(f.getName(), f.getType())).collect(Collectors.toCollection(ArrayList::new)); return new Schema(fields); }
3.26
flink_ArrowUtils_collectAsPandasDataFrame_rdh
/** * Convert Flink table to Pandas DataFrame. */ public static CustomIterator<byte[]> collectAsPandasDataFrame(Table table, int maxArrowBatchSize) throws Exception { checkArrowUsable(); BufferAllocator allocator = getRootAllocator().newChildAllocator("collectAsPandasDataFrame", 0, Long.MAX_VALUE); RowTy...
3.26
flink_ArrowUtils_readFully_rdh
/** * Fills a buffer with data read from the channel. */ private static void readFully(ReadableByteChannel channel, ByteBuffer dst) throws IOException { int expected = dst.remaining(); while (dst.hasRemaining()) { if (channel.read(dst) < ...
3.26
flink_ArrowUtils_createArrowReader_rdh
/** * Creates an {@link ArrowReader} for the specified {@link VectorSchemaRoot}. */ public static ArrowReader createArrowReader(VectorSchemaRoot root, RowType rowType) { List<ColumnVector> columnVectors = new ArrayList<>(); List<FieldVector> fieldVectors = root.getFieldVectors(); for (int i = 0; i < fieldVectors.size...
3.26