id
int32
0
165k
repo
stringlengths
7
58
path
stringlengths
12
218
func_name
stringlengths
3
140
original_string
stringlengths
73
34.1k
language
stringclasses
1 value
code
stringlengths
73
34.1k
code_tokens
list
docstring
stringlengths
3
16k
docstring_tokens
list
sha
stringlengths
40
40
url
stringlengths
105
339
123,100
apache/flink
flink-streaming-java/src/main/java/org/apache/flink/streaming/api/datastream/DataStreamUtils.java
DataStreamUtils.collect
public static <OUT> Iterator<OUT> collect(DataStream<OUT> stream) throws IOException { TypeSerializer<OUT> serializer = stream.getType().createSerializer( stream.getExecutionEnvironment().getConfig()); SocketStreamIterator<OUT> iter = new SocketStreamIterator<OUT>(serializer); //Find out what IP of us shou...
java
public static <OUT> Iterator<OUT> collect(DataStream<OUT> stream) throws IOException { TypeSerializer<OUT> serializer = stream.getType().createSerializer( stream.getExecutionEnvironment().getConfig()); SocketStreamIterator<OUT> iter = new SocketStreamIterator<OUT>(serializer); //Find out what IP of us shou...
[ "public", "static", "<", "OUT", ">", "Iterator", "<", "OUT", ">", "collect", "(", "DataStream", "<", "OUT", ">", "stream", ")", "throws", "IOException", "{", "TypeSerializer", "<", "OUT", ">", "serializer", "=", "stream", ".", "getType", "(", ")", ".", ...
Returns an iterator to iterate over the elements of the DataStream. @return The iterator
[ "Returns", "an", "iterator", "to", "iterate", "over", "the", "elements", "of", "the", "DataStream", "." ]
b62db93bf63cb3bb34dd03d611a779d9e3fc61ac
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-streaming-java/src/main/java/org/apache/flink/streaming/api/datastream/DataStreamUtils.java#L50-L88
123,101
apache/flink
flink-table/flink-sql-client/src/main/java/org/apache/flink/table/client/config/entries/DeploymentEntry.java
DeploymentEntry.getCommandLine
public CommandLine getCommandLine(Options commandLineOptions) throws Exception { final List<String> args = new ArrayList<>(); properties.asMap().forEach((k, v) -> { // only add supported options if (commandLineOptions.hasOption(k)) { final Option o = commandLineOptions.getOption(k); final String argu...
java
public CommandLine getCommandLine(Options commandLineOptions) throws Exception { final List<String> args = new ArrayList<>(); properties.asMap().forEach((k, v) -> { // only add supported options if (commandLineOptions.hasOption(k)) { final Option o = commandLineOptions.getOption(k); final String argu...
[ "public", "CommandLine", "getCommandLine", "(", "Options", "commandLineOptions", ")", "throws", "Exception", "{", "final", "List", "<", "String", ">", "args", "=", "new", "ArrayList", "<>", "(", ")", ";", "properties", ".", "asMap", "(", ")", ".", "forEach",...
Parses the given command line options from the deployment properties. Ignores properties that are not defined by options.
[ "Parses", "the", "given", "command", "line", "options", "from", "the", "deployment", "properties", ".", "Ignores", "properties", "that", "are", "not", "defined", "by", "options", "." ]
b62db93bf63cb3bb34dd03d611a779d9e3fc61ac
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-table/flink-sql-client/src/main/java/org/apache/flink/table/client/config/entries/DeploymentEntry.java#L89-L118
123,102
apache/flink
flink-table/flink-sql-client/src/main/java/org/apache/flink/table/client/config/entries/DeploymentEntry.java
DeploymentEntry.merge
public static DeploymentEntry merge(DeploymentEntry deployment1, DeploymentEntry deployment2) { final Map<String, String> mergedProperties = new HashMap<>(deployment1.asMap()); mergedProperties.putAll(deployment2.asMap()); final DescriptorProperties properties = new DescriptorProperties(true); properties.putPr...
java
public static DeploymentEntry merge(DeploymentEntry deployment1, DeploymentEntry deployment2) { final Map<String, String> mergedProperties = new HashMap<>(deployment1.asMap()); mergedProperties.putAll(deployment2.asMap()); final DescriptorProperties properties = new DescriptorProperties(true); properties.putPr...
[ "public", "static", "DeploymentEntry", "merge", "(", "DeploymentEntry", "deployment1", ",", "DeploymentEntry", "deployment2", ")", "{", "final", "Map", "<", "String", ",", "String", ">", "mergedProperties", "=", "new", "HashMap", "<>", "(", "deployment1", ".", "...
Merges two deployments entries. The properties of the first deployment entry might be overwritten by the second one.
[ "Merges", "two", "deployments", "entries", ".", "The", "properties", "of", "the", "first", "deployment", "entry", "might", "be", "overwritten", "by", "the", "second", "one", "." ]
b62db93bf63cb3bb34dd03d611a779d9e3fc61ac
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-table/flink-sql-client/src/main/java/org/apache/flink/table/client/config/entries/DeploymentEntry.java#L139-L147
123,103
apache/flink
flink-runtime/src/main/java/org/apache/flink/runtime/taskexecutor/TaskManagerRunner.java
TaskManagerRunner.createRpcService
public static RpcService createRpcService( final Configuration configuration, final HighAvailabilityServices haServices) throws Exception { checkNotNull(configuration); checkNotNull(haServices); final String taskManagerAddress = determineTaskManagerBindAddress(configuration, haServices); final String po...
java
public static RpcService createRpcService( final Configuration configuration, final HighAvailabilityServices haServices) throws Exception { checkNotNull(configuration); checkNotNull(haServices); final String taskManagerAddress = determineTaskManagerBindAddress(configuration, haServices); final String po...
[ "public", "static", "RpcService", "createRpcService", "(", "final", "Configuration", "configuration", ",", "final", "HighAvailabilityServices", "haServices", ")", "throws", "Exception", "{", "checkNotNull", "(", "configuration", ")", ";", "checkNotNull", "(", "haService...
Create a RPC service for the task manager. @param configuration The configuration for the TaskManager. @param haServices to use for the task manager hostname retrieval
[ "Create", "a", "RPC", "service", "for", "the", "task", "manager", "." ]
b62db93bf63cb3bb34dd03d611a779d9e3fc61ac
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/taskexecutor/TaskManagerRunner.java#L397-L408
123,104
apache/flink
flink-runtime/src/main/java/org/apache/flink/runtime/io/network/partition/ResultPartitionMetrics.java
ResultPartitionMetrics.refreshAndGetTotal
long refreshAndGetTotal() { long total = 0; for (ResultSubpartition part : partition.getAllPartitions()) { total += part.unsynchronizedGetNumberOfQueuedBuffers(); } return total; }
java
long refreshAndGetTotal() { long total = 0; for (ResultSubpartition part : partition.getAllPartitions()) { total += part.unsynchronizedGetNumberOfQueuedBuffers(); } return total; }
[ "long", "refreshAndGetTotal", "(", ")", "{", "long", "total", "=", "0", ";", "for", "(", "ResultSubpartition", "part", ":", "partition", ".", "getAllPartitions", "(", ")", ")", "{", "total", "+=", "part", ".", "unsynchronizedGetNumberOfQueuedBuffers", "(", ")"...
Iterates over all sub-partitions and collects the total number of queued buffers in a best-effort way. @return total number of queued buffers
[ "Iterates", "over", "all", "sub", "-", "partitions", "and", "collects", "the", "total", "number", "of", "queued", "buffers", "in", "a", "best", "-", "effort", "way", "." ]
b62db93bf63cb3bb34dd03d611a779d9e3fc61ac
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/io/network/partition/ResultPartitionMetrics.java#L49-L57
123,105
apache/flink
flink-runtime/src/main/java/org/apache/flink/runtime/io/network/partition/ResultPartitionMetrics.java
ResultPartitionMetrics.refreshAndGetMin
int refreshAndGetMin() { int min = Integer.MAX_VALUE; ResultSubpartition[] allPartitions = partition.getAllPartitions(); if (allPartitions.length == 0) { // meaningful value when no channels exist: return 0; } for (ResultSubpartition part : allPartitions) { int size = part.unsynchronizedGetNumberOf...
java
int refreshAndGetMin() { int min = Integer.MAX_VALUE; ResultSubpartition[] allPartitions = partition.getAllPartitions(); if (allPartitions.length == 0) { // meaningful value when no channels exist: return 0; } for (ResultSubpartition part : allPartitions) { int size = part.unsynchronizedGetNumberOf...
[ "int", "refreshAndGetMin", "(", ")", "{", "int", "min", "=", "Integer", ".", "MAX_VALUE", ";", "ResultSubpartition", "[", "]", "allPartitions", "=", "partition", ".", "getAllPartitions", "(", ")", ";", "if", "(", "allPartitions", ".", "length", "==", "0", ...
Iterates over all sub-partitions and collects the minimum number of queued buffers in a sub-partition in a best-effort way. @return minimum number of queued buffers per sub-partition (<tt>0</tt> if sub-partitions exist)
[ "Iterates", "over", "all", "sub", "-", "partitions", "and", "collects", "the", "minimum", "number", "of", "queued", "buffers", "in", "a", "sub", "-", "partition", "in", "a", "best", "-", "effort", "way", "." ]
b62db93bf63cb3bb34dd03d611a779d9e3fc61ac
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/io/network/partition/ResultPartitionMetrics.java#L65-L80
123,106
apache/flink
flink-runtime/src/main/java/org/apache/flink/runtime/io/network/partition/ResultPartitionMetrics.java
ResultPartitionMetrics.refreshAndGetMax
int refreshAndGetMax() { int max = 0; for (ResultSubpartition part : partition.getAllPartitions()) { int size = part.unsynchronizedGetNumberOfQueuedBuffers(); max = Math.max(max, size); } return max; }
java
int refreshAndGetMax() { int max = 0; for (ResultSubpartition part : partition.getAllPartitions()) { int size = part.unsynchronizedGetNumberOfQueuedBuffers(); max = Math.max(max, size); } return max; }
[ "int", "refreshAndGetMax", "(", ")", "{", "int", "max", "=", "0", ";", "for", "(", "ResultSubpartition", "part", ":", "partition", ".", "getAllPartitions", "(", ")", ")", "{", "int", "size", "=", "part", ".", "unsynchronizedGetNumberOfQueuedBuffers", "(", ")...
Iterates over all sub-partitions and collects the maximum number of queued buffers in a sub-partition in a best-effort way. @return maximum number of queued buffers per sub-partition
[ "Iterates", "over", "all", "sub", "-", "partitions", "and", "collects", "the", "maximum", "number", "of", "queued", "buffers", "in", "a", "sub", "-", "partition", "in", "a", "best", "-", "effort", "way", "." ]
b62db93bf63cb3bb34dd03d611a779d9e3fc61ac
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/io/network/partition/ResultPartitionMetrics.java#L88-L97
123,107
apache/flink
flink-runtime/src/main/java/org/apache/flink/runtime/io/network/partition/ResultPartitionMetrics.java
ResultPartitionMetrics.refreshAndGetAvg
float refreshAndGetAvg() { long total = 0; ResultSubpartition[] allPartitions = partition.getAllPartitions(); for (ResultSubpartition part : allPartitions) { int size = part.unsynchronizedGetNumberOfQueuedBuffers(); total += size; } return total / (float) allPartitions.length; }
java
float refreshAndGetAvg() { long total = 0; ResultSubpartition[] allPartitions = partition.getAllPartitions(); for (ResultSubpartition part : allPartitions) { int size = part.unsynchronizedGetNumberOfQueuedBuffers(); total += size; } return total / (float) allPartitions.length; }
[ "float", "refreshAndGetAvg", "(", ")", "{", "long", "total", "=", "0", ";", "ResultSubpartition", "[", "]", "allPartitions", "=", "partition", ".", "getAllPartitions", "(", ")", ";", "for", "(", "ResultSubpartition", "part", ":", "allPartitions", ")", "{", "...
Iterates over all sub-partitions and collects the average number of queued buffers in a sub-partition in a best-effort way. @return average number of queued buffers per sub-partition
[ "Iterates", "over", "all", "sub", "-", "partitions", "and", "collects", "the", "average", "number", "of", "queued", "buffers", "in", "a", "sub", "-", "partition", "in", "a", "best", "-", "effort", "way", "." ]
b62db93bf63cb3bb34dd03d611a779d9e3fc61ac
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/io/network/partition/ResultPartitionMetrics.java#L105-L115
123,108
apache/flink
flink-mesos/src/main/java/org/apache/flink/mesos/util/MesosArtifactServer.java
MesosArtifactServer.addFile
public synchronized URL addFile(File localFile, String remoteFile) throws IOException, MalformedURLException { return addPath(new Path(localFile.toURI()), new Path(remoteFile)); }
java
public synchronized URL addFile(File localFile, String remoteFile) throws IOException, MalformedURLException { return addPath(new Path(localFile.toURI()), new Path(remoteFile)); }
[ "public", "synchronized", "URL", "addFile", "(", "File", "localFile", ",", "String", "remoteFile", ")", "throws", "IOException", ",", "MalformedURLException", "{", "return", "addPath", "(", "new", "Path", "(", "localFile", ".", "toURI", "(", ")", ")", ",", "...
Adds a file to the artifact server. @param localFile the local file to serve. @param remoteFile the remote path with which to locate the file. @return the fully-qualified remote path to the file. @throws MalformedURLException if the remote path is invalid.
[ "Adds", "a", "file", "to", "the", "artifact", "server", "." ]
b62db93bf63cb3bb34dd03d611a779d9e3fc61ac
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-mesos/src/main/java/org/apache/flink/mesos/util/MesosArtifactServer.java#L198-L200
123,109
apache/flink
flink-mesos/src/main/java/org/apache/flink/mesos/util/MesosArtifactServer.java
MesosArtifactServer.addPath
public synchronized URL addPath(Path path, Path remoteFile) throws IOException, MalformedURLException { if (paths.containsKey(remoteFile)) { throw new IllegalArgumentException("duplicate path registered"); } if (remoteFile.isAbsolute()) { throw new IllegalArgumentException("not expecting an absolute path");...
java
public synchronized URL addPath(Path path, Path remoteFile) throws IOException, MalformedURLException { if (paths.containsKey(remoteFile)) { throw new IllegalArgumentException("duplicate path registered"); } if (remoteFile.isAbsolute()) { throw new IllegalArgumentException("not expecting an absolute path");...
[ "public", "synchronized", "URL", "addPath", "(", "Path", "path", ",", "Path", "remoteFile", ")", "throws", "IOException", ",", "MalformedURLException", "{", "if", "(", "paths", ".", "containsKey", "(", "remoteFile", ")", ")", "{", "throw", "new", "IllegalArgum...
Adds a path to the artifact server. @param path the qualified FS path to serve (local, hdfs, etc). @param remoteFile the remote path with which to locate the file. @return the fully-qualified remote path to the file. @throws MalformedURLException if the remote path is invalid.
[ "Adds", "a", "path", "to", "the", "artifact", "server", "." ]
b62db93bf63cb3bb34dd03d611a779d9e3fc61ac
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-mesos/src/main/java/org/apache/flink/mesos/util/MesosArtifactServer.java#L209-L222
123,110
apache/flink
flink-mesos/src/main/java/org/apache/flink/mesos/util/MesosArtifactServer.java
MesosArtifactServer.stop
public synchronized void stop() throws Exception { if (this.serverChannel != null) { this.serverChannel.close().awaitUninterruptibly(); this.serverChannel = null; } if (bootstrap != null) { if (bootstrap.group() != null) { bootstrap.group().shutdownGracefully(); } bootstrap = null; } }
java
public synchronized void stop() throws Exception { if (this.serverChannel != null) { this.serverChannel.close().awaitUninterruptibly(); this.serverChannel = null; } if (bootstrap != null) { if (bootstrap.group() != null) { bootstrap.group().shutdownGracefully(); } bootstrap = null; } }
[ "public", "synchronized", "void", "stop", "(", ")", "throws", "Exception", "{", "if", "(", "this", ".", "serverChannel", "!=", "null", ")", "{", "this", ".", "serverChannel", ".", "close", "(", ")", ".", "awaitUninterruptibly", "(", ")", ";", "this", "."...
Stops the artifact server. @throws Exception
[ "Stops", "the", "artifact", "server", "." ]
b62db93bf63cb3bb34dd03d611a779d9e3fc61ac
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-mesos/src/main/java/org/apache/flink/mesos/util/MesosArtifactServer.java#L246-L257
123,111
apache/flink
flink-runtime/src/main/java/org/apache/flink/runtime/rpc/akka/AkkaInvocationHandler.java
AkkaInvocationHandler.invokeRpc
private Object invokeRpc(Method method, Object[] args) throws Exception { String methodName = method.getName(); Class<?>[] parameterTypes = method.getParameterTypes(); Annotation[][] parameterAnnotations = method.getParameterAnnotations(); Time futureTimeout = extractRpcTimeout(parameterAnnotations, args, timeo...
java
private Object invokeRpc(Method method, Object[] args) throws Exception { String methodName = method.getName(); Class<?>[] parameterTypes = method.getParameterTypes(); Annotation[][] parameterAnnotations = method.getParameterAnnotations(); Time futureTimeout = extractRpcTimeout(parameterAnnotations, args, timeo...
[ "private", "Object", "invokeRpc", "(", "Method", "method", ",", "Object", "[", "]", "args", ")", "throws", "Exception", "{", "String", "methodName", "=", "method", ".", "getName", "(", ")", ";", "Class", "<", "?", ">", "[", "]", "parameterTypes", "=", ...
Invokes a RPC method by sending the RPC invocation details to the rpc endpoint. @param method to call @param args of the method call @return result of the RPC @throws Exception if the RPC invocation fails
[ "Invokes", "a", "RPC", "method", "by", "sending", "the", "RPC", "invocation", "details", "to", "the", "rpc", "endpoint", "." ]
b62db93bf63cb3bb34dd03d611a779d9e3fc61ac
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/rpc/akka/AkkaInvocationHandler.java#L194-L240
123,112
apache/flink
flink-runtime/src/main/java/org/apache/flink/runtime/rpc/akka/AkkaInvocationHandler.java
AkkaInvocationHandler.createRpcInvocationMessage
protected RpcInvocation createRpcInvocationMessage( final String methodName, final Class<?>[] parameterTypes, final Object[] args) throws IOException { final RpcInvocation rpcInvocation; if (isLocal) { rpcInvocation = new LocalRpcInvocation( methodName, parameterTypes, args); } else { ...
java
protected RpcInvocation createRpcInvocationMessage( final String methodName, final Class<?>[] parameterTypes, final Object[] args) throws IOException { final RpcInvocation rpcInvocation; if (isLocal) { rpcInvocation = new LocalRpcInvocation( methodName, parameterTypes, args); } else { ...
[ "protected", "RpcInvocation", "createRpcInvocationMessage", "(", "final", "String", "methodName", ",", "final", "Class", "<", "?", ">", "[", "]", "parameterTypes", ",", "final", "Object", "[", "]", "args", ")", "throws", "IOException", "{", "final", "RpcInvocati...
Create the RpcInvocation message for the given RPC. @param methodName of the RPC @param parameterTypes of the RPC @param args of the RPC @return RpcInvocation message which encapsulates the RPC details @throws IOException if we cannot serialize the RPC invocation parameters
[ "Create", "the", "RpcInvocation", "message", "for", "the", "given", "RPC", "." ]
b62db93bf63cb3bb34dd03d611a779d9e3fc61ac
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/rpc/akka/AkkaInvocationHandler.java#L251-L281
123,113
apache/flink
flink-runtime/src/main/java/org/apache/flink/runtime/rpc/akka/AkkaInvocationHandler.java
AkkaInvocationHandler.ask
protected CompletableFuture<?> ask(Object message, Time timeout) { return FutureUtils.toJava( Patterns.ask(rpcEndpoint, message, timeout.toMilliseconds())); }
java
protected CompletableFuture<?> ask(Object message, Time timeout) { return FutureUtils.toJava( Patterns.ask(rpcEndpoint, message, timeout.toMilliseconds())); }
[ "protected", "CompletableFuture", "<", "?", ">", "ask", "(", "Object", "message", ",", "Time", "timeout", ")", "{", "return", "FutureUtils", ".", "toJava", "(", "Patterns", ".", "ask", "(", "rpcEndpoint", ",", "message", ",", "timeout", ".", "toMilliseconds"...
Sends the message to the RPC endpoint and returns a future containing its response. @param message to send to the RPC endpoint @param timeout time to wait until the response future is failed with a {@link TimeoutException} @return Response future
[ "Sends", "the", "message", "to", "the", "RPC", "endpoint", "and", "returns", "a", "future", "containing", "its", "response", "." ]
b62db93bf63cb3bb34dd03d611a779d9e3fc61ac
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/rpc/akka/AkkaInvocationHandler.java#L351-L354
123,114
apache/flink
flink-runtime/src/main/java/org/apache/flink/runtime/state/SharedStateRegistry.java
SharedStateRegistry.unregisterReference
public Result unregisterReference(SharedStateRegistryKey registrationKey) { Preconditions.checkNotNull(registrationKey); final Result result; final StreamStateHandle scheduledStateDeletion; SharedStateRegistry.SharedStateEntry entry; synchronized (registeredStates) { entry = registeredStates.get(regist...
java
public Result unregisterReference(SharedStateRegistryKey registrationKey) { Preconditions.checkNotNull(registrationKey); final Result result; final StreamStateHandle scheduledStateDeletion; SharedStateRegistry.SharedStateEntry entry; synchronized (registeredStates) { entry = registeredStates.get(regist...
[ "public", "Result", "unregisterReference", "(", "SharedStateRegistryKey", "registrationKey", ")", "{", "Preconditions", ".", "checkNotNull", "(", "registrationKey", ")", ";", "final", "Result", "result", ";", "final", "StreamStateHandle", "scheduledStateDeletion", ";", ...
Releases one reference to the given shared state in the registry. This decreases the reference count by one. Once the count reaches zero, the shared state is deleted. @param registrationKey the shared state for which we release a reference. @return the result of the request, consisting of the reference count after thi...
[ "Releases", "one", "reference", "to", "the", "given", "shared", "state", "in", "the", "registry", ".", "This", "decreases", "the", "reference", "count", "by", "one", ".", "Once", "the", "count", "reaches", "zero", "the", "shared", "state", "is", "deleted", ...
b62db93bf63cb3bb34dd03d611a779d9e3fc61ac
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/state/SharedStateRegistry.java#L134-L165
123,115
apache/flink
flink-runtime/src/main/java/org/apache/flink/runtime/state/SharedStateRegistry.java
SharedStateRegistry.registerAll
public void registerAll(Iterable<? extends CompositeStateHandle> stateHandles) { if (stateHandles == null) { return; } synchronized (registeredStates) { for (CompositeStateHandle stateHandle : stateHandles) { stateHandle.registerSharedStates(this); } } }
java
public void registerAll(Iterable<? extends CompositeStateHandle> stateHandles) { if (stateHandles == null) { return; } synchronized (registeredStates) { for (CompositeStateHandle stateHandle : stateHandles) { stateHandle.registerSharedStates(this); } } }
[ "public", "void", "registerAll", "(", "Iterable", "<", "?", "extends", "CompositeStateHandle", ">", "stateHandles", ")", "{", "if", "(", "stateHandles", "==", "null", ")", "{", "return", ";", "}", "synchronized", "(", "registeredStates", ")", "{", "for", "("...
Register given shared states in the registry. @param stateHandles The shared states to register.
[ "Register", "given", "shared", "states", "in", "the", "registry", "." ]
b62db93bf63cb3bb34dd03d611a779d9e3fc61ac
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/state/SharedStateRegistry.java#L172-L183
123,116
apache/flink
flink-runtime/src/main/java/org/apache/flink/runtime/checkpoint/PendingCheckpoint.java
PendingCheckpoint.setCancellerHandle
public boolean setCancellerHandle(ScheduledFuture<?> cancellerHandle) { synchronized (lock) { if (this.cancellerHandle == null) { if (!discarded) { this.cancellerHandle = cancellerHandle; return true; } else { return false; } } else { throw new IllegalStateException("A cancelle...
java
public boolean setCancellerHandle(ScheduledFuture<?> cancellerHandle) { synchronized (lock) { if (this.cancellerHandle == null) { if (!discarded) { this.cancellerHandle = cancellerHandle; return true; } else { return false; } } else { throw new IllegalStateException("A cancelle...
[ "public", "boolean", "setCancellerHandle", "(", "ScheduledFuture", "<", "?", ">", "cancellerHandle", ")", "{", "synchronized", "(", "lock", ")", "{", "if", "(", "this", ".", "cancellerHandle", "==", "null", ")", "{", "if", "(", "!", "discarded", ")", "{", ...
Sets the handle for the canceller to this pending checkpoint. This method fails with an exception if a handle has already been set. @return true, if the handle was set, false, if the checkpoint is already disposed;
[ "Sets", "the", "handle", "for", "the", "canceller", "to", "this", "pending", "checkpoint", ".", "This", "method", "fails", "with", "an", "exception", "if", "a", "handle", "has", "already", "been", "set", "." ]
b62db93bf63cb3bb34dd03d611a779d9e3fc61ac
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/checkpoint/PendingCheckpoint.java#L218-L232
123,117
apache/flink
flink-runtime/src/main/java/org/apache/flink/runtime/checkpoint/PendingCheckpoint.java
PendingCheckpoint.acknowledgeTask
public TaskAcknowledgeResult acknowledgeTask( ExecutionAttemptID executionAttemptId, TaskStateSnapshot operatorSubtaskStates, CheckpointMetrics metrics) { synchronized (lock) { if (discarded) { return TaskAcknowledgeResult.DISCARDED; } final ExecutionVertex vertex = notYetAcknowledgedTasks.rem...
java
public TaskAcknowledgeResult acknowledgeTask( ExecutionAttemptID executionAttemptId, TaskStateSnapshot operatorSubtaskStates, CheckpointMetrics metrics) { synchronized (lock) { if (discarded) { return TaskAcknowledgeResult.DISCARDED; } final ExecutionVertex vertex = notYetAcknowledgedTasks.rem...
[ "public", "TaskAcknowledgeResult", "acknowledgeTask", "(", "ExecutionAttemptID", "executionAttemptId", ",", "TaskStateSnapshot", "operatorSubtaskStates", ",", "CheckpointMetrics", "metrics", ")", "{", "synchronized", "(", "lock", ")", "{", "if", "(", "discarded", ")", "...
Acknowledges the task with the given execution attempt id and the given subtask state. @param executionAttemptId of the acknowledged task @param operatorSubtaskStates of the acknowledged task @param metrics Checkpoint metrics for the stats @return TaskAcknowledgeResult of the operation
[ "Acknowledges", "the", "task", "with", "the", "given", "execution", "attempt", "id", "and", "the", "given", "subtask", "state", "." ]
b62db93bf63cb3bb34dd03d611a779d9e3fc61ac
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/checkpoint/PendingCheckpoint.java#L306-L383
123,118
apache/flink
flink-runtime/src/main/java/org/apache/flink/runtime/checkpoint/PendingCheckpoint.java
PendingCheckpoint.abort
public void abort(CheckpointFailureReason reason, Throwable cause) { try { CheckpointException exception = new CheckpointException(reason, cause); onCompletionPromise.completeExceptionally(exception); reportFailedCheckpoint(exception); assertAbortSubsumedForced(reason); } finally { dispose(true); }...
java
public void abort(CheckpointFailureReason reason, Throwable cause) { try { CheckpointException exception = new CheckpointException(reason, cause); onCompletionPromise.completeExceptionally(exception); reportFailedCheckpoint(exception); assertAbortSubsumedForced(reason); } finally { dispose(true); }...
[ "public", "void", "abort", "(", "CheckpointFailureReason", "reason", ",", "Throwable", "cause", ")", "{", "try", "{", "CheckpointException", "exception", "=", "new", "CheckpointException", "(", "reason", ",", "cause", ")", ";", "onCompletionPromise", ".", "complet...
Aborts a checkpoint with reason and cause.
[ "Aborts", "a", "checkpoint", "with", "reason", "and", "cause", "." ]
b62db93bf63cb3bb34dd03d611a779d9e3fc61ac
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/checkpoint/PendingCheckpoint.java#L409-L418
123,119
apache/flink
flink-runtime/src/main/java/org/apache/flink/runtime/checkpoint/PendingCheckpoint.java
PendingCheckpoint.reportFailedCheckpoint
private void reportFailedCheckpoint(Exception cause) { // to prevent null-pointers from concurrent modification, copy reference onto stack final PendingCheckpointStats statsCallback = this.statsCallback; if (statsCallback != null) { long failureTimestamp = System.currentTimeMillis(); statsCallback.reportFai...
java
private void reportFailedCheckpoint(Exception cause) { // to prevent null-pointers from concurrent modification, copy reference onto stack final PendingCheckpointStats statsCallback = this.statsCallback; if (statsCallback != null) { long failureTimestamp = System.currentTimeMillis(); statsCallback.reportFai...
[ "private", "void", "reportFailedCheckpoint", "(", "Exception", "cause", ")", "{", "// to prevent null-pointers from concurrent modification, copy reference onto stack", "final", "PendingCheckpointStats", "statsCallback", "=", "this", ".", "statsCallback", ";", "if", "(", "stats...
Reports a failed checkpoint with the given optional cause. @param cause The failure cause or <code>null</code>.
[ "Reports", "a", "failed", "checkpoint", "with", "the", "given", "optional", "cause", "." ]
b62db93bf63cb3bb34dd03d611a779d9e3fc61ac
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/checkpoint/PendingCheckpoint.java#L486-L493
123,120
apache/flink
flink-connectors/flink-orc/src/main/java/org/apache/flink/orc/OrcBatchReader.java
OrcBatchReader.schemaToTypeInfo
static TypeInformation schemaToTypeInfo(TypeDescription schema) { switch (schema.getCategory()) { case BOOLEAN: return BasicTypeInfo.BOOLEAN_TYPE_INFO; case BYTE: return BasicTypeInfo.BYTE_TYPE_INFO; case SHORT: return BasicTypeInfo.SHORT_TYPE_INFO; case INT: return BasicTypeInfo.INT_TYPE_...
java
static TypeInformation schemaToTypeInfo(TypeDescription schema) { switch (schema.getCategory()) { case BOOLEAN: return BasicTypeInfo.BOOLEAN_TYPE_INFO; case BYTE: return BasicTypeInfo.BYTE_TYPE_INFO; case SHORT: return BasicTypeInfo.SHORT_TYPE_INFO; case INT: return BasicTypeInfo.INT_TYPE_...
[ "static", "TypeInformation", "schemaToTypeInfo", "(", "TypeDescription", "schema", ")", "{", "switch", "(", "schema", ".", "getCategory", "(", ")", ")", "{", "case", "BOOLEAN", ":", "return", "BasicTypeInfo", ".", "BOOLEAN_TYPE_INFO", ";", "case", "BYTE", ":", ...
Converts an ORC schema to a Flink TypeInformation. @param schema The ORC schema. @return The TypeInformation that corresponds to the ORC schema.
[ "Converts", "an", "ORC", "schema", "to", "a", "Flink", "TypeInformation", "." ]
b62db93bf63cb3bb34dd03d611a779d9e3fc61ac
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-connectors/flink-orc/src/main/java/org/apache/flink/orc/OrcBatchReader.java#L72-L124
123,121
apache/flink
flink-connectors/flink-orc/src/main/java/org/apache/flink/orc/OrcBatchReader.java
OrcBatchReader.fillRows
static int fillRows(Row[] rows, TypeDescription schema, VectorizedRowBatch batch, int[] selectedFields) { int rowsToRead = Math.min((int) batch.count(), rows.length); List<TypeDescription> fieldTypes = schema.getChildren(); // read each selected field for (int fieldIdx = 0; fieldIdx < selectedFields.length; f...
java
static int fillRows(Row[] rows, TypeDescription schema, VectorizedRowBatch batch, int[] selectedFields) { int rowsToRead = Math.min((int) batch.count(), rows.length); List<TypeDescription> fieldTypes = schema.getChildren(); // read each selected field for (int fieldIdx = 0; fieldIdx < selectedFields.length; f...
[ "static", "int", "fillRows", "(", "Row", "[", "]", "rows", ",", "TypeDescription", "schema", ",", "VectorizedRowBatch", "batch", ",", "int", "[", "]", "selectedFields", ")", "{", "int", "rowsToRead", "=", "Math", ".", "min", "(", "(", "int", ")", "batch"...
Fills an ORC batch into an array of Row. @param rows The batch of rows need to be filled. @param schema The schema of the ORC data. @param batch The ORC data. @param selectedFields The list of selected ORC fields. @return The number of rows that were filled.
[ "Fills", "an", "ORC", "batch", "into", "an", "array", "of", "Row", "." ]
b62db93bf63cb3bb34dd03d611a779d9e3fc61ac
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-connectors/flink-orc/src/main/java/org/apache/flink/orc/OrcBatchReader.java#L135-L146
123,122
apache/flink
flink-connectors/flink-orc/src/main/java/org/apache/flink/orc/OrcBatchReader.java
OrcBatchReader.fillColumnWithRepeatingValue
private static void fillColumnWithRepeatingValue(Object[] vals, int fieldIdx, Object repeatingValue, int childCount) { if (fieldIdx == -1) { // set value as an object Arrays.fill(vals, 0, childCount, repeatingValue); } else { // set value as a field of Row Row[] rows = (Row[]) vals; for (int i = 0; ...
java
private static void fillColumnWithRepeatingValue(Object[] vals, int fieldIdx, Object repeatingValue, int childCount) { if (fieldIdx == -1) { // set value as an object Arrays.fill(vals, 0, childCount, repeatingValue); } else { // set value as a field of Row Row[] rows = (Row[]) vals; for (int i = 0; ...
[ "private", "static", "void", "fillColumnWithRepeatingValue", "(", "Object", "[", "]", "vals", ",", "int", "fieldIdx", ",", "Object", "repeatingValue", ",", "int", "childCount", ")", "{", "if", "(", "fieldIdx", "==", "-", "1", ")", "{", "// set value as an obje...
Sets a repeating value to all objects or row fields of the passed vals array. @param vals The array of objects or Rows. @param fieldIdx If the objs array is an array of Row, the index of the field that needs to be filled. Otherwise a -1 must be passed and the data is directly filled into the array. @param repeatingVal...
[ "Sets", "a", "repeating", "value", "to", "all", "objects", "or", "row", "fields", "of", "the", "passed", "vals", "array", "." ]
b62db93bf63cb3bb34dd03d611a779d9e3fc61ac
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-connectors/flink-orc/src/main/java/org/apache/flink/orc/OrcBatchReader.java#L1122-L1134
123,123
apache/flink
flink-table/flink-table-runtime-blink/src/main/java/org/apache/flink/table/runtime/functions/SqlFunctionUtils.java
SqlFunctionUtils.lpad
public static String lpad(String base, int len, String pad) { if (len < 0 || "".equals(pad)) { return null; } else if (len == 0) { return ""; } char[] data = new char[len]; char[] baseChars = base.toCharArray(); char[] padChars = pad.toCharArray(); // the length of the padding needed int pos = M...
java
public static String lpad(String base, int len, String pad) { if (len < 0 || "".equals(pad)) { return null; } else if (len == 0) { return ""; } char[] data = new char[len]; char[] baseChars = base.toCharArray(); char[] padChars = pad.toCharArray(); // the length of the padding needed int pos = M...
[ "public", "static", "String", "lpad", "(", "String", "base", ",", "int", "len", ",", "String", "pad", ")", "{", "if", "(", "len", "<", "0", "||", "\"\"", ".", "equals", "(", "pad", ")", ")", "{", "return", "null", ";", "}", "else", "if", "(", "...
Returns the string str left-padded with the string pad to a length of len characters. If str is longer than len, the return value is shortened to len characters.
[ "Returns", "the", "string", "str", "left", "-", "padded", "with", "the", "string", "pad", "to", "a", "length", "of", "len", "characters", ".", "If", "str", "is", "longer", "than", "len", "the", "return", "value", "is", "shortened", "to", "len", "characte...
b62db93bf63cb3bb34dd03d611a779d9e3fc61ac
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-table/flink-table-runtime-blink/src/main/java/org/apache/flink/table/runtime/functions/SqlFunctionUtils.java#L221-L250
123,124
apache/flink
flink-table/flink-table-runtime-blink/src/main/java/org/apache/flink/table/runtime/functions/SqlFunctionUtils.java
SqlFunctionUtils.rpad
public static String rpad(String base, int len, String pad) { if (len < 0 || "".equals(pad)) { return null; } else if (len == 0) { return ""; } char[] data = new char[len]; char[] baseChars = base.toCharArray(); char[] padChars = pad.toCharArray(); int pos = 0; // copy the base while (pos < b...
java
public static String rpad(String base, int len, String pad) { if (len < 0 || "".equals(pad)) { return null; } else if (len == 0) { return ""; } char[] data = new char[len]; char[] baseChars = base.toCharArray(); char[] padChars = pad.toCharArray(); int pos = 0; // copy the base while (pos < b...
[ "public", "static", "String", "rpad", "(", "String", "base", ",", "int", "len", ",", "String", "pad", ")", "{", "if", "(", "len", "<", "0", "||", "\"\"", ".", "equals", "(", "pad", ")", ")", "{", "return", "null", ";", "}", "else", "if", "(", "...
Returns the string str right-padded with the string pad to a length of len characters. If str is longer than len, the return value is shortened to len characters.
[ "Returns", "the", "string", "str", "right", "-", "padded", "with", "the", "string", "pad", "to", "a", "length", "of", "len", "characters", ".", "If", "str", "is", "longer", "than", "len", "the", "return", "value", "is", "shortened", "to", "len", "charact...
b62db93bf63cb3bb34dd03d611a779d9e3fc61ac
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-table/flink-table-runtime-blink/src/main/java/org/apache/flink/table/runtime/functions/SqlFunctionUtils.java#L256-L286
123,125
apache/flink
flink-table/flink-table-runtime-blink/src/main/java/org/apache/flink/table/runtime/functions/SqlFunctionUtils.java
SqlFunctionUtils.replace
public static String replace(String str, String oldStr, String replacement) { return str.replace(oldStr, replacement); }
java
public static String replace(String str, String oldStr, String replacement) { return str.replace(oldStr, replacement); }
[ "public", "static", "String", "replace", "(", "String", "str", ",", "String", "oldStr", ",", "String", "replacement", ")", "{", "return", "str", ".", "replace", "(", "oldStr", ",", "replacement", ")", ";", "}" ]
Replaces all the old strings with the replacement string.
[ "Replaces", "all", "the", "old", "strings", "with", "the", "replacement", "string", "." ]
b62db93bf63cb3bb34dd03d611a779d9e3fc61ac
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-table/flink-table-runtime-blink/src/main/java/org/apache/flink/table/runtime/functions/SqlFunctionUtils.java#L298-L300
123,126
apache/flink
flink-table/flink-table-runtime-blink/src/main/java/org/apache/flink/table/runtime/functions/SqlFunctionUtils.java
SqlFunctionUtils.regexpReplace
public static String regexpReplace(String str, String regex, String replacement) { if (regex.isEmpty()) { return str; } try { // we should use StringBuffer here because Matcher only accept it StringBuffer sb = new StringBuffer(); Matcher m = REGEXP_PATTERN_CACHE.get(regex).matcher(str); while (m.fi...
java
public static String regexpReplace(String str, String regex, String replacement) { if (regex.isEmpty()) { return str; } try { // we should use StringBuffer here because Matcher only accept it StringBuffer sb = new StringBuffer(); Matcher m = REGEXP_PATTERN_CACHE.get(regex).matcher(str); while (m.fi...
[ "public", "static", "String", "regexpReplace", "(", "String", "str", ",", "String", "regex", ",", "String", "replacement", ")", "{", "if", "(", "regex", ".", "isEmpty", "(", ")", ")", "{", "return", "str", ";", "}", "try", "{", "// we should use StringBuff...
Returns a string resulting from replacing all substrings that match the regular expression with replacement.
[ "Returns", "a", "string", "resulting", "from", "replacing", "all", "substrings", "that", "match", "the", "regular", "expression", "with", "replacement", "." ]
b62db93bf63cb3bb34dd03d611a779d9e3fc61ac
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-table/flink-table-runtime-blink/src/main/java/org/apache/flink/table/runtime/functions/SqlFunctionUtils.java#L346-L366
123,127
apache/flink
flink-table/flink-table-runtime-blink/src/main/java/org/apache/flink/table/runtime/functions/SqlFunctionUtils.java
SqlFunctionUtils.regexpExtract
public static String regexpExtract(String str, String regex, int extractIndex) { if (extractIndex < 0) { return null; } try { Matcher m = REGEXP_PATTERN_CACHE.get(regex).matcher(str); if (m.find()) { MatchResult mr = m.toMatchResult(); return mr.group(extractIndex); } return null; } catc...
java
public static String regexpExtract(String str, String regex, int extractIndex) { if (extractIndex < 0) { return null; } try { Matcher m = REGEXP_PATTERN_CACHE.get(regex).matcher(str); if (m.find()) { MatchResult mr = m.toMatchResult(); return mr.group(extractIndex); } return null; } catc...
[ "public", "static", "String", "regexpExtract", "(", "String", "str", ",", "String", "regex", ",", "int", "extractIndex", ")", "{", "if", "(", "extractIndex", "<", "0", ")", "{", "return", "null", ";", "}", "try", "{", "Matcher", "m", "=", "REGEXP_PATTERN...
Returns a string extracted with a specified regular expression and a regex match group index.
[ "Returns", "a", "string", "extracted", "with", "a", "specified", "regular", "expression", "and", "a", "regex", "match", "group", "index", "." ]
b62db93bf63cb3bb34dd03d611a779d9e3fc61ac
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-table/flink-table-runtime-blink/src/main/java/org/apache/flink/table/runtime/functions/SqlFunctionUtils.java#L372-L390
123,128
apache/flink
flink-table/flink-table-runtime-blink/src/main/java/org/apache/flink/table/runtime/functions/SqlFunctionUtils.java
SqlFunctionUtils.hash
public static String hash(String algorithm, String str, String charsetName) { try { byte[] digest = MessageDigest .getInstance(algorithm) .digest(strToBytesWithCharset(str, charsetName)); return EncodingUtils.hex(digest); } catch (NoSuchAlgorithmException e) { throw new IllegalArgumentException("Un...
java
public static String hash(String algorithm, String str, String charsetName) { try { byte[] digest = MessageDigest .getInstance(algorithm) .digest(strToBytesWithCharset(str, charsetName)); return EncodingUtils.hex(digest); } catch (NoSuchAlgorithmException e) { throw new IllegalArgumentException("Un...
[ "public", "static", "String", "hash", "(", "String", "algorithm", ",", "String", "str", ",", "String", "charsetName", ")", "{", "try", "{", "byte", "[", "]", "digest", "=", "MessageDigest", ".", "getInstance", "(", "algorithm", ")", ".", "digest", "(", "...
Calculate the hash value of a given string. @param algorithm message digest algorithm. @param str string to hash. @param charsetName charset of string. @return hash value of string.
[ "Calculate", "the", "hash", "value", "of", "a", "given", "string", "." ]
b62db93bf63cb3bb34dd03d611a779d9e3fc61ac
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-table/flink-table-runtime-blink/src/main/java/org/apache/flink/table/runtime/functions/SqlFunctionUtils.java#L473-L482
123,129
apache/flink
flink-table/flink-table-runtime-blink/src/main/java/org/apache/flink/table/runtime/functions/SqlFunctionUtils.java
SqlFunctionUtils.parseUrl
public static String parseUrl(String urlStr, String partToExtract) { URL url; try { url = URL_CACHE.get(urlStr); } catch (Exception e) { LOG.error("Parse URL error: " + urlStr, e); return null; } if ("HOST".equals(partToExtract)) { return url.getHost(); } if ("PATH".equals(partToExtract)) { ...
java
public static String parseUrl(String urlStr, String partToExtract) { URL url; try { url = URL_CACHE.get(urlStr); } catch (Exception e) { LOG.error("Parse URL error: " + urlStr, e); return null; } if ("HOST".equals(partToExtract)) { return url.getHost(); } if ("PATH".equals(partToExtract)) { ...
[ "public", "static", "String", "parseUrl", "(", "String", "urlStr", ",", "String", "partToExtract", ")", "{", "URL", "url", ";", "try", "{", "url", "=", "URL_CACHE", ".", "get", "(", "urlStr", ")", ";", "}", "catch", "(", "Exception", "e", ")", "{", "...
Parse url and return various components of the URL. If accept any null arguments, return null. @param urlStr URL string. @param partToExtract determines which components would return. accept values: HOST,PATH,QUERY,REF, PROTOCOL,FILE,AUTHORITY,USERINFO @return target value.
[ "Parse", "url", "and", "return", "various", "components", "of", "the", "URL", ".", "If", "accept", "any", "null", "arguments", "return", "null", "." ]
b62db93bf63cb3bb34dd03d611a779d9e3fc61ac
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-table/flink-table-runtime-blink/src/main/java/org/apache/flink/table/runtime/functions/SqlFunctionUtils.java#L511-L545
123,130
apache/flink
flink-table/flink-table-runtime-blink/src/main/java/org/apache/flink/table/runtime/functions/SqlFunctionUtils.java
SqlFunctionUtils.parseUrl
public static String parseUrl(String urlStr, String partToExtract, String key) { if (!"QUERY".equals(partToExtract)) { return null; } String query = parseUrl(urlStr, partToExtract); if (query == null) { return null; } Pattern p = Pattern.compile("(&|^)" + Pattern.quote(key) + "=([^&]*)"); Matcher ...
java
public static String parseUrl(String urlStr, String partToExtract, String key) { if (!"QUERY".equals(partToExtract)) { return null; } String query = parseUrl(urlStr, partToExtract); if (query == null) { return null; } Pattern p = Pattern.compile("(&|^)" + Pattern.quote(key) + "=([^&]*)"); Matcher ...
[ "public", "static", "String", "parseUrl", "(", "String", "urlStr", ",", "String", "partToExtract", ",", "String", "key", ")", "{", "if", "(", "!", "\"QUERY\"", ".", "equals", "(", "partToExtract", ")", ")", "{", "return", "null", ";", "}", "String", "que...
Parse url and return various parameter of the URL. If accept any null arguments, return null. @param urlStr URL string. @param partToExtract must be QUERY, or return null. @param key parameter name. @return target value.
[ "Parse", "url", "and", "return", "various", "parameter", "of", "the", "URL", ".", "If", "accept", "any", "null", "arguments", "return", "null", "." ]
b62db93bf63cb3bb34dd03d611a779d9e3fc61ac
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-table/flink-table-runtime-blink/src/main/java/org/apache/flink/table/runtime/functions/SqlFunctionUtils.java#L556-L572
123,131
apache/flink
flink-table/flink-table-runtime-blink/src/main/java/org/apache/flink/table/runtime/functions/SqlFunctionUtils.java
SqlFunctionUtils.hex
public static String hex(String x) { return EncodingUtils.hex(x.getBytes(StandardCharsets.UTF_8)).toUpperCase(); }
java
public static String hex(String x) { return EncodingUtils.hex(x.getBytes(StandardCharsets.UTF_8)).toUpperCase(); }
[ "public", "static", "String", "hex", "(", "String", "x", ")", "{", "return", "EncodingUtils", ".", "hex", "(", "x", ".", "getBytes", "(", "StandardCharsets", ".", "UTF_8", ")", ")", ".", "toUpperCase", "(", ")", ";", "}" ]
Returns the hex string of a string argument.
[ "Returns", "the", "hex", "string", "of", "a", "string", "argument", "." ]
b62db93bf63cb3bb34dd03d611a779d9e3fc61ac
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-table/flink-table-runtime-blink/src/main/java/org/apache/flink/table/runtime/functions/SqlFunctionUtils.java#L697-L699
123,132
apache/flink
flink-table/flink-table-runtime-blink/src/main/java/org/apache/flink/table/runtime/functions/SqlFunctionUtils.java
SqlFunctionUtils.strToMap
public static Map<String, String> strToMap(String text, String listDelimiter, String keyValueDelimiter) { if (StringUtils.isEmpty(text)) { return EMPTY_MAP; } String[] keyValuePairs = text.split(listDelimiter); Map<String, String> ret = new HashMap<>(keyValuePairs.length); for (String keyValuePair : keyVa...
java
public static Map<String, String> strToMap(String text, String listDelimiter, String keyValueDelimiter) { if (StringUtils.isEmpty(text)) { return EMPTY_MAP; } String[] keyValuePairs = text.split(listDelimiter); Map<String, String> ret = new HashMap<>(keyValuePairs.length); for (String keyValuePair : keyVa...
[ "public", "static", "Map", "<", "String", ",", "String", ">", "strToMap", "(", "String", "text", ",", "String", "listDelimiter", ",", "String", "keyValueDelimiter", ")", "{", "if", "(", "StringUtils", ".", "isEmpty", "(", "text", ")", ")", "{", "return", ...
Creates a map by parsing text. Split text into key-value pairs using two delimiters. The first delimiter separates pairs, and the second delimiter separates key and value. @param text the input text @param listDelimiter the delimiter to separates pairs @param keyValueDelimiter the delimiter to separates key and value @...
[ "Creates", "a", "map", "by", "parsing", "text", ".", "Split", "text", "into", "key", "-", "value", "pairs", "using", "two", "delimiters", ".", "The", "first", "delimiter", "separates", "pairs", "and", "the", "second", "delimiter", "separates", "key", "and", ...
b62db93bf63cb3bb34dd03d611a779d9e3fc61ac
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-table/flink-table-runtime-blink/src/main/java/org/apache/flink/table/runtime/functions/SqlFunctionUtils.java#L722-L738
123,133
apache/flink
flink-connectors/flink-connector-kafka/src/main/java/org/apache/flink/streaming/connectors/kafka/internal/Handover.java
Handover.pollNext
@Nonnull public ConsumerRecords<byte[], byte[]> pollNext() throws Exception { synchronized (lock) { while (next == null && error == null) { lock.wait(); } ConsumerRecords<byte[], byte[]> n = next; if (n != null) { next = null; lock.notifyAll(); return n; } else { ExceptionUtils...
java
@Nonnull public ConsumerRecords<byte[], byte[]> pollNext() throws Exception { synchronized (lock) { while (next == null && error == null) { lock.wait(); } ConsumerRecords<byte[], byte[]> n = next; if (n != null) { next = null; lock.notifyAll(); return n; } else { ExceptionUtils...
[ "@", "Nonnull", "public", "ConsumerRecords", "<", "byte", "[", "]", ",", "byte", "[", "]", ">", "pollNext", "(", ")", "throws", "Exception", "{", "synchronized", "(", "lock", ")", "{", "while", "(", "next", "==", "null", "&&", "error", "==", "null", ...
Polls the next element from the Handover, possibly blocking until the next element is available. This method behaves similar to polling from a blocking queue. <p>If an exception was handed in by the producer ({@link #reportError(Throwable)}), then that exception is thrown rather than an element being returned. @retur...
[ "Polls", "the", "next", "element", "from", "the", "Handover", "possibly", "blocking", "until", "the", "next", "element", "is", "available", ".", "This", "method", "behaves", "similar", "to", "polling", "from", "a", "blocking", "queue", "." ]
b62db93bf63cb3bb34dd03d611a779d9e3fc61ac
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-connectors/flink-connector-kafka/src/main/java/org/apache/flink/streaming/connectors/kafka/internal/Handover.java#L70-L91
123,134
apache/flink
flink-connectors/flink-connector-kafka/src/main/java/org/apache/flink/streaming/connectors/kafka/internal/Handover.java
Handover.produce
public void produce(final ConsumerRecords<byte[], byte[]> element) throws InterruptedException, WakeupException, ClosedException { checkNotNull(element); synchronized (lock) { while (next != null && !wakeupProducer) { lock.wait(); } wakeupProducer = false; // if there is still an element, we ...
java
public void produce(final ConsumerRecords<byte[], byte[]> element) throws InterruptedException, WakeupException, ClosedException { checkNotNull(element); synchronized (lock) { while (next != null && !wakeupProducer) { lock.wait(); } wakeupProducer = false; // if there is still an element, we ...
[ "public", "void", "produce", "(", "final", "ConsumerRecords", "<", "byte", "[", "]", ",", "byte", "[", "]", ">", "element", ")", "throws", "InterruptedException", ",", "WakeupException", ",", "ClosedException", "{", "checkNotNull", "(", "element", ")", ";", ...
Hands over an element from the producer. If the Handover already has an element that was not yet picked up by the consumer thread, this call blocks until the consumer picks up that previous element. <p>This behavior is similar to a "size one" blocking queue. @param element The next element to hand over. @throws Inte...
[ "Hands", "over", "an", "element", "from", "the", "producer", ".", "If", "the", "Handover", "already", "has", "an", "element", "that", "was", "not", "yet", "picked", "up", "by", "the", "consumer", "thread", "this", "call", "blocks", "until", "the", "consume...
b62db93bf63cb3bb34dd03d611a779d9e3fc61ac
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-connectors/flink-connector-kafka/src/main/java/org/apache/flink/streaming/connectors/kafka/internal/Handover.java#L110-L136
123,135
apache/flink
flink-libraries/flink-cep/src/main/java/org/apache/flink/cep/nfa/DeweyNumber.java
DeweyNumber.isCompatibleWith
public boolean isCompatibleWith(DeweyNumber other) { if (length() > other.length()) { // prefix case for (int i = 0; i < other.length(); i++) { if (other.deweyNumber[i] != deweyNumber[i]) { return false; } } return true; } else if (length() == other.length()) { // check init digits for ...
java
public boolean isCompatibleWith(DeweyNumber other) { if (length() > other.length()) { // prefix case for (int i = 0; i < other.length(); i++) { if (other.deweyNumber[i] != deweyNumber[i]) { return false; } } return true; } else if (length() == other.length()) { // check init digits for ...
[ "public", "boolean", "isCompatibleWith", "(", "DeweyNumber", "other", ")", "{", "if", "(", "length", "(", ")", ">", "other", ".", "length", "(", ")", ")", "{", "// prefix case", "for", "(", "int", "i", "=", "0", ";", "i", "<", "other", ".", "length",...
Checks whether this dewey number is compatible to the other dewey number. <p>True iff this contains other as a prefix or iff they differ only in the last digit whereas the last digit of this is greater than the last digit of other. @param other The other dewey number to check compatibility against @return Whether thi...
[ "Checks", "whether", "this", "dewey", "number", "is", "compatible", "to", "the", "other", "dewey", "number", "." ]
b62db93bf63cb3bb34dd03d611a779d9e3fc61ac
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-libraries/flink-cep/src/main/java/org/apache/flink/cep/nfa/DeweyNumber.java#L68-L92
123,136
apache/flink
flink-libraries/flink-cep/src/main/java/org/apache/flink/cep/nfa/DeweyNumber.java
DeweyNumber.increase
public DeweyNumber increase(int times) { int[] newDeweyNumber = Arrays.copyOf(deweyNumber, deweyNumber.length); newDeweyNumber[deweyNumber.length - 1] += times; return new DeweyNumber(newDeweyNumber); }
java
public DeweyNumber increase(int times) { int[] newDeweyNumber = Arrays.copyOf(deweyNumber, deweyNumber.length); newDeweyNumber[deweyNumber.length - 1] += times; return new DeweyNumber(newDeweyNumber); }
[ "public", "DeweyNumber", "increase", "(", "int", "times", ")", "{", "int", "[", "]", "newDeweyNumber", "=", "Arrays", ".", "copyOf", "(", "deweyNumber", ",", "deweyNumber", ".", "length", ")", ";", "newDeweyNumber", "[", "deweyNumber", ".", "length", "-", ...
Creates a new dewey number from this such that its last digit is increased by the supplied number. @param times how many times to increase the Dewey number @return A new dewey number derived from this whose last digit is increased by given number
[ "Creates", "a", "new", "dewey", "number", "from", "this", "such", "that", "its", "last", "digit", "is", "increased", "by", "the", "supplied", "number", "." ]
b62db93bf63cb3bb34dd03d611a779d9e3fc61ac
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-libraries/flink-cep/src/main/java/org/apache/flink/cep/nfa/DeweyNumber.java#L119-L124
123,137
apache/flink
flink-libraries/flink-cep/src/main/java/org/apache/flink/cep/nfa/DeweyNumber.java
DeweyNumber.addStage
public DeweyNumber addStage() { int[] newDeweyNumber = Arrays.copyOf(deweyNumber, deweyNumber.length + 1); return new DeweyNumber(newDeweyNumber); }
java
public DeweyNumber addStage() { int[] newDeweyNumber = Arrays.copyOf(deweyNumber, deweyNumber.length + 1); return new DeweyNumber(newDeweyNumber); }
[ "public", "DeweyNumber", "addStage", "(", ")", "{", "int", "[", "]", "newDeweyNumber", "=", "Arrays", ".", "copyOf", "(", "deweyNumber", ",", "deweyNumber", ".", "length", "+", "1", ")", ";", "return", "new", "DeweyNumber", "(", "newDeweyNumber", ")", ";",...
Creates a new dewey number from this such that a 0 is appended as new last digit. @return A new dewey number which contains this as a prefix and has 0 as last digit
[ "Creates", "a", "new", "dewey", "number", "from", "this", "such", "that", "a", "0", "is", "appended", "as", "new", "last", "digit", "." ]
b62db93bf63cb3bb34dd03d611a779d9e3fc61ac
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-libraries/flink-cep/src/main/java/org/apache/flink/cep/nfa/DeweyNumber.java#L131-L135
123,138
apache/flink
flink-libraries/flink-cep/src/main/java/org/apache/flink/cep/nfa/DeweyNumber.java
DeweyNumber.fromString
public static DeweyNumber fromString(final String deweyNumberString) { String[] splits = deweyNumberString.split("\\."); if (splits.length == 0) { return new DeweyNumber(Integer.parseInt(deweyNumberString)); } else { int[] deweyNumber = new int[splits.length]; for (int i = 0; i < splits.length; i++) { ...
java
public static DeweyNumber fromString(final String deweyNumberString) { String[] splits = deweyNumberString.split("\\."); if (splits.length == 0) { return new DeweyNumber(Integer.parseInt(deweyNumberString)); } else { int[] deweyNumber = new int[splits.length]; for (int i = 0; i < splits.length; i++) { ...
[ "public", "static", "DeweyNumber", "fromString", "(", "final", "String", "deweyNumberString", ")", "{", "String", "[", "]", "splits", "=", "deweyNumberString", ".", "split", "(", "\"\\\\.\"", ")", ";", "if", "(", "splits", ".", "length", "==", "0", ")", "{...
Creates a dewey number from a string representation. The input string must be a dot separated string of integers. @param deweyNumberString Dot separated string of integers @return Dewey number generated from the given input string
[ "Creates", "a", "dewey", "number", "from", "a", "string", "representation", ".", "The", "input", "string", "must", "be", "a", "dot", "separated", "string", "of", "integers", "." ]
b62db93bf63cb3bb34dd03d611a779d9e3fc61ac
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-libraries/flink-cep/src/main/java/org/apache/flink/cep/nfa/DeweyNumber.java#L175-L189
123,139
apache/flink
flink-clients/src/main/java/org/apache/flink/client/program/rest/RestClusterClient.java
RestClusterClient.getJobDetails
public CompletableFuture<JobDetailsInfo> getJobDetails(JobID jobId) { final JobDetailsHeaders detailsHeaders = JobDetailsHeaders.getInstance(); final JobMessageParameters params = new JobMessageParameters(); params.jobPathParameter.resolve(jobId); return sendRequest( detailsHeaders, params); }
java
public CompletableFuture<JobDetailsInfo> getJobDetails(JobID jobId) { final JobDetailsHeaders detailsHeaders = JobDetailsHeaders.getInstance(); final JobMessageParameters params = new JobMessageParameters(); params.jobPathParameter.resolve(jobId); return sendRequest( detailsHeaders, params); }
[ "public", "CompletableFuture", "<", "JobDetailsInfo", ">", "getJobDetails", "(", "JobID", "jobId", ")", "{", "final", "JobDetailsHeaders", "detailsHeaders", "=", "JobDetailsHeaders", ".", "getInstance", "(", ")", ";", "final", "JobMessageParameters", "params", "=", ...
Requests the job details. @param jobId The job id @return Job details
[ "Requests", "the", "job", "details", "." ]
b62db93bf63cb3bb34dd03d611a779d9e3fc61ac
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-clients/src/main/java/org/apache/flink/client/program/rest/RestClusterClient.java#L275-L283
123,140
apache/flink
flink-runtime/src/main/java/org/apache/flink/runtime/operators/hash/HashPartition.java
HashPartition.spillPartition
public int spillPartition(List<MemorySegment> target, IOManager ioAccess, FileIOChannel.ID targetChannel, LinkedBlockingQueue<MemorySegment> bufferReturnQueue) throws IOException { // sanity checks if (!isInMemory()) { throw new RuntimeException("Bug in Hybrid Hash Join: " + "Request to spill a partiti...
java
public int spillPartition(List<MemorySegment> target, IOManager ioAccess, FileIOChannel.ID targetChannel, LinkedBlockingQueue<MemorySegment> bufferReturnQueue) throws IOException { // sanity checks if (!isInMemory()) { throw new RuntimeException("Bug in Hybrid Hash Join: " + "Request to spill a partiti...
[ "public", "int", "spillPartition", "(", "List", "<", "MemorySegment", ">", "target", ",", "IOManager", "ioAccess", ",", "FileIOChannel", ".", "ID", "targetChannel", ",", "LinkedBlockingQueue", "<", "MemorySegment", ">", "bufferReturnQueue", ")", "throws", "IOExcepti...
Spills this partition to disk and sets it up such that it continues spilling records that are added to it. The spilling process must free at least one buffer, either in the partition's record buffers, or in the memory segments for overflow buckets. The partition immediately takes back one buffer to use it for further s...
[ "Spills", "this", "partition", "to", "disk", "and", "sets", "it", "up", "such", "that", "it", "continues", "spilling", "records", "that", "are", "added", "to", "it", ".", "The", "spilling", "process", "must", "free", "at", "least", "one", "buffer", "either...
b62db93bf63cb3bb34dd03d611a779d9e3fc61ac
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/operators/hash/HashPartition.java#L292-L319
123,141
apache/flink
flink-clients/src/main/java/org/apache/flink/client/program/DetachedEnvironment.java
DetachedEnvironment.finalizeExecute
JobSubmissionResult finalizeExecute() throws ProgramInvocationException { return client.run(detachedPlan, jarFilesToAttach, classpathsToAttach, userCodeClassLoader, savepointSettings); }
java
JobSubmissionResult finalizeExecute() throws ProgramInvocationException { return client.run(detachedPlan, jarFilesToAttach, classpathsToAttach, userCodeClassLoader, savepointSettings); }
[ "JobSubmissionResult", "finalizeExecute", "(", ")", "throws", "ProgramInvocationException", "{", "return", "client", ".", "run", "(", "detachedPlan", ",", "jarFilesToAttach", ",", "classpathsToAttach", ",", "userCodeClassLoader", ",", "savepointSettings", ")", ";", "}" ...
Finishes this Context Environment's execution by explicitly running the plan constructed.
[ "Finishes", "this", "Context", "Environment", "s", "execution", "by", "explicitly", "running", "the", "plan", "constructed", "." ]
b62db93bf63cb3bb34dd03d611a779d9e3fc61ac
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-clients/src/main/java/org/apache/flink/client/program/DetachedEnvironment.java#L76-L78
123,142
apache/flink
flink-runtime/src/main/java/org/apache/flink/runtime/state/StateUtil.java
StateUtil.discardStateFuture
public static void discardStateFuture(RunnableFuture<? extends StateObject> stateFuture) throws Exception { if (null != stateFuture) { if (!stateFuture.cancel(true)) { try { // We attempt to get a result, in case the future completed before cancellation. StateObject stateObject = FutureUtils.runIfNo...
java
public static void discardStateFuture(RunnableFuture<? extends StateObject> stateFuture) throws Exception { if (null != stateFuture) { if (!stateFuture.cancel(true)) { try { // We attempt to get a result, in case the future completed before cancellation. StateObject stateObject = FutureUtils.runIfNo...
[ "public", "static", "void", "discardStateFuture", "(", "RunnableFuture", "<", "?", "extends", "StateObject", ">", "stateFuture", ")", "throws", "Exception", "{", "if", "(", "null", "!=", "stateFuture", ")", "{", "if", "(", "!", "stateFuture", ".", "cancel", ...
Discards the given state future by first trying to cancel it. If this is not possible, then the state object contained in the future is calculated and afterwards discarded. @param stateFuture to be discarded @throws Exception if the discard operation failed
[ "Discards", "the", "given", "state", "future", "by", "first", "trying", "to", "cancel", "it", ".", "If", "this", "is", "not", "possible", "then", "the", "state", "object", "contained", "in", "the", "future", "is", "calculated", "and", "afterwards", "discarde...
b62db93bf63cb3bb34dd03d611a779d9e3fc61ac
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/state/StateUtil.java#L70-L87
123,143
apache/flink
flink-table/flink-table-common/src/main/java/org/apache/flink/table/factories/TableFactoryService.java
TableFactoryService.find
public static <T> T find(Class<T> factoryClass, Descriptor descriptor) { Preconditions.checkNotNull(descriptor); return findInternal(factoryClass, descriptor.toProperties(), Optional.empty()); }
java
public static <T> T find(Class<T> factoryClass, Descriptor descriptor) { Preconditions.checkNotNull(descriptor); return findInternal(factoryClass, descriptor.toProperties(), Optional.empty()); }
[ "public", "static", "<", "T", ">", "T", "find", "(", "Class", "<", "T", ">", "factoryClass", ",", "Descriptor", "descriptor", ")", "{", "Preconditions", ".", "checkNotNull", "(", "descriptor", ")", ";", "return", "findInternal", "(", "factoryClass", ",", "...
Finds a table factory of the given class and descriptor. @param factoryClass desired factory class @param descriptor descriptor describing the factory configuration @param <T> factory class type @return the matching factory
[ "Finds", "a", "table", "factory", "of", "the", "given", "class", "and", "descriptor", "." ]
b62db93bf63cb3bb34dd03d611a779d9e3fc61ac
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-table/flink-table-common/src/main/java/org/apache/flink/table/factories/TableFactoryService.java#L65-L68
123,144
apache/flink
flink-table/flink-table-common/src/main/java/org/apache/flink/table/factories/TableFactoryService.java
TableFactoryService.find
public static <T> T find(Class<T> factoryClass, Descriptor descriptor, ClassLoader classLoader) { Preconditions.checkNotNull(descriptor); Preconditions.checkNotNull(classLoader); return findInternal(factoryClass, descriptor.toProperties(), Optional.of(classLoader)); }
java
public static <T> T find(Class<T> factoryClass, Descriptor descriptor, ClassLoader classLoader) { Preconditions.checkNotNull(descriptor); Preconditions.checkNotNull(classLoader); return findInternal(factoryClass, descriptor.toProperties(), Optional.of(classLoader)); }
[ "public", "static", "<", "T", ">", "T", "find", "(", "Class", "<", "T", ">", "factoryClass", ",", "Descriptor", "descriptor", ",", "ClassLoader", "classLoader", ")", "{", "Preconditions", ".", "checkNotNull", "(", "descriptor", ")", ";", "Preconditions", "."...
Finds a table factory of the given class, descriptor, and classloader. @param factoryClass desired factory class @param descriptor descriptor describing the factory configuration @param classLoader classloader for service loading @param <T> factory class type @return the matching factory
[ "Finds", "a", "table", "factory", "of", "the", "given", "class", "descriptor", "and", "classloader", "." ]
b62db93bf63cb3bb34dd03d611a779d9e3fc61ac
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-table/flink-table-common/src/main/java/org/apache/flink/table/factories/TableFactoryService.java#L79-L83
123,145
apache/flink
flink-table/flink-table-common/src/main/java/org/apache/flink/table/factories/TableFactoryService.java
TableFactoryService.find
public static <T> T find(Class<T> factoryClass, Map<String, String> propertyMap) { return findInternal(factoryClass, propertyMap, Optional.empty()); }
java
public static <T> T find(Class<T> factoryClass, Map<String, String> propertyMap) { return findInternal(factoryClass, propertyMap, Optional.empty()); }
[ "public", "static", "<", "T", ">", "T", "find", "(", "Class", "<", "T", ">", "factoryClass", ",", "Map", "<", "String", ",", "String", ">", "propertyMap", ")", "{", "return", "findInternal", "(", "factoryClass", ",", "propertyMap", ",", "Optional", ".", ...
Finds a table factory of the given class and property map. @param factoryClass desired factory class @param propertyMap properties that describe the factory configuration @param <T> factory class type @return the matching factory
[ "Finds", "a", "table", "factory", "of", "the", "given", "class", "and", "property", "map", "." ]
b62db93bf63cb3bb34dd03d611a779d9e3fc61ac
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-table/flink-table-common/src/main/java/org/apache/flink/table/factories/TableFactoryService.java#L93-L95
123,146
apache/flink
flink-table/flink-table-common/src/main/java/org/apache/flink/table/factories/TableFactoryService.java
TableFactoryService.discoverFactories
private static List<TableFactory> discoverFactories(Optional<ClassLoader> classLoader) { try { List<TableFactory> result = new LinkedList<>(); if (classLoader.isPresent()) { ServiceLoader .load(TableFactory.class, classLoader.get()) .iterator() .forEachRemaining(result::add); } else { ...
java
private static List<TableFactory> discoverFactories(Optional<ClassLoader> classLoader) { try { List<TableFactory> result = new LinkedList<>(); if (classLoader.isPresent()) { ServiceLoader .load(TableFactory.class, classLoader.get()) .iterator() .forEachRemaining(result::add); } else { ...
[ "private", "static", "List", "<", "TableFactory", ">", "discoverFactories", "(", "Optional", "<", "ClassLoader", ">", "classLoader", ")", "{", "try", "{", "List", "<", "TableFactory", ">", "result", "=", "new", "LinkedList", "<>", "(", ")", ";", "if", "(",...
Searches for factories using Java service providers. @return all factories in the classpath
[ "Searches", "for", "factories", "using", "Java", "service", "providers", "." ]
b62db93bf63cb3bb34dd03d611a779d9e3fc61ac
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-table/flink-table-common/src/main/java/org/apache/flink/table/factories/TableFactoryService.java#L150-L167
123,147
apache/flink
flink-table/flink-table-common/src/main/java/org/apache/flink/table/factories/TableFactoryService.java
TableFactoryService.filterByFactoryClass
private static <T> List<TableFactory> filterByFactoryClass( Class<T> factoryClass, Map<String, String> properties, List<TableFactory> foundFactories) { List<TableFactory> classFactories = foundFactories.stream() .filter(p -> factoryClass.isAssignableFrom(p.getClass())) .collect(Collectors.toList()); i...
java
private static <T> List<TableFactory> filterByFactoryClass( Class<T> factoryClass, Map<String, String> properties, List<TableFactory> foundFactories) { List<TableFactory> classFactories = foundFactories.stream() .filter(p -> factoryClass.isAssignableFrom(p.getClass())) .collect(Collectors.toList()); i...
[ "private", "static", "<", "T", ">", "List", "<", "TableFactory", ">", "filterByFactoryClass", "(", "Class", "<", "T", ">", "factoryClass", ",", "Map", "<", "String", ",", "String", ">", "properties", ",", "List", "<", "TableFactory", ">", "foundFactories", ...
Filters factories with matching context by factory class.
[ "Filters", "factories", "with", "matching", "context", "by", "factory", "class", "." ]
b62db93bf63cb3bb34dd03d611a779d9e3fc61ac
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-table/flink-table-common/src/main/java/org/apache/flink/table/factories/TableFactoryService.java#L172-L190
123,148
apache/flink
flink-table/flink-table-common/src/main/java/org/apache/flink/table/factories/TableFactoryService.java
TableFactoryService.filterByContext
private static <T> List<TableFactory> filterByContext( Class<T> factoryClass, Map<String, String> properties, List<TableFactory> foundFactories, List<TableFactory> classFactories) { List<TableFactory> matchingFactories = classFactories.stream().filter(factory -> { Map<String, String> requestedContext = no...
java
private static <T> List<TableFactory> filterByContext( Class<T> factoryClass, Map<String, String> properties, List<TableFactory> foundFactories, List<TableFactory> classFactories) { List<TableFactory> matchingFactories = classFactories.stream().filter(factory -> { Map<String, String> requestedContext = no...
[ "private", "static", "<", "T", ">", "List", "<", "TableFactory", ">", "filterByContext", "(", "Class", "<", "T", ">", "factoryClass", ",", "Map", "<", "String", ",", "String", ">", "properties", ",", "List", "<", "TableFactory", ">", "foundFactories", ",",...
Filters for factories with matching context. @return all matching factories
[ "Filters", "for", "factories", "with", "matching", "context", "." ]
b62db93bf63cb3bb34dd03d611a779d9e3fc61ac
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-table/flink-table-common/src/main/java/org/apache/flink/table/factories/TableFactoryService.java#L197-L228
123,149
apache/flink
flink-table/flink-table-common/src/main/java/org/apache/flink/table/factories/TableFactoryService.java
TableFactoryService.normalizeContext
private static Map<String, String> normalizeContext(TableFactory factory) { Map<String, String> requiredContext = factory.requiredContext(); if (requiredContext == null) { throw new TableException( String.format("Required context of factory '%s' must not be null.", factory.getClass().getName())); } retur...
java
private static Map<String, String> normalizeContext(TableFactory factory) { Map<String, String> requiredContext = factory.requiredContext(); if (requiredContext == null) { throw new TableException( String.format("Required context of factory '%s' must not be null.", factory.getClass().getName())); } retur...
[ "private", "static", "Map", "<", "String", ",", "String", ">", "normalizeContext", "(", "TableFactory", "factory", ")", "{", "Map", "<", "String", ",", "String", ">", "requiredContext", "=", "factory", ".", "requiredContext", "(", ")", ";", "if", "(", "req...
Prepares the properties of a context to be used for match operations.
[ "Prepares", "the", "properties", "of", "a", "context", "to", "be", "used", "for", "match", "operations", "." ]
b62db93bf63cb3bb34dd03d611a779d9e3fc61ac
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-table/flink-table-common/src/main/java/org/apache/flink/table/factories/TableFactoryService.java#L233-L241
123,150
apache/flink
flink-table/flink-table-common/src/main/java/org/apache/flink/table/factories/TableFactoryService.java
TableFactoryService.filterBySupportedProperties
private static <T> T filterBySupportedProperties( Class<T> factoryClass, Map<String, String> properties, List<TableFactory> foundFactories, List<TableFactory> classFactories) { final List<String> plainGivenKeys = new LinkedList<>(); properties.keySet().forEach(k -> { // replace arrays with wildcard S...
java
private static <T> T filterBySupportedProperties( Class<T> factoryClass, Map<String, String> properties, List<TableFactory> foundFactories, List<TableFactory> classFactories) { final List<String> plainGivenKeys = new LinkedList<>(); properties.keySet().forEach(k -> { // replace arrays with wildcard S...
[ "private", "static", "<", "T", ">", "T", "filterBySupportedProperties", "(", "Class", "<", "T", ">", "factoryClass", ",", "Map", "<", "String", ",", "String", ">", "properties", ",", "List", "<", "TableFactory", ">", "foundFactories", ",", "List", "<", "Ta...
Filters the matching class factories by supported properties.
[ "Filters", "the", "matching", "class", "factories", "by", "supported", "properties", "." ]
b62db93bf63cb3bb34dd03d611a779d9e3fc61ac
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-table/flink-table-common/src/main/java/org/apache/flink/table/factories/TableFactoryService.java#L246-L321
123,151
apache/flink
flink-table/flink-table-common/src/main/java/org/apache/flink/table/factories/TableFactoryService.java
TableFactoryService.normalizeSupportedProperties
private static Tuple2<List<String>, List<String>> normalizeSupportedProperties(TableFactory factory) { List<String> supportedProperties = factory.supportedProperties(); if (supportedProperties == null) { throw new TableException( String.format("Supported properties of factory '%s' must not be null.", fa...
java
private static Tuple2<List<String>, List<String>> normalizeSupportedProperties(TableFactory factory) { List<String> supportedProperties = factory.supportedProperties(); if (supportedProperties == null) { throw new TableException( String.format("Supported properties of factory '%s' must not be null.", fa...
[ "private", "static", "Tuple2", "<", "List", "<", "String", ">", ",", "List", "<", "String", ">", ">", "normalizeSupportedProperties", "(", "TableFactory", "factory", ")", "{", "List", "<", "String", ">", "supportedProperties", "=", "factory", ".", "supportedPr...
Prepares the supported properties of a factory to be used for match operations.
[ "Prepares", "the", "supported", "properties", "of", "a", "factory", "to", "be", "used", "for", "match", "operations", "." ]
b62db93bf63cb3bb34dd03d611a779d9e3fc61ac
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-table/flink-table-common/src/main/java/org/apache/flink/table/factories/TableFactoryService.java#L326-L340
123,152
apache/flink
flink-runtime/src/main/java/org/apache/flink/runtime/operators/hash/InPlaceMutableHashTable.java
InPlaceMutableHashTable.insertOrReplaceRecord
@Override public void insertOrReplaceRecord(T record) throws IOException { if (closed) { return; } T match = prober.getMatchFor(record, reuse); if (match == null) { prober.insertAfterNoMatch(record); } else { prober.updateMatch(record); } }
java
@Override public void insertOrReplaceRecord(T record) throws IOException { if (closed) { return; } T match = prober.getMatchFor(record, reuse); if (match == null) { prober.insertAfterNoMatch(record); } else { prober.updateMatch(record); } }
[ "@", "Override", "public", "void", "insertOrReplaceRecord", "(", "T", "record", ")", "throws", "IOException", "{", "if", "(", "closed", ")", "{", "return", ";", "}", "T", "match", "=", "prober", ".", "getMatchFor", "(", "record", ",", "reuse", ")", ";", ...
Searches the hash table for a record with the given key. If it is found, then it is overridden with the specified record. Otherwise, the specified record is inserted. @param record The record to insert or to replace with. @throws IOException (EOFException specifically, if memory ran out)
[ "Searches", "the", "hash", "table", "for", "a", "record", "with", "the", "given", "key", ".", "If", "it", "is", "found", "then", "it", "is", "overridden", "with", "the", "specified", "record", ".", "Otherwise", "the", "specified", "record", "is", "inserted...
b62db93bf63cb3bb34dd03d611a779d9e3fc61ac
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/operators/hash/InPlaceMutableHashTable.java#L357-L369
123,153
apache/flink
flink-runtime/src/main/java/org/apache/flink/runtime/operators/hash/InPlaceMutableHashTable.java
InPlaceMutableHashTable.rebuild
private void rebuild(long newNumBucketSegments) throws IOException { // Get new bucket segments releaseBucketSegments(); allocateBucketSegments((int)newNumBucketSegments); T record = buildSideSerializer.createInstance(); try { EntryIterator iter = getEntryIterator(); recordArea.resetAppendPosition(); ...
java
private void rebuild(long newNumBucketSegments) throws IOException { // Get new bucket segments releaseBucketSegments(); allocateBucketSegments((int)newNumBucketSegments); T record = buildSideSerializer.createInstance(); try { EntryIterator iter = getEntryIterator(); recordArea.resetAppendPosition(); ...
[ "private", "void", "rebuild", "(", "long", "newNumBucketSegments", ")", "throws", "IOException", "{", "// Get new bucket segments", "releaseBucketSegments", "(", ")", ";", "allocateBucketSegments", "(", "(", "int", ")", "newNumBucketSegments", ")", ";", "T", "record",...
Same as above, but the number of bucket segments of the new table can be specified.
[ "Same", "as", "above", "but", "the", "number", "of", "bucket", "segments", "of", "the", "new", "table", "can", "be", "specified", "." ]
b62db93bf63cb3bb34dd03d611a779d9e3fc61ac
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/operators/hash/InPlaceMutableHashTable.java#L444-L472
123,154
apache/flink
flink-runtime/src/main/java/org/apache/flink/runtime/accumulators/StringifiedAccumulatorResult.java
StringifiedAccumulatorResult.stringifyAccumulatorResults
public static StringifiedAccumulatorResult[] stringifyAccumulatorResults(Map<String, OptionalFailure<Accumulator<?, ?>>> accs) { if (accs == null || accs.isEmpty()) { return new StringifiedAccumulatorResult[0]; } else { StringifiedAccumulatorResult[] results = new StringifiedAccumulatorResult[accs.size()]; ...
java
public static StringifiedAccumulatorResult[] stringifyAccumulatorResults(Map<String, OptionalFailure<Accumulator<?, ?>>> accs) { if (accs == null || accs.isEmpty()) { return new StringifiedAccumulatorResult[0]; } else { StringifiedAccumulatorResult[] results = new StringifiedAccumulatorResult[accs.size()]; ...
[ "public", "static", "StringifiedAccumulatorResult", "[", "]", "stringifyAccumulatorResults", "(", "Map", "<", "String", ",", "OptionalFailure", "<", "Accumulator", "<", "?", ",", "?", ">", ">", ">", "accs", ")", "{", "if", "(", "accs", "==", "null", "||", ...
Flatten a map of accumulator names to Accumulator instances into an array of StringifiedAccumulatorResult values.
[ "Flatten", "a", "map", "of", "accumulator", "names", "to", "Accumulator", "instances", "into", "an", "array", "of", "StringifiedAccumulatorResult", "values", "." ]
b62db93bf63cb3bb34dd03d611a779d9e3fc61ac
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/accumulators/StringifiedAccumulatorResult.java#L69-L82
123,155
apache/flink
flink-runtime/src/main/java/org/apache/flink/runtime/clusterframework/types/ResourceProfile.java
ResourceProfile.isMatching
public boolean isMatching(ResourceProfile required) { if (required == UNKNOWN) { return true; } if (cpuCores >= required.getCpuCores() && heapMemoryInMB >= required.getHeapMemoryInMB() && directMemoryInMB >= required.getDirectMemoryInMB() && nativeMemoryInMB >= required.getNativeMemoryInMB() && ...
java
public boolean isMatching(ResourceProfile required) { if (required == UNKNOWN) { return true; } if (cpuCores >= required.getCpuCores() && heapMemoryInMB >= required.getHeapMemoryInMB() && directMemoryInMB >= required.getDirectMemoryInMB() && nativeMemoryInMB >= required.getNativeMemoryInMB() && ...
[ "public", "boolean", "isMatching", "(", "ResourceProfile", "required", ")", "{", "if", "(", "required", "==", "UNKNOWN", ")", "{", "return", "true", ";", "}", "if", "(", "cpuCores", ">=", "required", ".", "getCpuCores", "(", ")", "&&", "heapMemoryInMB", ">...
Check whether required resource profile can be matched. @param required the required resource profile @return true if the requirement is matched, otherwise false
[ "Check", "whether", "required", "resource", "profile", "can", "be", "matched", "." ]
b62db93bf63cb3bb34dd03d611a779d9e3fc61ac
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/clusterframework/types/ResourceProfile.java#L208-L229
123,156
apache/flink
flink-table/flink-table-runtime-blink/src/main/java/org/apache/flink/table/dataformat/AbstractBinaryWriter.java
AbstractBinaryWriter.grow
private void grow(int minCapacity) { int oldCapacity = segment.size(); int newCapacity = oldCapacity + (oldCapacity >> 1); if (newCapacity - minCapacity < 0) { newCapacity = minCapacity; } segment = MemorySegmentFactory.wrap(Arrays.copyOf(segment.getArray(), newCapacity)); afterGrow(); }
java
private void grow(int minCapacity) { int oldCapacity = segment.size(); int newCapacity = oldCapacity + (oldCapacity >> 1); if (newCapacity - minCapacity < 0) { newCapacity = minCapacity; } segment = MemorySegmentFactory.wrap(Arrays.copyOf(segment.getArray(), newCapacity)); afterGrow(); }
[ "private", "void", "grow", "(", "int", "minCapacity", ")", "{", "int", "oldCapacity", "=", "segment", ".", "size", "(", ")", ";", "int", "newCapacity", "=", "oldCapacity", "+", "(", "oldCapacity", ">>", "1", ")", ";", "if", "(", "newCapacity", "-", "mi...
Increases the capacity to ensure that it can hold at least the minimum capacity argument.
[ "Increases", "the", "capacity", "to", "ensure", "that", "it", "can", "hold", "at", "least", "the", "minimum", "capacity", "argument", "." ]
b62db93bf63cb3bb34dd03d611a779d9e3fc61ac
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-table/flink-table-runtime-blink/src/main/java/org/apache/flink/table/dataformat/AbstractBinaryWriter.java#L270-L278
123,157
apache/flink
flink-runtime/src/main/java/org/apache/flink/runtime/io/network/NetworkEnvironment.java
NetworkEnvironment.releasePartitions
public void releasePartitions(Collection<ResultPartitionID> partitionIds) { for (ResultPartitionID partitionId : partitionIds) { resultPartitionManager.releasePartition(partitionId, null); } }
java
public void releasePartitions(Collection<ResultPartitionID> partitionIds) { for (ResultPartitionID partitionId : partitionIds) { resultPartitionManager.releasePartition(partitionId, null); } }
[ "public", "void", "releasePartitions", "(", "Collection", "<", "ResultPartitionID", ">", "partitionIds", ")", "{", "for", "(", "ResultPartitionID", "partitionId", ":", "partitionIds", ")", "{", "resultPartitionManager", ".", "releasePartition", "(", "partitionId", ","...
Batch release intermediate result partitions. @param partitionIds partition ids to release
[ "Batch", "release", "intermediate", "result", "partitions", "." ]
b62db93bf63cb3bb34dd03d611a779d9e3fc61ac
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/io/network/NetworkEnvironment.java#L217-L221
123,158
apache/flink
flink-core/src/main/java/org/apache/flink/api/common/restartstrategy/RestartStrategies.java
RestartStrategies.fixedDelayRestart
public static RestartStrategyConfiguration fixedDelayRestart(int restartAttempts, long delayBetweenAttempts) { return fixedDelayRestart(restartAttempts, Time.of(delayBetweenAttempts, TimeUnit.MILLISECONDS)); }
java
public static RestartStrategyConfiguration fixedDelayRestart(int restartAttempts, long delayBetweenAttempts) { return fixedDelayRestart(restartAttempts, Time.of(delayBetweenAttempts, TimeUnit.MILLISECONDS)); }
[ "public", "static", "RestartStrategyConfiguration", "fixedDelayRestart", "(", "int", "restartAttempts", ",", "long", "delayBetweenAttempts", ")", "{", "return", "fixedDelayRestart", "(", "restartAttempts", ",", "Time", ".", "of", "(", "delayBetweenAttempts", ",", "TimeU...
Generates a FixedDelayRestartStrategyConfiguration. @param restartAttempts Number of restart attempts for the FixedDelayRestartStrategy @param delayBetweenAttempts Delay in-between restart attempts for the FixedDelayRestartStrategy @return FixedDelayRestartStrategy
[ "Generates", "a", "FixedDelayRestartStrategyConfiguration", "." ]
b62db93bf63cb3bb34dd03d611a779d9e3fc61ac
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-core/src/main/java/org/apache/flink/api/common/restartstrategy/RestartStrategies.java#L57-L59
123,159
apache/flink
flink-core/src/main/java/org/apache/flink/api/common/restartstrategy/RestartStrategies.java
RestartStrategies.failureRateRestart
public static FailureRateRestartStrategyConfiguration failureRateRestart( int failureRate, Time failureInterval, Time delayInterval) { return new FailureRateRestartStrategyConfiguration(failureRate, failureInterval, delayInterval); }
java
public static FailureRateRestartStrategyConfiguration failureRateRestart( int failureRate, Time failureInterval, Time delayInterval) { return new FailureRateRestartStrategyConfiguration(failureRate, failureInterval, delayInterval); }
[ "public", "static", "FailureRateRestartStrategyConfiguration", "failureRateRestart", "(", "int", "failureRate", ",", "Time", "failureInterval", ",", "Time", "delayInterval", ")", "{", "return", "new", "FailureRateRestartStrategyConfiguration", "(", "failureRate", ",", "fail...
Generates a FailureRateRestartStrategyConfiguration. @param failureRate Maximum number of restarts in given interval {@code failureInterval} before failing a job @param failureInterval Time interval for failures @param delayInterval Delay in-between restart attempts
[ "Generates", "a", "FailureRateRestartStrategyConfiguration", "." ]
b62db93bf63cb3bb34dd03d611a779d9e3fc61ac
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-core/src/main/java/org/apache/flink/api/common/restartstrategy/RestartStrategies.java#L79-L82
123,160
apache/flink
flink-table/flink-sql-client/src/main/java/org/apache/flink/table/client/gateway/local/ProgramDeployer.java
ProgramDeployer.deployJob
private <T> void deployJob(ExecutionContext<T> context, JobGraph jobGraph, Result<T> result) { // create or retrieve cluster and deploy job try (final ClusterDescriptor<T> clusterDescriptor = context.createClusterDescriptor()) { try { // new cluster if (context.getClusterId() == null) { deployJobOnN...
java
private <T> void deployJob(ExecutionContext<T> context, JobGraph jobGraph, Result<T> result) { // create or retrieve cluster and deploy job try (final ClusterDescriptor<T> clusterDescriptor = context.createClusterDescriptor()) { try { // new cluster if (context.getClusterId() == null) { deployJobOnN...
[ "private", "<", "T", ">", "void", "deployJob", "(", "ExecutionContext", "<", "T", ">", "context", ",", "JobGraph", "jobGraph", ",", "Result", "<", "T", ">", "result", ")", "{", "// create or retrieve cluster and deploy job", "try", "(", "final", "ClusterDescript...
Deploys a job. Depending on the deployment creates a new job cluster. It saves the cluster id in the result and blocks until job completion.
[ "Deploys", "a", "job", ".", "Depending", "on", "the", "deployment", "creates", "a", "new", "job", "cluster", ".", "It", "saves", "the", "cluster", "id", "in", "the", "result", "and", "blocks", "until", "job", "completion", "." ]
b62db93bf63cb3bb34dd03d611a779d9e3fc61ac
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-table/flink-sql-client/src/main/java/org/apache/flink/table/client/gateway/local/ProgramDeployer.java#L89-L109
123,161
apache/flink
flink-runtime/src/main/java/org/apache/flink/runtime/operators/hash/ReOpenableMutableHashTable.java
ReOpenableMutableHashTable.storeInitialHashTable
void storeInitialHashTable() throws IOException { if (spilled) { return; // we create the initialHashTable only once. Later calls are caused by deeper recursion lvls } spilled = true; for (int partIdx = 0; partIdx < initialPartitions.size(); partIdx++) { final ReOpenableHashPartition<BT, PT> p = (ReOpe...
java
void storeInitialHashTable() throws IOException { if (spilled) { return; // we create the initialHashTable only once. Later calls are caused by deeper recursion lvls } spilled = true; for (int partIdx = 0; partIdx < initialPartitions.size(); partIdx++) { final ReOpenableHashPartition<BT, PT> p = (ReOpe...
[ "void", "storeInitialHashTable", "(", ")", "throws", "IOException", "{", "if", "(", "spilled", ")", "{", "return", ";", "// we create the initialHashTable only once. Later calls are caused by deeper recursion lvls", "}", "spilled", "=", "true", ";", "for", "(", "int", "...
This method stores the initial hash table's contents on disk if hash join needs the memory for further partition processing. The initial hash table is rebuild before a new secondary input is opened. For the sake of simplicity we iterate over all in-memory elements and store them in one file. The file is hashed into me...
[ "This", "method", "stores", "the", "initial", "hash", "table", "s", "contents", "on", "disk", "if", "hash", "join", "needs", "the", "memory", "for", "further", "partition", "processing", ".", "The", "initial", "hash", "table", "is", "rebuild", "before", "a",...
b62db93bf63cb3bb34dd03d611a779d9e3fc61ac
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/operators/hash/ReOpenableMutableHashTable.java#L135-L147
123,162
apache/flink
flink-table/flink-table-runtime-blink/src/main/java/org/apache/flink/table/runtime/sort/BinaryIndexedSortable.java
BinaryIndexedSortable.checkNextIndexOffset
protected boolean checkNextIndexOffset() { if (this.currentSortIndexOffset > this.lastIndexEntryOffset) { MemorySegment returnSegment = nextMemorySegment(); if (returnSegment != null) { this.currentSortIndexSegment = returnSegment; this.sortIndex.add(this.currentSortIndexSegment); this.currentSortIn...
java
protected boolean checkNextIndexOffset() { if (this.currentSortIndexOffset > this.lastIndexEntryOffset) { MemorySegment returnSegment = nextMemorySegment(); if (returnSegment != null) { this.currentSortIndexSegment = returnSegment; this.sortIndex.add(this.currentSortIndexSegment); this.currentSortIn...
[ "protected", "boolean", "checkNextIndexOffset", "(", ")", "{", "if", "(", "this", ".", "currentSortIndexOffset", ">", "this", ".", "lastIndexEntryOffset", ")", "{", "MemorySegment", "returnSegment", "=", "nextMemorySegment", "(", ")", ";", "if", "(", "returnSegmen...
check if we need request next index memory.
[ "check", "if", "we", "need", "request", "next", "index", "memory", "." ]
b62db93bf63cb3bb34dd03d611a779d9e3fc61ac
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-table/flink-table-runtime-blink/src/main/java/org/apache/flink/table/runtime/sort/BinaryIndexedSortable.java#L121-L133
123,163
apache/flink
flink-table/flink-table-runtime-blink/src/main/java/org/apache/flink/table/runtime/sort/BinaryIndexedSortable.java
BinaryIndexedSortable.writeIndexAndNormalizedKey
protected void writeIndexAndNormalizedKey(BaseRow record, long currOffset) { // add the pointer and the normalized key this.currentSortIndexSegment.putLong(this.currentSortIndexOffset, currOffset); if (this.numKeyBytes != 0) { normalizedKeyComputer.putKey(record, this.currentSortIndexSegment, this.currentSort...
java
protected void writeIndexAndNormalizedKey(BaseRow record, long currOffset) { // add the pointer and the normalized key this.currentSortIndexSegment.putLong(this.currentSortIndexOffset, currOffset); if (this.numKeyBytes != 0) { normalizedKeyComputer.putKey(record, this.currentSortIndexSegment, this.currentSort...
[ "protected", "void", "writeIndexAndNormalizedKey", "(", "BaseRow", "record", ",", "long", "currOffset", ")", "{", "// add the pointer and the normalized key", "this", ".", "currentSortIndexSegment", ".", "putLong", "(", "this", ".", "currentSortIndexOffset", ",", "currOff...
Write of index and normalizedKey.
[ "Write", "of", "index", "and", "normalizedKey", "." ]
b62db93bf63cb3bb34dd03d611a779d9e3fc61ac
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-table/flink-table-runtime-blink/src/main/java/org/apache/flink/table/runtime/sort/BinaryIndexedSortable.java#L138-L148
123,164
apache/flink
flink-libraries/flink-python/src/main/java/org/apache/flink/python/api/streaming/data/PythonReceiver.java
PythonReceiver.collectBuffer
@SuppressWarnings({ "rawtypes", "unchecked" }) public void collectBuffer(Collector<OUT> c, int bufferSize) throws IOException { fileBuffer.position(0); while (fileBuffer.position() < bufferSize) { c.collect(deserializer.deserialize()); } }
java
@SuppressWarnings({ "rawtypes", "unchecked" }) public void collectBuffer(Collector<OUT> c, int bufferSize) throws IOException { fileBuffer.position(0); while (fileBuffer.position() < bufferSize) { c.collect(deserializer.deserialize()); } }
[ "@", "SuppressWarnings", "(", "{", "\"rawtypes\"", ",", "\"unchecked\"", "}", ")", "public", "void", "collectBuffer", "(", "Collector", "<", "OUT", ">", "c", ",", "int", "bufferSize", ")", "throws", "IOException", "{", "fileBuffer", ".", "position", "(", "0"...
Reads a buffer of the given size from the memory-mapped file, and collects all records contained. This method assumes that all values in the buffer are of the same type. This method does NOT take care of synchronization. The user must guarantee that the buffer was completely written before calling this method. @param ...
[ "Reads", "a", "buffer", "of", "the", "given", "size", "from", "the", "memory", "-", "mapped", "file", "and", "collects", "all", "records", "contained", ".", "This", "method", "assumes", "that", "all", "values", "in", "the", "buffer", "are", "of", "the", ...
b62db93bf63cb3bb34dd03d611a779d9e3fc61ac
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-libraries/flink-python/src/main/java/org/apache/flink/python/api/streaming/data/PythonReceiver.java#L91-L98
123,165
apache/flink
flink-libraries/flink-cep/src/main/java/org/apache/flink/cep/nfa/sharedbuffer/SharedBuffer.java
SharedBuffer.init
@Deprecated public void init( Map<EventId, Lockable<V>> events, Map<NodeId, Lockable<SharedBufferNode>> entries) throws Exception { eventsBuffer.putAll(events); this.entries.putAll(entries); Map<Long, Integer> maxIds = events.keySet().stream().collect(Collectors.toMap( EventId::getTimestamp, EventId...
java
@Deprecated public void init( Map<EventId, Lockable<V>> events, Map<NodeId, Lockable<SharedBufferNode>> entries) throws Exception { eventsBuffer.putAll(events); this.entries.putAll(entries); Map<Long, Integer> maxIds = events.keySet().stream().collect(Collectors.toMap( EventId::getTimestamp, EventId...
[ "@", "Deprecated", "public", "void", "init", "(", "Map", "<", "EventId", ",", "Lockable", "<", "V", ">", ">", "events", ",", "Map", "<", "NodeId", ",", "Lockable", "<", "SharedBufferNode", ">", ">", "entries", ")", "throws", "Exception", "{", "eventsBuff...
Initializes underlying state with given map of events and entries. Should be used only in case of migration from old state. @param events map of events with assigned unique ids @param entries map of SharedBufferNodes @throws Exception Thrown if the system cannot access the state. @deprecated Only for state migration!
[ "Initializes", "underlying", "state", "with", "given", "map", "of", "events", "and", "entries", ".", "Should", "be", "used", "only", "in", "case", "of", "migration", "from", "old", "state", "." ]
b62db93bf63cb3bb34dd03d611a779d9e3fc61ac
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-libraries/flink-cep/src/main/java/org/apache/flink/cep/nfa/sharedbuffer/SharedBuffer.java#L100-L113
123,166
apache/flink
flink-libraries/flink-cep/src/main/java/org/apache/flink/cep/nfa/sharedbuffer/SharedBuffer.java
SharedBuffer.isEmpty
public boolean isEmpty() throws Exception { return Iterables.isEmpty(eventsBufferCache.keySet()) && Iterables.isEmpty(eventsBuffer.keys()); }
java
public boolean isEmpty() throws Exception { return Iterables.isEmpty(eventsBufferCache.keySet()) && Iterables.isEmpty(eventsBuffer.keys()); }
[ "public", "boolean", "isEmpty", "(", ")", "throws", "Exception", "{", "return", "Iterables", ".", "isEmpty", "(", "eventsBufferCache", ".", "keySet", "(", ")", ")", "&&", "Iterables", ".", "isEmpty", "(", "eventsBuffer", ".", "keys", "(", ")", ")", ";", ...
Checks if there is no elements in the buffer. @return true if there is no elements in the buffer @throws Exception Thrown if the system cannot access the state.
[ "Checks", "if", "there", "is", "no", "elements", "in", "the", "buffer", "." ]
b62db93bf63cb3bb34dd03d611a779d9e3fc61ac
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-libraries/flink-cep/src/main/java/org/apache/flink/cep/nfa/sharedbuffer/SharedBuffer.java#L152-L154
123,167
apache/flink
flink-libraries/flink-cep/src/main/java/org/apache/flink/cep/nfa/sharedbuffer/SharedBuffer.java
SharedBuffer.upsertEvent
void upsertEvent(EventId eventId, Lockable<V> event) { this.eventsBufferCache.put(eventId, event); }
java
void upsertEvent(EventId eventId, Lockable<V> event) { this.eventsBufferCache.put(eventId, event); }
[ "void", "upsertEvent", "(", "EventId", "eventId", ",", "Lockable", "<", "V", ">", "event", ")", "{", "this", ".", "eventsBufferCache", ".", "put", "(", "eventId", ",", "event", ")", ";", "}" ]
Inserts or updates an event in cache. @param eventId id of the event @param event event body
[ "Inserts", "or", "updates", "an", "event", "in", "cache", "." ]
b62db93bf63cb3bb34dd03d611a779d9e3fc61ac
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-libraries/flink-cep/src/main/java/org/apache/flink/cep/nfa/sharedbuffer/SharedBuffer.java#L162-L164
123,168
apache/flink
flink-libraries/flink-cep/src/main/java/org/apache/flink/cep/nfa/sharedbuffer/SharedBuffer.java
SharedBuffer.upsertEntry
void upsertEntry(NodeId nodeId, Lockable<SharedBufferNode> entry) { this.entryCache.put(nodeId, entry); }
java
void upsertEntry(NodeId nodeId, Lockable<SharedBufferNode> entry) { this.entryCache.put(nodeId, entry); }
[ "void", "upsertEntry", "(", "NodeId", "nodeId", ",", "Lockable", "<", "SharedBufferNode", ">", "entry", ")", "{", "this", ".", "entryCache", ".", "put", "(", "nodeId", ",", "entry", ")", ";", "}" ]
Inserts or updates a shareBufferNode in cache. @param nodeId id of the event @param entry SharedBufferNode
[ "Inserts", "or", "updates", "a", "shareBufferNode", "in", "cache", "." ]
b62db93bf63cb3bb34dd03d611a779d9e3fc61ac
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-libraries/flink-cep/src/main/java/org/apache/flink/cep/nfa/sharedbuffer/SharedBuffer.java#L172-L174
123,169
apache/flink
flink-libraries/flink-cep/src/main/java/org/apache/flink/cep/nfa/sharedbuffer/SharedBuffer.java
SharedBuffer.removeEvent
void removeEvent(EventId eventId) throws Exception { this.eventsBufferCache.remove(eventId); this.eventsBuffer.remove(eventId); }
java
void removeEvent(EventId eventId) throws Exception { this.eventsBufferCache.remove(eventId); this.eventsBuffer.remove(eventId); }
[ "void", "removeEvent", "(", "EventId", "eventId", ")", "throws", "Exception", "{", "this", ".", "eventsBufferCache", ".", "remove", "(", "eventId", ")", ";", "this", ".", "eventsBuffer", ".", "remove", "(", "eventId", ")", ";", "}" ]
Removes an event from cache and state. @param eventId id of the event
[ "Removes", "an", "event", "from", "cache", "and", "state", "." ]
b62db93bf63cb3bb34dd03d611a779d9e3fc61ac
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-libraries/flink-cep/src/main/java/org/apache/flink/cep/nfa/sharedbuffer/SharedBuffer.java#L181-L184
123,170
apache/flink
flink-libraries/flink-cep/src/main/java/org/apache/flink/cep/nfa/sharedbuffer/SharedBuffer.java
SharedBuffer.removeEntry
void removeEntry(NodeId nodeId) throws Exception { this.entryCache.remove(nodeId); this.entries.remove(nodeId); }
java
void removeEntry(NodeId nodeId) throws Exception { this.entryCache.remove(nodeId); this.entries.remove(nodeId); }
[ "void", "removeEntry", "(", "NodeId", "nodeId", ")", "throws", "Exception", "{", "this", ".", "entryCache", ".", "remove", "(", "nodeId", ")", ";", "this", ".", "entries", ".", "remove", "(", "nodeId", ")", ";", "}" ]
Removes a ShareBufferNode from cache and state. @param nodeId id of the event
[ "Removes", "a", "ShareBufferNode", "from", "cache", "and", "state", "." ]
b62db93bf63cb3bb34dd03d611a779d9e3fc61ac
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-libraries/flink-cep/src/main/java/org/apache/flink/cep/nfa/sharedbuffer/SharedBuffer.java#L191-L194
123,171
apache/flink
flink-libraries/flink-cep/src/main/java/org/apache/flink/cep/nfa/sharedbuffer/SharedBuffer.java
SharedBuffer.getEntry
Lockable<SharedBufferNode> getEntry(NodeId nodeId) { return entryCache.computeIfAbsent(nodeId, id -> { try { return entries.get(id); } catch (Exception ex) { throw new WrappingRuntimeException(ex); } }); }
java
Lockable<SharedBufferNode> getEntry(NodeId nodeId) { return entryCache.computeIfAbsent(nodeId, id -> { try { return entries.get(id); } catch (Exception ex) { throw new WrappingRuntimeException(ex); } }); }
[ "Lockable", "<", "SharedBufferNode", ">", "getEntry", "(", "NodeId", "nodeId", ")", "{", "return", "entryCache", ".", "computeIfAbsent", "(", "nodeId", ",", "id", "->", "{", "try", "{", "return", "entries", ".", "get", "(", "id", ")", ";", "}", "catch", ...
It always returns node either from state or cache. @param nodeId id of the node @return SharedBufferNode
[ "It", "always", "returns", "node", "either", "from", "state", "or", "cache", "." ]
b62db93bf63cb3bb34dd03d611a779d9e3fc61ac
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-libraries/flink-cep/src/main/java/org/apache/flink/cep/nfa/sharedbuffer/SharedBuffer.java#L202-L210
123,172
apache/flink
flink-libraries/flink-cep/src/main/java/org/apache/flink/cep/nfa/sharedbuffer/SharedBuffer.java
SharedBuffer.getEvent
Lockable<V> getEvent(EventId eventId) { return eventsBufferCache.computeIfAbsent(eventId, id -> { try { return eventsBuffer.get(id); } catch (Exception ex) { throw new WrappingRuntimeException(ex); } }); }
java
Lockable<V> getEvent(EventId eventId) { return eventsBufferCache.computeIfAbsent(eventId, id -> { try { return eventsBuffer.get(id); } catch (Exception ex) { throw new WrappingRuntimeException(ex); } }); }
[ "Lockable", "<", "V", ">", "getEvent", "(", "EventId", "eventId", ")", "{", "return", "eventsBufferCache", ".", "computeIfAbsent", "(", "eventId", ",", "id", "->", "{", "try", "{", "return", "eventsBuffer", ".", "get", "(", "id", ")", ";", "}", "catch", ...
It always returns event either from state or cache. @param eventId id of the event @return event
[ "It", "always", "returns", "event", "either", "from", "state", "or", "cache", "." ]
b62db93bf63cb3bb34dd03d611a779d9e3fc61ac
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-libraries/flink-cep/src/main/java/org/apache/flink/cep/nfa/sharedbuffer/SharedBuffer.java#L218-L226
123,173
apache/flink
flink-libraries/flink-cep/src/main/java/org/apache/flink/cep/nfa/sharedbuffer/SharedBuffer.java
SharedBuffer.flushCache
void flushCache() throws Exception { if (!entryCache.isEmpty()) { entries.putAll(entryCache); entryCache.clear(); } if (!eventsBufferCache.isEmpty()) { eventsBuffer.putAll(eventsBufferCache); eventsBufferCache.clear(); } }
java
void flushCache() throws Exception { if (!entryCache.isEmpty()) { entries.putAll(entryCache); entryCache.clear(); } if (!eventsBufferCache.isEmpty()) { eventsBuffer.putAll(eventsBufferCache); eventsBufferCache.clear(); } }
[ "void", "flushCache", "(", ")", "throws", "Exception", "{", "if", "(", "!", "entryCache", ".", "isEmpty", "(", ")", ")", "{", "entries", ".", "putAll", "(", "entryCache", ")", ";", "entryCache", ".", "clear", "(", ")", ";", "}", "if", "(", "!", "ev...
Flush the event and node from cache to state. @throws Exception Thrown if the system cannot access the state.
[ "Flush", "the", "event", "and", "node", "from", "cache", "to", "state", "." ]
b62db93bf63cb3bb34dd03d611a779d9e3fc61ac
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-libraries/flink-cep/src/main/java/org/apache/flink/cep/nfa/sharedbuffer/SharedBuffer.java#L233-L242
123,174
apache/flink
flink-streaming-java/src/main/java/org/apache/flink/streaming/api/windowing/windows/TimeWindow.java
TimeWindow.cover
public TimeWindow cover(TimeWindow other) { return new TimeWindow(Math.min(start, other.start), Math.max(end, other.end)); }
java
public TimeWindow cover(TimeWindow other) { return new TimeWindow(Math.min(start, other.start), Math.max(end, other.end)); }
[ "public", "TimeWindow", "cover", "(", "TimeWindow", "other", ")", "{", "return", "new", "TimeWindow", "(", "Math", ".", "min", "(", "start", ",", "other", ".", "start", ")", ",", "Math", ".", "max", "(", "end", ",", "other", ".", "end", ")", ")", "...
Returns the minimal window covers both this window and the given window.
[ "Returns", "the", "minimal", "window", "covers", "both", "this", "window", "and", "the", "given", "window", "." ]
b62db93bf63cb3bb34dd03d611a779d9e3fc61ac
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-streaming-java/src/main/java/org/apache/flink/streaming/api/windowing/windows/TimeWindow.java#L126-L128
123,175
apache/flink
flink-optimizer/src/main/java/org/apache/flink/optimizer/dag/DataSinkNode.java
DataSinkNode.computeOperatorSpecificDefaultEstimates
@Override protected void computeOperatorSpecificDefaultEstimates(DataStatistics statistics) { this.estimatedNumRecords = getPredecessorNode().getEstimatedNumRecords(); this.estimatedOutputSize = getPredecessorNode().getEstimatedOutputSize(); }
java
@Override protected void computeOperatorSpecificDefaultEstimates(DataStatistics statistics) { this.estimatedNumRecords = getPredecessorNode().getEstimatedNumRecords(); this.estimatedOutputSize = getPredecessorNode().getEstimatedOutputSize(); }
[ "@", "Override", "protected", "void", "computeOperatorSpecificDefaultEstimates", "(", "DataStatistics", "statistics", ")", "{", "this", ".", "estimatedNumRecords", "=", "getPredecessorNode", "(", ")", ".", "getEstimatedNumRecords", "(", ")", ";", "this", ".", "estimat...
Computes the estimated outputs for the data sink. Since the sink does not modify anything, it simply copies the output estimates from its direct predecessor.
[ "Computes", "the", "estimated", "outputs", "for", "the", "data", "sink", ".", "Since", "the", "sink", "does", "not", "modify", "anything", "it", "simply", "copies", "the", "output", "estimates", "from", "its", "direct", "predecessor", "." ]
b62db93bf63cb3bb34dd03d611a779d9e3fc61ac
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-optimizer/src/main/java/org/apache/flink/optimizer/dag/DataSinkNode.java#L132-L136
123,176
apache/flink
flink-connectors/flink-connector-kafka-base/src/main/java/org/apache/flink/streaming/connectors/kafka/internals/AbstractPartitionDiscoverer.java
AbstractPartitionDiscoverer.discoverPartitions
public List<KafkaTopicPartition> discoverPartitions() throws WakeupException, ClosedException { if (!closed && !wakeup) { try { List<KafkaTopicPartition> newDiscoveredPartitions; // (1) get all possible partitions, based on whether we are subscribed to fixed topics or a topic pattern if (topicsDescrip...
java
public List<KafkaTopicPartition> discoverPartitions() throws WakeupException, ClosedException { if (!closed && !wakeup) { try { List<KafkaTopicPartition> newDiscoveredPartitions; // (1) get all possible partitions, based on whether we are subscribed to fixed topics or a topic pattern if (topicsDescrip...
[ "public", "List", "<", "KafkaTopicPartition", ">", "discoverPartitions", "(", ")", "throws", "WakeupException", ",", "ClosedException", "{", "if", "(", "!", "closed", "&&", "!", "wakeup", ")", "{", "try", "{", "List", "<", "KafkaTopicPartition", ">", "newDisco...
Execute a partition discovery attempt for this subtask. This method lets the partition discoverer update what partitions it has discovered so far. @return List of discovered new partitions that this subtask should subscribe to.
[ "Execute", "a", "partition", "discovery", "attempt", "for", "this", "subtask", ".", "This", "method", "lets", "the", "partition", "discoverer", "update", "what", "partitions", "it", "has", "discovered", "so", "far", "." ]
b62db93bf63cb3bb34dd03d611a779d9e3fc61ac
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-connectors/flink-connector-kafka-base/src/main/java/org/apache/flink/streaming/connectors/kafka/internals/AbstractPartitionDiscoverer.java#L124-L179
123,177
apache/flink
flink-connectors/flink-connector-kafka-base/src/main/java/org/apache/flink/streaming/connectors/kafka/internals/AbstractPartitionDiscoverer.java
AbstractPartitionDiscoverer.setAndCheckDiscoveredPartition
public boolean setAndCheckDiscoveredPartition(KafkaTopicPartition partition) { if (isUndiscoveredPartition(partition)) { discoveredPartitions.add(partition); return KafkaTopicPartitionAssigner.assign(partition, numParallelSubtasks) == indexOfThisSubtask; } return false; }
java
public boolean setAndCheckDiscoveredPartition(KafkaTopicPartition partition) { if (isUndiscoveredPartition(partition)) { discoveredPartitions.add(partition); return KafkaTopicPartitionAssigner.assign(partition, numParallelSubtasks) == indexOfThisSubtask; } return false; }
[ "public", "boolean", "setAndCheckDiscoveredPartition", "(", "KafkaTopicPartition", "partition", ")", "{", "if", "(", "isUndiscoveredPartition", "(", "partition", ")", ")", "{", "discoveredPartitions", ".", "add", "(", "partition", ")", ";", "return", "KafkaTopicPartit...
Sets a partition as discovered. Partitions are considered as new if its partition id is larger than all partition ids previously seen for the topic it belongs to. Therefore, for a set of discovered partitions, the order that this method is invoked with each partition is important. <p>If the partition is indeed newly d...
[ "Sets", "a", "partition", "as", "discovered", ".", "Partitions", "are", "considered", "as", "new", "if", "its", "partition", "id", "is", "larger", "than", "all", "partition", "ids", "previously", "seen", "for", "the", "topic", "it", "belongs", "to", ".", "...
b62db93bf63cb3bb34dd03d611a779d9e3fc61ac
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-connectors/flink-connector-kafka-base/src/main/java/org/apache/flink/streaming/connectors/kafka/internals/AbstractPartitionDiscoverer.java#L196-L204
123,178
apache/flink
flink-runtime/src/main/java/org/apache/flink/runtime/checkpoint/CheckpointCoordinator.java
CheckpointCoordinator.shutdown
public void shutdown(JobStatus jobStatus) throws Exception { synchronized (lock) { if (!shutdown) { shutdown = true; LOG.info("Stopping checkpoint coordinator for job {}.", job); periodicScheduling = false; triggerRequestQueued = false; // shut down the hooks MasterHooks.close(masterHooks...
java
public void shutdown(JobStatus jobStatus) throws Exception { synchronized (lock) { if (!shutdown) { shutdown = true; LOG.info("Stopping checkpoint coordinator for job {}.", job); periodicScheduling = false; triggerRequestQueued = false; // shut down the hooks MasterHooks.close(masterHooks...
[ "public", "void", "shutdown", "(", "JobStatus", "jobStatus", ")", "throws", "Exception", "{", "synchronized", "(", "lock", ")", "{", "if", "(", "!", "shutdown", ")", "{", "shutdown", "=", "true", ";", "LOG", ".", "info", "(", "\"Stopping checkpoint coordinat...
Shuts down the checkpoint coordinator. <p>After this method has been called, the coordinator does not accept and further messages and cannot trigger any further checkpoints.
[ "Shuts", "down", "the", "checkpoint", "coordinator", "." ]
b62db93bf63cb3bb34dd03d611a779d9e3fc61ac
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/checkpoint/CheckpointCoordinator.java#L323-L349
123,179
apache/flink
flink-runtime/src/main/java/org/apache/flink/runtime/checkpoint/CheckpointCoordinator.java
CheckpointCoordinator.triggerSavepoint
public CompletableFuture<CompletedCheckpoint> triggerSavepoint( final long timestamp, @Nullable final String targetLocation) { final CheckpointProperties properties = CheckpointProperties.forSavepoint(); return triggerSavepointInternal(timestamp, properties, false, targetLocation); }
java
public CompletableFuture<CompletedCheckpoint> triggerSavepoint( final long timestamp, @Nullable final String targetLocation) { final CheckpointProperties properties = CheckpointProperties.forSavepoint(); return triggerSavepointInternal(timestamp, properties, false, targetLocation); }
[ "public", "CompletableFuture", "<", "CompletedCheckpoint", ">", "triggerSavepoint", "(", "final", "long", "timestamp", ",", "@", "Nullable", "final", "String", "targetLocation", ")", "{", "final", "CheckpointProperties", "properties", "=", "CheckpointProperties", ".", ...
Triggers a savepoint with the given savepoint directory as a target. @param timestamp The timestamp for the savepoint. @param targetLocation Target location for the savepoint, optional. If null, the state backend's configured default will be used. @return A future to the completed checkpoint @throws IllegalStateExcept...
[ "Triggers", "a", "savepoint", "with", "the", "given", "savepoint", "directory", "as", "a", "target", "." ]
b62db93bf63cb3bb34dd03d611a779d9e3fc61ac
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/checkpoint/CheckpointCoordinator.java#L370-L376
123,180
apache/flink
flink-runtime/src/main/java/org/apache/flink/runtime/checkpoint/CheckpointCoordinator.java
CheckpointCoordinator.triggerSynchronousSavepoint
public CompletableFuture<CompletedCheckpoint> triggerSynchronousSavepoint( final long timestamp, final boolean advanceToEndOfEventTime, @Nullable final String targetLocation) { final CheckpointProperties properties = CheckpointProperties.forSyncSavepoint(); return triggerSavepointInternal(timestamp, prope...
java
public CompletableFuture<CompletedCheckpoint> triggerSynchronousSavepoint( final long timestamp, final boolean advanceToEndOfEventTime, @Nullable final String targetLocation) { final CheckpointProperties properties = CheckpointProperties.forSyncSavepoint(); return triggerSavepointInternal(timestamp, prope...
[ "public", "CompletableFuture", "<", "CompletedCheckpoint", ">", "triggerSynchronousSavepoint", "(", "final", "long", "timestamp", ",", "final", "boolean", "advanceToEndOfEventTime", ",", "@", "Nullable", "final", "String", "targetLocation", ")", "{", "final", "Checkpoin...
Triggers a synchronous savepoint with the given savepoint directory as a target. @param timestamp The timestamp for the savepoint. @param advanceToEndOfEventTime Flag indicating if the source should inject a {@code MAX_WATERMARK} in the pipeline to fire any registered event-time timers. @param targetLocation Target lo...
[ "Triggers", "a", "synchronous", "savepoint", "with", "the", "given", "savepoint", "directory", "as", "a", "target", "." ]
b62db93bf63cb3bb34dd03d611a779d9e3fc61ac
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/checkpoint/CheckpointCoordinator.java#L391-L398
123,181
apache/flink
flink-runtime/src/main/java/org/apache/flink/runtime/checkpoint/CheckpointCoordinator.java
CheckpointCoordinator.triggerCheckpoint
public boolean triggerCheckpoint(long timestamp, boolean isPeriodic) { try { triggerCheckpoint(timestamp, checkpointProperties, null, isPeriodic, false); return true; } catch (CheckpointException e) { return false; } }
java
public boolean triggerCheckpoint(long timestamp, boolean isPeriodic) { try { triggerCheckpoint(timestamp, checkpointProperties, null, isPeriodic, false); return true; } catch (CheckpointException e) { return false; } }
[ "public", "boolean", "triggerCheckpoint", "(", "long", "timestamp", ",", "boolean", "isPeriodic", ")", "{", "try", "{", "triggerCheckpoint", "(", "timestamp", ",", "checkpointProperties", ",", "null", ",", "isPeriodic", ",", "false", ")", ";", "return", "true", ...
Triggers a new standard checkpoint and uses the given timestamp as the checkpoint timestamp. @param timestamp The timestamp for the checkpoint. @param isPeriodic Flag indicating whether this triggered checkpoint is periodic. If this flag is true, but the periodic scheduler is disabled, the checkpoint will be declined....
[ "Triggers", "a", "new", "standard", "checkpoint", "and", "uses", "the", "given", "timestamp", "as", "the", "checkpoint", "timestamp", "." ]
b62db93bf63cb3bb34dd03d611a779d9e3fc61ac
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/checkpoint/CheckpointCoordinator.java#L433-L440
123,182
apache/flink
flink-runtime/src/main/java/org/apache/flink/runtime/checkpoint/CheckpointCoordinator.java
CheckpointCoordinator.completePendingCheckpoint
private void completePendingCheckpoint(PendingCheckpoint pendingCheckpoint) throws CheckpointException { final long checkpointId = pendingCheckpoint.getCheckpointId(); final CompletedCheckpoint completedCheckpoint; // As a first step to complete the checkpoint, we register its state with the registry Map<Opera...
java
private void completePendingCheckpoint(PendingCheckpoint pendingCheckpoint) throws CheckpointException { final long checkpointId = pendingCheckpoint.getCheckpointId(); final CompletedCheckpoint completedCheckpoint; // As a first step to complete the checkpoint, we register its state with the registry Map<Opera...
[ "private", "void", "completePendingCheckpoint", "(", "PendingCheckpoint", "pendingCheckpoint", ")", "throws", "CheckpointException", "{", "final", "long", "checkpointId", "=", "pendingCheckpoint", ".", "getCheckpointId", "(", ")", ";", "final", "CompletedCheckpoint", "com...
Try to complete the given pending checkpoint. <p>Important: This method should only be called in the checkpoint lock scope. @param pendingCheckpoint to complete @throws CheckpointException if the completion failed
[ "Try", "to", "complete", "the", "given", "pending", "checkpoint", "." ]
b62db93bf63cb3bb34dd03d611a779d9e3fc61ac
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/checkpoint/CheckpointCoordinator.java#L872-L955
123,183
apache/flink
flink-runtime/src/main/java/org/apache/flink/runtime/checkpoint/CheckpointCoordinator.java
CheckpointCoordinator.failUnacknowledgedPendingCheckpointsFor
public void failUnacknowledgedPendingCheckpointsFor(ExecutionAttemptID executionAttemptId, Throwable cause) { synchronized (lock) { Iterator<PendingCheckpoint> pendingCheckpointIterator = pendingCheckpoints.values().iterator(); while (pendingCheckpointIterator.hasNext()) { final PendingCheckpoint pendingCh...
java
public void failUnacknowledgedPendingCheckpointsFor(ExecutionAttemptID executionAttemptId, Throwable cause) { synchronized (lock) { Iterator<PendingCheckpoint> pendingCheckpointIterator = pendingCheckpoints.values().iterator(); while (pendingCheckpointIterator.hasNext()) { final PendingCheckpoint pendingCh...
[ "public", "void", "failUnacknowledgedPendingCheckpointsFor", "(", "ExecutionAttemptID", "executionAttemptId", ",", "Throwable", "cause", ")", "{", "synchronized", "(", "lock", ")", "{", "Iterator", "<", "PendingCheckpoint", ">", "pendingCheckpointIterator", "=", "pendingC...
Fails all pending checkpoints which have not been acknowledged by the given execution attempt id. @param executionAttemptId for which to discard unacknowledged pending checkpoints @param cause of the failure
[ "Fails", "all", "pending", "checkpoints", "which", "have", "not", "been", "acknowledged", "by", "the", "given", "execution", "attempt", "id", "." ]
b62db93bf63cb3bb34dd03d611a779d9e3fc61ac
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/checkpoint/CheckpointCoordinator.java#L964-L977
123,184
apache/flink
flink-runtime/src/main/java/org/apache/flink/runtime/checkpoint/CheckpointCoordinator.java
CheckpointCoordinator.triggerQueuedRequests
private void triggerQueuedRequests() { if (triggerRequestQueued) { triggerRequestQueued = false; // trigger the checkpoint from the trigger timer, to finish the work of this thread before // starting with the next checkpoint if (periodicScheduling) { if (currentPeriodicTrigger != null) { current...
java
private void triggerQueuedRequests() { if (triggerRequestQueued) { triggerRequestQueued = false; // trigger the checkpoint from the trigger timer, to finish the work of this thread before // starting with the next checkpoint if (periodicScheduling) { if (currentPeriodicTrigger != null) { current...
[ "private", "void", "triggerQueuedRequests", "(", ")", "{", "if", "(", "triggerRequestQueued", ")", "{", "triggerRequestQueued", "=", "false", ";", "// trigger the checkpoint from the trigger timer, to finish the work of this thread before", "// starting with the next checkpoint", "...
Triggers the queued request, if there is one. <p>NOTE: The caller of this method must hold the lock when invoking the method!
[ "Triggers", "the", "queued", "request", "if", "there", "is", "one", "." ]
b62db93bf63cb3bb34dd03d611a779d9e3fc61ac
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/checkpoint/CheckpointCoordinator.java#L1005-L1023
123,185
apache/flink
flink-runtime/src/main/java/org/apache/flink/runtime/checkpoint/CheckpointCoordinator.java
CheckpointCoordinator.restoreSavepoint
public boolean restoreSavepoint( String savepointPointer, boolean allowNonRestored, Map<JobVertexID, ExecutionJobVertex> tasks, ClassLoader userClassLoader) throws Exception { Preconditions.checkNotNull(savepointPointer, "The savepoint path cannot be null."); LOG.info("Starting job {} from savepoint {...
java
public boolean restoreSavepoint( String savepointPointer, boolean allowNonRestored, Map<JobVertexID, ExecutionJobVertex> tasks, ClassLoader userClassLoader) throws Exception { Preconditions.checkNotNull(savepointPointer, "The savepoint path cannot be null."); LOG.info("Starting job {} from savepoint {...
[ "public", "boolean", "restoreSavepoint", "(", "String", "savepointPointer", ",", "boolean", "allowNonRestored", ",", "Map", "<", "JobVertexID", ",", "ExecutionJobVertex", ">", "tasks", ",", "ClassLoader", "userClassLoader", ")", "throws", "Exception", "{", "Preconditi...
Restore the state with given savepoint. @param savepointPointer The pointer to the savepoint. @param allowNonRestored True if allowing checkpoint state that cannot be mapped to any job vertex in tasks. @param tasks Map of job vertices to restore. State for these vertices is restored via {@link Execution#set...
[ "Restore", "the", "state", "with", "given", "savepoint", "." ]
b62db93bf63cb3bb34dd03d611a779d9e3fc61ac
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/checkpoint/CheckpointCoordinator.java#L1144-L1170
123,186
apache/flink
flink-runtime/src/main/java/org/apache/flink/runtime/checkpoint/CheckpointCoordinator.java
CheckpointCoordinator.abortPendingCheckpoints
public void abortPendingCheckpoints(CheckpointException exception) { synchronized (lock) { for (PendingCheckpoint p : pendingCheckpoints.values()) { p.abort(exception.getCheckpointFailureReason()); } pendingCheckpoints.clear(); } }
java
public void abortPendingCheckpoints(CheckpointException exception) { synchronized (lock) { for (PendingCheckpoint p : pendingCheckpoints.values()) { p.abort(exception.getCheckpointFailureReason()); } pendingCheckpoints.clear(); } }
[ "public", "void", "abortPendingCheckpoints", "(", "CheckpointException", "exception", ")", "{", "synchronized", "(", "lock", ")", "{", "for", "(", "PendingCheckpoint", "p", ":", "pendingCheckpoints", ".", "values", "(", ")", ")", "{", "p", ".", "abort", "(", ...
Aborts all the pending checkpoints due to en exception. @param exception The exception.
[ "Aborts", "all", "the", "pending", "checkpoints", "due", "to", "en", "exception", "." ]
b62db93bf63cb3bb34dd03d611a779d9e3fc61ac
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/checkpoint/CheckpointCoordinator.java#L1264-L1272
123,187
apache/flink
flink-runtime/src/main/java/org/apache/flink/runtime/checkpoint/CheckpointCoordinator.java
CheckpointCoordinator.discardSubtaskState
private void discardSubtaskState( final JobID jobId, final ExecutionAttemptID executionAttemptID, final long checkpointId, final TaskStateSnapshot subtaskState) { if (subtaskState != null) { executor.execute(new Runnable() { @Override public void run() { try { subtaskState.discardS...
java
private void discardSubtaskState( final JobID jobId, final ExecutionAttemptID executionAttemptID, final long checkpointId, final TaskStateSnapshot subtaskState) { if (subtaskState != null) { executor.execute(new Runnable() { @Override public void run() { try { subtaskState.discardS...
[ "private", "void", "discardSubtaskState", "(", "final", "JobID", "jobId", ",", "final", "ExecutionAttemptID", "executionAttemptID", ",", "final", "long", "checkpointId", ",", "final", "TaskStateSnapshot", "subtaskState", ")", "{", "if", "(", "subtaskState", "!=", "n...
Discards the given state object asynchronously belonging to the given job, execution attempt id and checkpoint id. @param jobId identifying the job to which the state object belongs @param executionAttemptID identifying the task to which the state object belongs @param checkpointId of the state object @param subtaskSt...
[ "Discards", "the", "given", "state", "object", "asynchronously", "belonging", "to", "the", "given", "job", "execution", "attempt", "id", "and", "checkpoint", "id", "." ]
b62db93bf63cb3bb34dd03d611a779d9e3fc61ac
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/checkpoint/CheckpointCoordinator.java#L1355-L1375
123,188
apache/flink
flink-core/src/main/java/org/apache/flink/api/common/operators/ResourceSpec.java
ResourceSpec.merge
public ResourceSpec merge(ResourceSpec other) { ResourceSpec target = new ResourceSpec( Math.max(this.cpuCores, other.cpuCores), this.heapMemoryInMB + other.heapMemoryInMB, this.directMemoryInMB + other.directMemoryInMB, this.nativeMemoryInMB + other.nativeMemoryInMB, this.stateSizeInMB + other.st...
java
public ResourceSpec merge(ResourceSpec other) { ResourceSpec target = new ResourceSpec( Math.max(this.cpuCores, other.cpuCores), this.heapMemoryInMB + other.heapMemoryInMB, this.directMemoryInMB + other.directMemoryInMB, this.nativeMemoryInMB + other.nativeMemoryInMB, this.stateSizeInMB + other.st...
[ "public", "ResourceSpec", "merge", "(", "ResourceSpec", "other", ")", "{", "ResourceSpec", "target", "=", "new", "ResourceSpec", "(", "Math", ".", "max", "(", "this", ".", "cpuCores", ",", "other", ".", "cpuCores", ")", ",", "this", ".", "heapMemoryInMB", ...
Used by system internally to merge the other resources of chained operators when generating the job graph or merge the resource consumed by state backend. @param other Reference to resource to merge in. @return The new resource with merged values.
[ "Used", "by", "system", "internally", "to", "merge", "the", "other", "resources", "of", "chained", "operators", "when", "generating", "the", "job", "graph", "or", "merge", "the", "resource", "consumed", "by", "state", "backend", "." ]
b62db93bf63cb3bb34dd03d611a779d9e3fc61ac
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-core/src/main/java/org/apache/flink/api/common/operators/ResourceSpec.java#L111-L123
123,189
apache/flink
flink-core/src/main/java/org/apache/flink/api/common/operators/ResourceSpec.java
ResourceSpec.isValid
public boolean isValid() { if (this.cpuCores >= 0 && this.heapMemoryInMB >= 0 && this.directMemoryInMB >= 0 && this.nativeMemoryInMB >= 0 && this.stateSizeInMB >= 0) { for (Resource resource : extendedResources.values()) { if (resource.getValue() < 0) { return false; } } return true; } els...
java
public boolean isValid() { if (this.cpuCores >= 0 && this.heapMemoryInMB >= 0 && this.directMemoryInMB >= 0 && this.nativeMemoryInMB >= 0 && this.stateSizeInMB >= 0) { for (Resource resource : extendedResources.values()) { if (resource.getValue() < 0) { return false; } } return true; } els...
[ "public", "boolean", "isValid", "(", ")", "{", "if", "(", "this", ".", "cpuCores", ">=", "0", "&&", "this", ".", "heapMemoryInMB", ">=", "0", "&&", "this", ".", "directMemoryInMB", ">=", "0", "&&", "this", ".", "nativeMemoryInMB", ">=", "0", "&&", "thi...
Check whether all the field values are valid. @return True if all the values are equal or greater than 0, otherwise false.
[ "Check", "whether", "all", "the", "field", "values", "are", "valid", "." ]
b62db93bf63cb3bb34dd03d611a779d9e3fc61ac
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-core/src/main/java/org/apache/flink/api/common/operators/ResourceSpec.java#L163-L175
123,190
apache/flink
flink-core/src/main/java/org/apache/flink/api/common/operators/CompilerHints.java
CompilerHints.addUniqueField
public void addUniqueField(FieldSet uniqueFieldSet) { if (this.uniqueFields == null) { this.uniqueFields = new HashSet<FieldSet>(); } this.uniqueFields.add(uniqueFieldSet); }
java
public void addUniqueField(FieldSet uniqueFieldSet) { if (this.uniqueFields == null) { this.uniqueFields = new HashSet<FieldSet>(); } this.uniqueFields.add(uniqueFieldSet); }
[ "public", "void", "addUniqueField", "(", "FieldSet", "uniqueFieldSet", ")", "{", "if", "(", "this", ".", "uniqueFields", "==", "null", ")", "{", "this", ".", "uniqueFields", "=", "new", "HashSet", "<", "FieldSet", ">", "(", ")", ";", "}", "this", ".", ...
Adds a FieldSet to be unique @param uniqueFieldSet The unique FieldSet
[ "Adds", "a", "FieldSet", "to", "be", "unique" ]
b62db93bf63cb3bb34dd03d611a779d9e3fc61ac
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-core/src/main/java/org/apache/flink/api/common/operators/CompilerHints.java#L119-L124
123,191
apache/flink
flink-core/src/main/java/org/apache/flink/api/common/operators/CompilerHints.java
CompilerHints.addUniqueField
public void addUniqueField(int field) { if (this.uniqueFields == null) { this.uniqueFields = new HashSet<FieldSet>(); } this.uniqueFields.add(new FieldSet(field)); }
java
public void addUniqueField(int field) { if (this.uniqueFields == null) { this.uniqueFields = new HashSet<FieldSet>(); } this.uniqueFields.add(new FieldSet(field)); }
[ "public", "void", "addUniqueField", "(", "int", "field", ")", "{", "if", "(", "this", ".", "uniqueFields", "==", "null", ")", "{", "this", ".", "uniqueFields", "=", "new", "HashSet", "<", "FieldSet", ">", "(", ")", ";", "}", "this", ".", "uniqueFields"...
Adds a field as having only unique values. @param field The field with unique values.
[ "Adds", "a", "field", "as", "having", "only", "unique", "values", "." ]
b62db93bf63cb3bb34dd03d611a779d9e3fc61ac
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-core/src/main/java/org/apache/flink/api/common/operators/CompilerHints.java#L131-L136
123,192
apache/flink
flink-core/src/main/java/org/apache/flink/api/common/operators/CompilerHints.java
CompilerHints.addUniqueFields
public void addUniqueFields(Set<FieldSet> uniqueFieldSets) { if (this.uniqueFields == null) { this.uniqueFields = new HashSet<FieldSet>(); } this.uniqueFields.addAll(uniqueFieldSets); }
java
public void addUniqueFields(Set<FieldSet> uniqueFieldSets) { if (this.uniqueFields == null) { this.uniqueFields = new HashSet<FieldSet>(); } this.uniqueFields.addAll(uniqueFieldSets); }
[ "public", "void", "addUniqueFields", "(", "Set", "<", "FieldSet", ">", "uniqueFieldSets", ")", "{", "if", "(", "this", ".", "uniqueFields", "==", "null", ")", "{", "this", ".", "uniqueFields", "=", "new", "HashSet", "<", "FieldSet", ">", "(", ")", ";", ...
Adds multiple FieldSets to be unique @param uniqueFieldSets A set of unique FieldSet
[ "Adds", "multiple", "FieldSets", "to", "be", "unique" ]
b62db93bf63cb3bb34dd03d611a779d9e3fc61ac
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-core/src/main/java/org/apache/flink/api/common/operators/CompilerHints.java#L143-L148
123,193
apache/flink
flink-table/flink-sql-client/src/main/java/org/apache/flink/table/client/config/ConfigUtil.java
ConfigUtil.normalizeYaml
public static DescriptorProperties normalizeYaml(Map<String, Object> yamlMap) { final Map<String, String> normalized = new HashMap<>(); yamlMap.forEach((k, v) -> normalizeYamlObject(normalized, k, v)); final DescriptorProperties properties = new DescriptorProperties(true); properties.putProperties(normalized); ...
java
public static DescriptorProperties normalizeYaml(Map<String, Object> yamlMap) { final Map<String, String> normalized = new HashMap<>(); yamlMap.forEach((k, v) -> normalizeYamlObject(normalized, k, v)); final DescriptorProperties properties = new DescriptorProperties(true); properties.putProperties(normalized); ...
[ "public", "static", "DescriptorProperties", "normalizeYaml", "(", "Map", "<", "String", ",", "Object", ">", "yamlMap", ")", "{", "final", "Map", "<", "String", ",", "String", ">", "normalized", "=", "new", "HashMap", "<>", "(", ")", ";", "yamlMap", ".", ...
Normalizes key-value properties from Yaml in the normalized format of the Table API.
[ "Normalizes", "key", "-", "value", "properties", "from", "Yaml", "in", "the", "normalized", "format", "of", "the", "Table", "API", "." ]
b62db93bf63cb3bb34dd03d611a779d9e3fc61ac
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-table/flink-sql-client/src/main/java/org/apache/flink/table/client/config/ConfigUtil.java#L48-L54
123,194
apache/flink
flink-runtime/src/main/java/org/apache/flink/runtime/io/network/partition/consumer/LocalInputChannel.java
LocalInputChannel.retriggerSubpartitionRequest
void retriggerSubpartitionRequest(Timer timer, final int subpartitionIndex) { synchronized (requestLock) { checkState(subpartitionView == null, "already requested partition"); timer.schedule(new TimerTask() { @Override public void run() { try { requestSubpartition(subpartitionIndex); } ...
java
void retriggerSubpartitionRequest(Timer timer, final int subpartitionIndex) { synchronized (requestLock) { checkState(subpartitionView == null, "already requested partition"); timer.schedule(new TimerTask() { @Override public void run() { try { requestSubpartition(subpartitionIndex); } ...
[ "void", "retriggerSubpartitionRequest", "(", "Timer", "timer", ",", "final", "int", "subpartitionIndex", ")", "{", "synchronized", "(", "requestLock", ")", "{", "checkState", "(", "subpartitionView", "==", "null", ",", "\"already requested partition\"", ")", ";", "t...
Retriggers a subpartition request.
[ "Retriggers", "a", "subpartition", "request", "." ]
b62db93bf63cb3bb34dd03d611a779d9e3fc61ac
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/io/network/partition/consumer/LocalInputChannel.java#L146-L161
123,195
apache/flink
flink-examples/flink-examples-streaming/src/main/java/org/apache/flink/streaming/examples/statemachine/event/Event.java
Event.formatAddress
public static String formatAddress(int address) { int b1 = (address >>> 24) & 0xff; int b2 = (address >>> 16) & 0xff; int b3 = (address >>> 8) & 0xff; int b4 = address & 0xff; return "" + b1 + '.' + b2 + '.' + b3 + '.' + b4; }
java
public static String formatAddress(int address) { int b1 = (address >>> 24) & 0xff; int b2 = (address >>> 16) & 0xff; int b3 = (address >>> 8) & 0xff; int b4 = address & 0xff; return "" + b1 + '.' + b2 + '.' + b3 + '.' + b4; }
[ "public", "static", "String", "formatAddress", "(", "int", "address", ")", "{", "int", "b1", "=", "(", "address", ">>>", "24", ")", "&", "0xff", ";", "int", "b2", "=", "(", "address", ">>>", "16", ")", "&", "0xff", ";", "int", "b3", "=", "(", "ad...
Util method to create a string representation of a 32 bit integer representing an IPv4 address. @param address The address, MSB first. @return The IP address string.
[ "Util", "method", "to", "create", "a", "string", "representation", "of", "a", "32", "bit", "integer", "representing", "an", "IPv4", "address", "." ]
b62db93bf63cb3bb34dd03d611a779d9e3fc61ac
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-examples/flink-examples-streaming/src/main/java/org/apache/flink/streaming/examples/statemachine/event/Event.java#L96-L103
123,196
apache/flink
flink-libraries/flink-streaming-python/src/main/java/org/apache/flink/streaming/python/api/environment/PythonStreamExecutionEnvironment.java
PythonStreamExecutionEnvironment.from_collection
public PythonDataStream from_collection(Iterator<Object> iter) throws Exception { return new PythonDataStream<>(env.addSource(new PythonIteratorFunction(iter), TypeExtractor.getForClass(Object.class)) .map(new AdapterMap<>())); }
java
public PythonDataStream from_collection(Iterator<Object> iter) throws Exception { return new PythonDataStream<>(env.addSource(new PythonIteratorFunction(iter), TypeExtractor.getForClass(Object.class)) .map(new AdapterMap<>())); }
[ "public", "PythonDataStream", "from_collection", "(", "Iterator", "<", "Object", ">", "iter", ")", "throws", "Exception", "{", "return", "new", "PythonDataStream", "<>", "(", "env", ".", "addSource", "(", "new", "PythonIteratorFunction", "(", "iter", ")", ",", ...
Creates a python data stream from the given iterator. <p>Note that this operation will result in a non-parallel data stream source, i.e., a data stream source with a parallelism of one.</p> @param iter The iterator of elements to create the data stream from @return The data stream representing the elements in the ite...
[ "Creates", "a", "python", "data", "stream", "from", "the", "given", "iterator", "." ]
b62db93bf63cb3bb34dd03d611a779d9e3fc61ac
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-libraries/flink-streaming-python/src/main/java/org/apache/flink/streaming/python/api/environment/PythonStreamExecutionEnvironment.java#L164-L167
123,197
apache/flink
flink-formats/flink-parquet/src/main/java/org/apache/flink/formats/parquet/utils/ParquetRecordReader.java
ParquetRecordReader.seek
public void seek(long block, long recordInBlock) throws IOException { List<BlockMetaData> blockMetaData = reader.getRowGroups(); if (block == -1L && recordInBlock == -1L) { // the split was fully consumed currentBlock = blockMetaData.size() - 1; numReadRecords = numTotalRecords; numRecordsUpToCurrentB...
java
public void seek(long block, long recordInBlock) throws IOException { List<BlockMetaData> blockMetaData = reader.getRowGroups(); if (block == -1L && recordInBlock == -1L) { // the split was fully consumed currentBlock = blockMetaData.size() - 1; numReadRecords = numTotalRecords; numRecordsUpToCurrentB...
[ "public", "void", "seek", "(", "long", "block", ",", "long", "recordInBlock", ")", "throws", "IOException", "{", "List", "<", "BlockMetaData", ">", "blockMetaData", "=", "reader", ".", "getRowGroups", "(", ")", ";", "if", "(", "block", "==", "-", "1L", "...
Moves the reading position to the given block and seeks to and reads the given record. @param block The block to seek to. @param recordInBlock The number of the record in the block to return next.
[ "Moves", "the", "reading", "position", "to", "the", "given", "block", "and", "seeks", "to", "and", "reads", "the", "given", "record", "." ]
b62db93bf63cb3bb34dd03d611a779d9e3fc61ac
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-formats/flink-parquet/src/main/java/org/apache/flink/formats/parquet/utils/ParquetRecordReader.java#L127-L160
123,198
apache/flink
flink-formats/flink-parquet/src/main/java/org/apache/flink/formats/parquet/utils/ParquetRecordReader.java
ParquetRecordReader.getCurrentReadPosition
public Tuple2<Long, Long> getCurrentReadPosition() { // compute number of returned records long numRecordsReturned = numReadRecords; if (!readRecordReturned && numReadRecords > 0) { numRecordsReturned -= 1; } if (numRecordsReturned == numTotalRecords) { // all records of split returned. return Tupl...
java
public Tuple2<Long, Long> getCurrentReadPosition() { // compute number of returned records long numRecordsReturned = numReadRecords; if (!readRecordReturned && numReadRecords > 0) { numRecordsReturned -= 1; } if (numRecordsReturned == numTotalRecords) { // all records of split returned. return Tupl...
[ "public", "Tuple2", "<", "Long", ",", "Long", ">", "getCurrentReadPosition", "(", ")", "{", "// compute number of returned records", "long", "numRecordsReturned", "=", "numReadRecords", ";", "if", "(", "!", "readRecordReturned", "&&", "numReadRecords", ">", "0", ")"...
Returns the current read position in the split, i.e., the current block and the number of records that were returned from that block. @return The current read position in the split.
[ "Returns", "the", "current", "read", "position", "in", "the", "split", "i", ".", "e", ".", "the", "current", "block", "and", "the", "number", "of", "records", "that", "were", "returned", "from", "that", "block", "." ]
b62db93bf63cb3bb34dd03d611a779d9e3fc61ac
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-formats/flink-parquet/src/main/java/org/apache/flink/formats/parquet/utils/ParquetRecordReader.java#L168-L189
123,199
apache/flink
flink-formats/flink-parquet/src/main/java/org/apache/flink/formats/parquet/utils/ParquetRecordReader.java
ParquetRecordReader.reachEnd
public boolean reachEnd() throws IOException { // check if we have a read row that was not returned yet if (readRecord != null && !readRecordReturned) { return false; } // check if there are more rows to be read if (numReadRecords >= numTotalRecords) { return true; } // try to read next row return...
java
public boolean reachEnd() throws IOException { // check if we have a read row that was not returned yet if (readRecord != null && !readRecordReturned) { return false; } // check if there are more rows to be read if (numReadRecords >= numTotalRecords) { return true; } // try to read next row return...
[ "public", "boolean", "reachEnd", "(", ")", "throws", "IOException", "{", "// check if we have a read row that was not returned yet", "if", "(", "readRecord", "!=", "null", "&&", "!", "readRecordReturned", ")", "{", "return", "false", ";", "}", "// check if there are mor...
Checks if the record reader returned all records. This method must be called before a record can be returned. @return False if there are more records to be read. True if all records have been returned.
[ "Checks", "if", "the", "record", "reader", "returned", "all", "records", ".", "This", "method", "must", "be", "called", "before", "a", "record", "can", "be", "returned", "." ]
b62db93bf63cb3bb34dd03d611a779d9e3fc61ac
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-formats/flink-parquet/src/main/java/org/apache/flink/formats/parquet/utils/ParquetRecordReader.java#L197-L208