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,700
apache/flink
flink-table/flink-table-runtime-blink/src/main/java/org/apache/flink/table/runtime/functions/SqlDateTimeUtils.java
SqlDateTimeUtils.timestampToString
public static String timestampToString(long ts, int precision, TimeZone tz) { int p = (precision <= 3 && precision >= 0) ? precision : 3; String format = DEFAULT_DATETIME_FORMATS[p]; return dateFormat(ts, format, tz); }
java
public static String timestampToString(long ts, int precision, TimeZone tz) { int p = (precision <= 3 && precision >= 0) ? precision : 3; String format = DEFAULT_DATETIME_FORMATS[p]; return dateFormat(ts, format, tz); }
[ "public", "static", "String", "timestampToString", "(", "long", "ts", ",", "int", "precision", ",", "TimeZone", "tz", ")", "{", "int", "p", "=", "(", "precision", "<=", "3", "&&", "precision", ">=", "0", ")", "?", "precision", ":", "3", ";", "String", ...
Convert a timestamp to string. @param ts the timestamp to convert. @param precision the milli second precision to preserve @param tz the time zone
[ "Convert", "a", "timestamp", "to", "string", "." ]
b62db93bf63cb3bb34dd03d611a779d9e3fc61ac
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-table/flink-table-runtime-blink/src/main/java/org/apache/flink/table/runtime/functions/SqlDateTimeUtils.java#L391-L395
123,701
apache/flink
flink-table/flink-table-runtime-blink/src/main/java/org/apache/flink/table/runtime/functions/SqlDateTimeUtils.java
SqlDateTimeUtils.getMillis
private static int getMillis(String dateStr) { int length = dateStr.length(); if (length == 19) { // "1999-12-31 12:34:56", no milli second left return 0; } else if (length == 21) { // "1999-12-31 12:34:56.7", return 7 return Integer.parseInt(dateStr.substring(20)) * 100; } else if (length == 22) { ...
java
private static int getMillis(String dateStr) { int length = dateStr.length(); if (length == 19) { // "1999-12-31 12:34:56", no milli second left return 0; } else if (length == 21) { // "1999-12-31 12:34:56.7", return 7 return Integer.parseInt(dateStr.substring(20)) * 100; } else if (length == 22) { ...
[ "private", "static", "int", "getMillis", "(", "String", "dateStr", ")", "{", "int", "length", "=", "dateStr", ".", "length", "(", ")", ";", "if", "(", "length", "==", "19", ")", "{", "// \"1999-12-31 12:34:56\", no milli second left", "return", "0", ";", "}"...
Returns the milli second part of the datetime.
[ "Returns", "the", "milli", "second", "part", "of", "the", "datetime", "." ]
b62db93bf63cb3bb34dd03d611a779d9e3fc61ac
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-table/flink-table-runtime-blink/src/main/java/org/apache/flink/table/runtime/functions/SqlDateTimeUtils.java#L476-L493
123,702
apache/flink
flink-table/flink-table-runtime-blink/src/main/java/org/apache/flink/table/runtime/functions/SqlDateTimeUtils.java
SqlDateTimeUtils.timestampCeil
public static long timestampCeil(TimeUnitRange range, long ts, TimeZone tz) { // assume that we are at UTC timezone, just for algorithm performance long offset = tz.getOffset(ts); long utcTs = ts + offset; switch (range) { case HOUR: return ceil(utcTs, MILLIS_PER_HOUR) - offset; case DAY: return ...
java
public static long timestampCeil(TimeUnitRange range, long ts, TimeZone tz) { // assume that we are at UTC timezone, just for algorithm performance long offset = tz.getOffset(ts); long utcTs = ts + offset; switch (range) { case HOUR: return ceil(utcTs, MILLIS_PER_HOUR) - offset; case DAY: return ...
[ "public", "static", "long", "timestampCeil", "(", "TimeUnitRange", "range", ",", "long", "ts", ",", "TimeZone", "tz", ")", "{", "// assume that we are at UTC timezone, just for algorithm performance", "long", "offset", "=", "tz", ".", "getOffset", "(", "ts", ")", ";...
Keep the algorithm consistent with Calcite DateTimeUtils.julianDateFloor, but here we take time zone into account.
[ "Keep", "the", "algorithm", "consistent", "with", "Calcite", "DateTimeUtils", ".", "julianDateFloor", "but", "here", "we", "take", "time", "zone", "into", "account", "." ]
b62db93bf63cb3bb34dd03d611a779d9e3fc61ac
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-table/flink-table-runtime-blink/src/main/java/org/apache/flink/table/runtime/functions/SqlDateTimeUtils.java#L627-L647
123,703
apache/flink
flink-libraries/flink-gelly/src/main/java/org/apache/flink/graph/validation/InvalidVertexIdsValidator.java
InvalidVertexIdsValidator.validate
@Override public boolean validate(Graph<K, VV, EV> graph) throws Exception { DataSet<Tuple1<K>> edgeIds = graph.getEdges() .flatMap(new MapEdgeIds<>()).distinct(); DataSet<K> invalidIds = graph.getVertices().coGroup(edgeIds).where(0) .equalTo(0).with(new GroupInvalidIds<>()).first(1); return invalidIds....
java
@Override public boolean validate(Graph<K, VV, EV> graph) throws Exception { DataSet<Tuple1<K>> edgeIds = graph.getEdges() .flatMap(new MapEdgeIds<>()).distinct(); DataSet<K> invalidIds = graph.getVertices().coGroup(edgeIds).where(0) .equalTo(0).with(new GroupInvalidIds<>()).first(1); return invalidIds....
[ "@", "Override", "public", "boolean", "validate", "(", "Graph", "<", "K", ",", "VV", ",", "EV", ">", "graph", ")", "throws", "Exception", "{", "DataSet", "<", "Tuple1", "<", "K", ">>", "edgeIds", "=", "graph", ".", "getEdges", "(", ")", ".", "flatMap...
Checks that the edge set input contains valid vertex Ids, i.e. that they also exist in the vertex input set. @return a boolean stating whether a graph is valid with respect to its vertex ids.
[ "Checks", "that", "the", "edge", "set", "input", "contains", "valid", "vertex", "Ids", "i", ".", "e", ".", "that", "they", "also", "exist", "in", "the", "vertex", "input", "set", "." ]
b62db93bf63cb3bb34dd03d611a779d9e3fc61ac
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-libraries/flink-gelly/src/main/java/org/apache/flink/graph/validation/InvalidVertexIdsValidator.java#L48-L56
123,704
apache/flink
flink-connectors/flink-hcatalog/src/main/java/org/apache/flink/hcatalog/HCatInputFormatBase.java
HCatInputFormatBase.getFields
public HCatInputFormatBase<T> getFields(String... fields) throws IOException { // build output schema ArrayList<HCatFieldSchema> fieldSchemas = new ArrayList<HCatFieldSchema>(fields.length); for (String field : fields) { fieldSchemas.add(this.outputSchema.get(field)); } this.outputSchema = new HCatSchema(...
java
public HCatInputFormatBase<T> getFields(String... fields) throws IOException { // build output schema ArrayList<HCatFieldSchema> fieldSchemas = new ArrayList<HCatFieldSchema>(fields.length); for (String field : fields) { fieldSchemas.add(this.outputSchema.get(field)); } this.outputSchema = new HCatSchema(...
[ "public", "HCatInputFormatBase", "<", "T", ">", "getFields", "(", "String", "...", "fields", ")", "throws", "IOException", "{", "// build output schema", "ArrayList", "<", "HCatFieldSchema", ">", "fieldSchemas", "=", "new", "ArrayList", "<", "HCatFieldSchema", ">", ...
Specifies the fields which are returned by the InputFormat and their order. @param fields The fields and their order which are returned by the InputFormat. @return This InputFormat with specified return fields. @throws java.io.IOException
[ "Specifies", "the", "fields", "which", "are", "returned", "by", "the", "InputFormat", "and", "their", "order", "." ]
b62db93bf63cb3bb34dd03d611a779d9e3fc61ac
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-connectors/flink-hcatalog/src/main/java/org/apache/flink/hcatalog/HCatInputFormatBase.java#L134-L147
123,705
apache/flink
flink-table/flink-table-runtime-blink/src/main/java/org/apache/flink/table/dataformat/BinaryFormat.java
BinaryFormat.readBinaryFieldFromSegments
static byte[] readBinaryFieldFromSegments( MemorySegment[] segments, int baseOffset, int fieldOffset, long variablePartOffsetAndLen) { long mark = variablePartOffsetAndLen & HIGHEST_FIRST_BIT; if (mark == 0) { final int subOffset = (int) (variablePartOffsetAndLen >> 32); final int len = (int) variablePa...
java
static byte[] readBinaryFieldFromSegments( MemorySegment[] segments, int baseOffset, int fieldOffset, long variablePartOffsetAndLen) { long mark = variablePartOffsetAndLen & HIGHEST_FIRST_BIT; if (mark == 0) { final int subOffset = (int) (variablePartOffsetAndLen >> 32); final int len = (int) variablePa...
[ "static", "byte", "[", "]", "readBinaryFieldFromSegments", "(", "MemorySegment", "[", "]", "segments", ",", "int", "baseOffset", ",", "int", "fieldOffset", ",", "long", "variablePartOffsetAndLen", ")", "{", "long", "mark", "=", "variablePartOffsetAndLen", "&", "HI...
Get binary, if len less than 8, will be include in variablePartOffsetAndLen. <p>Note: Need to consider the ByteOrder. @param baseOffset base offset of composite binary format. @param fieldOffset absolute start offset of 'variablePartOffsetAndLen'. @param variablePartOffsetAndLen a long value, real data or offset and ...
[ "Get", "binary", "if", "len", "less", "than", "8", "will", "be", "include", "in", "variablePartOffsetAndLen", "." ]
b62db93bf63cb3bb34dd03d611a779d9e3fc61ac
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-table/flink-table-runtime-blink/src/main/java/org/apache/flink/table/dataformat/BinaryFormat.java#L119-L136
123,706
apache/flink
flink-table/flink-table-runtime-blink/src/main/java/org/apache/flink/table/dataformat/BinaryFormat.java
BinaryFormat.readBinaryStringFieldFromSegments
static BinaryString readBinaryStringFieldFromSegments( MemorySegment[] segments, int baseOffset, int fieldOffset, long variablePartOffsetAndLen) { long mark = variablePartOffsetAndLen & HIGHEST_FIRST_BIT; if (mark == 0) { final int subOffset = (int) (variablePartOffsetAndLen >> 32); final int len = (int...
java
static BinaryString readBinaryStringFieldFromSegments( MemorySegment[] segments, int baseOffset, int fieldOffset, long variablePartOffsetAndLen) { long mark = variablePartOffsetAndLen & HIGHEST_FIRST_BIT; if (mark == 0) { final int subOffset = (int) (variablePartOffsetAndLen >> 32); final int len = (int...
[ "static", "BinaryString", "readBinaryStringFieldFromSegments", "(", "MemorySegment", "[", "]", "segments", ",", "int", "baseOffset", ",", "int", "fieldOffset", ",", "long", "variablePartOffsetAndLen", ")", "{", "long", "mark", "=", "variablePartOffsetAndLen", "&", "HI...
Get binary string, if len less than 8, will be include in variablePartOffsetAndLen. <p>Note: Need to consider the ByteOrder. @param baseOffset base offset of composite binary format. @param fieldOffset absolute start offset of 'variablePartOffsetAndLen'. @param variablePartOffsetAndLen a long value, real data or offs...
[ "Get", "binary", "string", "if", "len", "less", "than", "8", "will", "be", "include", "in", "variablePartOffsetAndLen", "." ]
b62db93bf63cb3bb34dd03d611a779d9e3fc61ac
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-table/flink-table-runtime-blink/src/main/java/org/apache/flink/table/dataformat/BinaryFormat.java#L147-L164
123,707
apache/flink
flink-runtime/src/main/java/org/apache/flink/runtime/util/EnvironmentInformation.java
EnvironmentInformation.getVersion
public static String getVersion() { String version = EnvironmentInformation.class.getPackage().getImplementationVersion(); return version != null ? version : UNKNOWN; }
java
public static String getVersion() { String version = EnvironmentInformation.class.getPackage().getImplementationVersion(); return version != null ? version : UNKNOWN; }
[ "public", "static", "String", "getVersion", "(", ")", "{", "String", "version", "=", "EnvironmentInformation", ".", "class", ".", "getPackage", "(", ")", ".", "getImplementationVersion", "(", ")", ";", "return", "version", "!=", "null", "?", "version", ":", ...
Returns the version of the code as String. If version == null, then the JobManager does not run from a Maven build. An example is a source code checkout, compile, and run from inside an IDE. @return The version string.
[ "Returns", "the", "version", "of", "the", "code", "as", "String", ".", "If", "version", "==", "null", "then", "the", "JobManager", "does", "not", "run", "from", "a", "Maven", "build", ".", "An", "example", "is", "a", "source", "code", "checkout", "compil...
b62db93bf63cb3bb34dd03d611a779d9e3fc61ac
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/util/EnvironmentInformation.java#L49-L52
123,708
apache/flink
flink-runtime/src/main/java/org/apache/flink/runtime/util/EnvironmentInformation.java
EnvironmentInformation.getHadoopUser
public static String getHadoopUser() { try { Class<?> ugiClass = Class.forName( "org.apache.hadoop.security.UserGroupInformation", false, EnvironmentInformation.class.getClassLoader()); Method currentUserMethod = ugiClass.getMethod("getCurrentUser"); Method shortUserNameMethod = ugiClass.getMeth...
java
public static String getHadoopUser() { try { Class<?> ugiClass = Class.forName( "org.apache.hadoop.security.UserGroupInformation", false, EnvironmentInformation.class.getClassLoader()); Method currentUserMethod = ugiClass.getMethod("getCurrentUser"); Method shortUserNameMethod = ugiClass.getMeth...
[ "public", "static", "String", "getHadoopUser", "(", ")", "{", "try", "{", "Class", "<", "?", ">", "ugiClass", "=", "Class", ".", "forName", "(", "\"org.apache.hadoop.security.UserGroupInformation\"", ",", "false", ",", "EnvironmentInformation", ".", "class", ".", ...
Gets the name of the user that is running the JVM. @return The name of the user that is running the JVM.
[ "Gets", "the", "name", "of", "the", "user", "that", "is", "running", "the", "JVM", "." ]
b62db93bf63cb3bb34dd03d611a779d9e3fc61ac
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/util/EnvironmentInformation.java#L87-L113
123,709
apache/flink
flink-runtime/src/main/java/org/apache/flink/runtime/util/EnvironmentInformation.java
EnvironmentInformation.getMaxJvmHeapMemory
public static long getMaxJvmHeapMemory() { final long maxMemory = Runtime.getRuntime().maxMemory(); if (maxMemory != Long.MAX_VALUE) { // we have the proper max memory return maxMemory; } else { // max JVM heap size is not set - use the heuristic to use 1/4th of the physical memory final long physical...
java
public static long getMaxJvmHeapMemory() { final long maxMemory = Runtime.getRuntime().maxMemory(); if (maxMemory != Long.MAX_VALUE) { // we have the proper max memory return maxMemory; } else { // max JVM heap size is not set - use the heuristic to use 1/4th of the physical memory final long physical...
[ "public", "static", "long", "getMaxJvmHeapMemory", "(", ")", "{", "final", "long", "maxMemory", "=", "Runtime", ".", "getRuntime", "(", ")", ".", "maxMemory", "(", ")", ";", "if", "(", "maxMemory", "!=", "Long", ".", "MAX_VALUE", ")", "{", "// we have the ...
The maximum JVM heap size, in bytes. <p>This method uses the <i>-Xmx</i> value of the JVM, if set. If not set, it returns (as a heuristic) 1/4th of the physical memory size. @return The maximum JVM heap size, in bytes.
[ "The", "maximum", "JVM", "heap", "size", "in", "bytes", "." ]
b62db93bf63cb3bb34dd03d611a779d9e3fc61ac
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/util/EnvironmentInformation.java#L123-L139
123,710
apache/flink
flink-runtime/src/main/java/org/apache/flink/runtime/util/EnvironmentInformation.java
EnvironmentInformation.logEnvironmentInfo
public static void logEnvironmentInfo(Logger log, String componentName, String[] commandLineArgs) { if (log.isInfoEnabled()) { RevisionInformation rev = getRevisionInformation(); String version = getVersion(); String jvmVersion = getJvmVersion(); String[] options = getJvmStartupOptionsArray(); ...
java
public static void logEnvironmentInfo(Logger log, String componentName, String[] commandLineArgs) { if (log.isInfoEnabled()) { RevisionInformation rev = getRevisionInformation(); String version = getVersion(); String jvmVersion = getJvmVersion(); String[] options = getJvmStartupOptionsArray(); ...
[ "public", "static", "void", "logEnvironmentInfo", "(", "Logger", "log", ",", "String", "componentName", ",", "String", "[", "]", "commandLineArgs", ")", "{", "if", "(", "log", ".", "isInfoEnabled", "(", ")", ")", "{", "RevisionInformation", "rev", "=", "getR...
Logs information about the environment, like code revision, current user, Java version, and JVM parameters. @param log The logger to log the information to. @param componentName The component name to mention in the log. @param commandLineArgs The arguments accompanying the starting the component.
[ "Logs", "information", "about", "the", "environment", "like", "code", "revision", "current", "user", "Java", "version", "and", "JVM", "parameters", "." ]
b62db93bf63cb3bb34dd03d611a779d9e3fc61ac
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/util/EnvironmentInformation.java#L269-L321
123,711
apache/flink
flink-formats/flink-json/src/main/java/org/apache/flink/table/descriptors/Json.java
Json.schema
public Json schema(TypeInformation<Row> schemaType) { Preconditions.checkNotNull(schemaType); this.schema = TypeStringUtils.writeTypeInfo(schemaType); this.jsonSchema = null; this.deriveSchema = null; return this; }
java
public Json schema(TypeInformation<Row> schemaType) { Preconditions.checkNotNull(schemaType); this.schema = TypeStringUtils.writeTypeInfo(schemaType); this.jsonSchema = null; this.deriveSchema = null; return this; }
[ "public", "Json", "schema", "(", "TypeInformation", "<", "Row", ">", "schemaType", ")", "{", "Preconditions", ".", "checkNotNull", "(", "schemaType", ")", ";", "this", ".", "schema", "=", "TypeStringUtils", ".", "writeTypeInfo", "(", "schemaType", ")", ";", ...
Sets the schema using type information. <p>JSON objects are represented as ROW types. <p>The schema might be nested. @param schemaType type information that describes the schema
[ "Sets", "the", "schema", "using", "type", "information", "." ]
b62db93bf63cb3bb34dd03d611a779d9e3fc61ac
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-formats/flink-json/src/main/java/org/apache/flink/table/descriptors/Json.java#L87-L93
123,712
apache/flink
flink-runtime/src/main/java/org/apache/flink/runtime/operators/hash/CompactingHashTable.java
CompactingHashTable.open
@Override public void open() { synchronized (stateLock) { if (!closed) { throw new IllegalStateException("currently not closed."); } closed = false; } // create the partitions final int partitionFanOut = getPartitioningFanOutNoEstimates(this.availableMemory.size()); createPartitions(partitio...
java
@Override public void open() { synchronized (stateLock) { if (!closed) { throw new IllegalStateException("currently not closed."); } closed = false; } // create the partitions final int partitionFanOut = getPartitioningFanOutNoEstimates(this.availableMemory.size()); createPartitions(partitio...
[ "@", "Override", "public", "void", "open", "(", ")", "{", "synchronized", "(", "stateLock", ")", "{", "if", "(", "!", "closed", ")", "{", "throw", "new", "IllegalStateException", "(", "\"currently not closed.\"", ")", ";", "}", "closed", "=", "false", ";",...
Initialize the hash table
[ "Initialize", "the", "hash", "table" ]
b62db93bf63cb3bb34dd03d611a779d9e3fc61ac
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/operators/hash/CompactingHashTable.java#L246-L264
123,713
apache/flink
flink-runtime/src/main/java/org/apache/flink/runtime/operators/hash/CompactingHashTable.java
CompactingHashTable.close
@Override public void close() { // make sure that we close only once synchronized (this.stateLock) { if (this.closed) { return; } this.closed = true; } LOG.debug("Closing hash table and releasing resources."); // release the table structure releaseTable(); // clear the memory in the...
java
@Override public void close() { // make sure that we close only once synchronized (this.stateLock) { if (this.closed) { return; } this.closed = true; } LOG.debug("Closing hash table and releasing resources."); // release the table structure releaseTable(); // clear the memory in the...
[ "@", "Override", "public", "void", "close", "(", ")", "{", "// make sure that we close only once", "synchronized", "(", "this", ".", "stateLock", ")", "{", "if", "(", "this", ".", "closed", ")", "{", "return", ";", "}", "this", ".", "closed", "=", "true", ...
Closes the hash table. This effectively releases all internal structures and closes all open files and removes them. The call to this method is valid both as a cleanup after the complete inputs were properly processed, and as an cancellation call, which cleans up all resources that are currently held by the hash join. ...
[ "Closes", "the", "hash", "table", ".", "This", "effectively", "releases", "all", "internal", "structures", "and", "closes", "all", "open", "files", "and", "removes", "them", ".", "The", "call", "to", "this", "method", "is", "valid", "both", "as", "a", "cle...
b62db93bf63cb3bb34dd03d611a779d9e3fc61ac
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/operators/hash/CompactingHashTable.java#L273-L290
123,714
apache/flink
flink-runtime/src/main/java/org/apache/flink/runtime/operators/hash/CompactingHashTable.java
CompactingHashTable.getSize
private long getSize() { long numSegments = 0; numSegments += this.availableMemory.size(); numSegments += this.buckets.length; for(InMemoryPartition<T> p : this.partitions) { numSegments += p.getBlockCount(); numSegments += p.numOverflowSegments; } numSegments += this.compactionMemory.getBlockCount();...
java
private long getSize() { long numSegments = 0; numSegments += this.availableMemory.size(); numSegments += this.buckets.length; for(InMemoryPartition<T> p : this.partitions) { numSegments += p.getBlockCount(); numSegments += p.numOverflowSegments; } numSegments += this.compactionMemory.getBlockCount();...
[ "private", "long", "getSize", "(", ")", "{", "long", "numSegments", "=", "0", ";", "numSegments", "+=", "this", ".", "availableMemory", ".", "size", "(", ")", ";", "numSegments", "+=", "this", ".", "buckets", ".", "length", ";", "for", "(", "InMemoryPart...
Size of all memory segments owned by this hash table @return size in bytes
[ "Size", "of", "all", "memory", "segments", "owned", "by", "this", "hash", "table" ]
b62db93bf63cb3bb34dd03d611a779d9e3fc61ac
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/operators/hash/CompactingHashTable.java#L780-L790
123,715
apache/flink
flink-runtime/src/main/java/org/apache/flink/runtime/operators/hash/CompactingHashTable.java
CompactingHashTable.getPartitionSize
private long getPartitionSize() { long numSegments = 0; for(InMemoryPartition<T> p : this.partitions) { numSegments += p.getBlockCount(); } return numSegments*this.segmentSize; }
java
private long getPartitionSize() { long numSegments = 0; for(InMemoryPartition<T> p : this.partitions) { numSegments += p.getBlockCount(); } return numSegments*this.segmentSize; }
[ "private", "long", "getPartitionSize", "(", ")", "{", "long", "numSegments", "=", "0", ";", "for", "(", "InMemoryPartition", "<", "T", ">", "p", ":", "this", ".", "partitions", ")", "{", "numSegments", "+=", "p", ".", "getBlockCount", "(", ")", ";", "}...
Size of all memory segments owned by the partitions of this hash table excluding the compaction partition @return size in bytes
[ "Size", "of", "all", "memory", "segments", "owned", "by", "the", "partitions", "of", "this", "hash", "table", "excluding", "the", "compaction", "partition" ]
b62db93bf63cb3bb34dd03d611a779d9e3fc61ac
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/operators/hash/CompactingHashTable.java#L797-L803
123,716
apache/flink
flink-runtime/src/main/java/org/apache/flink/runtime/highavailability/zookeeper/ZooKeeperHaServices.java
ZooKeeperHaServices.tryDeleteEmptyParentZNodes
private void tryDeleteEmptyParentZNodes() throws Exception { // try to delete the parent znodes if they are empty String remainingPath = getParentPath(getNormalizedPath(client.getNamespace())); final CuratorFramework nonNamespaceClient = client.usingNamespace(null); while (!isRootPath(remainingPath)) { try ...
java
private void tryDeleteEmptyParentZNodes() throws Exception { // try to delete the parent znodes if they are empty String remainingPath = getParentPath(getNormalizedPath(client.getNamespace())); final CuratorFramework nonNamespaceClient = client.usingNamespace(null); while (!isRootPath(remainingPath)) { try ...
[ "private", "void", "tryDeleteEmptyParentZNodes", "(", ")", "throws", "Exception", "{", "// try to delete the parent znodes if they are empty", "String", "remainingPath", "=", "getParentPath", "(", "getNormalizedPath", "(", "client", ".", "getNamespace", "(", ")", ")", ")"...
Tries to delete empty parent znodes. <p>IMPORTANT: This method can be removed once all supported ZooKeeper versions support the container {@link org.apache.zookeeper.CreateMode}. @throws Exception if the deletion fails for other reason than {@link KeeperException.NotEmptyException}
[ "Tries", "to", "delete", "empty", "parent", "znodes", "." ]
b62db93bf63cb3bb34dd03d611a779d9e3fc61ac
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/highavailability/zookeeper/ZooKeeperHaServices.java#L279-L294
123,717
apache/flink
flink-runtime/src/main/java/org/apache/flink/runtime/state/heap/HeapKeyedStateBackend.java
HeapKeyedStateBackend.numKeyValueStateEntries
@VisibleForTesting public int numKeyValueStateEntries(Object namespace) { int sum = 0; for (StateTable<?, ?, ?> state : registeredKVStates.values()) { sum += state.sizeOfNamespace(namespace); } return sum; }
java
@VisibleForTesting public int numKeyValueStateEntries(Object namespace) { int sum = 0; for (StateTable<?, ?, ?> state : registeredKVStates.values()) { sum += state.sizeOfNamespace(namespace); } return sum; }
[ "@", "VisibleForTesting", "public", "int", "numKeyValueStateEntries", "(", "Object", "namespace", ")", "{", "int", "sum", "=", "0", ";", "for", "(", "StateTable", "<", "?", ",", "?", ",", "?", ">", "state", ":", "registeredKVStates", ".", "values", "(", ...
Returns the total number of state entries across all keys for the given namespace.
[ "Returns", "the", "total", "number", "of", "state", "entries", "across", "all", "keys", "for", "the", "given", "namespace", "." ]
b62db93bf63cb3bb34dd03d611a779d9e3fc61ac
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/state/heap/HeapKeyedStateBackend.java#L361-L368
123,718
apache/flink
flink-libraries/flink-cep/src/main/java/org/apache/flink/cep/nfa/MigrationUtils.java
MigrationUtils.skipSerializedStates
static void skipSerializedStates(DataInputView in) throws IOException { TypeSerializer<String> nameSerializer = StringSerializer.INSTANCE; TypeSerializer<State.StateType> stateTypeSerializer = new EnumSerializer<>(State.StateType.class); TypeSerializer<StateTransitionAction> actionSerializer = new EnumSerializer<...
java
static void skipSerializedStates(DataInputView in) throws IOException { TypeSerializer<String> nameSerializer = StringSerializer.INSTANCE; TypeSerializer<State.StateType> stateTypeSerializer = new EnumSerializer<>(State.StateType.class); TypeSerializer<StateTransitionAction> actionSerializer = new EnumSerializer<...
[ "static", "void", "skipSerializedStates", "(", "DataInputView", "in", ")", "throws", "IOException", "{", "TypeSerializer", "<", "String", ">", "nameSerializer", "=", "StringSerializer", ".", "INSTANCE", ";", "TypeSerializer", "<", "State", ".", "StateType", ">", "...
Skips bytes corresponding to serialized states. In flink 1.6+ the states are no longer kept in state.
[ "Skips", "bytes", "corresponding", "to", "serialized", "states", ".", "In", "flink", "1", ".", "6", "+", "the", "states", "are", "no", "longer", "kept", "in", "state", "." ]
b62db93bf63cb3bb34dd03d611a779d9e3fc61ac
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-libraries/flink-cep/src/main/java/org/apache/flink/cep/nfa/MigrationUtils.java#L44-L75
123,719
apache/flink
flink-table/flink-table-runtime-blink/src/main/java/org/apache/flink/table/dataformat/BinaryRow.java
BinaryRow.isInFixedLengthPart
public static boolean isInFixedLengthPart(InternalType type) { if (type instanceof DecimalType) { return ((DecimalType) type).precision() <= DecimalType.MAX_COMPACT_PRECISION; } else { return MUTABLE_FIELD_TYPES.contains(type); } }
java
public static boolean isInFixedLengthPart(InternalType type) { if (type instanceof DecimalType) { return ((DecimalType) type).precision() <= DecimalType.MAX_COMPACT_PRECISION; } else { return MUTABLE_FIELD_TYPES.contains(type); } }
[ "public", "static", "boolean", "isInFixedLengthPart", "(", "InternalType", "type", ")", "{", "if", "(", "type", "instanceof", "DecimalType", ")", "{", "return", "(", "(", "DecimalType", ")", "type", ")", ".", "precision", "(", ")", "<=", "DecimalType", ".", ...
If it is a fixed-length field, we can call this BinaryRow's setXX method for in-place updates. If it is variable-length field, can't use this method, because the underlying data is stored continuously.
[ "If", "it", "is", "a", "fixed", "-", "length", "field", "we", "can", "call", "this", "BinaryRow", "s", "setXX", "method", "for", "in", "-", "place", "updates", ".", "If", "it", "is", "variable", "-", "length", "field", "can", "t", "use", "this", "met...
b62db93bf63cb3bb34dd03d611a779d9e3fc61ac
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-table/flink-table-runtime-blink/src/main/java/org/apache/flink/table/dataformat/BinaryRow.java#L98-L104
123,720
apache/flink
flink-table/flink-table-runtime-blink/src/main/java/org/apache/flink/table/dataformat/BinaryRow.java
BinaryRow.anyNull
public boolean anyNull() { // Skip the header. if ((segments[0].getLong(0) & FIRST_BYTE_ZERO) != 0) { return true; } for (int i = 8; i < nullBitsSizeInBytes; i += 8) { if (segments[0].getLong(i) != 0) { return true; } } return false; }
java
public boolean anyNull() { // Skip the header. if ((segments[0].getLong(0) & FIRST_BYTE_ZERO) != 0) { return true; } for (int i = 8; i < nullBitsSizeInBytes; i += 8) { if (segments[0].getLong(i) != 0) { return true; } } return false; }
[ "public", "boolean", "anyNull", "(", ")", "{", "// Skip the header.", "if", "(", "(", "segments", "[", "0", "]", ".", "getLong", "(", "0", ")", "&", "FIRST_BYTE_ZERO", ")", "!=", "0", ")", "{", "return", "true", ";", "}", "for", "(", "int", "i", "=...
The bit is 1 when the field is null. Default is 0.
[ "The", "bit", "is", "1", "when", "the", "field", "is", "null", ".", "Default", "is", "0", "." ]
b62db93bf63cb3bb34dd03d611a779d9e3fc61ac
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-table/flink-table-runtime-blink/src/main/java/org/apache/flink/table/dataformat/BinaryRow.java#L365-L376
123,721
apache/flink
flink-runtime-web/src/main/java/org/apache/flink/runtime/webmonitor/handlers/utils/JarHandlerUtils.java
JarHandlerUtils.getProgramArgs
private static <R extends JarRequestBody, M extends MessageParameters> List<String> getProgramArgs( HandlerRequest<R, M> request, Logger log) throws RestHandlerException { JarRequestBody requestBody = request.getRequestBody(); @SuppressWarnings("deprecation") List<String> programArgs = tokenizeArguments( fr...
java
private static <R extends JarRequestBody, M extends MessageParameters> List<String> getProgramArgs( HandlerRequest<R, M> request, Logger log) throws RestHandlerException { JarRequestBody requestBody = request.getRequestBody(); @SuppressWarnings("deprecation") List<String> programArgs = tokenizeArguments( fr...
[ "private", "static", "<", "R", "extends", "JarRequestBody", ",", "M", "extends", "MessageParameters", ">", "List", "<", "String", ">", "getProgramArgs", "(", "HandlerRequest", "<", "R", ",", "M", ">", "request", ",", "Logger", "log", ")", "throws", "RestHand...
Parse program arguments in jar run or plan request.
[ "Parse", "program", "arguments", "in", "jar", "run", "or", "plan", "request", "." ]
b62db93bf63cb3bb34dd03d611a779d9e3fc61ac
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime-web/src/main/java/org/apache/flink/runtime/webmonitor/handlers/utils/JarHandlerUtils.java#L134-L160
123,722
apache/flink
flink-runtime-web/src/main/java/org/apache/flink/runtime/webmonitor/handlers/utils/JarHandlerUtils.java
JarHandlerUtils.tokenizeArguments
@VisibleForTesting static List<String> tokenizeArguments(@Nullable final String args) { if (args == null) { return Collections.emptyList(); } final Matcher matcher = ARGUMENTS_TOKENIZE_PATTERN.matcher(args); final List<String> tokens = new ArrayList<>(); while (matcher.find()) { tokens.add(matcher.grou...
java
@VisibleForTesting static List<String> tokenizeArguments(@Nullable final String args) { if (args == null) { return Collections.emptyList(); } final Matcher matcher = ARGUMENTS_TOKENIZE_PATTERN.matcher(args); final List<String> tokens = new ArrayList<>(); while (matcher.find()) { tokens.add(matcher.grou...
[ "@", "VisibleForTesting", "static", "List", "<", "String", ">", "tokenizeArguments", "(", "@", "Nullable", "final", "String", "args", ")", "{", "if", "(", "args", "==", "null", ")", "{", "return", "Collections", ".", "emptyList", "(", ")", ";", "}", "fin...
Takes program arguments as a single string, and splits them into a list of string. <pre> tokenizeArguments("--foo bar") = ["--foo" "bar"] tokenizeArguments("--foo \"bar baz\"") = ["--foo" "bar baz"] tokenizeArguments("--foo 'bar baz'") = ["--foo" "bar baz"] tokenizeArguments(null) ...
[ "Takes", "program", "arguments", "as", "a", "single", "string", "and", "splits", "them", "into", "a", "list", "of", "string", "." ]
b62db93bf63cb3bb34dd03d611a779d9e3fc61ac
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime-web/src/main/java/org/apache/flink/runtime/webmonitor/handlers/utils/JarHandlerUtils.java#L176-L190
123,723
apache/flink
flink-runtime/src/main/java/org/apache/flink/runtime/executiongraph/ExecutionGraph.java
ExecutionGraph.aggregateUserAccumulators
public Map<String, OptionalFailure<Accumulator<?, ?>>> aggregateUserAccumulators() { Map<String, OptionalFailure<Accumulator<?, ?>>> userAccumulators = new HashMap<>(); for (ExecutionVertex vertex : getAllExecutionVertices()) { Map<String, Accumulator<?, ?>> next = vertex.getCurrentExecutionAttempt().getUserAc...
java
public Map<String, OptionalFailure<Accumulator<?, ?>>> aggregateUserAccumulators() { Map<String, OptionalFailure<Accumulator<?, ?>>> userAccumulators = new HashMap<>(); for (ExecutionVertex vertex : getAllExecutionVertices()) { Map<String, Accumulator<?, ?>> next = vertex.getCurrentExecutionAttempt().getUserAc...
[ "public", "Map", "<", "String", ",", "OptionalFailure", "<", "Accumulator", "<", "?", ",", "?", ">", ">", ">", "aggregateUserAccumulators", "(", ")", "{", "Map", "<", "String", ",", "OptionalFailure", "<", "Accumulator", "<", "?", ",", "?", ">", ">", "...
Merges all accumulator results from the tasks previously executed in the Executions. @return The accumulator map
[ "Merges", "all", "accumulator", "results", "from", "the", "tasks", "previously", "executed", "in", "the", "Executions", "." ]
b62db93bf63cb3bb34dd03d611a779d9e3fc61ac
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/executiongraph/ExecutionGraph.java#L749-L761
123,724
apache/flink
flink-runtime/src/main/java/org/apache/flink/runtime/executiongraph/ExecutionGraph.java
ExecutionGraph.getAccumulatorsSerialized
@Override public Map<String, SerializedValue<OptionalFailure<Object>>> getAccumulatorsSerialized() { return aggregateUserAccumulators() .entrySet() .stream() .collect(Collectors.toMap( Map.Entry::getKey, entry -> serializeAccumulator(entry.getKey(), entry.getValue()))); }
java
@Override public Map<String, SerializedValue<OptionalFailure<Object>>> getAccumulatorsSerialized() { return aggregateUserAccumulators() .entrySet() .stream() .collect(Collectors.toMap( Map.Entry::getKey, entry -> serializeAccumulator(entry.getKey(), entry.getValue()))); }
[ "@", "Override", "public", "Map", "<", "String", ",", "SerializedValue", "<", "OptionalFailure", "<", "Object", ">", ">", ">", "getAccumulatorsSerialized", "(", ")", "{", "return", "aggregateUserAccumulators", "(", ")", ".", "entrySet", "(", ")", ".", "stream"...
Gets a serialized accumulator map. @return The accumulator map with serialized accumulator values.
[ "Gets", "a", "serialized", "accumulator", "map", "." ]
b62db93bf63cb3bb34dd03d611a779d9e3fc61ac
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/executiongraph/ExecutionGraph.java#L767-L775
123,725
apache/flink
flink-runtime/src/main/java/org/apache/flink/runtime/executiongraph/ExecutionGraph.java
ExecutionGraph.getAccumulatorResultsStringified
@Override public StringifiedAccumulatorResult[] getAccumulatorResultsStringified() { Map<String, OptionalFailure<Accumulator<?, ?>>> accumulatorMap = aggregateUserAccumulators(); return StringifiedAccumulatorResult.stringifyAccumulatorResults(accumulatorMap); }
java
@Override public StringifiedAccumulatorResult[] getAccumulatorResultsStringified() { Map<String, OptionalFailure<Accumulator<?, ?>>> accumulatorMap = aggregateUserAccumulators(); return StringifiedAccumulatorResult.stringifyAccumulatorResults(accumulatorMap); }
[ "@", "Override", "public", "StringifiedAccumulatorResult", "[", "]", "getAccumulatorResultsStringified", "(", ")", "{", "Map", "<", "String", ",", "OptionalFailure", "<", "Accumulator", "<", "?", ",", "?", ">", ">", ">", "accumulatorMap", "=", "aggregateUserAccumu...
Returns the a stringified version of the user-defined accumulators. @return an Array containing the StringifiedAccumulatorResult objects
[ "Returns", "the", "a", "stringified", "version", "of", "the", "user", "-", "defined", "accumulators", "." ]
b62db93bf63cb3bb34dd03d611a779d9e3fc61ac
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/executiongraph/ExecutionGraph.java#L797-L801
123,726
apache/flink
flink-runtime/src/main/java/org/apache/flink/runtime/executiongraph/ExecutionGraph.java
ExecutionGraph.suspend
public void suspend(Throwable suspensionCause) { assertRunningInJobMasterMainThread(); if (state.isTerminalState()) { // stay in a terminal state return; } else if (transitionState(state, JobStatus.SUSPENDED, suspensionCause)) { initFailureCause(suspensionCause); // make sure no concurrent local ac...
java
public void suspend(Throwable suspensionCause) { assertRunningInJobMasterMainThread(); if (state.isTerminalState()) { // stay in a terminal state return; } else if (transitionState(state, JobStatus.SUSPENDED, suspensionCause)) { initFailureCause(suspensionCause); // make sure no concurrent local ac...
[ "public", "void", "suspend", "(", "Throwable", "suspensionCause", ")", "{", "assertRunningInJobMasterMainThread", "(", ")", ";", "if", "(", "state", ".", "isTerminalState", "(", ")", ")", "{", "// stay in a terminal state", "return", ";", "}", "else", "if", "(",...
Suspends the current ExecutionGraph. <p>The JobStatus will be directly set to {@link JobStatus#SUSPENDED} iff the current state is not a terminal state. All ExecutionJobVertices will be canceled and the onTerminalState() is executed. <p>The {@link JobStatus#SUSPENDED} state is a local terminal state which stops the e...
[ "Suspends", "the", "current", "ExecutionGraph", "." ]
b62db93bf63cb3bb34dd03d611a779d9e3fc61ac
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/executiongraph/ExecutionGraph.java#L1106-L1145
123,727
apache/flink
flink-runtime/src/main/java/org/apache/flink/runtime/executiongraph/ExecutionGraph.java
ExecutionGraph.failGlobal
public void failGlobal(Throwable t) { assertRunningInJobMasterMainThread(); while (true) { JobStatus current = state; // stay in these states if (current == JobStatus.FAILING || current == JobStatus.SUSPENDED || current.isGloballyTerminalState()) { return; } else if (transitionState(curren...
java
public void failGlobal(Throwable t) { assertRunningInJobMasterMainThread(); while (true) { JobStatus current = state; // stay in these states if (current == JobStatus.FAILING || current == JobStatus.SUSPENDED || current.isGloballyTerminalState()) { return; } else if (transitionState(curren...
[ "public", "void", "failGlobal", "(", "Throwable", "t", ")", "{", "assertRunningInJobMasterMainThread", "(", ")", ";", "while", "(", "true", ")", "{", "JobStatus", "current", "=", "state", ";", "// stay in these states", "if", "(", "current", "==", "JobStatus", ...
Fails the execution graph globally. This failure will not be recovered by a specific failover strategy, but results in a full restart of all tasks. <p>This global failure is meant to be triggered in cases where the consistency of the execution graph' state cannot be guaranteed any more (for example when catching unexp...
[ "Fails", "the", "execution", "graph", "globally", ".", "This", "failure", "will", "not", "be", "recovered", "by", "a", "specific", "failover", "strategy", "but", "results", "in", "a", "full", "restart", "of", "all", "tasks", "." ]
b62db93bf63cb3bb34dd03d611a779d9e3fc61ac
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/executiongraph/ExecutionGraph.java#L1158-L1208
123,728
apache/flink
flink-runtime/src/main/java/org/apache/flink/runtime/executiongraph/ExecutionGraph.java
ExecutionGraph.updateState
public boolean updateState(TaskExecutionState state) { assertRunningInJobMasterMainThread(); final Execution attempt = currentExecutions.get(state.getID()); if (attempt != null) { try { Map<String, Accumulator<?, ?>> accumulators; switch (state.getExecutionState()) { case RUNNING: return a...
java
public boolean updateState(TaskExecutionState state) { assertRunningInJobMasterMainThread(); final Execution attempt = currentExecutions.get(state.getID()); if (attempt != null) { try { Map<String, Accumulator<?, ?>> accumulators; switch (state.getExecutionState()) { case RUNNING: return a...
[ "public", "boolean", "updateState", "(", "TaskExecutionState", "state", ")", "{", "assertRunningInJobMasterMainThread", "(", ")", ";", "final", "Execution", "attempt", "=", "currentExecutions", ".", "get", "(", "state", ".", "getID", "(", ")", ")", ";", "if", ...
Updates the state of one of the ExecutionVertex's Execution attempts. If the new status if "FINISHED", this also updates the accumulators. @param state The state update. @return True, if the task update was properly applied, false, if the execution attempt was not found.
[ "Updates", "the", "state", "of", "one", "of", "the", "ExecutionVertex", "s", "Execution", "attempts", ".", "If", "the", "new", "status", "if", "FINISHED", "this", "also", "updates", "the", "accumulators", "." ]
b62db93bf63cb3bb34dd03d611a779d9e3fc61ac
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/executiongraph/ExecutionGraph.java#L1542-L1590
123,729
apache/flink
flink-runtime/src/main/java/org/apache/flink/runtime/executiongraph/ExecutionGraph.java
ExecutionGraph.deserializeAccumulators
private Map<String, Accumulator<?, ?>> deserializeAccumulators(TaskExecutionState state) { AccumulatorSnapshot serializedAccumulators = state.getAccumulators(); if (serializedAccumulators != null) { try { return serializedAccumulators.deserializeUserAccumulators(userClassLoader); } catch (Throwable t)...
java
private Map<String, Accumulator<?, ?>> deserializeAccumulators(TaskExecutionState state) { AccumulatorSnapshot serializedAccumulators = state.getAccumulators(); if (serializedAccumulators != null) { try { return serializedAccumulators.deserializeUserAccumulators(userClassLoader); } catch (Throwable t)...
[ "private", "Map", "<", "String", ",", "Accumulator", "<", "?", ",", "?", ">", ">", "deserializeAccumulators", "(", "TaskExecutionState", "state", ")", "{", "AccumulatorSnapshot", "serializedAccumulators", "=", "state", ".", "getAccumulators", "(", ")", ";", "if"...
Deserializes accumulators from a task state update. <p>This method never throws an exception! @param state The task execution state from which to deserialize the accumulators. @return The deserialized accumulators, of null, if there are no accumulators or an error occurred.
[ "Deserializes", "accumulators", "from", "a", "task", "state", "update", "." ]
b62db93bf63cb3bb34dd03d611a779d9e3fc61ac
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/executiongraph/ExecutionGraph.java#L1600-L1614
123,730
apache/flink
flink-runtime/src/main/java/org/apache/flink/runtime/executiongraph/ExecutionGraph.java
ExecutionGraph.scheduleOrUpdateConsumers
public void scheduleOrUpdateConsumers(ResultPartitionID partitionId) throws ExecutionGraphException { assertRunningInJobMasterMainThread(); final Execution execution = currentExecutions.get(partitionId.getProducerId()); if (execution == null) { throw new ExecutionGraphException("Cannot find execution for ex...
java
public void scheduleOrUpdateConsumers(ResultPartitionID partitionId) throws ExecutionGraphException { assertRunningInJobMasterMainThread(); final Execution execution = currentExecutions.get(partitionId.getProducerId()); if (execution == null) { throw new ExecutionGraphException("Cannot find execution for ex...
[ "public", "void", "scheduleOrUpdateConsumers", "(", "ResultPartitionID", "partitionId", ")", "throws", "ExecutionGraphException", "{", "assertRunningInJobMasterMainThread", "(", ")", ";", "final", "Execution", "execution", "=", "currentExecutions", ".", "get", "(", "parti...
Schedule or updates consumers of the given result partition. @param partitionId specifying the result partition whose consumer shall be scheduled or updated @throws ExecutionGraphException if the schedule or update consumers operation could not be executed
[ "Schedule", "or", "updates", "consumers", "of", "the", "given", "result", "partition", "." ]
b62db93bf63cb3bb34dd03d611a779d9e3fc61ac
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/executiongraph/ExecutionGraph.java#L1622-L1638
123,731
apache/flink
flink-runtime/src/main/java/org/apache/flink/runtime/executiongraph/ExecutionGraph.java
ExecutionGraph.updateAccumulators
public void updateAccumulators(AccumulatorSnapshot accumulatorSnapshot) { Map<String, Accumulator<?, ?>> userAccumulators; try { userAccumulators = accumulatorSnapshot.deserializeUserAccumulators(userClassLoader); ExecutionAttemptID execID = accumulatorSnapshot.getExecutionAttemptID(); Execution execution...
java
public void updateAccumulators(AccumulatorSnapshot accumulatorSnapshot) { Map<String, Accumulator<?, ?>> userAccumulators; try { userAccumulators = accumulatorSnapshot.deserializeUserAccumulators(userClassLoader); ExecutionAttemptID execID = accumulatorSnapshot.getExecutionAttemptID(); Execution execution...
[ "public", "void", "updateAccumulators", "(", "AccumulatorSnapshot", "accumulatorSnapshot", ")", "{", "Map", "<", "String", ",", "Accumulator", "<", "?", ",", "?", ">", ">", "userAccumulators", ";", "try", "{", "userAccumulators", "=", "accumulatorSnapshot", ".", ...
Updates the accumulators during the runtime of a job. Final accumulator results are transferred through the UpdateTaskExecutionState message. @param accumulatorSnapshot The serialized flink and user-defined accumulators
[ "Updates", "the", "accumulators", "during", "the", "runtime", "of", "a", "job", ".", "Final", "accumulator", "results", "are", "transferred", "through", "the", "UpdateTaskExecutionState", "message", "." ]
b62db93bf63cb3bb34dd03d611a779d9e3fc61ac
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/executiongraph/ExecutionGraph.java#L1666-L1681
123,732
apache/flink
flink-runtime/src/main/java/org/apache/flink/runtime/executiongraph/ExecutionGraph.java
ExecutionGraph.computeAllPriorAllocationIds
private Set<AllocationID> computeAllPriorAllocationIds() { HashSet<AllocationID> allPreviousAllocationIds = new HashSet<>(getNumberOfExecutionJobVertices()); for (ExecutionVertex executionVertex : getAllExecutionVertices()) { AllocationID latestPriorAllocation = executionVertex.getLatestPriorAllocation(); if ...
java
private Set<AllocationID> computeAllPriorAllocationIds() { HashSet<AllocationID> allPreviousAllocationIds = new HashSet<>(getNumberOfExecutionJobVertices()); for (ExecutionVertex executionVertex : getAllExecutionVertices()) { AllocationID latestPriorAllocation = executionVertex.getLatestPriorAllocation(); if ...
[ "private", "Set", "<", "AllocationID", ">", "computeAllPriorAllocationIds", "(", ")", "{", "HashSet", "<", "AllocationID", ">", "allPreviousAllocationIds", "=", "new", "HashSet", "<>", "(", "getNumberOfExecutionJobVertices", "(", ")", ")", ";", "for", "(", "Execut...
Computes and returns a set with the prior allocation ids from all execution vertices in the graph.
[ "Computes", "and", "returns", "a", "set", "with", "the", "prior", "allocation", "ids", "from", "all", "execution", "vertices", "in", "the", "graph", "." ]
b62db93bf63cb3bb34dd03d611a779d9e3fc61ac
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/executiongraph/ExecutionGraph.java#L1686-L1695
123,733
apache/flink
flink-java/src/main/java/org/apache/flink/api/java/ClosureCleaner.java
ClosureCleaner.clean
public static void clean(Object func, boolean checkSerializable) { if (func == null) { return; } final Class<?> cls = func.getClass(); // First find the field name of the "this$0" field, this can // be "this$x" depending on the nesting boolean closureAccessed = false; for (Field f: cls.getDeclaredFi...
java
public static void clean(Object func, boolean checkSerializable) { if (func == null) { return; } final Class<?> cls = func.getClass(); // First find the field name of the "this$0" field, this can // be "this$x" depending on the nesting boolean closureAccessed = false; for (Field f: cls.getDeclaredFi...
[ "public", "static", "void", "clean", "(", "Object", "func", ",", "boolean", "checkSerializable", ")", "{", "if", "(", "func", "==", "null", ")", "{", "return", ";", "}", "final", "Class", "<", "?", ">", "cls", "=", "func", ".", "getClass", "(", ")", ...
Tries to clean the closure of the given object, if the object is a non-static inner class. @param func The object whose closure should be cleaned. @param checkSerializable Flag to indicate whether serializability should be checked after the closure cleaning attempt. @throws InvalidProgramException Thrown, if 'checkSe...
[ "Tries", "to", "clean", "the", "closure", "of", "the", "given", "object", "if", "the", "object", "is", "a", "non", "-", "static", "inner", "class", "." ]
b62db93bf63cb3bb34dd03d611a779d9e3fc61ac
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-java/src/main/java/org/apache/flink/api/java/ClosureCleaner.java#L61-L102
123,734
apache/flink
flink-core/src/main/java/org/apache/flink/util/LambdaUtil.java
LambdaUtil.applyToAllWhileSuppressingExceptions
public static <T> void applyToAllWhileSuppressingExceptions( Iterable<T> inputs, ThrowingConsumer<T, ? extends Exception> throwingConsumer) throws Exception { if (inputs != null && throwingConsumer != null) { Exception exception = null; for (T input : inputs) { if (input != null) { try { t...
java
public static <T> void applyToAllWhileSuppressingExceptions( Iterable<T> inputs, ThrowingConsumer<T, ? extends Exception> throwingConsumer) throws Exception { if (inputs != null && throwingConsumer != null) { Exception exception = null; for (T input : inputs) { if (input != null) { try { t...
[ "public", "static", "<", "T", ">", "void", "applyToAllWhileSuppressingExceptions", "(", "Iterable", "<", "T", ">", "inputs", ",", "ThrowingConsumer", "<", "T", ",", "?", "extends", "Exception", ">", "throwingConsumer", ")", "throws", "Exception", "{", "if", "(...
This method supplies all elements from the input to the consumer. Exceptions that happen on elements are suppressed until all elements are processed. If exceptions happened for one or more of the inputs, they are reported in a combining suppressed exception. @param inputs iterator for all inputs to the throwingConsume...
[ "This", "method", "supplies", "all", "elements", "from", "the", "input", "to", "the", "consumer", ".", "Exceptions", "that", "happen", "on", "elements", "are", "suppressed", "until", "all", "elements", "are", "processed", ".", "If", "exceptions", "happened", "...
b62db93bf63cb3bb34dd03d611a779d9e3fc61ac
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-core/src/main/java/org/apache/flink/util/LambdaUtil.java#L45-L67
123,735
apache/flink
flink-queryable-state/flink-queryable-state-client-java/src/main/java/org/apache/flink/queryablestate/network/AbstractServerBase.java
AbstractServerBase.createQueryExecutor
private ExecutorService createQueryExecutor() { ThreadFactory threadFactory = new ThreadFactoryBuilder() .setDaemon(true) .setNameFormat("Flink " + getServerName() + " Thread %d") .build(); return Executors.newFixedThreadPool(numQueryThreads, threadFactory); }
java
private ExecutorService createQueryExecutor() { ThreadFactory threadFactory = new ThreadFactoryBuilder() .setDaemon(true) .setNameFormat("Flink " + getServerName() + " Thread %d") .build(); return Executors.newFixedThreadPool(numQueryThreads, threadFactory); }
[ "private", "ExecutorService", "createQueryExecutor", "(", ")", "{", "ThreadFactory", "threadFactory", "=", "new", "ThreadFactoryBuilder", "(", ")", ".", "setDaemon", "(", "true", ")", ".", "setNameFormat", "(", "\"Flink \"", "+", "getServerName", "(", ")", "+", ...
Creates a thread pool for the query execution. @return Thread pool for query execution
[ "Creates", "a", "thread", "pool", "for", "the", "query", "execution", "." ]
b62db93bf63cb3bb34dd03d611a779d9e3fc61ac
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-queryable-state/flink-queryable-state-client-java/src/main/java/org/apache/flink/queryablestate/network/AbstractServerBase.java#L143-L149
123,736
apache/flink
flink-queryable-state/flink-queryable-state-client-java/src/main/java/org/apache/flink/queryablestate/network/AbstractServerBase.java
AbstractServerBase.attemptToBind
private boolean attemptToBind(final int port) throws Throwable { log.debug("Attempting to start {} on port {}.", serverName, port); this.queryExecutor = createQueryExecutor(); this.handler = initializeHandler(); final NettyBufferPool bufferPool = new NettyBufferPool(numEventLoopThreads); final ThreadFactor...
java
private boolean attemptToBind(final int port) throws Throwable { log.debug("Attempting to start {} on port {}.", serverName, port); this.queryExecutor = createQueryExecutor(); this.handler = initializeHandler(); final NettyBufferPool bufferPool = new NettyBufferPool(numEventLoopThreads); final ThreadFactor...
[ "private", "boolean", "attemptToBind", "(", "final", "int", "port", ")", "throws", "Throwable", "{", "log", ".", "debug", "(", "\"Attempting to start {} on port {}.\"", ",", "serverName", ",", "port", ")", ";", "this", ".", "queryExecutor", "=", "createQueryExecut...
Tries to start the server at the provided port. <p>This, in conjunction with {@link #start()}, try to start the server on a free port among the port range provided at the constructor. @param port the port to try to bind the server to. @throws Exception If something goes wrong during the bind operation.
[ "Tries", "to", "start", "the", "server", "at", "the", "provided", "port", "." ]
b62db93bf63cb3bb34dd03d611a779d9e3fc61ac
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-queryable-state/flink-queryable-state-client-java/src/main/java/org/apache/flink/queryablestate/network/AbstractServerBase.java#L211-L279
123,737
apache/flink
flink-queryable-state/flink-queryable-state-client-java/src/main/java/org/apache/flink/queryablestate/network/AbstractServerBase.java
AbstractServerBase.shutdownServer
public CompletableFuture<Void> shutdownServer() { CompletableFuture<Void> shutdownFuture = new CompletableFuture<>(); if (serverShutdownFuture.compareAndSet(null, shutdownFuture)) { log.info("Shutting down {} @ {}", serverName, serverAddress); final CompletableFuture<Void> groupShutdownFuture = new Completab...
java
public CompletableFuture<Void> shutdownServer() { CompletableFuture<Void> shutdownFuture = new CompletableFuture<>(); if (serverShutdownFuture.compareAndSet(null, shutdownFuture)) { log.info("Shutting down {} @ {}", serverName, serverAddress); final CompletableFuture<Void> groupShutdownFuture = new Completab...
[ "public", "CompletableFuture", "<", "Void", ">", "shutdownServer", "(", ")", "{", "CompletableFuture", "<", "Void", ">", "shutdownFuture", "=", "new", "CompletableFuture", "<>", "(", ")", ";", "if", "(", "serverShutdownFuture", ".", "compareAndSet", "(", "null",...
Shuts down the server and all related thread pools. @return A {@link CompletableFuture} that will be completed upon termination of the shutdown process.
[ "Shuts", "down", "the", "server", "and", "all", "related", "thread", "pools", "." ]
b62db93bf63cb3bb34dd03d611a779d9e3fc61ac
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-queryable-state/flink-queryable-state-client-java/src/main/java/org/apache/flink/queryablestate/network/AbstractServerBase.java#L285-L339
123,738
apache/flink
flink-runtime/src/main/java/org/apache/flink/runtime/metrics/dump/MetricQueryService.java
MetricQueryService.createMetricQueryService
public static MetricQueryService createMetricQueryService( RpcService rpcService, ResourceID resourceID, long maximumFrameSize) { String endpointId = resourceID == null ? METRIC_QUERY_SERVICE_NAME : METRIC_QUERY_SERVICE_NAME + "_" + resourceID.getResourceIdString(); return new MetricQueryService(rpcSe...
java
public static MetricQueryService createMetricQueryService( RpcService rpcService, ResourceID resourceID, long maximumFrameSize) { String endpointId = resourceID == null ? METRIC_QUERY_SERVICE_NAME : METRIC_QUERY_SERVICE_NAME + "_" + resourceID.getResourceIdString(); return new MetricQueryService(rpcSe...
[ "public", "static", "MetricQueryService", "createMetricQueryService", "(", "RpcService", "rpcService", ",", "ResourceID", "resourceID", ",", "long", "maximumFrameSize", ")", "{", "String", "endpointId", "=", "resourceID", "==", "null", "?", "METRIC_QUERY_SERVICE_NAME", ...
Starts the MetricQueryService actor in the given actor system. @param rpcService The rpcService running the MetricQueryService @param resourceID resource ID to disambiguate the actor name @return actor reference to the MetricQueryService
[ "Starts", "the", "MetricQueryService", "actor", "in", "the", "given", "actor", "system", "." ]
b62db93bf63cb3bb34dd03d611a779d9e3fc61ac
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/metrics/dump/MetricQueryService.java#L243-L253
123,739
apache/flink
flink-runtime/src/main/java/org/apache/flink/runtime/rest/handler/router/Router.java
Router.size
public int size() { int ret = anyMethodRouter.size(); for (MethodlessRouter<T> router : routers.values()) { ret += router.size(); } return ret; }
java
public int size() { int ret = anyMethodRouter.size(); for (MethodlessRouter<T> router : routers.values()) { ret += router.size(); } return ret; }
[ "public", "int", "size", "(", ")", "{", "int", "ret", "=", "anyMethodRouter", ".", "size", "(", ")", ";", "for", "(", "MethodlessRouter", "<", "T", ">", "router", ":", "routers", ".", "values", "(", ")", ")", "{", "ret", "+=", "router", ".", "size"...
Returns the number of routes in this router.
[ "Returns", "the", "number", "of", "routes", "in", "this", "router", "." ]
b62db93bf63cb3bb34dd03d611a779d9e3fc61ac
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/rest/handler/router/Router.java#L156-L164
123,740
apache/flink
flink-runtime/src/main/java/org/apache/flink/runtime/rest/handler/router/Router.java
Router.addRoute
public Router<T> addRoute(HttpMethod method, String pathPattern, T target) { getMethodlessRouter(method).addRoute(pathPattern, target); return this; }
java
public Router<T> addRoute(HttpMethod method, String pathPattern, T target) { getMethodlessRouter(method).addRoute(pathPattern, target); return this; }
[ "public", "Router", "<", "T", ">", "addRoute", "(", "HttpMethod", "method", ",", "String", "pathPattern", ",", "T", "target", ")", "{", "getMethodlessRouter", "(", "method", ")", ".", "addRoute", "(", "pathPattern", ",", "target", ")", ";", "return", "this...
Add route. <p>A path pattern can only point to one target. This method does nothing if the pattern has already been added.
[ "Add", "route", "." ]
b62db93bf63cb3bb34dd03d611a779d9e3fc61ac
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/rest/handler/router/Router.java#L174-L177
123,741
apache/flink
flink-runtime/src/main/java/org/apache/flink/runtime/rest/handler/router/Router.java
Router.allowedMethods
public Set<HttpMethod> allowedMethods(String uri) { QueryStringDecoder decoder = new QueryStringDecoder(uri); String[] tokens = PathPattern.removeSlashesAtBothEnds(decoder.path()).split("/"); if (anyMethodRouter.anyMatched(tokens)) { return allAllowedMethods(); } Set<HttpMethod> ret = new HashSet<HttpMet...
java
public Set<HttpMethod> allowedMethods(String uri) { QueryStringDecoder decoder = new QueryStringDecoder(uri); String[] tokens = PathPattern.removeSlashesAtBothEnds(decoder.path()).split("/"); if (anyMethodRouter.anyMatched(tokens)) { return allAllowedMethods(); } Set<HttpMethod> ret = new HashSet<HttpMet...
[ "public", "Set", "<", "HttpMethod", ">", "allowedMethods", "(", "String", "uri", ")", "{", "QueryStringDecoder", "decoder", "=", "new", "QueryStringDecoder", "(", "uri", ")", ";", "String", "[", "]", "tokens", "=", "PathPattern", ".", "removeSlashesAtBothEnds", ...
Returns allowed methods for a specific URI. <p>For {@code OPTIONS *}, use {@link #allAllowedMethods()} instead of this method.
[ "Returns", "allowed", "methods", "for", "a", "specific", "URI", "." ]
b62db93bf63cb3bb34dd03d611a779d9e3fc61ac
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/rest/handler/router/Router.java#L274-L292
123,742
apache/flink
flink-streaming-java/src/main/java/org/apache/flink/streaming/api/datastream/KeyedStream.java
KeyedStream.asQueryableState
@PublicEvolving public QueryableStateStream<KEY, T> asQueryableState(String queryableStateName) { ValueStateDescriptor<T> valueStateDescriptor = new ValueStateDescriptor<T>( UUID.randomUUID().toString(), getType()); return asQueryableState(queryableStateName, valueStateDescriptor); }
java
@PublicEvolving public QueryableStateStream<KEY, T> asQueryableState(String queryableStateName) { ValueStateDescriptor<T> valueStateDescriptor = new ValueStateDescriptor<T>( UUID.randomUUID().toString(), getType()); return asQueryableState(queryableStateName, valueStateDescriptor); }
[ "@", "PublicEvolving", "public", "QueryableStateStream", "<", "KEY", ",", "T", ">", "asQueryableState", "(", "String", "queryableStateName", ")", "{", "ValueStateDescriptor", "<", "T", ">", "valueStateDescriptor", "=", "new", "ValueStateDescriptor", "<", "T", ">", ...
Publishes the keyed stream as queryable ValueState instance. @param queryableStateName Name under which to the publish the queryable state instance @return Queryable state instance
[ "Publishes", "the", "keyed", "stream", "as", "queryable", "ValueState", "instance", "." ]
b62db93bf63cb3bb34dd03d611a779d9e3fc61ac
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-streaming-java/src/main/java/org/apache/flink/streaming/api/datastream/KeyedStream.java#L1003-L1010
123,743
apache/flink
flink-streaming-java/src/main/java/org/apache/flink/streaming/api/datastream/KeyedStream.java
KeyedStream.asQueryableState
@PublicEvolving public QueryableStateStream<KEY, T> asQueryableState( String queryableStateName, ValueStateDescriptor<T> stateDescriptor) { transform("Queryable state: " + queryableStateName, getType(), new QueryableValueStateOperator<>(queryableStateName, stateDescriptor)); stateDescriptor.initial...
java
@PublicEvolving public QueryableStateStream<KEY, T> asQueryableState( String queryableStateName, ValueStateDescriptor<T> stateDescriptor) { transform("Queryable state: " + queryableStateName, getType(), new QueryableValueStateOperator<>(queryableStateName, stateDescriptor)); stateDescriptor.initial...
[ "@", "PublicEvolving", "public", "QueryableStateStream", "<", "KEY", ",", "T", ">", "asQueryableState", "(", "String", "queryableStateName", ",", "ValueStateDescriptor", "<", "T", ">", "stateDescriptor", ")", "{", "transform", "(", "\"Queryable state: \"", "+", "que...
Publishes the keyed stream as a queryable ValueState instance. @param queryableStateName Name under which to the publish the queryable state instance @param stateDescriptor State descriptor to create state instance from @return Queryable state instance
[ "Publishes", "the", "keyed", "stream", "as", "a", "queryable", "ValueState", "instance", "." ]
b62db93bf63cb3bb34dd03d611a779d9e3fc61ac
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-streaming-java/src/main/java/org/apache/flink/streaming/api/datastream/KeyedStream.java#L1019-L1034
123,744
apache/flink
flink-streaming-java/src/main/java/org/apache/flink/streaming/api/datastream/KeyedStream.java
KeyedStream.asQueryableState
@PublicEvolving @Deprecated public <ACC> QueryableStateStream<KEY, ACC> asQueryableState( String queryableStateName, FoldingStateDescriptor<T, ACC> stateDescriptor) { transform("Queryable state: " + queryableStateName, getType(), new QueryableAppendingStateOperator<>(queryableStateName, stateDescript...
java
@PublicEvolving @Deprecated public <ACC> QueryableStateStream<KEY, ACC> asQueryableState( String queryableStateName, FoldingStateDescriptor<T, ACC> stateDescriptor) { transform("Queryable state: " + queryableStateName, getType(), new QueryableAppendingStateOperator<>(queryableStateName, stateDescript...
[ "@", "PublicEvolving", "@", "Deprecated", "public", "<", "ACC", ">", "QueryableStateStream", "<", "KEY", ",", "ACC", ">", "asQueryableState", "(", "String", "queryableStateName", ",", "FoldingStateDescriptor", "<", "T", ",", "ACC", ">", "stateDescriptor", ")", "...
Publishes the keyed stream as a queryable FoldingState instance. @param queryableStateName Name under which to the publish the queryable state instance @param stateDescriptor State descriptor to create state instance from @return Queryable state instance @deprecated will be removed in a future version
[ "Publishes", "the", "keyed", "stream", "as", "a", "queryable", "FoldingState", "instance", "." ]
b62db93bf63cb3bb34dd03d611a779d9e3fc61ac
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-streaming-java/src/main/java/org/apache/flink/streaming/api/datastream/KeyedStream.java#L1045-L1061
123,745
apache/flink
flink-streaming-java/src/main/java/org/apache/flink/streaming/api/datastream/KeyedStream.java
KeyedStream.asQueryableState
@PublicEvolving public QueryableStateStream<KEY, T> asQueryableState( String queryableStateName, ReducingStateDescriptor<T> stateDescriptor) { transform("Queryable state: " + queryableStateName, getType(), new QueryableAppendingStateOperator<>(queryableStateName, stateDescriptor)); stateDescriptor....
java
@PublicEvolving public QueryableStateStream<KEY, T> asQueryableState( String queryableStateName, ReducingStateDescriptor<T> stateDescriptor) { transform("Queryable state: " + queryableStateName, getType(), new QueryableAppendingStateOperator<>(queryableStateName, stateDescriptor)); stateDescriptor....
[ "@", "PublicEvolving", "public", "QueryableStateStream", "<", "KEY", ",", "T", ">", "asQueryableState", "(", "String", "queryableStateName", ",", "ReducingStateDescriptor", "<", "T", ">", "stateDescriptor", ")", "{", "transform", "(", "\"Queryable state: \"", "+", "...
Publishes the keyed stream as a queryable ReducingState instance. @param queryableStateName Name under which to the publish the queryable state instance @param stateDescriptor State descriptor to create state instance from @return Queryable state instance
[ "Publishes", "the", "keyed", "stream", "as", "a", "queryable", "ReducingState", "instance", "." ]
b62db93bf63cb3bb34dd03d611a779d9e3fc61ac
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-streaming-java/src/main/java/org/apache/flink/streaming/api/datastream/KeyedStream.java#L1070-L1085
123,746
apache/flink
flink-table/flink-sql-client/src/main/java/org/apache/flink/table/client/config/Environment.java
Environment.parse
public static Environment parse(URL url) throws IOException { try { return new ConfigUtil.LowerCaseYamlMapper().readValue(url, Environment.class); } catch (JsonMappingException e) { throw new SqlClientException("Could not parse environment file. Cause: " + e.getMessage()); } }
java
public static Environment parse(URL url) throws IOException { try { return new ConfigUtil.LowerCaseYamlMapper().readValue(url, Environment.class); } catch (JsonMappingException e) { throw new SqlClientException("Could not parse environment file. Cause: " + e.getMessage()); } }
[ "public", "static", "Environment", "parse", "(", "URL", "url", ")", "throws", "IOException", "{", "try", "{", "return", "new", "ConfigUtil", ".", "LowerCaseYamlMapper", "(", ")", ".", "readValue", "(", "url", ",", "Environment", ".", "class", ")", ";", "}"...
Parses an environment file from an URL.
[ "Parses", "an", "environment", "file", "from", "an", "URL", "." ]
b62db93bf63cb3bb34dd03d611a779d9e3fc61ac
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-table/flink-sql-client/src/main/java/org/apache/flink/table/client/config/Environment.java#L142-L148
123,747
apache/flink
flink-table/flink-sql-client/src/main/java/org/apache/flink/table/client/config/Environment.java
Environment.parse
public static Environment parse(String content) throws IOException { try { return new ConfigUtil.LowerCaseYamlMapper().readValue(content, Environment.class); } catch (JsonMappingException e) { throw new SqlClientException("Could not parse environment file. Cause: " + e.getMessage()); } }
java
public static Environment parse(String content) throws IOException { try { return new ConfigUtil.LowerCaseYamlMapper().readValue(content, Environment.class); } catch (JsonMappingException e) { throw new SqlClientException("Could not parse environment file. Cause: " + e.getMessage()); } }
[ "public", "static", "Environment", "parse", "(", "String", "content", ")", "throws", "IOException", "{", "try", "{", "return", "new", "ConfigUtil", ".", "LowerCaseYamlMapper", "(", ")", ".", "readValue", "(", "content", ",", "Environment", ".", "class", ")", ...
Parses an environment file from an String.
[ "Parses", "an", "environment", "file", "from", "an", "String", "." ]
b62db93bf63cb3bb34dd03d611a779d9e3fc61ac
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-table/flink-sql-client/src/main/java/org/apache/flink/table/client/config/Environment.java#L153-L159
123,748
apache/flink
flink-table/flink-sql-client/src/main/java/org/apache/flink/table/client/config/Environment.java
Environment.merge
public static Environment merge(Environment env1, Environment env2) { final Environment mergedEnv = new Environment(); // merge tables final Map<String, TableEntry> tables = new LinkedHashMap<>(env1.getTables()); tables.putAll(env2.getTables()); mergedEnv.tables = tables; // merge functions final Map<St...
java
public static Environment merge(Environment env1, Environment env2) { final Environment mergedEnv = new Environment(); // merge tables final Map<String, TableEntry> tables = new LinkedHashMap<>(env1.getTables()); tables.putAll(env2.getTables()); mergedEnv.tables = tables; // merge functions final Map<St...
[ "public", "static", "Environment", "merge", "(", "Environment", "env1", ",", "Environment", "env2", ")", "{", "final", "Environment", "mergedEnv", "=", "new", "Environment", "(", ")", ";", "// merge tables", "final", "Map", "<", "String", ",", "TableEntry", ">...
Merges two environments. The properties of the first environment might be overwritten by the second one.
[ "Merges", "two", "environments", ".", "The", "properties", "of", "the", "first", "environment", "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/Environment.java#L164-L184
123,749
apache/flink
flink-runtime/src/main/java/org/apache/flink/runtime/checkpoint/MinMaxAvgStats.java
MinMaxAvgStats.add
void add(long value) { if (value >= 0) { if (count > 0) { min = Math.min(min, value); max = Math.max(max, value); } else { min = value; max = value; } count++; sum += value; } }
java
void add(long value) { if (value >= 0) { if (count > 0) { min = Math.min(min, value); max = Math.max(max, value); } else { min = value; max = value; } count++; sum += value; } }
[ "void", "add", "(", "long", "value", ")", "{", "if", "(", "value", ">=", "0", ")", "{", "if", "(", "count", ">", "0", ")", "{", "min", "=", "Math", ".", "min", "(", "min", ",", "value", ")", ";", "max", "=", "Math", ".", "max", "(", "max", ...
Adds the value to the stats if it is >= 0. @param value Value to add for min/max/avg stats..
[ "Adds", "the", "value", "to", "the", "stats", "if", "it", "is", ">", "=", "0", "." ]
b62db93bf63cb3bb34dd03d611a779d9e3fc61ac
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/checkpoint/MinMaxAvgStats.java#L57-L70
123,750
apache/flink
flink-runtime/src/main/java/org/apache/flink/runtime/state/heap/AbstractHeapPriorityQueue.java
AbstractHeapPriorityQueue.clear
public void clear() { final int arrayOffset = getHeadElementIndex(); Arrays.fill(queue, arrayOffset, arrayOffset + size, null); size = 0; }
java
public void clear() { final int arrayOffset = getHeadElementIndex(); Arrays.fill(queue, arrayOffset, arrayOffset + size, null); size = 0; }
[ "public", "void", "clear", "(", ")", "{", "final", "int", "arrayOffset", "=", "getHeadElementIndex", "(", ")", ";", "Arrays", ".", "fill", "(", "queue", ",", "arrayOffset", ",", "arrayOffset", "+", "size", ",", "null", ")", ";", "size", "=", "0", ";", ...
Clears the queue.
[ "Clears", "the", "queue", "." ]
b62db93bf63cb3bb34dd03d611a779d9e3fc61ac
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/state/heap/AbstractHeapPriorityQueue.java#L138-L142
123,751
apache/flink
flink-runtime/src/main/java/org/apache/flink/runtime/state/heap/NestedMapsStateTable.java
NestedMapsStateTable.setMapForKeyGroup
private void setMapForKeyGroup(int keyGroupId, Map<N, Map<K, S>> map) { try { state[indexToOffset(keyGroupId)] = map; } catch (ArrayIndexOutOfBoundsException e) { throw new IllegalArgumentException("Key group index " + keyGroupId + " is out of range of key group " + "range [" + keyGroupOffset + ", " + (ke...
java
private void setMapForKeyGroup(int keyGroupId, Map<N, Map<K, S>> map) { try { state[indexToOffset(keyGroupId)] = map; } catch (ArrayIndexOutOfBoundsException e) { throw new IllegalArgumentException("Key group index " + keyGroupId + " is out of range of key group " + "range [" + keyGroupOffset + ", " + (ke...
[ "private", "void", "setMapForKeyGroup", "(", "int", "keyGroupId", ",", "Map", "<", "N", ",", "Map", "<", "K", ",", "S", ">", ">", "map", ")", "{", "try", "{", "state", "[", "indexToOffset", "(", "keyGroupId", ")", "]", "=", "map", ";", "}", "catch"...
Sets the given map for the given key-group.
[ "Sets", "the", "given", "map", "for", "the", "given", "key", "-", "group", "." ]
b62db93bf63cb3bb34dd03d611a779d9e3fc61ac
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/state/heap/NestedMapsStateTable.java#L120-L127
123,752
apache/flink
flink-runtime/src/main/java/org/apache/flink/runtime/io/network/api/writer/RecordWriter.java
RecordWriter.randomEmit
public void randomEmit(T record) throws IOException, InterruptedException { emit(record, rng.nextInt(numberOfChannels)); }
java
public void randomEmit(T record) throws IOException, InterruptedException { emit(record, rng.nextInt(numberOfChannels)); }
[ "public", "void", "randomEmit", "(", "T", "record", ")", "throws", "IOException", ",", "InterruptedException", "{", "emit", "(", "record", ",", "rng", ".", "nextInt", "(", "numberOfChannels", ")", ")", ";", "}" ]
This is used to send LatencyMarks to a random target channel.
[ "This", "is", "used", "to", "send", "LatencyMarks", "to", "a", "random", "target", "channel", "." ]
b62db93bf63cb3bb34dd03d611a779d9e3fc61ac
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/io/network/api/writer/RecordWriter.java#L147-L149
123,753
apache/flink
flink-runtime/src/main/java/org/apache/flink/runtime/io/network/api/writer/RecordWriter.java
RecordWriter.notifyFlusherException
private void notifyFlusherException(Throwable t) { if (flusherException == null) { LOG.error("An exception happened while flushing the outputs", t); flusherException = t; } }
java
private void notifyFlusherException(Throwable t) { if (flusherException == null) { LOG.error("An exception happened while flushing the outputs", t); flusherException = t; } }
[ "private", "void", "notifyFlusherException", "(", "Throwable", "t", ")", "{", "if", "(", "flusherException", "==", "null", ")", "{", "LOG", ".", "error", "(", "\"An exception happened while flushing the outputs\"", ",", "t", ")", ";", "flusherException", "=", "t",...
Notifies the writer that the output flusher thread encountered an exception. @param t The exception to report.
[ "Notifies", "the", "writer", "that", "the", "output", "flusher", "thread", "encountered", "an", "exception", "." ]
b62db93bf63cb3bb34dd03d611a779d9e3fc61ac
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/io/network/api/writer/RecordWriter.java#L292-L297
123,754
apache/flink
flink-runtime/src/main/java/org/apache/flink/runtime/rpc/akka/AkkaRpcActor.java
AkkaRpcActor.handleRpcInvocation
private void handleRpcInvocation(RpcInvocation rpcInvocation) { Method rpcMethod = null; try { String methodName = rpcInvocation.getMethodName(); Class<?>[] parameterTypes = rpcInvocation.getParameterTypes(); rpcMethod = lookupRpcMethod(methodName, parameterTypes); } catch (ClassNotFoundException e) { ...
java
private void handleRpcInvocation(RpcInvocation rpcInvocation) { Method rpcMethod = null; try { String methodName = rpcInvocation.getMethodName(); Class<?>[] parameterTypes = rpcInvocation.getParameterTypes(); rpcMethod = lookupRpcMethod(methodName, parameterTypes); } catch (ClassNotFoundException e) { ...
[ "private", "void", "handleRpcInvocation", "(", "RpcInvocation", "rpcInvocation", ")", "{", "Method", "rpcMethod", "=", "null", ";", "try", "{", "String", "methodName", "=", "rpcInvocation", ".", "getMethodName", "(", ")", ";", "Class", "<", "?", ">", "[", "]...
Handle rpc invocations by looking up the rpc method on the rpc endpoint and calling this method with the provided method arguments. If the method has a return value, it is returned to the sender of the call. @param rpcInvocation Rpc invocation message
[ "Handle", "rpc", "invocations", "by", "looking", "up", "the", "rpc", "method", "on", "the", "rpc", "endpoint", "and", "calling", "this", "method", "with", "the", "provided", "method", "arguments", ".", "If", "the", "method", "has", "a", "return", "value", ...
b62db93bf63cb3bb34dd03d611a779d9e3fc61ac
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/rpc/akka/AkkaRpcActor.java#L242-L304
123,755
apache/flink
flink-runtime/src/main/java/org/apache/flink/runtime/rpc/akka/AkkaRpcActor.java
AkkaRpcActor.sendErrorIfSender
protected void sendErrorIfSender(Throwable throwable) { if (!getSender().equals(ActorRef.noSender())) { getSender().tell(new Status.Failure(throwable), getSelf()); } }
java
protected void sendErrorIfSender(Throwable throwable) { if (!getSender().equals(ActorRef.noSender())) { getSender().tell(new Status.Failure(throwable), getSelf()); } }
[ "protected", "void", "sendErrorIfSender", "(", "Throwable", "throwable", ")", "{", "if", "(", "!", "getSender", "(", ")", ".", "equals", "(", "ActorRef", ".", "noSender", "(", ")", ")", ")", "{", "getSender", "(", ")", ".", "tell", "(", "new", "Status"...
Send throwable to sender if the sender is specified. @param throwable to send to the sender
[ "Send", "throwable", "to", "sender", "if", "the", "sender", "is", "specified", "." ]
b62db93bf63cb3bb34dd03d611a779d9e3fc61ac
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/rpc/akka/AkkaRpcActor.java#L433-L437
123,756
apache/flink
flink-runtime/src/main/java/org/apache/flink/runtime/rpc/akka/AkkaRpcActor.java
AkkaRpcActor.stop
private void stop(RpcEndpointTerminationResult rpcEndpointTerminationResult) { if (rpcEndpointStopped.compareAndSet(false, true)) { this.rpcEndpointTerminationResult = rpcEndpointTerminationResult; getContext().stop(getSelf()); } }
java
private void stop(RpcEndpointTerminationResult rpcEndpointTerminationResult) { if (rpcEndpointStopped.compareAndSet(false, true)) { this.rpcEndpointTerminationResult = rpcEndpointTerminationResult; getContext().stop(getSelf()); } }
[ "private", "void", "stop", "(", "RpcEndpointTerminationResult", "rpcEndpointTerminationResult", ")", "{", "if", "(", "rpcEndpointStopped", ".", "compareAndSet", "(", "false", ",", "true", ")", ")", "{", "this", ".", "rpcEndpointTerminationResult", "=", "rpcEndpointTer...
Stop the actor immediately.
[ "Stop", "the", "actor", "immediately", "." ]
b62db93bf63cb3bb34dd03d611a779d9e3fc61ac
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/rpc/akka/AkkaRpcActor.java#L452-L457
123,757
apache/flink
flink-clients/src/main/java/org/apache/flink/client/cli/CliFrontendParser.java
CliFrontendParser.printCustomCliOptions
private static void printCustomCliOptions( Collection<CustomCommandLine<?>> customCommandLines, HelpFormatter formatter, boolean runOptions) { // prints options from all available command-line classes for (CustomCommandLine cli: customCommandLines) { formatter.setSyntaxPrefix(" Options for " + cli.getI...
java
private static void printCustomCliOptions( Collection<CustomCommandLine<?>> customCommandLines, HelpFormatter formatter, boolean runOptions) { // prints options from all available command-line classes for (CustomCommandLine cli: customCommandLines) { formatter.setSyntaxPrefix(" Options for " + cli.getI...
[ "private", "static", "void", "printCustomCliOptions", "(", "Collection", "<", "CustomCommandLine", "<", "?", ">", ">", "customCommandLines", ",", "HelpFormatter", "formatter", ",", "boolean", "runOptions", ")", "{", "// prints options from all available command-line classes...
Prints custom cli options. @param formatter The formatter to use for printing @param runOptions True if the run options should be printed, False to print only general options
[ "Prints", "custom", "cli", "options", "." ]
b62db93bf63cb3bb34dd03d611a779d9e3fc61ac
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-clients/src/main/java/org/apache/flink/client/cli/CliFrontendParser.java#L386-L401
123,758
apache/flink
flink-core/src/main/java/org/apache/flink/util/FileUtils.java
FileUtils.deleteFileOrDirectory
public static void deleteFileOrDirectory(File file) throws IOException { checkNotNull(file, "file"); guardIfWindows(FileUtils::deleteFileOrDirectoryInternal, file); }
java
public static void deleteFileOrDirectory(File file) throws IOException { checkNotNull(file, "file"); guardIfWindows(FileUtils::deleteFileOrDirectoryInternal, file); }
[ "public", "static", "void", "deleteFileOrDirectory", "(", "File", "file", ")", "throws", "IOException", "{", "checkNotNull", "(", "file", ",", "\"file\"", ")", ";", "guardIfWindows", "(", "FileUtils", "::", "deleteFileOrDirectoryInternal", ",", "file", ")", ";", ...
Removes the given file or directory recursively. <p>If the file or directory does not exist, this does not throw an exception, but simply does nothing. It considers the fact that a file-to-be-deleted is not present a success. <p>This method is safe against other concurrent deletion attempts. @param file The file or ...
[ "Removes", "the", "given", "file", "or", "directory", "recursively", "." ]
b62db93bf63cb3bb34dd03d611a779d9e3fc61ac
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-core/src/main/java/org/apache/flink/util/FileUtils.java#L223-L227
123,759
apache/flink
flink-core/src/main/java/org/apache/flink/util/FileUtils.java
FileUtils.deleteDirectory
public static void deleteDirectory(File directory) throws IOException { checkNotNull(directory, "directory"); guardIfWindows(FileUtils::deleteDirectoryInternal, directory); }
java
public static void deleteDirectory(File directory) throws IOException { checkNotNull(directory, "directory"); guardIfWindows(FileUtils::deleteDirectoryInternal, directory); }
[ "public", "static", "void", "deleteDirectory", "(", "File", "directory", ")", "throws", "IOException", "{", "checkNotNull", "(", "directory", ",", "\"directory\"", ")", ";", "guardIfWindows", "(", "FileUtils", "::", "deleteDirectoryInternal", ",", "directory", ")", ...
Deletes the given directory recursively. <p>If the directory does not exist, this does not throw an exception, but simply does nothing. It considers the fact that a directory-to-be-deleted is not present a success. <p>This method is safe against other concurrent deletion attempts. @param directory The directory to b...
[ "Deletes", "the", "given", "directory", "recursively", "." ]
b62db93bf63cb3bb34dd03d611a779d9e3fc61ac
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-core/src/main/java/org/apache/flink/util/FileUtils.java#L241-L245
123,760
apache/flink
flink-core/src/main/java/org/apache/flink/util/FileUtils.java
FileUtils.cleanDirectory
public static void cleanDirectory(File directory) throws IOException { checkNotNull(directory, "directory"); guardIfWindows(FileUtils::cleanDirectoryInternal, directory); }
java
public static void cleanDirectory(File directory) throws IOException { checkNotNull(directory, "directory"); guardIfWindows(FileUtils::cleanDirectoryInternal, directory); }
[ "public", "static", "void", "cleanDirectory", "(", "File", "directory", ")", "throws", "IOException", "{", "checkNotNull", "(", "directory", ",", "\"directory\"", ")", ";", "guardIfWindows", "(", "FileUtils", "::", "cleanDirectoryInternal", ",", "directory", ")", ...
Removes all files contained within a directory, without removing the directory itself. <p>This method is safe against other concurrent deletion attempts. @param directory The directory to remove all files from. @throws FileNotFoundException Thrown if the directory itself does not exist. @throws IOException Thrown if...
[ "Removes", "all", "files", "contained", "within", "a", "directory", "without", "removing", "the", "directory", "itself", "." ]
b62db93bf63cb3bb34dd03d611a779d9e3fc61ac
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-core/src/main/java/org/apache/flink/util/FileUtils.java#L279-L283
123,761
apache/flink
flink-core/src/main/java/org/apache/flink/util/FileUtils.java
FileUtils.copy
public static void copy(Path sourcePath, Path targetPath, boolean executable) throws IOException { // we unwrap the file system to get raw streams without safety net FileSystem sFS = FileSystem.getUnguardedFileSystem(sourcePath.toUri()); FileSystem tFS = FileSystem.getUnguardedFileSystem(targetPath.toUri()); if...
java
public static void copy(Path sourcePath, Path targetPath, boolean executable) throws IOException { // we unwrap the file system to get raw streams without safety net FileSystem sFS = FileSystem.getUnguardedFileSystem(sourcePath.toUri()); FileSystem tFS = FileSystem.getUnguardedFileSystem(targetPath.toUri()); if...
[ "public", "static", "void", "copy", "(", "Path", "sourcePath", ",", "Path", "targetPath", ",", "boolean", "executable", ")", "throws", "IOException", "{", "// we unwrap the file system to get raw streams without safety net", "FileSystem", "sFS", "=", "FileSystem", ".", ...
Copies all files from source to target and sets executable flag. Paths might be on different systems. @param sourcePath source path to copy from @param targetPath target path to copy to @param executable if target file should be executable @throws IOException if the copy fails
[ "Copies", "all", "files", "from", "source", "to", "target", "and", "sets", "executable", "flag", ".", "Paths", "might", "be", "on", "different", "systems", "." ]
b62db93bf63cb3bb34dd03d611a779d9e3fc61ac
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-core/src/main/java/org/apache/flink/util/FileUtils.java#L436-L447
123,762
apache/flink
flink-runtime/src/main/java/org/apache/flink/runtime/jobmaster/slotpool/AllocatedSlot.java
AllocatedSlot.releasePayload
public void releasePayload(Throwable cause) { final Payload payload = payloadReference.get(); if (payload != null) { payload.release(cause); payloadReference.set(null); } }
java
public void releasePayload(Throwable cause) { final Payload payload = payloadReference.get(); if (payload != null) { payload.release(cause); payloadReference.set(null); } }
[ "public", "void", "releasePayload", "(", "Throwable", "cause", ")", "{", "final", "Payload", "payload", "=", "payloadReference", ".", "get", "(", ")", ";", "if", "(", "payload", "!=", "null", ")", "{", "payload", ".", "release", "(", "cause", ")", ";", ...
Triggers the release of the assigned payload. If the payload could be released, then it is removed from the slot. @param cause of the release operation
[ "Triggers", "the", "release", "of", "the", "assigned", "payload", ".", "If", "the", "payload", "could", "be", "released", "then", "it", "is", "removed", "from", "the", "slot", "." ]
b62db93bf63cb3bb34dd03d611a779d9e3fc61ac
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/jobmaster/slotpool/AllocatedSlot.java#L145-L152
123,763
apache/flink
flink-mesos/src/main/java/org/apache/flink/mesos/Utils.java
Utils.variable
public static Protos.Environment.Variable variable(String name, String value) { checkNotNull(name); return Protos.Environment.Variable.newBuilder() .setName(name) .setValue(value) .build(); }
java
public static Protos.Environment.Variable variable(String name, String value) { checkNotNull(name); return Protos.Environment.Variable.newBuilder() .setName(name) .setValue(value) .build(); }
[ "public", "static", "Protos", ".", "Environment", ".", "Variable", "variable", "(", "String", "name", ",", "String", "value", ")", "{", "checkNotNull", "(", "name", ")", ";", "return", "Protos", ".", "Environment", ".", "Variable", ".", "newBuilder", "(", ...
Construct a Mesos environment variable.
[ "Construct", "a", "Mesos", "environment", "variable", "." ]
b62db93bf63cb3bb34dd03d611a779d9e3fc61ac
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-mesos/src/main/java/org/apache/flink/mesos/Utils.java#L50-L56
123,764
apache/flink
flink-mesos/src/main/java/org/apache/flink/mesos/Utils.java
Utils.resources
public static List<Protos.Resource> resources(Protos.Resource... resources) { checkNotNull(resources); return Arrays.asList(resources); }
java
public static List<Protos.Resource> resources(Protos.Resource... resources) { checkNotNull(resources); return Arrays.asList(resources); }
[ "public", "static", "List", "<", "Protos", ".", "Resource", ">", "resources", "(", "Protos", ".", "Resource", "...", "resources", ")", "{", "checkNotNull", "(", "resources", ")", ";", "return", "Arrays", ".", "asList", "(", "resources", ")", ";", "}" ]
Construct a list of resources.
[ "Construct", "a", "list", "of", "resources", "." ]
b62db93bf63cb3bb34dd03d611a779d9e3fc61ac
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-mesos/src/main/java/org/apache/flink/mesos/Utils.java#L93-L96
123,765
apache/flink
flink-mesos/src/main/java/org/apache/flink/mesos/Utils.java
Utils.scalar
public static Protos.Resource scalar(String name, String role, double value) { checkNotNull(name); checkNotNull(role); checkNotNull(value); return Protos.Resource.newBuilder() .setName(name) .setType(Protos.Value.Type.SCALAR) .setScalar(Protos.Value.Scalar.newBuilder().setValue(value)) .setRole(role...
java
public static Protos.Resource scalar(String name, String role, double value) { checkNotNull(name); checkNotNull(role); checkNotNull(value); return Protos.Resource.newBuilder() .setName(name) .setType(Protos.Value.Type.SCALAR) .setScalar(Protos.Value.Scalar.newBuilder().setValue(value)) .setRole(role...
[ "public", "static", "Protos", ".", "Resource", "scalar", "(", "String", "name", ",", "String", "role", ",", "double", "value", ")", "{", "checkNotNull", "(", "name", ")", ";", "checkNotNull", "(", "role", ")", ";", "checkNotNull", "(", "value", ")", ";",...
Construct a scalar resource.
[ "Construct", "a", "scalar", "resource", "." ]
b62db93bf63cb3bb34dd03d611a779d9e3fc61ac
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-mesos/src/main/java/org/apache/flink/mesos/Utils.java#L185-L195
123,766
apache/flink
flink-mesos/src/main/java/org/apache/flink/mesos/Utils.java
Utils.range
public static Protos.Value.Range range(long begin, long end) { return Protos.Value.Range.newBuilder().setBegin(begin).setEnd(end).build(); }
java
public static Protos.Value.Range range(long begin, long end) { return Protos.Value.Range.newBuilder().setBegin(begin).setEnd(end).build(); }
[ "public", "static", "Protos", ".", "Value", ".", "Range", "range", "(", "long", "begin", ",", "long", "end", ")", "{", "return", "Protos", ".", "Value", ".", "Range", ".", "newBuilder", "(", ")", ".", "setBegin", "(", "begin", ")", ".", "setEnd", "("...
Construct a range value.
[ "Construct", "a", "range", "value", "." ]
b62db93bf63cb3bb34dd03d611a779d9e3fc61ac
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-mesos/src/main/java/org/apache/flink/mesos/Utils.java#L200-L202
123,767
apache/flink
flink-mesos/src/main/java/org/apache/flink/mesos/Utils.java
Utils.ranges
public static Protos.Resource ranges(String name, String role, Protos.Value.Range... ranges) { checkNotNull(name); checkNotNull(role); checkNotNull(ranges); return Protos.Resource.newBuilder() .setName(name) .setType(Protos.Value.Type.RANGES) .setRanges(Protos.Value.Ranges.newBuilder().addAllRange(Arra...
java
public static Protos.Resource ranges(String name, String role, Protos.Value.Range... ranges) { checkNotNull(name); checkNotNull(role); checkNotNull(ranges); return Protos.Resource.newBuilder() .setName(name) .setType(Protos.Value.Type.RANGES) .setRanges(Protos.Value.Ranges.newBuilder().addAllRange(Arra...
[ "public", "static", "Protos", ".", "Resource", "ranges", "(", "String", "name", ",", "String", "role", ",", "Protos", ".", "Value", ".", "Range", "...", "ranges", ")", "{", "checkNotNull", "(", "name", ")", ";", "checkNotNull", "(", "role", ")", ";", "...
Construct a range resource.
[ "Construct", "a", "range", "resource", "." ]
b62db93bf63cb3bb34dd03d611a779d9e3fc61ac
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-mesos/src/main/java/org/apache/flink/mesos/Utils.java#L207-L217
123,768
apache/flink
flink-mesos/src/main/java/org/apache/flink/mesos/Utils.java
Utils.rangeValues
public static LongStream rangeValues(Collection<Protos.Resource> resources) { checkNotNull(resources); return resources.stream() .filter(Protos.Resource::hasRanges) .flatMap(r -> r.getRanges().getRangeList().stream()) .flatMapToLong(Utils::rangeValues); }
java
public static LongStream rangeValues(Collection<Protos.Resource> resources) { checkNotNull(resources); return resources.stream() .filter(Protos.Resource::hasRanges) .flatMap(r -> r.getRanges().getRangeList().stream()) .flatMapToLong(Utils::rangeValues); }
[ "public", "static", "LongStream", "rangeValues", "(", "Collection", "<", "Protos", ".", "Resource", ">", "resources", ")", "{", "checkNotNull", "(", "resources", ")", ";", "return", "resources", ".", "stream", "(", ")", ".", "filter", "(", "Protos", ".", "...
Gets a stream of values from a collection of range resources.
[ "Gets", "a", "stream", "of", "values", "from", "a", "collection", "of", "range", "resources", "." ]
b62db93bf63cb3bb34dd03d611a779d9e3fc61ac
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-mesos/src/main/java/org/apache/flink/mesos/Utils.java#L222-L228
123,769
apache/flink
flink-mesos/src/main/java/org/apache/flink/mesos/Utils.java
Utils.rangeValues
public static LongStream rangeValues(Protos.Value.Range range) { checkNotNull(range); return LongStream.rangeClosed(range.getBegin(), range.getEnd()); }
java
public static LongStream rangeValues(Protos.Value.Range range) { checkNotNull(range); return LongStream.rangeClosed(range.getBegin(), range.getEnd()); }
[ "public", "static", "LongStream", "rangeValues", "(", "Protos", ".", "Value", ".", "Range", "range", ")", "{", "checkNotNull", "(", "range", ")", ";", "return", "LongStream", ".", "rangeClosed", "(", "range", ".", "getBegin", "(", ")", ",", "range", ".", ...
Gets a stream of values from a range.
[ "Gets", "a", "stream", "of", "values", "from", "a", "range", "." ]
b62db93bf63cb3bb34dd03d611a779d9e3fc61ac
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-mesos/src/main/java/org/apache/flink/mesos/Utils.java#L233-L236
123,770
apache/flink
flink-table/flink-table-common/src/main/java/org/apache/flink/table/api/TableSchema.java
TableSchema.getFieldType
public Optional<TypeInformation<?>> getFieldType(int fieldIndex) { if (fieldIndex < 0 || fieldIndex >= fieldTypes.length) { return Optional.empty(); } return Optional.of(fieldTypes[fieldIndex]); }
java
public Optional<TypeInformation<?>> getFieldType(int fieldIndex) { if (fieldIndex < 0 || fieldIndex >= fieldTypes.length) { return Optional.empty(); } return Optional.of(fieldTypes[fieldIndex]); }
[ "public", "Optional", "<", "TypeInformation", "<", "?", ">", ">", "getFieldType", "(", "int", "fieldIndex", ")", "{", "if", "(", "fieldIndex", "<", "0", "||", "fieldIndex", ">=", "fieldTypes", ".", "length", ")", "{", "return", "Optional", ".", "empty", ...
Returns the specified type information for the given field index. @param fieldIndex the index of the field
[ "Returns", "the", "specified", "type", "information", "for", "the", "given", "field", "index", "." ]
b62db93bf63cb3bb34dd03d611a779d9e3fc61ac
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-table/flink-table-common/src/main/java/org/apache/flink/table/api/TableSchema.java#L109-L114
123,771
apache/flink
flink-table/flink-table-common/src/main/java/org/apache/flink/table/api/TableSchema.java
TableSchema.getFieldType
public Optional<TypeInformation<?>> getFieldType(String fieldName) { if (fieldNameToIndex.containsKey(fieldName)) { return Optional.of(fieldTypes[fieldNameToIndex.get(fieldName)]); } return Optional.empty(); }
java
public Optional<TypeInformation<?>> getFieldType(String fieldName) { if (fieldNameToIndex.containsKey(fieldName)) { return Optional.of(fieldTypes[fieldNameToIndex.get(fieldName)]); } return Optional.empty(); }
[ "public", "Optional", "<", "TypeInformation", "<", "?", ">", ">", "getFieldType", "(", "String", "fieldName", ")", "{", "if", "(", "fieldNameToIndex", ".", "containsKey", "(", "fieldName", ")", ")", "{", "return", "Optional", ".", "of", "(", "fieldTypes", ...
Returns the specified type information for the given field name. @param fieldName the name of the field
[ "Returns", "the", "specified", "type", "information", "for", "the", "given", "field", "name", "." ]
b62db93bf63cb3bb34dd03d611a779d9e3fc61ac
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-table/flink-table-common/src/main/java/org/apache/flink/table/api/TableSchema.java#L121-L126
123,772
apache/flink
flink-table/flink-table-common/src/main/java/org/apache/flink/table/api/TableSchema.java
TableSchema.getFieldName
public Optional<String> getFieldName(int fieldIndex) { if (fieldIndex < 0 || fieldIndex >= fieldNames.length) { return Optional.empty(); } return Optional.of(fieldNames[fieldIndex]); }
java
public Optional<String> getFieldName(int fieldIndex) { if (fieldIndex < 0 || fieldIndex >= fieldNames.length) { return Optional.empty(); } return Optional.of(fieldNames[fieldIndex]); }
[ "public", "Optional", "<", "String", ">", "getFieldName", "(", "int", "fieldIndex", ")", "{", "if", "(", "fieldIndex", "<", "0", "||", "fieldIndex", ">=", "fieldNames", ".", "length", ")", "{", "return", "Optional", ".", "empty", "(", ")", ";", "}", "r...
Returns the specified name for the given field index. @param fieldIndex the index of the field
[ "Returns", "the", "specified", "name", "for", "the", "given", "field", "index", "." ]
b62db93bf63cb3bb34dd03d611a779d9e3fc61ac
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-table/flink-table-common/src/main/java/org/apache/flink/table/api/TableSchema.java#L147-L152
123,773
apache/flink
flink-runtime/src/main/java/org/apache/flink/runtime/executiongraph/Execution.java
Execution.deploy
public void deploy() throws JobException { assertRunningInJobMasterMainThread(); final LogicalSlot slot = assignedResource; checkNotNull(slot, "In order to deploy the execution we first have to assign a resource via tryAssignResource."); // Check if the TaskManager died in the meantime // This only speeds...
java
public void deploy() throws JobException { assertRunningInJobMasterMainThread(); final LogicalSlot slot = assignedResource; checkNotNull(slot, "In order to deploy the execution we first have to assign a resource via tryAssignResource."); // Check if the TaskManager died in the meantime // This only speeds...
[ "public", "void", "deploy", "(", ")", "throws", "JobException", "{", "assertRunningInJobMasterMainThread", "(", ")", ";", "final", "LogicalSlot", "slot", "=", "assignedResource", ";", "checkNotNull", "(", "slot", ",", "\"In order to deploy the execution we first have to a...
Deploys the execution to the previously assigned resource. @throws JobException if the execution cannot be deployed to the assigned resource
[ "Deploys", "the", "execution", "to", "the", "previously", "assigned", "resource", "." ]
b62db93bf63cb3bb34dd03d611a779d9e3fc61ac
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/executiongraph/Execution.java#L574-L662
123,774
apache/flink
flink-runtime/src/main/java/org/apache/flink/runtime/executiongraph/Execution.java
Execution.requestStackTraceSample
public CompletableFuture<StackTraceSampleResponse> requestStackTraceSample( int sampleId, int numSamples, Time delayBetweenSamples, int maxStackTraceDepth, Time timeout) { final LogicalSlot slot = assignedResource; if (slot != null) { final TaskManagerGateway taskManagerGateway = slot.getTaskMan...
java
public CompletableFuture<StackTraceSampleResponse> requestStackTraceSample( int sampleId, int numSamples, Time delayBetweenSamples, int maxStackTraceDepth, Time timeout) { final LogicalSlot slot = assignedResource; if (slot != null) { final TaskManagerGateway taskManagerGateway = slot.getTaskMan...
[ "public", "CompletableFuture", "<", "StackTraceSampleResponse", ">", "requestStackTraceSample", "(", "int", "sampleId", ",", "int", "numSamples", ",", "Time", "delayBetweenSamples", ",", "int", "maxStackTraceDepth", ",", "Time", "timeout", ")", "{", "final", "LogicalS...
Request a stack trace sample from the task of this execution. @param sampleId of the stack trace sample @param numSamples the sample should contain @param delayBetweenSamples to wait @param maxStackTraceDepth of the samples @param timeout until the request times out @return Future stack trace sample response
[ "Request", "a", "stack", "trace", "sample", "from", "the", "task", "of", "this", "execution", "." ]
b62db93bf63cb3bb34dd03d611a779d9e3fc61ac
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/executiongraph/Execution.java#L818-L840
123,775
apache/flink
flink-runtime/src/main/java/org/apache/flink/runtime/executiongraph/Execution.java
Execution.notifyCheckpointComplete
public void notifyCheckpointComplete(long checkpointId, long timestamp) { final LogicalSlot slot = assignedResource; if (slot != null) { final TaskManagerGateway taskManagerGateway = slot.getTaskManagerGateway(); taskManagerGateway.notifyCheckpointComplete(attemptId, getVertex().getJobId(), checkpointId, ti...
java
public void notifyCheckpointComplete(long checkpointId, long timestamp) { final LogicalSlot slot = assignedResource; if (slot != null) { final TaskManagerGateway taskManagerGateway = slot.getTaskManagerGateway(); taskManagerGateway.notifyCheckpointComplete(attemptId, getVertex().getJobId(), checkpointId, ti...
[ "public", "void", "notifyCheckpointComplete", "(", "long", "checkpointId", ",", "long", "timestamp", ")", "{", "final", "LogicalSlot", "slot", "=", "assignedResource", ";", "if", "(", "slot", "!=", "null", ")", "{", "final", "TaskManagerGateway", "taskManagerGatew...
Notify the task of this execution about a completed checkpoint. @param checkpointId of the completed checkpoint @param timestamp of the completed checkpoint
[ "Notify", "the", "task", "of", "this", "execution", "about", "a", "completed", "checkpoint", "." ]
b62db93bf63cb3bb34dd03d611a779d9e3fc61ac
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/executiongraph/Execution.java#L848-L859
123,776
apache/flink
flink-runtime/src/main/java/org/apache/flink/runtime/executiongraph/Execution.java
Execution.sendCancelRpcCall
private void sendCancelRpcCall(int numberRetries) { final LogicalSlot slot = assignedResource; if (slot != null) { final TaskManagerGateway taskManagerGateway = slot.getTaskManagerGateway(); final ComponentMainThreadExecutor jobMasterMainThreadExecutor = getVertex().getExecutionGraph().getJobMasterMainTh...
java
private void sendCancelRpcCall(int numberRetries) { final LogicalSlot slot = assignedResource; if (slot != null) { final TaskManagerGateway taskManagerGateway = slot.getTaskManagerGateway(); final ComponentMainThreadExecutor jobMasterMainThreadExecutor = getVertex().getExecutionGraph().getJobMasterMainTh...
[ "private", "void", "sendCancelRpcCall", "(", "int", "numberRetries", ")", "{", "final", "LogicalSlot", "slot", "=", "assignedResource", ";", "if", "(", "slot", "!=", "null", ")", "{", "final", "TaskManagerGateway", "taskManagerGateway", "=", "slot", ".", "getTas...
This method sends a CancelTask message to the instance of the assigned slot. <p>The sending is tried up to NUM_CANCEL_CALL_TRIES times.
[ "This", "method", "sends", "a", "CancelTask", "message", "to", "the", "instance", "of", "the", "assigned", "slot", "." ]
b62db93bf63cb3bb34dd03d611a779d9e3fc61ac
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/executiongraph/Execution.java#L1184-L1204
123,777
apache/flink
flink-runtime/src/main/java/org/apache/flink/runtime/executiongraph/Execution.java
Execution.sendUpdatePartitionInfoRpcCall
private void sendUpdatePartitionInfoRpcCall( final Iterable<PartitionInfo> partitionInfos) { final LogicalSlot slot = assignedResource; if (slot != null) { final TaskManagerGateway taskManagerGateway = slot.getTaskManagerGateway(); final TaskManagerLocation taskManagerLocation = slot.getTaskManagerLocati...
java
private void sendUpdatePartitionInfoRpcCall( final Iterable<PartitionInfo> partitionInfos) { final LogicalSlot slot = assignedResource; if (slot != null) { final TaskManagerGateway taskManagerGateway = slot.getTaskManagerGateway(); final TaskManagerLocation taskManagerLocation = slot.getTaskManagerLocati...
[ "private", "void", "sendUpdatePartitionInfoRpcCall", "(", "final", "Iterable", "<", "PartitionInfo", ">", "partitionInfos", ")", "{", "final", "LogicalSlot", "slot", "=", "assignedResource", ";", "if", "(", "slot", "!=", "null", ")", "{", "final", "TaskManagerGate...
Update the partition infos on the assigned resource. @param partitionInfos for the remote task
[ "Update", "the", "partition", "infos", "on", "the", "assigned", "resource", "." ]
b62db93bf63cb3bb34dd03d611a779d9e3fc61ac
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/executiongraph/Execution.java#L1231-L1251
123,778
apache/flink
flink-runtime/src/main/java/org/apache/flink/runtime/executiongraph/Execution.java
Execution.calculatePreferredLocations
@VisibleForTesting public CompletableFuture<Collection<TaskManagerLocation>> calculatePreferredLocations(LocationPreferenceConstraint locationPreferenceConstraint) { final Collection<CompletableFuture<TaskManagerLocation>> preferredLocationFutures = getVertex().getPreferredLocations(); final CompletableFuture<Coll...
java
@VisibleForTesting public CompletableFuture<Collection<TaskManagerLocation>> calculatePreferredLocations(LocationPreferenceConstraint locationPreferenceConstraint) { final Collection<CompletableFuture<TaskManagerLocation>> preferredLocationFutures = getVertex().getPreferredLocations(); final CompletableFuture<Coll...
[ "@", "VisibleForTesting", "public", "CompletableFuture", "<", "Collection", "<", "TaskManagerLocation", ">", ">", "calculatePreferredLocations", "(", "LocationPreferenceConstraint", "locationPreferenceConstraint", ")", "{", "final", "Collection", "<", "CompletableFuture", "<"...
Calculates the preferred locations based on the location preference constraint. @param locationPreferenceConstraint constraint for the location preference @return Future containing the collection of preferred locations. This might not be completed if not all inputs have been a resource assigned.
[ "Calculates", "the", "preferred", "locations", "based", "on", "the", "location", "preference", "constraint", "." ]
b62db93bf63cb3bb34dd03d611a779d9e3fc61ac
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/executiongraph/Execution.java#L1295-L1326
123,779
apache/flink
flink-core/src/main/java/org/apache/flink/core/io/SimpleVersionedSerialization.java
SimpleVersionedSerialization.writeVersionAndSerialize
public static <T> void writeVersionAndSerialize(SimpleVersionedSerializer<T> serializer, T datum, DataOutputView out) throws IOException { checkNotNull(serializer, "serializer"); checkNotNull(datum, "datum"); checkNotNull(out, "out"); final byte[] data = serializer.serialize(datum); out.writeInt(serializer....
java
public static <T> void writeVersionAndSerialize(SimpleVersionedSerializer<T> serializer, T datum, DataOutputView out) throws IOException { checkNotNull(serializer, "serializer"); checkNotNull(datum, "datum"); checkNotNull(out, "out"); final byte[] data = serializer.serialize(datum); out.writeInt(serializer....
[ "public", "static", "<", "T", ">", "void", "writeVersionAndSerialize", "(", "SimpleVersionedSerializer", "<", "T", ">", "serializer", ",", "T", "datum", ",", "DataOutputView", "out", ")", "throws", "IOException", "{", "checkNotNull", "(", "serializer", ",", "\"s...
Serializes the version and datum into a stream. <p>Data serialized via this method can be deserialized via {@link #readVersionAndDeSerialize(SimpleVersionedSerializer, DataInputView)}. <p>The first four bytes will be occupied by the version, as returned by {@link SimpleVersionedSerializer#getVersion()}. The remaining...
[ "Serializes", "the", "version", "and", "datum", "into", "a", "stream", "." ]
b62db93bf63cb3bb34dd03d611a779d9e3fc61ac
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-core/src/main/java/org/apache/flink/core/io/SimpleVersionedSerialization.java#L52-L62
123,780
apache/flink
flink-core/src/main/java/org/apache/flink/core/io/SimpleVersionedSerialization.java
SimpleVersionedSerialization.readVersionAndDeSerialize
public static <T> T readVersionAndDeSerialize(SimpleVersionedSerializer<T> serializer, DataInputView in) throws IOException { checkNotNull(serializer, "serializer"); checkNotNull(in, "in"); final int version = in.readInt(); final int length = in.readInt(); final byte[] data = new byte[length]; in.readFully...
java
public static <T> T readVersionAndDeSerialize(SimpleVersionedSerializer<T> serializer, DataInputView in) throws IOException { checkNotNull(serializer, "serializer"); checkNotNull(in, "in"); final int version = in.readInt(); final int length = in.readInt(); final byte[] data = new byte[length]; in.readFully...
[ "public", "static", "<", "T", ">", "T", "readVersionAndDeSerialize", "(", "SimpleVersionedSerializer", "<", "T", ">", "serializer", ",", "DataInputView", "in", ")", "throws", "IOException", "{", "checkNotNull", "(", "serializer", ",", "\"serializer\"", ")", ";", ...
Deserializes the version and datum from a stream. <p>This method deserializes data serialized via {@link #writeVersionAndSerialize(SimpleVersionedSerializer, Object, DataOutputView)}. <p>The first four bytes will be interpreted as the version. The next four bytes will be interpreted as the length of the datum bytes, ...
[ "Deserializes", "the", "version", "and", "datum", "from", "a", "stream", "." ]
b62db93bf63cb3bb34dd03d611a779d9e3fc61ac
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-core/src/main/java/org/apache/flink/core/io/SimpleVersionedSerialization.java#L78-L88
123,781
apache/flink
flink-runtime/src/main/java/org/apache/flink/runtime/state/SnapshotDirectory.java
SnapshotDirectory.cleanup
public boolean cleanup() throws IOException { return !state.compareAndSet(State.ONGOING, State.DELETED) || fileSystem.delete(directory, true); }
java
public boolean cleanup() throws IOException { return !state.compareAndSet(State.ONGOING, State.DELETED) || fileSystem.delete(directory, true); }
[ "public", "boolean", "cleanup", "(", ")", "throws", "IOException", "{", "return", "!", "state", ".", "compareAndSet", "(", "State", ".", "ONGOING", ",", "State", ".", "DELETED", ")", "||", "fileSystem", ".", "delete", "(", "directory", ",", "true", ")", ...
Calling this method will attempt delete the underlying snapshot directory recursively, if the state is "ongoing". In this case, the state will be set to "deleted" as a result of this call. @return <code>true</code> if delete is successful, <code>false</code> otherwise. @throws IOException if an exception happens durin...
[ "Calling", "this", "method", "will", "attempt", "delete", "the", "underlying", "snapshot", "directory", "recursively", "if", "the", "state", "is", "ongoing", ".", "In", "this", "case", "the", "state", "will", "be", "set", "to", "deleted", "as", "a", "result"...
b62db93bf63cb3bb34dd03d611a779d9e3fc61ac
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/state/SnapshotDirectory.java#L105-L107
123,782
apache/flink
flink-streaming-java/src/main/java/org/apache/flink/streaming/api/functions/sink/filesystem/Buckets.java
Buckets.initializeState
void initializeState(final ListState<byte[]> bucketStates, final ListState<Long> partCounterState) throws Exception { initializePartCounter(partCounterState); LOG.info("Subtask {} initializing its state (max part counter={}).", subtaskIndex, maxPartCounter); initializeActiveBuckets(bucketStates); }
java
void initializeState(final ListState<byte[]> bucketStates, final ListState<Long> partCounterState) throws Exception { initializePartCounter(partCounterState); LOG.info("Subtask {} initializing its state (max part counter={}).", subtaskIndex, maxPartCounter); initializeActiveBuckets(bucketStates); }
[ "void", "initializeState", "(", "final", "ListState", "<", "byte", "[", "]", ">", "bucketStates", ",", "final", "ListState", "<", "Long", ">", "partCounterState", ")", "throws", "Exception", "{", "initializePartCounter", "(", "partCounterState", ")", ";", "LOG",...
Initializes the state after recovery from a failure. <p>During this process: <ol> <li>we set the initial value for part counter to the maximum value used before across all tasks and buckets. This guarantees that we do not overwrite valid data,</li> <li>we commit any pending files for previous checkpoints (previous to ...
[ "Initializes", "the", "state", "after", "recovery", "from", "a", "failure", "." ]
b62db93bf63cb3bb34dd03d611a779d9e3fc61ac
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-streaming-java/src/main/java/org/apache/flink/streaming/api/functions/sink/filesystem/Buckets.java#L143-L150
123,783
apache/flink
flink-connectors/flink-connector-filesystem/src/main/java/org/apache/flink/streaming/connectors/fs/RollingSink.java
RollingSink.shouldRoll
private boolean shouldRoll() throws IOException { boolean shouldRoll = false; int subtaskIndex = getRuntimeContext().getIndexOfThisSubtask(); if (!isWriterOpen) { shouldRoll = true; LOG.debug("RollingSink {} starting new initial bucket. ", subtaskIndex); } if (bucketer.shouldStartNewBucket(new Path(base...
java
private boolean shouldRoll() throws IOException { boolean shouldRoll = false; int subtaskIndex = getRuntimeContext().getIndexOfThisSubtask(); if (!isWriterOpen) { shouldRoll = true; LOG.debug("RollingSink {} starting new initial bucket. ", subtaskIndex); } if (bucketer.shouldStartNewBucket(new Path(base...
[ "private", "boolean", "shouldRoll", "(", ")", "throws", "IOException", "{", "boolean", "shouldRoll", "=", "false", ";", "int", "subtaskIndex", "=", "getRuntimeContext", "(", ")", ".", "getIndexOfThisSubtask", "(", ")", ";", "if", "(", "!", "isWriterOpen", ")",...
Determines whether we should change the bucket file we are writing to. <p>This will roll if no file was created yet, if the file size is larger than the specified size or if the {@code Bucketer} determines that we should roll.
[ "Determines", "whether", "we", "should", "change", "the", "bucket", "file", "we", "are", "writing", "to", "." ]
b62db93bf63cb3bb34dd03d611a779d9e3fc61ac
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-connectors/flink-connector-filesystem/src/main/java/org/apache/flink/streaming/connectors/fs/RollingSink.java#L413-L438
123,784
apache/flink
flink-connectors/flink-connector-filesystem/src/main/java/org/apache/flink/streaming/connectors/fs/RollingSink.java
RollingSink.openNewPartFile
private void openNewPartFile() throws Exception { closeCurrentPartFile(); Path newBucketDirectory = bucketer.getNextBucketPath(new Path(basePath)); if (!newBucketDirectory.equals(currentBucketDirectory)) { currentBucketDirectory = newBucketDirectory; try { if (fs.mkdirs(currentBucketDirectory)) { ...
java
private void openNewPartFile() throws Exception { closeCurrentPartFile(); Path newBucketDirectory = bucketer.getNextBucketPath(new Path(basePath)); if (!newBucketDirectory.equals(currentBucketDirectory)) { currentBucketDirectory = newBucketDirectory; try { if (fs.mkdirs(currentBucketDirectory)) { ...
[ "private", "void", "openNewPartFile", "(", ")", "throws", "Exception", "{", "closeCurrentPartFile", "(", ")", ";", "Path", "newBucketDirectory", "=", "bucketer", ".", "getNextBucketPath", "(", "new", "Path", "(", "basePath", ")", ")", ";", "if", "(", "!", "n...
Opens a new part file. <p>This closes the old bucket file and retrieves a new bucket path from the {@code Bucketer}.
[ "Opens", "a", "new", "part", "file", "." ]
b62db93bf63cb3bb34dd03d611a779d9e3fc61ac
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-connectors/flink-connector-filesystem/src/main/java/org/apache/flink/streaming/connectors/fs/RollingSink.java#L446-L482
123,785
apache/flink
flink-connectors/flink-connector-filesystem/src/main/java/org/apache/flink/streaming/connectors/fs/RollingSink.java
RollingSink.closeCurrentPartFile
private void closeCurrentPartFile() throws Exception { if (isWriterOpen) { writer.close(); isWriterOpen = false; } if (currentPartPath != null) { Path inProgressPath = getInProgressPathFor(currentPartPath); Path pendingPath = getPendingPathFor(currentPartPath); fs.rename(inProgressPath, pendingPat...
java
private void closeCurrentPartFile() throws Exception { if (isWriterOpen) { writer.close(); isWriterOpen = false; } if (currentPartPath != null) { Path inProgressPath = getInProgressPathFor(currentPartPath); Path pendingPath = getPendingPathFor(currentPartPath); fs.rename(inProgressPath, pendingPat...
[ "private", "void", "closeCurrentPartFile", "(", ")", "throws", "Exception", "{", "if", "(", "isWriterOpen", ")", "{", "writer", ".", "close", "(", ")", ";", "isWriterOpen", "=", "false", ";", "}", "if", "(", "currentPartPath", "!=", "null", ")", "{", "Pa...
Closes the current part file. <p>This moves the current in-progress part file to a pending file and adds it to the list of pending files in our bucket state.
[ "Closes", "the", "current", "part", "file", "." ]
b62db93bf63cb3bb34dd03d611a779d9e3fc61ac
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-connectors/flink-connector-filesystem/src/main/java/org/apache/flink/streaming/connectors/fs/RollingSink.java#L503-L516
123,786
apache/flink
flink-libraries/flink-gelly/src/main/java/org/apache/flink/graph/generator/GridGraph.java
GridGraph.addDimension
public GridGraph addDimension(long size, boolean wrapEndpoints) { Preconditions.checkArgument(size >= 2, "Dimension size must be at least 2"); vertexCount = Math.multiplyExact(vertexCount, size); // prevent duplicate edges if (size == 2) { wrapEndpoints = false; } dimensions.add(new Tuple2<>(size, wra...
java
public GridGraph addDimension(long size, boolean wrapEndpoints) { Preconditions.checkArgument(size >= 2, "Dimension size must be at least 2"); vertexCount = Math.multiplyExact(vertexCount, size); // prevent duplicate edges if (size == 2) { wrapEndpoints = false; } dimensions.add(new Tuple2<>(size, wra...
[ "public", "GridGraph", "addDimension", "(", "long", "size", ",", "boolean", "wrapEndpoints", ")", "{", "Preconditions", ".", "checkArgument", "(", "size", ">=", "2", ",", "\"Dimension size must be at least 2\"", ")", ";", "vertexCount", "=", "Math", ".", "multiply...
Required configuration for each dimension of the graph. @param size number of vertices; dimensions of size 1 are prohibited due to having no effect on the generated graph @param wrapEndpoints whether to connect first and last vertices; this has no effect on dimensions of size 2 @return this
[ "Required", "configuration", "for", "each", "dimension", "of", "the", "graph", "." ]
b62db93bf63cb3bb34dd03d611a779d9e3fc61ac
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-libraries/flink-gelly/src/main/java/org/apache/flink/graph/generator/GridGraph.java#L71-L84
123,787
apache/flink
flink-core/src/main/java/org/apache/flink/api/common/typeutils/NestedSerializersSnapshotDelegate.java
NestedSerializersSnapshotDelegate.getRestoredNestedSerializer
public <T> TypeSerializer<T> getRestoredNestedSerializer(int pos) { checkArgument(pos < nestedSnapshots.length); @SuppressWarnings("unchecked") TypeSerializerSnapshot<T> snapshot = (TypeSerializerSnapshot<T>) nestedSnapshots[pos]; return snapshot.restoreSerializer(); }
java
public <T> TypeSerializer<T> getRestoredNestedSerializer(int pos) { checkArgument(pos < nestedSnapshots.length); @SuppressWarnings("unchecked") TypeSerializerSnapshot<T> snapshot = (TypeSerializerSnapshot<T>) nestedSnapshots[pos]; return snapshot.restoreSerializer(); }
[ "public", "<", "T", ">", "TypeSerializer", "<", "T", ">", "getRestoredNestedSerializer", "(", "int", "pos", ")", "{", "checkArgument", "(", "pos", "<", "nestedSnapshots", ".", "length", ")", ";", "@", "SuppressWarnings", "(", "\"unchecked\"", ")", "TypeSeriali...
Creates the restore serializer from the pos-th config snapshot.
[ "Creates", "the", "restore", "serializer", "from", "the", "pos", "-", "th", "config", "snapshot", "." ]
b62db93bf63cb3bb34dd03d611a779d9e3fc61ac
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-core/src/main/java/org/apache/flink/api/common/typeutils/NestedSerializersSnapshotDelegate.java#L89-L96
123,788
apache/flink
flink-core/src/main/java/org/apache/flink/api/common/typeutils/NestedSerializersSnapshotDelegate.java
NestedSerializersSnapshotDelegate.resolveCompatibilityWithNested
@Deprecated public <T> TypeSerializerSchemaCompatibility<T> resolveCompatibilityWithNested( TypeSerializerSchemaCompatibility<?> outerCompatibility, TypeSerializer<?>... newNestedSerializers) { checkArgument(newNestedSerializers.length == nestedSnapshots.length, "Different number of new serializers and ex...
java
@Deprecated public <T> TypeSerializerSchemaCompatibility<T> resolveCompatibilityWithNested( TypeSerializerSchemaCompatibility<?> outerCompatibility, TypeSerializer<?>... newNestedSerializers) { checkArgument(newNestedSerializers.length == nestedSnapshots.length, "Different number of new serializers and ex...
[ "@", "Deprecated", "public", "<", "T", ">", "TypeSerializerSchemaCompatibility", "<", "T", ">", "resolveCompatibilityWithNested", "(", "TypeSerializerSchemaCompatibility", "<", "?", ">", "outerCompatibility", ",", "TypeSerializer", "<", "?", ">", "...", "newNestedSerial...
Resolves the compatibility of the nested serializer snapshots with the nested serializers of the new outer serializer. @deprecated this no method will be removed in the future. Resolving compatibility for nested serializers is now handled by {@link CompositeTypeSerializerSnapshot}.
[ "Resolves", "the", "compatibility", "of", "the", "nested", "serializer", "snapshots", "with", "the", "nested", "serializers", "of", "the", "new", "outer", "serializer", "." ]
b62db93bf63cb3bb34dd03d611a779d9e3fc61ac
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-core/src/main/java/org/apache/flink/api/common/typeutils/NestedSerializersSnapshotDelegate.java#L114-L144
123,789
apache/flink
flink-core/src/main/java/org/apache/flink/api/common/typeutils/NestedSerializersSnapshotDelegate.java
NestedSerializersSnapshotDelegate.writeNestedSerializerSnapshots
public final void writeNestedSerializerSnapshots(DataOutputView out) throws IOException { out.writeInt(MAGIC_NUMBER); out.writeInt(VERSION); out.writeInt(nestedSnapshots.length); for (TypeSerializerSnapshot<?> snap : nestedSnapshots) { TypeSerializerSnapshot.writeVersionedSnapshot(out, snap); } }
java
public final void writeNestedSerializerSnapshots(DataOutputView out) throws IOException { out.writeInt(MAGIC_NUMBER); out.writeInt(VERSION); out.writeInt(nestedSnapshots.length); for (TypeSerializerSnapshot<?> snap : nestedSnapshots) { TypeSerializerSnapshot.writeVersionedSnapshot(out, snap); } }
[ "public", "final", "void", "writeNestedSerializerSnapshots", "(", "DataOutputView", "out", ")", "throws", "IOException", "{", "out", ".", "writeInt", "(", "MAGIC_NUMBER", ")", ";", "out", ".", "writeInt", "(", "VERSION", ")", ";", "out", ".", "writeInt", "(", ...
Writes the composite snapshot of all the contained serializers.
[ "Writes", "the", "composite", "snapshot", "of", "all", "the", "contained", "serializers", "." ]
b62db93bf63cb3bb34dd03d611a779d9e3fc61ac
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-core/src/main/java/org/apache/flink/api/common/typeutils/NestedSerializersSnapshotDelegate.java#L153-L161
123,790
apache/flink
flink-core/src/main/java/org/apache/flink/api/common/typeutils/NestedSerializersSnapshotDelegate.java
NestedSerializersSnapshotDelegate.readNestedSerializerSnapshots
public static NestedSerializersSnapshotDelegate readNestedSerializerSnapshots(DataInputView in, ClassLoader cl) throws IOException { final int magicNumber = in.readInt(); if (magicNumber != MAGIC_NUMBER) { throw new IOException(String.format("Corrupt data, magic number mismatch. Expected %8x, found %8x", MA...
java
public static NestedSerializersSnapshotDelegate readNestedSerializerSnapshots(DataInputView in, ClassLoader cl) throws IOException { final int magicNumber = in.readInt(); if (magicNumber != MAGIC_NUMBER) { throw new IOException(String.format("Corrupt data, magic number mismatch. Expected %8x, found %8x", MA...
[ "public", "static", "NestedSerializersSnapshotDelegate", "readNestedSerializerSnapshots", "(", "DataInputView", "in", ",", "ClassLoader", "cl", ")", "throws", "IOException", "{", "final", "int", "magicNumber", "=", "in", ".", "readInt", "(", ")", ";", "if", "(", "...
Reads the composite snapshot of all the contained serializers.
[ "Reads", "the", "composite", "snapshot", "of", "all", "the", "contained", "serializers", "." ]
b62db93bf63cb3bb34dd03d611a779d9e3fc61ac
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-core/src/main/java/org/apache/flink/api/common/typeutils/NestedSerializersSnapshotDelegate.java#L166-L186
123,791
apache/flink
flink-core/src/main/java/org/apache/flink/api/common/typeutils/NestedSerializersSnapshotDelegate.java
NestedSerializersSnapshotDelegate.resolveCompatibility
@SuppressWarnings("unchecked") private static <E> TypeSerializerSchemaCompatibility<E> resolveCompatibility( TypeSerializer<?> serializer, TypeSerializerSnapshot<?> snapshot) { TypeSerializer<E> typedSerializer = (TypeSerializer<E>) serializer; TypeSerializerSnapshot<E> typedSnapshot = (TypeSerializerSnapsh...
java
@SuppressWarnings("unchecked") private static <E> TypeSerializerSchemaCompatibility<E> resolveCompatibility( TypeSerializer<?> serializer, TypeSerializerSnapshot<?> snapshot) { TypeSerializer<E> typedSerializer = (TypeSerializer<E>) serializer; TypeSerializerSnapshot<E> typedSnapshot = (TypeSerializerSnapsh...
[ "@", "SuppressWarnings", "(", "\"unchecked\"", ")", "private", "static", "<", "E", ">", "TypeSerializerSchemaCompatibility", "<", "E", ">", "resolveCompatibility", "(", "TypeSerializer", "<", "?", ">", "serializer", ",", "TypeSerializerSnapshot", "<", "?", ">", "s...
Utility method to conjure up a new scope for the generic parameters.
[ "Utility", "method", "to", "conjure", "up", "a", "new", "scope", "for", "the", "generic", "parameters", "." ]
b62db93bf63cb3bb34dd03d611a779d9e3fc61ac
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-core/src/main/java/org/apache/flink/api/common/typeutils/NestedSerializersSnapshotDelegate.java#L211-L220
123,792
apache/flink
flink-connectors/flink-connector-twitter/src/main/java/org/apache/flink/streaming/connectors/twitter/TwitterSource.java
TwitterSource.setCustomEndpointInitializer
public void setCustomEndpointInitializer(EndpointInitializer initializer) { Objects.requireNonNull(initializer, "Initializer has to be set"); ClosureCleaner.ensureSerializable(initializer); this.initializer = initializer; }
java
public void setCustomEndpointInitializer(EndpointInitializer initializer) { Objects.requireNonNull(initializer, "Initializer has to be set"); ClosureCleaner.ensureSerializable(initializer); this.initializer = initializer; }
[ "public", "void", "setCustomEndpointInitializer", "(", "EndpointInitializer", "initializer", ")", "{", "Objects", ".", "requireNonNull", "(", "initializer", ",", "\"Initializer has to be set\"", ")", ";", "ClosureCleaner", ".", "ensureSerializable", "(", "initializer", ")...
Set a custom endpoint initializer.
[ "Set", "a", "custom", "endpoint", "initializer", "." ]
b62db93bf63cb3bb34dd03d611a779d9e3fc61ac
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-connectors/flink-connector-twitter/src/main/java/org/apache/flink/streaming/connectors/twitter/TwitterSource.java#L106-L110
123,793
apache/flink
flink-core/src/main/java/org/apache/flink/core/fs/LimitedConnectionsFileSystem.java
LimitedConnectionsFileSystem.unregisterOutputStream
void unregisterOutputStream(OutStream stream) { lock.lock(); try { // only decrement if we actually remove the stream if (openOutputStreams.remove(stream)) { numReservedOutputStreams--; available.signalAll(); } } finally { lock.unlock(); } }
java
void unregisterOutputStream(OutStream stream) { lock.lock(); try { // only decrement if we actually remove the stream if (openOutputStreams.remove(stream)) { numReservedOutputStreams--; available.signalAll(); } } finally { lock.unlock(); } }
[ "void", "unregisterOutputStream", "(", "OutStream", "stream", ")", "{", "lock", ".", "lock", "(", ")", ";", "try", "{", "// only decrement if we actually remove the stream", "if", "(", "openOutputStreams", ".", "remove", "(", "stream", ")", ")", "{", "numReservedO...
Atomically removes the given output stream from the set of currently open output streams, and signals that new stream can now be opened.
[ "Atomically", "removes", "the", "given", "output", "stream", "from", "the", "set", "of", "currently", "open", "output", "streams", "and", "signals", "that", "new", "stream", "can", "now", "be", "opened", "." ]
b62db93bf63cb3bb34dd03d611a779d9e3fc61ac
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-core/src/main/java/org/apache/flink/core/fs/LimitedConnectionsFileSystem.java#L565-L577
123,794
apache/flink
flink-core/src/main/java/org/apache/flink/core/fs/LimitedConnectionsFileSystem.java
LimitedConnectionsFileSystem.unregisterInputStream
void unregisterInputStream(InStream stream) { lock.lock(); try { // only decrement if we actually remove the stream if (openInputStreams.remove(stream)) { numReservedInputStreams--; available.signalAll(); } } finally { lock.unlock(); } }
java
void unregisterInputStream(InStream stream) { lock.lock(); try { // only decrement if we actually remove the stream if (openInputStreams.remove(stream)) { numReservedInputStreams--; available.signalAll(); } } finally { lock.unlock(); } }
[ "void", "unregisterInputStream", "(", "InStream", "stream", ")", "{", "lock", ".", "lock", "(", ")", ";", "try", "{", "// only decrement if we actually remove the stream", "if", "(", "openInputStreams", ".", "remove", "(", "stream", ")", ")", "{", "numReservedInpu...
Atomically removes the given input stream from the set of currently open input streams, and signals that new stream can now be opened.
[ "Atomically", "removes", "the", "given", "input", "stream", "from", "the", "set", "of", "currently", "open", "input", "streams", "and", "signals", "that", "new", "stream", "can", "now", "be", "opened", "." ]
b62db93bf63cb3bb34dd03d611a779d9e3fc61ac
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-core/src/main/java/org/apache/flink/core/fs/LimitedConnectionsFileSystem.java#L583-L595
123,795
apache/flink
flink-streaming-java/src/main/java/org/apache/flink/streaming/api/transformations/StreamTransformation.java
StreamTransformation.setMaxParallelism
public void setMaxParallelism(int maxParallelism) { Preconditions.checkArgument(maxParallelism > 0 && maxParallelism <= StreamGraphGenerator.UPPER_BOUND_MAX_PARALLELISM, "Maximum parallelism must be between 1 and " + StreamGraphGenerator.UPPER_BOUND_MAX_PARALLELISM + ". Found: " + maxParallelism); t...
java
public void setMaxParallelism(int maxParallelism) { Preconditions.checkArgument(maxParallelism > 0 && maxParallelism <= StreamGraphGenerator.UPPER_BOUND_MAX_PARALLELISM, "Maximum parallelism must be between 1 and " + StreamGraphGenerator.UPPER_BOUND_MAX_PARALLELISM + ". Found: " + maxParallelism); t...
[ "public", "void", "setMaxParallelism", "(", "int", "maxParallelism", ")", "{", "Preconditions", ".", "checkArgument", "(", "maxParallelism", ">", "0", "&&", "maxParallelism", "<=", "StreamGraphGenerator", ".", "UPPER_BOUND_MAX_PARALLELISM", ",", "\"Maximum parallelism mus...
Sets the maximum parallelism for this stream transformation. @param maxParallelism Maximum parallelism for this stream transformation.
[ "Sets", "the", "maximum", "parallelism", "for", "this", "stream", "transformation", "." ]
b62db93bf63cb3bb34dd03d611a779d9e3fc61ac
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-streaming-java/src/main/java/org/apache/flink/streaming/api/transformations/StreamTransformation.java#L228-L234
123,796
apache/flink
flink-runtime/src/main/java/org/apache/flink/runtime/util/ClassLoaderUtil.java
ClassLoaderUtil.getUserCodeClassLoaderInfo
public static String getUserCodeClassLoaderInfo(ClassLoader loader) { if (loader instanceof URLClassLoader) { URLClassLoader cl = (URLClassLoader) loader; try { StringBuilder bld = new StringBuilder(); if (cl == ClassLoader.getSystemClassLoader()) { bld.append("System ClassLoader: "); ...
java
public static String getUserCodeClassLoaderInfo(ClassLoader loader) { if (loader instanceof URLClassLoader) { URLClassLoader cl = (URLClassLoader) loader; try { StringBuilder bld = new StringBuilder(); if (cl == ClassLoader.getSystemClassLoader()) { bld.append("System ClassLoader: "); ...
[ "public", "static", "String", "getUserCodeClassLoaderInfo", "(", "ClassLoader", "loader", ")", "{", "if", "(", "loader", "instanceof", "URLClassLoader", ")", "{", "URLClassLoader", "cl", "=", "(", "URLClassLoader", ")", "loader", ";", "try", "{", "StringBuilder", ...
Gets information about URL class loaders. The returned info string contains all URLs of the class loader. For file URLs, it contains in addition whether the referenced file exists, is a valid JAR file, or is a directory. <p>NOTE: This method makes a best effort to provide information about the classloader, and never t...
[ "Gets", "information", "about", "URL", "class", "loaders", ".", "The", "returned", "info", "string", "contains", "all", "URLs", "of", "the", "class", "loader", ".", "For", "file", "URLs", "it", "contains", "in", "addition", "whether", "the", "referenced", "f...
b62db93bf63cb3bb34dd03d611a779d9e3fc61ac
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/util/ClassLoaderUtil.java#L45-L109
123,797
apache/flink
flink-runtime/src/main/java/org/apache/flink/runtime/util/ClassLoaderUtil.java
ClassLoaderUtil.validateClassLoadable
public static boolean validateClassLoadable(ClassNotFoundException cnfe, ClassLoader cl) { try { String className = cnfe.getMessage(); Class.forName(className, false, cl); return true; } catch (ClassNotFoundException e) { return false; } catch (Exception e) { return false; } }
java
public static boolean validateClassLoadable(ClassNotFoundException cnfe, ClassLoader cl) { try { String className = cnfe.getMessage(); Class.forName(className, false, cl); return true; } catch (ClassNotFoundException e) { return false; } catch (Exception e) { return false; } }
[ "public", "static", "boolean", "validateClassLoadable", "(", "ClassNotFoundException", "cnfe", ",", "ClassLoader", "cl", ")", "{", "try", "{", "String", "className", "=", "cnfe", ".", "getMessage", "(", ")", ";", "Class", ".", "forName", "(", "className", ",",...
Checks, whether the class that was not found in the given exception, can be resolved through the given class loader. @param cnfe The ClassNotFoundException that defines the name of the class. @param cl The class loader to use for the class resolution. @return True, if the class can be resolved with the given class loa...
[ "Checks", "whether", "the", "class", "that", "was", "not", "found", "in", "the", "given", "exception", "can", "be", "resolved", "through", "the", "given", "class", "loader", "." ]
b62db93bf63cb3bb34dd03d611a779d9e3fc61ac
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/util/ClassLoaderUtil.java#L119-L131
123,798
apache/flink
flink-table/flink-table-planner/src/main/java/org/apache/flink/table/plan/rules/logical/ExtendedAggregateExtractProjectRule.java
ExtendedAggregateExtractProjectRule.extractProjectsAndMapping
private Mapping extractProjectsAndMapping( Aggregate aggregate, RelNode input, RelBuilder relBuilder) { // Compute which input fields are used. final ImmutableBitSet.Builder inputFieldsUsed = getInputFieldUsed(aggregate, input); final List<RexNode> projects = new ArrayList<>(); final Mapping mapping = ...
java
private Mapping extractProjectsAndMapping( Aggregate aggregate, RelNode input, RelBuilder relBuilder) { // Compute which input fields are used. final ImmutableBitSet.Builder inputFieldsUsed = getInputFieldUsed(aggregate, input); final List<RexNode> projects = new ArrayList<>(); final Mapping mapping = ...
[ "private", "Mapping", "extractProjectsAndMapping", "(", "Aggregate", "aggregate", ",", "RelNode", "input", ",", "RelBuilder", "relBuilder", ")", "{", "// Compute which input fields are used.", "final", "ImmutableBitSet", ".", "Builder", "inputFieldsUsed", "=", "getInputFiel...
Extract projects from the Aggregate and return the index mapping between the new projects and it's input.
[ "Extract", "projects", "from", "the", "Aggregate", "and", "return", "the", "index", "mapping", "between", "the", "new", "projects", "and", "it", "s", "input", "." ]
b62db93bf63cb3bb34dd03d611a779d9e3fc61ac
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-table/flink-table-planner/src/main/java/org/apache/flink/table/plan/rules/logical/ExtendedAggregateExtractProjectRule.java#L92-L119
123,799
apache/flink
flink-table/flink-table-planner/src/main/java/org/apache/flink/table/plan/rules/logical/ExtendedAggregateExtractProjectRule.java
ExtendedAggregateExtractProjectRule.getInputFieldUsed
private ImmutableBitSet.Builder getInputFieldUsed(Aggregate aggregate, RelNode input) { // 1. group fields are always used final ImmutableBitSet.Builder inputFieldsUsed = aggregate.getGroupSet().rebuild(); // 2. agg functions for (AggregateCall aggCall : aggregate.getAggCallList()) { for (int i : aggCall....
java
private ImmutableBitSet.Builder getInputFieldUsed(Aggregate aggregate, RelNode input) { // 1. group fields are always used final ImmutableBitSet.Builder inputFieldsUsed = aggregate.getGroupSet().rebuild(); // 2. agg functions for (AggregateCall aggCall : aggregate.getAggCallList()) { for (int i : aggCall....
[ "private", "ImmutableBitSet", ".", "Builder", "getInputFieldUsed", "(", "Aggregate", "aggregate", ",", "RelNode", "input", ")", "{", "// 1. group fields are always used", "final", "ImmutableBitSet", ".", "Builder", "inputFieldsUsed", "=", "aggregate", ".", "getGroupSet", ...
Compute which input fields are used by the aggregate.
[ "Compute", "which", "input", "fields", "are", "used", "by", "the", "aggregate", "." ]
b62db93bf63cb3bb34dd03d611a779d9e3fc61ac
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-table/flink-table-planner/src/main/java/org/apache/flink/table/plan/rules/logical/ExtendedAggregateExtractProjectRule.java#L124-L142