name stringlengths 12 178 | code_snippet stringlengths 8 36.5k | score float64 3.26 3.68 |
|---|---|---|
flink_OptimizerNode_getMinimalMemoryAcrossAllSubTasks_rdh | /**
* Gets the amount of memory that all subtasks of this task have jointly available.
*
* @return The total amount of memory across all subtasks.
*/
public long getMinimalMemoryAcrossAllSubTasks() {
return this.minimalMemoryPerSubTask == (-1) ? -1 : this.minimalMemoryPerSubTask * this.parallelism;
} | 3.26 |
flink_OptimizerNode_addOutgoingConnection_rdh | /**
* Adds a new outgoing connection to this node.
*
* @param connection
* The connection to add.
*/
public void addOutgoingConnection(DagConnection connection) {
if (this.outgoingConnections == null) {
this.outgoingConnections = new ArrayList<DagConnection>();
} else if (this.outgoingConnections... | 3.26 |
flink_OptimizerNode_m3_rdh | /**
* The node IDs are assigned in graph-traversal order (pre-order), hence, each list is sorted by
* ID in ascending order and all consecutive lists start with IDs in ascending order.
*
* @param markJoinedBranchesAsPipelineBreaking
* True, if the
*/
protected final boolean m3(List<UnclosedBranchDescriptor> chi... | 3.26 |
flink_OptimizerNode_getPredecessors_rdh | // ------------------------------------------------------------------------
// Getters / Setters
// ------------------------------------------------------------------------
@Override
public Iterable<OptimizerNode> getPredecessors() {
List<OptimizerNode> allPredecessors = new ArrayList<OptimizerNode>();
for (Dag... | 3.26 |
flink_OptimizerNode_addBroadcastConnection_rdh | /**
* Adds the broadcast connection identified by the given {@code name} to this node.
*
* @param broadcastConnection
* The connection to add.
*/
public void addBroadcastConnection(String name, DagConnection broadcastConnection) {
this.broadcastConnectionNames.add(name);
this.broadcastConnections.add(bro... | 3.26 |
flink_OptimizerNode_getBroadcastConnections_rdh | /**
* Return the list of inputs associated with broadcast variables for this node.
*/public List<DagConnection> getBroadcastConnections() {
return this.broadcastConnections;
} | 3.26 |
flink_OptimizerNode_isBranching_rdh | /**
* Checks whether this node has branching output. A node's output is branched, if it has more
* than one output connection.
*
* @return True, if the node's output branches. False otherwise.
*/
public boolean isBranching() {
return (getOutgoingConnections() != null) && (getOutgoingConnections().size() > 1);
... | 3.26 |
flink_SqlResourceType_symbol_rdh | /**
* Creates a parse-tree node representing an occurrence of this keyword at a particular position
* in the parsed text.
*/
public SqlLiteral symbol(SqlParserPos pos) {
return SqlLiteral.createSymbol(this, pos);
} | 3.26 |
flink_Catalog_getTable_rdh | /**
* Returns a {@link CatalogTable} or {@link CatalogView} at a specific time identified by the
* given {@link ObjectPath}. The framework will resolve the metadata objects when necessary.
*
* @param tablePath
* Path of the table or view
* @param timestamp
* Timestamp of the t... | 3.26 |
flink_Catalog_bulkGetPartitionColumnStatistics_rdh | /**
* Get a list of column statistics for given partitions.
*
* @param tablePath
* path of the table
* @param partitionSpecs
* partition specs of partitions that will be used to filter out all other
* unrelated statistics, i.e. the statistics fetch will be limited within the given
* partitions
* @retur... | 3.26 |
flink_Catalog_bulkGetPartitionStatistics_rdh | /**
* Get a list of statistics of given partitions.
*
* @param tablePath
* path of the table
* @param partitionSpecs
* partition specs of partitions that will be used to filter out all other
* unrelated statistics, i.e. the statistics fetch will be limited within the given
* partitions
* @return list o... | 3.26 |
flink_Catalog_dropDatabase_rdh | /**
* Drop a database.
*
* @param name
* Name of the database to be dropped.
* @param ignoreIfNotExists
* Flag to specify behavior when the database does not exist: if set to
* false, throw an exception, if set to true, do nothing.
* @throws DatabaseNotExistException
* if the given database does not ex... | 3.26 |
flink_Catalog_m0_rdh | /**
* Returns a factory for creating instances from catalog objects.
*
* <p>This method enables bypassing the discovery process. Implementers can directly pass
* internal catalog-specific objects to their own factory. For example, a custom {@link CatalogTable} can be processed by a custom {@link DynamicTableFactory... | 3.26 |
flink_Catalog_m2_rdh | /**
* Modifies an existing table or view. Note that the new and old {@link CatalogBaseTable} must
* be of the same kind. For example, this doesn't allow altering a regular table to partitioned
* table, or altering a view to a table, and vice versa.
*
* <p>The framework will make sure to call this method with fully... | 3.26 |
flink_Catalog_listProcedures_rdh | /**
* List the names of all procedures in the given database. An empty list is returned if no
* procedure.
*
* @param dbName
* name of the database.
* @return a list of the names of the procedures in this database
* @throws DatabaseNotExistException
* if the database does not exist
* @throws CatalogExcepti... | 3.26 |
flink_Catalog_getProcedure_rdh | /**
* Get the procedure. The procedure name should be handled in a case-insensitive way.
*
* @param procedurePath
* path of the procedure
* @return the requested procedure
* @throws ProcedureNotExistException
* if the procedure does not exist in the catalog
* @throws CatalogException
* in case of any run... | 3.26 |
flink_ByteParser_parseField_rdh | /**
* Static utility to parse a field of type byte 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 ... | 3.26 |
flink_AcknowledgeCheckpoint_getSubtaskState_rdh | // properties
// ------------------------------------------------------------------------
public TaskStateSnapshot getSubtaskState() {
return subtaskState;
} | 3.26 |
flink_AcknowledgeCheckpoint_equals_rdh | // --------------------------------------------------------------------------------------------
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (!(o instanceof AcknowledgeCheckpoint)) {
return false;
}
if (!super.equals(o)) {
return false;
... | 3.26 |
flink_ZooKeeperUtils_generateZookeeperPath_rdh | /**
* Creates a ZooKeeper path of the form "/a/b/.../z".
*/
public static String generateZookeeperPath(String... paths) { return Arrays.stream(paths).map(ZooKeeperUtils::trimSlashes).filter(s -> !s.isEmpty()).collect(Collectors.joining("/", "/", ""));
} | 3.26 |
flink_ZooKeeperUtils_createFileSystemStateStorage_rdh | /**
* Creates a {@link FileSystemStateStorageHelper} instance.
*
* @param configuration
* {@link Configuration} object
* @param prefix
* Prefix for the created files
* @param <T>
* Type of the state objects
* @return {@link FileSystemStateStorageHelper} instance
* @throws IOException
* if file system... | 3.26 |
flink_ZooKeeperUtils_createZooKeeperStateHandleStore_rdh | /**
* Creates an instance of {@link ZooKeeperStateHandleStore}.
*
* @param client
* ZK client
* @param path
* Path to use for the client namespace
* @param stateStorage
* RetrievableStateStorageHelper that persist the actual state and whose
* returned state handle is then written to ZooKeeper
* @param... | 3.26 |
flink_ZooKeeperUtils_createCompletedCheckpoints_rdh | /**
* Creates a {@link DefaultCompletedCheckpointStore} instance with {@link ZooKeeperStateHandleStore}.
*
* @param client
* The {@link CuratorFramework} ZooKeeper client to use
* @param configuration
* {@link Configuration} object
* @param maxNumberOfCheckpointsToRetain
* The maximum number of checkpoint... | 3.26 |
flink_ZooKeeperUtils_isZooKeeperRecoveryMode_rdh | /**
* Returns whether {@link HighAvailabilityMode#ZOOKEEPER} is configured.
*/
public static boolean isZooKeeperRecoveryMode(Configuration flinkConf) {
return HighAvailabilityMode.fromConfig(flinkConf).equals(HighAvailabilityMode.ZOOKEEPER);
} | 3.26 |
flink_ZooKeeperUtils_createJobGraphs_rdh | /**
* Creates a {@link DefaultJobGraphStore} instance with {@link ZooKeeperStateHandleStore},
* {@link ZooKeeperJobGraphStoreWatcher} and {@link ZooKeeperJobGraphStoreUtil}.
*
* @param client
* The {@link CuratorFramework} ZooKeeper client to use
* @param configuration
* {@link Configuration} object
* @retu... | 3.26 |
flink_ZooKeeperUtils_useNamespaceAndEnsurePath_rdh | /**
* Returns a facade of the client that uses the specified namespace, and ensures that all nodes
* in the path exist.
*
* @param client
* ZK client
* @param path
* the new namespace
* @return ZK Client that uses the new namespace
* @throws Exception
* ZK errors
*/
public static CuratorFramework useNa... | 3.26 |
flink_ZooKeeperUtils_getZooKeeperEnsemble_rdh | /**
* Returns the configured ZooKeeper quorum (and removes whitespace, because ZooKeeper does not
* tolerate it).
*/
public static String getZooKeeperEnsemble(Configuration flinkConf) throws IllegalConfigurationException {
String zkQuorum =
flinkConf.getValue(HighAvailabilityOptions.HA_ZOOKEEPER_QUORUM);
if ((zkQuor... | 3.26 |
flink_ZooKeeperUtils_startCuratorFramework_rdh | /**
* Starts a {@link CuratorFramework} instance and connects it to the given ZooKeeper quorum from
* a builder.
*
* @param builder
* {@link CuratorFrameworkFactory.Builder} A builder for curatorFramework.
* @param fatalErrorHandler
* {@link FatalErrorHandler} fatalErrorHandler to handle unexpected
* erro... | 3.26 |
flink_ZooKeeperUtils_getDefaultAcl_rdh | /**
* Secure {@link ACLProvider} implementation.
*/public static class SecureAclProvider implements ACLProvider {
@Override
public List<ACL> getDefaultAcl() {
return Ids.CREATOR_ALL_ACL;
} | 3.26 |
flink_ZooKeeperUtils_createLeaderRetrievalDriverFactory_rdh | /**
* Creates a {@link LeaderRetrievalDriverFactory} implemented by ZooKeeper.
*
* @param client
* The {@link CuratorFramework} ZooKeeper client to use
* @param path
* The path for the leader zNode
* @param configuration
* configuration for further config options
* @return {@link LeaderRetrievalDriverFac... | 3.26 |
flink_ZooKeeperUtils_fromConfig_rdh | /**
* Return the configured {@link ZkClientACLMode}.
*
* @param config
* The config to parse
* @return Configured ACL mode or the default defined by {@link HighAvailabilityOptions#ZOOKEEPER_CLIENT_ACL} if not configured.
*/
public static ZkClientACLMode fromConfig(Configuration config) {
String aclMode = config... | 3.26 |
flink_ZooKeeperUtils_createLeaderRetrievalService_rdh | /**
* Creates a {@link DefaultLeaderRetrievalService} instance with {@link ZooKeeperLeaderRetrievalDriver}.
*
* @param client
* The {@link CuratorFramework} ZooKeeper client to use
* @return {@link DefaultLeaderRetrievalService} instance.
*/
public static DefaultLeaderRetrievalService createLeaderRetrievalServi... | 3.26 |
flink_ZooKeeperUtils_createCheckpointIDCounter_rdh | /**
* Creates a {@link ZooKeeperCheckpointIDCounter} instance.
*
* @param client
* The {@link CuratorFramework} ZooKeeper client to use
* @return {@link ZooKeeperCheckpointIDCounter} instance
*/
public static ZooKeeperCheckpointIDCounter createCheckpointIDCounter(CuratorFramework client) {
return new ZooKeeperC... | 3.26 |
flink_ZooKeeperUtils_getPathForJob_rdh | /**
* Returns the JobID as a String (with leading slash).
*/
public static String getPathForJob(JobID jobId) {
checkNotNull(jobId, "Job ID");
return String.format("/%s", jobId);
} | 3.26 |
flink_ZooKeeperUtils_createTreeCache_rdh | /**
* Creates a {@link TreeCache} that only observes a specific node.
*
* @param client
* ZK client
* @param pathToNode
* full path of the node to observe
* @param nodeChangeCallback
* callback to run if the node has changed
* @return tree cache
*/public static TreeCache createTreeCache(final CuratorFra... | 3.26 |
flink_ZooKeeperUtils_treeCacheSelectorForPath_rdh | /**
* Returns a {@link TreeCacheSelector} that only accepts a specific node.
*
* @param fullPath
* node to accept
* @return tree cache selector
*/
private static TreeCacheSelector treeCacheSelectorForPath(String fullPath) {
return new TreeCacheSelector() {
@Override
public boolean traverseChildren(String childP... | 3.26 |
flink_ZooKeeperUtils_splitZooKeeperPath_rdh | /**
* Splits the given ZooKeeper path into its parts.
*
* @param path
* path to split
* @return splited path
*/
public static String[] splitZooKeeperPath(String path) {return path.split("/");
} | 3.26 |
flink_AccumulatorHelper_toResultMap_rdh | /**
* Transform the Map with accumulators into a Map containing only the results.
*/
public static Map<String, OptionalFailure<Object>> toResultMap(Map<String, Accumulator<?, ?>> accumulators) {
Map<String, OptionalFailure<Object>> resultMap = new HashMap<>();
for (Map.Entry<String, Accumulator<?, ?>> entry :... | 3.26 |
flink_AccumulatorHelper_deserializeAccumulators_rdh | /**
* Takes the serialized accumulator results and tries to deserialize them using the provided
* class loader.
*
* @param serializedAccumulators
* The serialized accumulator results.
* @param loader
* The class loader to use.
* @return The deserialized accumulator results.
*/public static Map<String, Opt... | 3.26 |
flink_AccumulatorHelper_deserializeAndUnwrapAccumulators_rdh | /**
* Takes the serialized accumulator results and tries to deserialize them using the provided
* class loader, and then try to unwrap the value unchecked.
*
* @param serializedAccumulators
* The serialized accumulator results.
* @param loader
* The class loader to use.
* @return The deserialized and unwrap... | 3.26 |
flink_AccumulatorHelper_compareAccumulatorTypes_rdh | /**
* Compare both classes and throw {@link UnsupportedOperationException} if they differ.
*/
@SuppressWarnings("rawtypes")
public static void compareAccumulatorTypes(Object name, Class<? extends Accumulator> first, Class<? extends Accumulator> second) throws UnsupportedOperationException {
if ((first == null) ||... | 3.26 |
flink_AccumulatorHelper_mergeSingle_rdh | /**
* Workaround method for type safety.
*/
private static <V, R extends Serializable> Accumulator<V, R> mergeSingle(Accumulator<?, ?> target, Accumulator<?, ?> toMerge) {
@SuppressWarnings("unchecked")
Accumulator<V, R> typedTarget = ((Accumulator<V, R>) (target));
@SuppressWarnings("unchecked")
Accu... | 3.26 |
flink_AccumulatorHelper_mergeInto_rdh | /**
* Merge two collections of accumulators. The second will be merged into the first.
*
* @param target
* The collection of accumulators that will be updated
* @param toMerge
* The collection of accumulators that will be merged into the other
*/public static void mergeInto(Map<String, OptionalFailure<Accumu... | 3.26 |
flink_TwoInputStreamTask_getCanEmitBatchOfRecords_rdh | // This is needed for StreamMultipleInputProcessor#processInput to preserve the existing
// behavior of choosing an input every time a record is emitted. This behavior is good for
// fairness between input consumption. But it can reduce throughput due to added control
// flow cost on the per-record code path.
@Override... | 3.26 |
flink_SlotManagerUtils_generateDefaultSlotResourceProfile_rdh | /**
* This must be consist with {@link org.apache.flink.runtime.taskexecutor.TaskExecutorResourceUtils#generateDefaultSlotResourceProfile}.
*/
public static ResourceProfile
generateDefaultSlotResourceProfile(WorkerResourceSpec workerResourceSpec, int numSlotsPerWorker) {
final ResourceProfile.Builder resourcePr... | 3.26 |
flink_ResourceInformationReflector_getAllResourceInfos_rdh | /**
* Get the name and value of all resources from the {@link Resource}.
*/
@VisibleForTesting
Map<String, Long> getAllResourceInfos(Object resource)
{
if (!isYarnResourceTypesAvailable) {
return Collections.emptyMap();
}
final Map<String, Long> externalResources = new HashMap<>();
final Objec... | 3.26 |
flink_ResourceInformationReflector_setResourceInformationUnSafe_rdh | /**
* Same as {@link #setResourceInformation(Resource, String, long)} but allows to pass objects
* that are not of type {@link Resource}.
*/
@VisibleForTesting
void setResourceInformationUnSafe(Object resource, String resourceName, long amount) {
if (!isYarnResourceTypesAvailable) {
LOG.info("Will not re... | 3.26 |
flink_ResourceInformationReflector_getExternalResources_rdh | /**
* Get the name and value of external resources from the {@link Resource}.
*/
Map<String, Long> getExternalResources(Resource resource) {
return getExternalResourcesUnSafe(resource);
} | 3.26 |
flink_ResourceInformationReflector_setResourceInformation_rdh | /**
* Add the given resourceName and value to the {@link Resource}.
*/
void setResourceInformation(Resource resource, String resourceName, long amount) {
setResourceInformationUnSafe(resource, resourceName, amount);
} | 3.26 |
flink_ResourceInformationReflector_getExternalResourcesUnSafe_rdh | /**
* Same as {@link #getExternalResources(Resource)} but allows to pass objects that are not of
* type {@link Resource}.
*/
@VisibleForTesting
Map<String, Long> getExternalResourcesUnSafe(Object resource) {
if (!isYarnResourceTypesAvailable) {
return Collections.emptyMap();
}
final Map<String, L... | 3.26 |
flink_SorterInputGateway_m0_rdh | /**
* Signals the end of input. Will flush all buffers and notify later stages.
*/
public void
m0() {
if ((currentBuffer != null) && (!currentBuffer.getBuffer().isEmpty())) {
this.dispatcher.send(SortStage.SORT, currentBuffer);
}
// add the sentinel to notify the receivers that the work is done
... | 3.26 |
flink_SorterInputGateway_writeRecord_rdh | /**
* Writes the given record for sorting.
*/
public void writeRecord(E record) throws IOException, InterruptedException
{
if (currentBuffer == null) {
this.currentBuffer = this.dispatcher.take(SortStage.READ);if (!currentBuffer.getBuffer().isEmpty()) {
throw new IOException("New buffer is ... | 3.26 |
flink_ChecksumUtils_convertChecksumToString_rdh | /**
* Converts an int crc32 checksum to the string format used by Google storage, which is the
* base64 string for the int in big-endian format.
*
* @param checksum
* The int checksum
* @return The string checksum
*/
public static String convertChecksumToString(int checksum) {
ByteBuffer buffer = ByteBuffe... | 3.26 |
flink_TypeExtractor_createTypeInfo_rdh | // --------------------------------------------------------------------------------------------
// Create type information
// --------------------------------------------------------------------------------------------
@SuppressWarnings("unchecked")
public static <T> TypeInformation<T> createTypeInfo(Class<T> type) {
... | 3.26 |
flink_TypeExtractor_createTypeInfoFromFactory_rdh | /**
* Creates type information using a given factory.
*/
@SuppressWarnings("unchecked")
private <IN1, IN2, OUT> TypeInformation<OUT> creat... | 3.26 |
flink_TypeExtractor_getParameterType_rdh | // --------------------------------------------------------------------------------------------
// Extract type parameters
// --------------------------------------------------------------------------------------------
@PublicEvolving
public static Type getParameterType(Class<?> baseClass, Class<?> clazz, int pos) {
re... | 3.26 |
flink_TypeExtractor_getAllDeclaredFields_rdh | /**
* Recursively determine all declared fields This is required because class.getFields() is not
* returning fields defined in parent classes.
*
* @param clazz
* class to be analyzed
* @param ignoreDuplicates
* if true, in case of duplicate field names only the lowest one in a
* hierarchy will be returne... | 3.26 |
flink_TypeExtractor_getMapReturnTypes_rdh | // --------------------------------------------------------------------------------------------
// Function specific methods
// --------------------------------------------------------------------------------------------
@PublicEvolving
public static <IN, OUT> TypeInformation<OUT> getMapReturnTypes(MapFunction<IN, OU... | 3.26 |
flink_TypeExtractor_isRecord_rdh | /**
* Determine whether the given class is a valid Java record.
*
* @param clazz
* class to check
* @return True if the class is a Java record
*/
@PublicEvolving
public static boolean isRecord(Class<?> clazz) {
return clazz.getSuperclass().getName().equals("java.lang.Record") && ((clazz.getModifiers() & Mo... | 3.26 |
flink_TypeExtractor_getTypeInfoFactory_rdh | /**
* Returns the type information factory for an annotated field.
*/
@Internal
@SuppressWarnings("unchecked")
public static <OUT> TypeInfoFactory<OUT> getTypeInfoFactory(Field field) {
if ((!isClassType(field.getType())) || (!field.isAnnotationPresent(TypeInfo.class))) { return null;
}
Class<?> factoryCl... | 3.26 |
flink_TypeExtractor_validateIfWritable_rdh | // visible for testing
static void validateIfWritable(TypeInformation<?> typeInfo, Type type) {
try {
// try to load the writable type info
Class<?> v16... | 3.26 |
flink_TypeExtractor_isValidPojoField_rdh | /**
* Checks if the given field is a valid pojo field: - it is public OR - there are getter and
* setter methods for the field.
*
* @param f
* field to check
* @param clazz
* class of field
* @param typeHierarchy
* type hierarchy for materializing generic types
*/
private boolean isValidPojoField(Field ... | 3.26 |
flink_TypeExtractor_privateCreateTypeInfo_rdh | // for LambdaFunctions
private <IN1, IN2, OUT> TypeInformation<OUT> privateCreateTypeInfo(Type returnType,
TypeInformation<IN1> in1Type, TypeInformation<IN2> in2Type) {
List<Type> typeHierarchy = new ArrayList<>();
// get info from hierarchy
return createTypeInfoWithTypeHierarchy(typeHierarchy, returnType, ... | 3.26 |
flink_TypeExtractor_getForClass_rdh | /**
* Creates type information from a given Class such as Integer, String[] or POJOs.
*
* <p>This method does not support ParameterizedTypes such as Tuples or complex type
* hierarchies. In most cases {@link TypeExtractor#createTypeInfo(Type)} is the recommended
* method for type extraction (a Class is a child of ... | 3.26 |
flink_TypeExtractor_getClosestFactory_rdh | /**
* Traverses the type hierarchy up until a type information factory can be found.
*
* @param typeHierarchy
* hierarchy to be filled while traversing up
* @param t
* type for which a factory needs to be found
* @return closest type information factory or null if there is no factory in the type hierarchy
*... | 3.26 |
flink_TypeExtractor_isHadoopWritable_rdh | // ------------------------------------------------------------------------
// Utilities to handle Hadoop's 'Writable' type via reflection
// ------------------------------------------------------------------------
// visible for testing
static boolean isHadoopWritable(Class<?> typeClass) {
// check if this is dire... | 3.26 |
flink_TypeExtractor_getBinaryOperatorReturnType_rdh | /**
* Returns the binary operator's return type.
*
* <p>This method can extract a type in 4 different ways:
*
* <p>1. By using the generics of the base class like MyFunction<X, Y, Z, IN, OUT>. This is what
* outputTypeArgumentIndex (in this example "4") is good for.
*
* <p>2. By using input type inference SubMy... | 3.26 |
flink_TypeExtractor_createTypeInfoFromInput_rdh | /**
* Finds the type information to a type variable.
*
* <p>It solve the following:
*
* <p>Return the type information for "returnTypeVar" given that "inType" has type information
* "inTypeInfo". Thus "inType" must contain "returnTypeVar" in a "inputTypeHierarchy", otherwise
* null is returned.
*/
private <IN1>... | 3.26 |
flink_TypeExtractor_validateInputType_rdh | // --------------------------------------------------------------------------------------------
// Validate input
// --------------------------------------------------------------------------------------------
... | 3.26 |
flink_TypeExtractor_countTypeInHierarchy_rdh | /**
*
* @return number of items with equal type or same raw type
*/
private static int countTypeInHierarchy(List<Type> typeHierarchy, ... | 3.26 |
flink_Schema_fromColumns_rdh | /**
* Adopts all columns from the given list.
*/
public Builder fromColumns(List<UnresolvedColumn> unresolvedColumns) {
columns.addAll(unresolvedColumns);
return this;
} | 3.26 |
flink_Schema_columnByMetadata_rdh | /**
* Declares a metadata column that is appended to this schema.
*
* <p>Metadata columns allow to access connector and/or format specific fields for every row
* of a table. For example, a metadata column can be used to read and write the timestamp
* from and to Kafka records for time-based operations. The connect... | 3.26 |
flink_Schema_fromRowDataType_rdh | /**
* Adopts all fields of the given row as physical columns of the schema.
*/
public Builder fromRowDataType(DataType dataType) {
Preconditions.checkNotNull(dataType, "Data type must not be null.");
Preconditions.checkArgument(dataType.getLogicalType().is(LogicalTypeRoot.ROW), "Data type of ROW expected.");
... | 3.26 |
flink_Schema_build_rdh | /**
* Returns an instance of an unresolved {@link Schema}.
*/
public Schema build() {
return new Schema(columns, watermarkSpecs, primaryKey);
} | 3.26 |
flink_Schema_fromSchema_rdh | /**
* Adopts all members from the given unresolved schema.
*/
public Builder fromSchema(Schema unresolvedSchema) {
columns.addAll(unresolvedSchema.columns); watermarkSpecs.addAll(unresolvedSchema.watermarkSpecs);
if (unresolvedSchema.primaryKey != null) {
primaryKeyNamed(unresolvedSchema.primaryKey.ge... | 3.26 |
flink_Schema_resolve_rdh | /**
* Resolves the given {@link Schema} to a validated {@link ResolvedSchema}.
*/
public ResolvedSchema resolve(SchemaResolver resolver) {
return resolver.resolve(this);
} | 3.26 |
flink_Schema_addResolvedColumns_rdh | // ----------------------------------------------------------------------------------------
private void addResolvedColumns(List<Column> columns) {
columns.forEach(c -> {
if (c instanceof PhysicalColumn) {
final PhysicalColumn v5
= ((PhysicalColumn) (c));
column(v5.getName(), v5.getDataType... | 3.26 |
flink_Schema_derived_rdh | /**
* Convenience method for stating explicitly that a schema is empty and should be fully derived
* by the framework.
*
* <p>The semantics are equivalent to calling {@code Schema.newBuilder().build()}.
*
* <p>Note that derivation depends on the context. Usually, the method that accepts a {@link Schema} instance ... | 3.26 |
flink_Schema_fromFields_rdh | /**
* Adopts the given field names and field data types as physical columns of the schema.
*/
public Builder fromFields(List<String> fieldNames, List<? extends AbstractDataType<?>> fieldDataTypes) {
Preconditions.checkNotNull(fieldNames, "Field names must not be null.");
Preconditions.checkNotNull(fieldDataT... | 3.26 |
flink_Schema_columnByExpression_rdh | /**
* Declares a computed column that is appended to this schema.
*
* <p>See {@link #columnByExpression(String, Expression)} for a detailed explanation.
*
* <p>This method uses a SQL expression that can be easily persisted in a durable catalog.
*
* <p>Example: {@code .columnByExpression("ts", "CAST(json_obj.ts A... | 3.26 |
flink_Schema_fromResolvedSchema_rdh | /**
* Adopts all members from the given resolved schema.
*/
public Builder fromResolvedSchema(ResolvedSchema resolvedSchema) {
addResolvedColumns(resolvedSchema.getColumns());
addResolvedWatermarkSpec(resolvedSchema.getWatermarkSpecs());
resolvedSchema.getPrimaryKey().ifPresent(this::addResolvedConstrai... | 3.26 |
flink_Schema_column_rdh | /**
* Declares a physical column that is appended to this schema.
*
* <p>See {@link #column(String, AbstractDataType)} for a detailed explanation.
*
* <p>This method uses a type string that can be easily persisted in a durable catalog.
*
* @param columnName
* column name
* @param serializableTypeString
* ... | 3.26 |
flink_Schema_watermark_rdh | /**
* Declares that the given column should serve as an event-time (i.e. rowtime) attribute and
* specifies a corresponding watermark strategy as an expression.
*
* <p>See {@link #watermark(String, Expression)} for a detailed explanation.
*
* <p>This method uses a SQL expression that can be easily persisted in a ... | 3.26 |
flink_Schema_withComment_rdh | /**
* Apply comment to the previous column.
*/
public Builder withComment(@Nullable
String comment) {
if (columns.size() > 0) {
columns.set(columns.size() - 1, columns.get(columns.size() - 1).withComment(comment));
} else {
throw new IllegalArgumentException("Metho... | 3.26 |
flink_Schema_newBuilder_rdh | /**
* Builder for configuring and creating instances of {@link Schema}.
*/
public static Schema.Builder newBuilder() {
return new Builder();
} | 3.26 |
flink_Schema_primaryKeyNamed_rdh | /**
* Declares a primary key constraint for a set of given columns. Primary key uniquely
* identify a row in a table. Neither of columns in a primary can be nullable. The primary
* key is informational only. It will not be enforced. It can be used for optimizations. It
* is the data owner's responsibility to ensure... | 3.26 |
flink_LineBreakElement_linebreak_rdh | /**
* Creates a line break in the description.
*/
public static LineBreakElement linebreak() {
return new LineBreakElement();
} | 3.26 |
flink_StreamGraphGenerator_determineSlotSharingGroup_rdh | /**
* Determines the slot sharing group for an operation based on the slot sharing group set by the
* user and the slot sharing groups of the inputs.
*
* <p>If the user specifies a group name, this is taken as is. If nothing is specified and the
* input operations all have the same group name then this name is tak... | 3.26 |
flink_StreamGraphGenerator_transformFeedback_rdh | /**
* Transforms a {@code FeedbackTransformation}.
*
* <p>This will recursively transform the input and the feedback edges. We return the
* concatenation of the input IDs and the feedback IDs so that downstream operations can be
* wired to both.
*
* <p>This is responsible for creating the IterationSource and Ite... | 3.26 |
flink_StreamGraphGenerator_setSlotSharingGroupResource_rdh | /**
* Specify fine-grained resource requirements for slot sharing groups.
*
* <p>Note that a slot sharing group hints the scheduler that the grouped operators CAN be
* deployed into a shared slot. There's no guarantee that the scheduler always deploy the
* grouped operators together. In cases grouped operators are... | 3.26 |
flink_StreamGraphGenerator_transformCoFeedback_rdh | /**
* Transforms a {@code CoFeedbackTransformation}.
*
* <p>This will only transform feedback edges, the result of this transform will be wired to the
* second input of a Co-Transform. The original input is wired directly to the first input of
* the downstream Co-Transform.
*
* <p>This is responsible for creatin... | 3.26 |
flink_FileSystemTableFactory_validateTimeZone_rdh | /**
* Similar logic as for {@link TableConfig}.
*/
private void validateTimeZone(String zone) {
boolean isValid;
try {
// We enforce a zone string that is compatible with both java.util.TimeZone and
// java.time.ZoneId to avoid bugs.
// In general, advertising either TZDB ID, GMT+xx:xx... | 3.26 |
flink_FileSystemTableFactory_formatFactoryExists_rdh | /**
* Returns true if the format factory can be found using the given factory base class and
* identifier.
*/
private boolean formatFactoryExists(Context context, Class<?> factoryClass) {
Configuration options = Configuration.fromMap(context.getCatalogTable().getOptions());
String identifier = options.get(F... | 3.26 |
flink_PartitionTimeCommitPredicate_watermarkHasPassedWithDelay_rdh | /**
* Returns the watermark has passed the partition time or not, if true means it's time to commit
* the partition.
*/
private boolean watermarkHasPassedWithDelay(long watermark, LocalDateTime partitionTime, long commitDelay) {// here we don't parse the long watermark to TIMESTAMP and then comparison,
// but pa... | 3.26 |
flink_SubtaskGatewayImpl_tryCloseGateway_rdh | /**
* Closes the gateway. All events sent through this gateway are blocked until the gateway is
* re-opened. If the gateway is already closed, this does nothing.
*
* @return True if the gateway is closed, false if the checkpointId is incorrect.
*/
boolean tryCloseGateway(long checkpointId) {
checkRunsInMainThr... | 3.26 |
flink_SubtaskGatewayImpl_markForCheckpoint_rdh | /**
* Marks the gateway for the next checkpoint. This remembers the checkpoint ID and will only
* allow closing the gateway for this specific checkpoint.
*
* <p>This is the gateway's mechanism to detect situations where multiple coordinator
* checkpoints would be attempted overlapping, which is currently not suppo... | 3.26 |
flink_SubtaskGatewayImpl_openGatewayAndUnmarkAllCheckpoint_rdh | /**
* Opens the gateway, releasing all buffered events.
*/
void openGatewayAndUnmarkAllCheckpoint() {
checkRunsInMainThread();
for (List<BlockedEvent> blockedEvents : blockedEventsMap.values()) {
for (BlockedEvent blockedEvent : blockedEvents) {
callSendAction(blockedEvent.sendAction, blo... | 3.26 |
flink_OptionalUtils_stream_rdh | /**
* Converts the given {@link Optional} into a {@link Stream}.
*
* <p>This is akin to {@code Optional#stream} available in JDK9+.
*/
@SuppressWarnings("OptionalUsedAsFieldOrParameterType")
public static <T> Stream<T> stream(Optional<T> opt) {
return opt.map(Stream::of).orElseGet(Stream::empty);
} | 3.26 |
flink_OptionalUtils_firstPresent_rdh | /**
* Returns the first {@link Optional} which is present.
*/
@SafeVarargs
public static <T> Optional<T> firstPresent(Optional<T>... opts) {
for (Optional<T> opt : opts) {if
(opt.isPresent()) {
return opt;
}
}
return Optional.empty();
} | 3.26 |
flink_AbstractBlockResettableIterator_writeNextRecord_rdh | // --------------------------------------------------------------------------------------------
protected boolean writeNextRecord(T record) throws IOException {
try {
this.serializer.serialize(record, this.collectingView);
this.numRecordsInBuffer++;
return true;
} catch (EOFException eof... | 3.26 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.