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,300 | apache/flink | flink-runtime/src/main/java/org/apache/flink/runtime/rest/handler/router/MethodlessRouter.java | MethodlessRouter.addRoute | public MethodlessRouter<T> addRoute(String pathPattern, T target) {
PathPattern p = new PathPattern(pathPattern);
if (routes.containsKey(p)) {
return this;
}
routes.put(p, target);
return this;
} | java | public MethodlessRouter<T> addRoute(String pathPattern, T target) {
PathPattern p = new PathPattern(pathPattern);
if (routes.containsKey(p)) {
return this;
}
routes.put(p, target);
return this;
} | [
"public",
"MethodlessRouter",
"<",
"T",
">",
"addRoute",
"(",
"String",
"pathPattern",
",",
"T",
"target",
")",
"{",
"PathPattern",
"p",
"=",
"new",
"PathPattern",
"(",
"pathPattern",
")",
";",
"if",
"(",
"routes",
".",
"containsKey",
"(",
"p",
")",
")",... | This method does nothing if the path pattern has already been added.
A path pattern can only point to one target. | [
"This",
"method",
"does",
"nothing",
"if",
"the",
"path",
"pattern",
"has",
"already",
"been",
"added",
".",
"A",
"path",
"pattern",
"can",
"only",
"point",
"to",
"one",
"target",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/rest/handler/router/MethodlessRouter.java#L60-L68 |
123,301 | apache/flink | flink-runtime/src/main/java/org/apache/flink/runtime/rest/handler/router/MethodlessRouter.java | MethodlessRouter.anyMatched | public boolean anyMatched(String[] requestPathTokens) {
Map<String, String> pathParams = new HashMap<>();
for (PathPattern pattern : routes.keySet()) {
if (pattern.match(requestPathTokens, pathParams)) {
return true;
}
// Reset for the next loop
pathParams.clear();
}
return false;
} | java | public boolean anyMatched(String[] requestPathTokens) {
Map<String, String> pathParams = new HashMap<>();
for (PathPattern pattern : routes.keySet()) {
if (pattern.match(requestPathTokens, pathParams)) {
return true;
}
// Reset for the next loop
pathParams.clear();
}
return false;
} | [
"public",
"boolean",
"anyMatched",
"(",
"String",
"[",
"]",
"requestPathTokens",
")",
"{",
"Map",
"<",
"String",
",",
"String",
">",
"pathParams",
"=",
"new",
"HashMap",
"<>",
"(",
")",
";",
"for",
"(",
"PathPattern",
"pattern",
":",
"routes",
".",
"keyS... | Checks if there's any matching route. | [
"Checks",
"if",
"there",
"s",
"any",
"matching",
"route",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/rest/handler/router/MethodlessRouter.java#L108-L120 |
123,302 | apache/flink | flink-core/src/main/java/org/apache/flink/core/fs/Path.java | Path.initialize | private void initialize(String scheme, String authority, String path) {
try {
this.uri = new URI(scheme, authority, normalizePath(path), null, null).normalize();
} catch (URISyntaxException e) {
throw new IllegalArgumentException(e);
}
} | java | private void initialize(String scheme, String authority, String path) {
try {
this.uri = new URI(scheme, authority, normalizePath(path), null, null).normalize();
} catch (URISyntaxException e) {
throw new IllegalArgumentException(e);
}
} | [
"private",
"void",
"initialize",
"(",
"String",
"scheme",
",",
"String",
"authority",
",",
"String",
"path",
")",
"{",
"try",
"{",
"this",
".",
"uri",
"=",
"new",
"URI",
"(",
"scheme",
",",
"authority",
",",
"normalizePath",
"(",
"path",
")",
",",
"nul... | Initializes a path object given the scheme, authority and path string.
@param scheme
the scheme string.
@param authority
the authority string.
@param path
the path string. | [
"Initializes",
"a",
"path",
"object",
"given",
"the",
"scheme",
"authority",
"and",
"path",
"string",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-core/src/main/java/org/apache/flink/core/fs/Path.java#L245-L251 |
123,303 | apache/flink | flink-core/src/main/java/org/apache/flink/core/fs/Path.java | Path.isAbsolute | public boolean isAbsolute() {
final int start = hasWindowsDrive(uri.getPath(), true) ? 3 : 0;
return uri.getPath().startsWith(SEPARATOR, start);
} | java | public boolean isAbsolute() {
final int start = hasWindowsDrive(uri.getPath(), true) ? 3 : 0;
return uri.getPath().startsWith(SEPARATOR, start);
} | [
"public",
"boolean",
"isAbsolute",
"(",
")",
"{",
"final",
"int",
"start",
"=",
"hasWindowsDrive",
"(",
"uri",
".",
"getPath",
"(",
")",
",",
"true",
")",
"?",
"3",
":",
"0",
";",
"return",
"uri",
".",
"getPath",
"(",
")",
".",
"startsWith",
"(",
"... | Checks if the directory of this path is absolute.
@return <code>true</code> if the directory of this path is absolute, <code>false</code> otherwise | [
"Checks",
"if",
"the",
"directory",
"of",
"this",
"path",
"is",
"absolute",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-core/src/main/java/org/apache/flink/core/fs/Path.java#L306-L309 |
123,304 | apache/flink | flink-core/src/main/java/org/apache/flink/core/fs/Path.java | Path.depth | public int depth() {
String path = uri.getPath();
int depth = 0;
int slash = path.length() == 1 && path.charAt(0) == '/' ? -1 : 0;
while (slash != -1) {
depth++;
slash = path.indexOf(SEPARATOR, slash + 1);
}
return depth;
} | java | public int depth() {
String path = uri.getPath();
int depth = 0;
int slash = path.length() == 1 && path.charAt(0) == '/' ? -1 : 0;
while (slash != -1) {
depth++;
slash = path.indexOf(SEPARATOR, slash + 1);
}
return depth;
} | [
"public",
"int",
"depth",
"(",
")",
"{",
"String",
"path",
"=",
"uri",
".",
"getPath",
"(",
")",
";",
"int",
"depth",
"=",
"0",
";",
"int",
"slash",
"=",
"path",
".",
"length",
"(",
")",
"==",
"1",
"&&",
"path",
".",
"charAt",
"(",
"0",
")",
... | Returns the number of elements in this path.
@return the number of elements in this path | [
"Returns",
"the",
"number",
"of",
"elements",
"in",
"this",
"path",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-core/src/main/java/org/apache/flink/core/fs/Path.java#L413-L422 |
123,305 | apache/flink | flink-formats/flink-avro/src/main/java/org/apache/flink/table/descriptors/Avro.java | Avro.recordClass | public Avro recordClass(Class<? extends SpecificRecord> recordClass) {
Preconditions.checkNotNull(recordClass);
this.recordClass = recordClass;
return this;
} | java | public Avro recordClass(Class<? extends SpecificRecord> recordClass) {
Preconditions.checkNotNull(recordClass);
this.recordClass = recordClass;
return this;
} | [
"public",
"Avro",
"recordClass",
"(",
"Class",
"<",
"?",
"extends",
"SpecificRecord",
">",
"recordClass",
")",
"{",
"Preconditions",
".",
"checkNotNull",
"(",
"recordClass",
")",
";",
"this",
".",
"recordClass",
"=",
"recordClass",
";",
"return",
"this",
";",
... | Sets the class of the Avro specific record.
@param recordClass class of the Avro record. | [
"Sets",
"the",
"class",
"of",
"the",
"Avro",
"specific",
"record",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-formats/flink-avro/src/main/java/org/apache/flink/table/descriptors/Avro.java#L49-L53 |
123,306 | apache/flink | flink-core/src/main/java/org/apache/flink/util/IOUtils.java | IOUtils.readFully | public static void readFully(final InputStream in, final byte[] buf, int off, final int len)
throws IOException {
int toRead = len;
while (toRead > 0) {
final int ret = in.read(buf, off, toRead);
if (ret < 0) {
throw new IOException("Premeture EOF from inputStream");
}
toRead -= ret;
off += re... | java | public static void readFully(final InputStream in, final byte[] buf, int off, final int len)
throws IOException {
int toRead = len;
while (toRead > 0) {
final int ret = in.read(buf, off, toRead);
if (ret < 0) {
throw new IOException("Premeture EOF from inputStream");
}
toRead -= ret;
off += re... | [
"public",
"static",
"void",
"readFully",
"(",
"final",
"InputStream",
"in",
",",
"final",
"byte",
"[",
"]",
"buf",
",",
"int",
"off",
",",
"final",
"int",
"len",
")",
"throws",
"IOException",
"{",
"int",
"toRead",
"=",
"len",
";",
"while",
"(",
"toRead... | Reads len bytes in a loop.
@param in
The InputStream to read from
@param buf
The buffer to fill
@param off
offset from the buffer
@param len
the length of bytes to read
@throws IOException
if it could not read requested number of bytes for any reason (including EOF) | [
"Reads",
"len",
"bytes",
"in",
"a",
"loop",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-core/src/main/java/org/apache/flink/util/IOUtils.java#L129-L140 |
123,307 | apache/flink | flink-libraries/flink-gelly-examples/src/main/java/org/apache/flink/graph/Runner.java | Runner.getAlgorithmsListing | private static String getAlgorithmsListing() {
StrBuilder strBuilder = new StrBuilder();
strBuilder
.appendNewLine()
.appendln("Select an algorithm to view usage: flink run examples/flink-gelly-examples_<version>.jar --algorithm <algorithm>")
.appendNewLine()
.appendln("Available algorithms:");
for ... | java | private static String getAlgorithmsListing() {
StrBuilder strBuilder = new StrBuilder();
strBuilder
.appendNewLine()
.appendln("Select an algorithm to view usage: flink run examples/flink-gelly-examples_<version>.jar --algorithm <algorithm>")
.appendNewLine()
.appendln("Available algorithms:");
for ... | [
"private",
"static",
"String",
"getAlgorithmsListing",
"(",
")",
"{",
"StrBuilder",
"strBuilder",
"=",
"new",
"StrBuilder",
"(",
")",
";",
"strBuilder",
".",
"appendNewLine",
"(",
")",
".",
"appendln",
"(",
"\"Select an algorithm to view usage: flink run examples/flink-... | List available algorithms. This is displayed to the user when no valid
algorithm is given in the program parameterization.
@return usage string listing available algorithms | [
"List",
"available",
"algorithms",
".",
"This",
"is",
"displayed",
"to",
"the",
"user",
"when",
"no",
"valid",
"algorithm",
"is",
"given",
"in",
"the",
"program",
"parameterization",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-libraries/flink-gelly-examples/src/main/java/org/apache/flink/graph/Runner.java#L191-L207 |
123,308 | apache/flink | flink-libraries/flink-gelly-examples/src/main/java/org/apache/flink/graph/Runner.java | Runner.getAlgorithmUsage | private static String getAlgorithmUsage(String algorithmName) {
StrBuilder strBuilder = new StrBuilder();
Driver algorithm = driverFactory.get(algorithmName);
strBuilder
.appendNewLine()
.appendNewLine()
.appendln(algorithm.getLongDescription())
.appendNewLine()
.append("usage: flink run examples... | java | private static String getAlgorithmUsage(String algorithmName) {
StrBuilder strBuilder = new StrBuilder();
Driver algorithm = driverFactory.get(algorithmName);
strBuilder
.appendNewLine()
.appendNewLine()
.appendln(algorithm.getLongDescription())
.appendNewLine()
.append("usage: flink run examples... | [
"private",
"static",
"String",
"getAlgorithmUsage",
"(",
"String",
"algorithmName",
")",
"{",
"StrBuilder",
"strBuilder",
"=",
"new",
"StrBuilder",
"(",
")",
";",
"Driver",
"algorithm",
"=",
"driverFactory",
".",
"get",
"(",
"algorithmName",
")",
";",
"strBuilde... | Display the usage for the given algorithm. This includes options for all
compatible inputs, the selected algorithm, and outputs implemented by
the selected algorithm.
@param algorithmName unique identifier of the selected algorithm
@return usage string for the given algorithm | [
"Display",
"the",
"usage",
"for",
"the",
"given",
"algorithm",
".",
"This",
"includes",
"options",
"for",
"all",
"compatible",
"inputs",
"the",
"selected",
"algorithm",
"and",
"outputs",
"implemented",
"by",
"the",
"selected",
"algorithm",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-libraries/flink-gelly-examples/src/main/java/org/apache/flink/graph/Runner.java#L217-L267 |
123,309 | apache/flink | flink-libraries/flink-gelly-examples/src/main/java/org/apache/flink/graph/Runner.java | Runner.execute | private void execute() throws Exception {
if (result == null) {
env.execute(executionName);
} else {
output.write(executionName.toString(), System.out, result);
}
System.out.println();
algorithm.printAnalytics(System.out);
if (jobDetailsPath.getValue() != null) {
writeJobDetails(env, jobDetailsPa... | java | private void execute() throws Exception {
if (result == null) {
env.execute(executionName);
} else {
output.write(executionName.toString(), System.out, result);
}
System.out.println();
algorithm.printAnalytics(System.out);
if (jobDetailsPath.getValue() != null) {
writeJobDetails(env, jobDetailsPa... | [
"private",
"void",
"execute",
"(",
")",
"throws",
"Exception",
"{",
"if",
"(",
"result",
"==",
"null",
")",
"{",
"env",
".",
"execute",
"(",
"executionName",
")",
";",
"}",
"else",
"{",
"output",
".",
"write",
"(",
"executionName",
".",
"toString",
"("... | Execute the Flink job.
@throws Exception on error | [
"Execute",
"the",
"Flink",
"job",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-libraries/flink-gelly-examples/src/main/java/org/apache/flink/graph/Runner.java#L450-L463 |
123,310 | apache/flink | flink-runtime/src/main/java/org/apache/flink/runtime/operators/sort/UnilateralSortMerger.java | UnilateralSortMerger.startThreads | protected void startThreads() {
if (this.readThread != null) {
this.readThread.start();
}
if (this.sortThread != null) {
this.sortThread.start();
}
if (this.spillThread != null) {
this.spillThread.start();
}
} | java | protected void startThreads() {
if (this.readThread != null) {
this.readThread.start();
}
if (this.sortThread != null) {
this.sortThread.start();
}
if (this.spillThread != null) {
this.spillThread.start();
}
} | [
"protected",
"void",
"startThreads",
"(",
")",
"{",
"if",
"(",
"this",
".",
"readThread",
"!=",
"null",
")",
"{",
"this",
".",
"readThread",
".",
"start",
"(",
")",
";",
"}",
"if",
"(",
"this",
".",
"sortThread",
"!=",
"null",
")",
"{",
"this",
"."... | Starts all the threads that are used by this sort-merger. | [
"Starts",
"all",
"the",
"threads",
"that",
"are",
"used",
"by",
"this",
"sort",
"-",
"merger",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/operators/sort/UnilateralSortMerger.java#L434-L444 |
123,311 | apache/flink | flink-runtime/src/main/java/org/apache/flink/runtime/operators/sort/UnilateralSortMerger.java | UnilateralSortMerger.setResultIteratorException | protected final void setResultIteratorException(IOException ioex) {
synchronized (this.iteratorLock) {
if (this.iteratorException == null) {
this.iteratorException = ioex;
this.iteratorLock.notifyAll();
}
}
} | java | protected final void setResultIteratorException(IOException ioex) {
synchronized (this.iteratorLock) {
if (this.iteratorException == null) {
this.iteratorException = ioex;
this.iteratorLock.notifyAll();
}
}
} | [
"protected",
"final",
"void",
"setResultIteratorException",
"(",
"IOException",
"ioex",
")",
"{",
"synchronized",
"(",
"this",
".",
"iteratorLock",
")",
"{",
"if",
"(",
"this",
".",
"iteratorException",
"==",
"null",
")",
"{",
"this",
".",
"iteratorException",
... | Reports an exception to all threads that are waiting for the result iterator.
@param ioex The exception to be reported to the threads that wait for the result iterator. | [
"Reports",
"an",
"exception",
"to",
"all",
"threads",
"that",
"are",
"waiting",
"for",
"the",
"result",
"iterator",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/operators/sort/UnilateralSortMerger.java#L680-L687 |
123,312 | apache/flink | flink-runtime/src/main/java/org/apache/flink/runtime/operators/sort/UnilateralSortMerger.java | UnilateralSortMerger.endMarker | protected static <T> CircularElement<T> endMarker() {
@SuppressWarnings("unchecked")
CircularElement<T> c = (CircularElement<T>) EOF_MARKER;
return c;
} | java | protected static <T> CircularElement<T> endMarker() {
@SuppressWarnings("unchecked")
CircularElement<T> c = (CircularElement<T>) EOF_MARKER;
return c;
} | [
"protected",
"static",
"<",
"T",
">",
"CircularElement",
"<",
"T",
">",
"endMarker",
"(",
")",
"{",
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"CircularElement",
"<",
"T",
">",
"c",
"=",
"(",
"CircularElement",
"<",
"T",
">",
")",
"EOF_MARKER",
... | Gets the element that is passed as marker for the end of data.
@return The element that is passed as marker for the end of data. | [
"Gets",
"the",
"element",
"that",
"is",
"passed",
"as",
"marker",
"for",
"the",
"end",
"of",
"data",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/operators/sort/UnilateralSortMerger.java#L708-L712 |
123,313 | apache/flink | flink-runtime/src/main/java/org/apache/flink/runtime/operators/sort/UnilateralSortMerger.java | UnilateralSortMerger.spillingMarker | protected static <T> CircularElement<T> spillingMarker() {
@SuppressWarnings("unchecked")
CircularElement<T> c = (CircularElement<T>) SPILLING_MARKER;
return c;
} | java | protected static <T> CircularElement<T> spillingMarker() {
@SuppressWarnings("unchecked")
CircularElement<T> c = (CircularElement<T>) SPILLING_MARKER;
return c;
} | [
"protected",
"static",
"<",
"T",
">",
"CircularElement",
"<",
"T",
">",
"spillingMarker",
"(",
")",
"{",
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"CircularElement",
"<",
"T",
">",
"c",
"=",
"(",
"CircularElement",
"<",
"T",
">",
")",
"SPILLING_M... | Gets the element that is passed as marker for signal beginning of spilling.
@return The element that is passed as marker for signal beginning of spilling. | [
"Gets",
"the",
"element",
"that",
"is",
"passed",
"as",
"marker",
"for",
"signal",
"beginning",
"of",
"spilling",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/operators/sort/UnilateralSortMerger.java#L719-L723 |
123,314 | apache/flink | flink-connectors/flink-connector-cassandra/src/main/java/org/apache/flink/streaming/connectors/cassandra/CassandraCommitter.java | CassandraCommitter.createResource | @Override
public void createResource() throws Exception {
cluster = builder.getCluster();
session = cluster.connect();
session.execute(String.format("CREATE KEYSPACE IF NOT EXISTS %s with replication={'class':'SimpleStrategy', 'replication_factor':1};", keySpace));
session.execute(String.format("CREATE TABLE ... | java | @Override
public void createResource() throws Exception {
cluster = builder.getCluster();
session = cluster.connect();
session.execute(String.format("CREATE KEYSPACE IF NOT EXISTS %s with replication={'class':'SimpleStrategy', 'replication_factor':1};", keySpace));
session.execute(String.format("CREATE TABLE ... | [
"@",
"Override",
"public",
"void",
"createResource",
"(",
")",
"throws",
"Exception",
"{",
"cluster",
"=",
"builder",
".",
"getCluster",
"(",
")",
";",
"session",
"=",
"cluster",
".",
"connect",
"(",
")",
";",
"session",
".",
"execute",
"(",
"String",
".... | Generates the necessary tables to store information.
@throws Exception | [
"Generates",
"the",
"necessary",
"tables",
"to",
"store",
"information",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-connectors/flink-connector-cassandra/src/main/java/org/apache/flink/streaming/connectors/cassandra/CassandraCommitter.java#L78-L96 |
123,315 | apache/flink | flink-scala-shell/src/main/java/org/apache/flink/api/java/JarHelper.java | JarHelper.jarDir | public void jarDir(File dirOrFile2Jar, File destJar)
throws IOException {
if (dirOrFile2Jar == null || destJar == null) {
throw new IllegalArgumentException();
}
mDestJarName = destJar.getCanonicalPath();
FileOutputStream fout = new FileOutputStream(destJar);
JarOutputStream jout = new JarOutputStream(... | java | public void jarDir(File dirOrFile2Jar, File destJar)
throws IOException {
if (dirOrFile2Jar == null || destJar == null) {
throw new IllegalArgumentException();
}
mDestJarName = destJar.getCanonicalPath();
FileOutputStream fout = new FileOutputStream(destJar);
JarOutputStream jout = new JarOutputStream(... | [
"public",
"void",
"jarDir",
"(",
"File",
"dirOrFile2Jar",
",",
"File",
"destJar",
")",
"throws",
"IOException",
"{",
"if",
"(",
"dirOrFile2Jar",
"==",
"null",
"||",
"destJar",
"==",
"null",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
")",
";",... | Jars a given directory or single file into a JarOutputStream. | [
"Jars",
"a",
"given",
"directory",
"or",
"single",
"file",
"into",
"a",
"JarOutputStream",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-scala-shell/src/main/java/org/apache/flink/api/java/JarHelper.java#L71-L90 |
123,316 | apache/flink | flink-scala-shell/src/main/java/org/apache/flink/api/java/JarHelper.java | JarHelper.unjarDir | public void unjarDir(File jarFile, File destDir) throws IOException {
BufferedOutputStream dest = null;
FileInputStream fis = new FileInputStream(jarFile);
unjar(fis, destDir);
} | java | public void unjarDir(File jarFile, File destDir) throws IOException {
BufferedOutputStream dest = null;
FileInputStream fis = new FileInputStream(jarFile);
unjar(fis, destDir);
} | [
"public",
"void",
"unjarDir",
"(",
"File",
"jarFile",
",",
"File",
"destDir",
")",
"throws",
"IOException",
"{",
"BufferedOutputStream",
"dest",
"=",
"null",
";",
"FileInputStream",
"fis",
"=",
"new",
"FileInputStream",
"(",
"jarFile",
")",
";",
"unjar",
"(",
... | Unjars a given jar file into a given directory. | [
"Unjars",
"a",
"given",
"jar",
"file",
"into",
"a",
"given",
"directory",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-scala-shell/src/main/java/org/apache/flink/api/java/JarHelper.java#L95-L99 |
123,317 | apache/flink | flink-scala-shell/src/main/java/org/apache/flink/api/java/JarHelper.java | JarHelper.unjar | public void unjar(InputStream in, File destDir) throws IOException {
BufferedOutputStream dest = null;
JarInputStream jis = new JarInputStream(in);
JarEntry entry;
while ((entry = jis.getNextJarEntry()) != null) {
if (entry.isDirectory()) {
File dir = new File(destDir, entry.getName());
dir.mkdir();
... | java | public void unjar(InputStream in, File destDir) throws IOException {
BufferedOutputStream dest = null;
JarInputStream jis = new JarInputStream(in);
JarEntry entry;
while ((entry = jis.getNextJarEntry()) != null) {
if (entry.isDirectory()) {
File dir = new File(destDir, entry.getName());
dir.mkdir();
... | [
"public",
"void",
"unjar",
"(",
"InputStream",
"in",
",",
"File",
"destDir",
")",
"throws",
"IOException",
"{",
"BufferedOutputStream",
"dest",
"=",
"null",
";",
"JarInputStream",
"jis",
"=",
"new",
"JarInputStream",
"(",
"in",
")",
";",
"JarEntry",
"entry",
... | Given an InputStream on a jar file, unjars the contents into the given
directory. | [
"Given",
"an",
"InputStream",
"on",
"a",
"jar",
"file",
"unjars",
"the",
"contents",
"into",
"the",
"given",
"directory",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-scala-shell/src/main/java/org/apache/flink/api/java/JarHelper.java#L105-L140 |
123,318 | apache/flink | flink-scala-shell/src/main/java/org/apache/flink/api/java/JarHelper.java | JarHelper.jarDir | private void jarDir(File dirOrFile2jar, JarOutputStream jos, String path)
throws IOException {
if (mVerbose) {
System.out.println("checking " + dirOrFile2jar);
}
if (dirOrFile2jar.isDirectory()) {
String[] dirList = dirOrFile2jar.list();
String subPath = (path == null) ? "" : (path + dirOrFile2jar.getN... | java | private void jarDir(File dirOrFile2jar, JarOutputStream jos, String path)
throws IOException {
if (mVerbose) {
System.out.println("checking " + dirOrFile2jar);
}
if (dirOrFile2jar.isDirectory()) {
String[] dirList = dirOrFile2jar.list();
String subPath = (path == null) ? "" : (path + dirOrFile2jar.getN... | [
"private",
"void",
"jarDir",
"(",
"File",
"dirOrFile2jar",
",",
"JarOutputStream",
"jos",
",",
"String",
"path",
")",
"throws",
"IOException",
"{",
"if",
"(",
"mVerbose",
")",
"{",
"System",
".",
"out",
".",
"println",
"(",
"\"checking \"",
"+",
"dirOrFile2j... | Recursively jars up the given path under the given directory. | [
"Recursively",
"jars",
"up",
"the",
"given",
"path",
"under",
"the",
"given",
"directory",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-scala-shell/src/main/java/org/apache/flink/api/java/JarHelper.java#L154-L203 |
123,319 | apache/flink | flink-connectors/flink-orc/src/main/java/org/apache/flink/orc/OrcRowInputFormat.java | OrcRowInputFormat.ensureBatch | private boolean ensureBatch() throws IOException {
if (nextRow >= rowsInBatch) {
// No more rows available in the Rows array.
nextRow = 0;
// Try to read the next batch if rows from the ORC file.
boolean moreRows = orcRowsReader.nextBatch(rowBatch);
if (moreRows) {
// Load the data into the Rows ... | java | private boolean ensureBatch() throws IOException {
if (nextRow >= rowsInBatch) {
// No more rows available in the Rows array.
nextRow = 0;
// Try to read the next batch if rows from the ORC file.
boolean moreRows = orcRowsReader.nextBatch(rowBatch);
if (moreRows) {
// Load the data into the Rows ... | [
"private",
"boolean",
"ensureBatch",
"(",
")",
"throws",
"IOException",
"{",
"if",
"(",
"nextRow",
">=",
"rowsInBatch",
")",
"{",
"// No more rows available in the Rows array.",
"nextRow",
"=",
"0",
";",
"// Try to read the next batch if rows from the ORC file.",
"boolean",... | Checks if there is at least one row left in the batch to return.
If no more row are available, it reads another batch of rows.
@return Returns true if there is one more row to return, false otherwise.
@throws IOException throw if an exception happens while reading a batch. | [
"Checks",
"if",
"there",
"is",
"at",
"least",
"one",
"row",
"left",
"in",
"the",
"batch",
"to",
"return",
".",
"If",
"no",
"more",
"row",
"are",
"available",
"it",
"reads",
"another",
"batch",
"of",
"rows",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-connectors/flink-orc/src/main/java/org/apache/flink/orc/OrcRowInputFormat.java#L323-L339 |
123,320 | apache/flink | flink-clients/src/main/java/org/apache/flink/client/program/ClusterClient.java | ClusterClient.run | public JobSubmissionResult run(JobWithJars jobWithJars, int parallelism, SavepointRestoreSettings savepointSettings)
throws CompilerException, ProgramInvocationException {
ClassLoader classLoader = jobWithJars.getUserCodeClassLoader();
if (classLoader == null) {
throw new IllegalArgumentException("The given J... | java | public JobSubmissionResult run(JobWithJars jobWithJars, int parallelism, SavepointRestoreSettings savepointSettings)
throws CompilerException, ProgramInvocationException {
ClassLoader classLoader = jobWithJars.getUserCodeClassLoader();
if (classLoader == null) {
throw new IllegalArgumentException("The given J... | [
"public",
"JobSubmissionResult",
"run",
"(",
"JobWithJars",
"jobWithJars",
",",
"int",
"parallelism",
",",
"SavepointRestoreSettings",
"savepointSettings",
")",
"throws",
"CompilerException",
",",
"ProgramInvocationException",
"{",
"ClassLoader",
"classLoader",
"=",
"jobWit... | Runs a program on the Flink cluster to which this client is connected. The call blocks until the
execution is complete, and returns afterwards.
@param jobWithJars The program to be executed.
@param parallelism The default parallelism to use when running the program. The default parallelism is used
when the program doe... | [
"Runs",
"a",
"program",
"on",
"the",
"Flink",
"cluster",
"to",
"which",
"this",
"client",
"is",
"connected",
".",
"The",
"call",
"blocks",
"until",
"the",
"execution",
"is",
"complete",
"and",
"returns",
"afterwards",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-clients/src/main/java/org/apache/flink/client/program/ClusterClient.java#L309-L318 |
123,321 | apache/flink | flink-clients/src/main/java/org/apache/flink/client/program/ClusterClient.java | ClusterClient.getAccumulators | public Map<String, OptionalFailure<Object>> getAccumulators(JobID jobID) throws Exception {
return getAccumulators(jobID, ClassLoader.getSystemClassLoader());
} | java | public Map<String, OptionalFailure<Object>> getAccumulators(JobID jobID) throws Exception {
return getAccumulators(jobID, ClassLoader.getSystemClassLoader());
} | [
"public",
"Map",
"<",
"String",
",",
"OptionalFailure",
"<",
"Object",
">",
">",
"getAccumulators",
"(",
"JobID",
"jobID",
")",
"throws",
"Exception",
"{",
"return",
"getAccumulators",
"(",
"jobID",
",",
"ClassLoader",
".",
"getSystemClassLoader",
"(",
")",
")... | Requests and returns the accumulators for the given job identifier. Accumulators can be
requested while a is running or after it has finished. The default class loader is used
to deserialize the incoming accumulator results.
@param jobID The job identifier of a job.
@return A Map containing the accumulator's name and i... | [
"Requests",
"and",
"returns",
"the",
"accumulators",
"for",
"the",
"given",
"job",
"identifier",
".",
"Accumulators",
"can",
"be",
"requested",
"while",
"a",
"is",
"running",
"or",
"after",
"it",
"has",
"finished",
".",
"The",
"default",
"class",
"loader",
"... | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-clients/src/main/java/org/apache/flink/client/program/ClusterClient.java#L397-L399 |
123,322 | apache/flink | flink-clients/src/main/java/org/apache/flink/client/program/ClusterClient.java | ClusterClient.getOptimizedPlan | private static OptimizedPlan getOptimizedPlan(Optimizer compiler, JobWithJars prog, int parallelism)
throws CompilerException, ProgramInvocationException {
return getOptimizedPlan(compiler, prog.getPlan(), parallelism);
} | java | private static OptimizedPlan getOptimizedPlan(Optimizer compiler, JobWithJars prog, int parallelism)
throws CompilerException, ProgramInvocationException {
return getOptimizedPlan(compiler, prog.getPlan(), parallelism);
} | [
"private",
"static",
"OptimizedPlan",
"getOptimizedPlan",
"(",
"Optimizer",
"compiler",
",",
"JobWithJars",
"prog",
",",
"int",
"parallelism",
")",
"throws",
"CompilerException",
",",
"ProgramInvocationException",
"{",
"return",
"getOptimizedPlan",
"(",
"compiler",
",",... | Creates the optimized plan for a given program, using this client's compiler.
@param prog The program to be compiled.
@return The compiled and optimized plan, as returned by the compiler.
@throws CompilerException Thrown, if the compiler encounters an illegal situation. | [
"Creates",
"the",
"optimized",
"plan",
"for",
"a",
"given",
"program",
"using",
"this",
"client",
"s",
"compiler",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-clients/src/main/java/org/apache/flink/client/program/ClusterClient.java#L421-L424 |
123,323 | apache/flink | flink-table/flink-table-common/src/main/java/org/apache/flink/table/util/TableConnectorUtil.java | TableConnectorUtil.generateRuntimeName | public static String generateRuntimeName(Class<?> clazz, String[] fields) {
return TableConnectorUtils.generateRuntimeName(clazz, fields);
} | java | public static String generateRuntimeName(Class<?> clazz, String[] fields) {
return TableConnectorUtils.generateRuntimeName(clazz, fields);
} | [
"public",
"static",
"String",
"generateRuntimeName",
"(",
"Class",
"<",
"?",
">",
"clazz",
",",
"String",
"[",
"]",
"fields",
")",
"{",
"return",
"TableConnectorUtils",
".",
"generateRuntimeName",
"(",
"clazz",
",",
"fields",
")",
";",
"}"
] | Returns the table connector name used for log and web UI. | [
"Returns",
"the",
"table",
"connector",
"name",
"used",
"for",
"log",
"and",
"web",
"UI",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-table/flink-table-common/src/main/java/org/apache/flink/table/util/TableConnectorUtil.java#L34-L36 |
123,324 | apache/flink | flink-runtime/src/main/java/org/apache/flink/runtime/io/network/netty/PartitionRequestClient.java | PartitionRequestClient.requestSubpartition | public ChannelFuture requestSubpartition(
final ResultPartitionID partitionId,
final int subpartitionIndex,
final RemoteInputChannel inputChannel,
int delayMs) throws IOException {
checkNotClosed();
LOG.debug("Requesting subpartition {} of partition {} with {} ms delay.",
subpartitionIndex, partit... | java | public ChannelFuture requestSubpartition(
final ResultPartitionID partitionId,
final int subpartitionIndex,
final RemoteInputChannel inputChannel,
int delayMs) throws IOException {
checkNotClosed();
LOG.debug("Requesting subpartition {} of partition {} with {} ms delay.",
subpartitionIndex, partit... | [
"public",
"ChannelFuture",
"requestSubpartition",
"(",
"final",
"ResultPartitionID",
"partitionId",
",",
"final",
"int",
"subpartitionIndex",
",",
"final",
"RemoteInputChannel",
"inputChannel",
",",
"int",
"delayMs",
")",
"throws",
"IOException",
"{",
"checkNotClosed",
... | Requests a remote intermediate result partition queue.
<p>The request goes to the remote producer, for which this partition
request client instance has been created. | [
"Requests",
"a",
"remote",
"intermediate",
"result",
"partition",
"queue",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/io/network/netty/PartitionRequestClient.java#L97-L144 |
123,325 | apache/flink | flink-formats/flink-parquet/src/main/java/org/apache/flink/formats/parquet/ParquetInputFormat.java | ParquetInputFormat.selectFields | public void selectFields(String[] fieldNames) {
checkNotNull(fieldNames, "fieldNames");
this.fieldNames = fieldNames;
RowTypeInfo rowTypeInfo = (RowTypeInfo) ParquetSchemaConverter.fromParquetType(expectedFileSchema);
TypeInformation[] selectFieldTypes = new TypeInformation[fieldNames.length];
for (int i = 0;... | java | public void selectFields(String[] fieldNames) {
checkNotNull(fieldNames, "fieldNames");
this.fieldNames = fieldNames;
RowTypeInfo rowTypeInfo = (RowTypeInfo) ParquetSchemaConverter.fromParquetType(expectedFileSchema);
TypeInformation[] selectFieldTypes = new TypeInformation[fieldNames.length];
for (int i = 0;... | [
"public",
"void",
"selectFields",
"(",
"String",
"[",
"]",
"fieldNames",
")",
"{",
"checkNotNull",
"(",
"fieldNames",
",",
"\"fieldNames\"",
")",
";",
"this",
".",
"fieldNames",
"=",
"fieldNames",
";",
"RowTypeInfo",
"rowTypeInfo",
"=",
"(",
"RowTypeInfo",
")"... | Configures the fields to be read and returned by the ParquetInputFormat. Selected fields must be present
in the configured schema.
@param fieldNames Names of all selected fields. | [
"Configures",
"the",
"fields",
"to",
"be",
"read",
"and",
"returned",
"by",
"the",
"ParquetInputFormat",
".",
"Selected",
"fields",
"must",
"be",
"present",
"in",
"the",
"configured",
"schema",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-formats/flink-parquet/src/main/java/org/apache/flink/formats/parquet/ParquetInputFormat.java#L130-L144 |
123,326 | apache/flink | flink-formats/flink-parquet/src/main/java/org/apache/flink/formats/parquet/ParquetInputFormat.java | ParquetInputFormat.getReadSchema | private MessageType getReadSchema(MessageType fileSchema, Path filePath) {
RowTypeInfo fileTypeInfo = (RowTypeInfo) ParquetSchemaConverter.fromParquetType(fileSchema);
List<Type> types = new ArrayList<>();
for (int i = 0; i < fieldNames.length; ++i) {
String readFieldName = fieldNames[i];
TypeInformation<?>... | java | private MessageType getReadSchema(MessageType fileSchema, Path filePath) {
RowTypeInfo fileTypeInfo = (RowTypeInfo) ParquetSchemaConverter.fromParquetType(fileSchema);
List<Type> types = new ArrayList<>();
for (int i = 0; i < fieldNames.length; ++i) {
String readFieldName = fieldNames[i];
TypeInformation<?>... | [
"private",
"MessageType",
"getReadSchema",
"(",
"MessageType",
"fileSchema",
",",
"Path",
"filePath",
")",
"{",
"RowTypeInfo",
"fileTypeInfo",
"=",
"(",
"RowTypeInfo",
")",
"ParquetSchemaConverter",
".",
"fromParquetType",
"(",
"fileSchema",
")",
";",
"List",
"<",
... | Generates and returns the read schema based on the projected fields for a given file.
@param fileSchema The schema of the given file.
@param filePath The path of the given file.
@return The read schema based on the given file's schema and the projected fields. | [
"Generates",
"and",
"returns",
"the",
"read",
"schema",
"based",
"on",
"the",
"projected",
"fields",
"for",
"a",
"given",
"file",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-formats/flink-parquet/src/main/java/org/apache/flink/formats/parquet/ParquetInputFormat.java#L248-L278 |
123,327 | apache/flink | flink-table/flink-table-runtime-blink/src/main/java/org/apache/flink/table/runtime/join/TimeBoundedStreamJoin.java | TimeBoundedStreamJoin.calExpirationTime | private long calExpirationTime(long operatorTime, long relativeSize) {
if (operatorTime < Long.MAX_VALUE) {
return operatorTime - relativeSize - allowedLateness - 1;
} else {
// When operatorTime = Long.MaxValue, it means the stream has reached the end.
return Long.MAX_VALUE;
}
} | java | private long calExpirationTime(long operatorTime, long relativeSize) {
if (operatorTime < Long.MAX_VALUE) {
return operatorTime - relativeSize - allowedLateness - 1;
} else {
// When operatorTime = Long.MaxValue, it means the stream has reached the end.
return Long.MAX_VALUE;
}
} | [
"private",
"long",
"calExpirationTime",
"(",
"long",
"operatorTime",
",",
"long",
"relativeSize",
")",
"{",
"if",
"(",
"operatorTime",
"<",
"Long",
".",
"MAX_VALUE",
")",
"{",
"return",
"operatorTime",
"-",
"relativeSize",
"-",
"allowedLateness",
"-",
"1",
";"... | Calculate the expiration time with the given operator time and relative window size.
@param operatorTime the operator time
@param relativeSize the relative window size
@return the expiration time for cached rows | [
"Calculate",
"the",
"expiration",
"time",
"with",
"the",
"given",
"operator",
"time",
"and",
"relative",
"window",
"size",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-table/flink-table-runtime-blink/src/main/java/org/apache/flink/table/runtime/join/TimeBoundedStreamJoin.java#L348-L355 |
123,328 | apache/flink | flink-table/flink-table-runtime-blink/src/main/java/org/apache/flink/table/runtime/join/TimeBoundedStreamJoin.java | TimeBoundedStreamJoin.registerCleanUpTimer | private void registerCleanUpTimer(Context ctx, long rowTime, boolean leftRow) throws IOException {
if (leftRow) {
long cleanUpTime = rowTime + leftRelativeSize + minCleanUpInterval + allowedLateness + 1;
registerTimer(ctx, cleanUpTime);
rightTimerState.update(cleanUpTime);
} else {
long cleanUpTime = ro... | java | private void registerCleanUpTimer(Context ctx, long rowTime, boolean leftRow) throws IOException {
if (leftRow) {
long cleanUpTime = rowTime + leftRelativeSize + minCleanUpInterval + allowedLateness + 1;
registerTimer(ctx, cleanUpTime);
rightTimerState.update(cleanUpTime);
} else {
long cleanUpTime = ro... | [
"private",
"void",
"registerCleanUpTimer",
"(",
"Context",
"ctx",
",",
"long",
"rowTime",
",",
"boolean",
"leftRow",
")",
"throws",
"IOException",
"{",
"if",
"(",
"leftRow",
")",
"{",
"long",
"cleanUpTime",
"=",
"rowTime",
"+",
"leftRelativeSize",
"+",
"minCle... | Register a timer for cleaning up rows in a specified time.
@param ctx the context to register timer
@param rowTime time for the input row
@param leftRow whether this row comes from the left stream | [
"Register",
"a",
"timer",
"for",
"cleaning",
"up",
"rows",
"in",
"a",
"specified",
"time",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-table/flink-table-runtime-blink/src/main/java/org/apache/flink/table/runtime/join/TimeBoundedStreamJoin.java#L364-L374 |
123,329 | apache/flink | flink-table/flink-table-runtime-blink/src/main/java/org/apache/flink/table/runtime/join/TimeBoundedStreamJoin.java | TimeBoundedStreamJoin.removeExpiredRows | private void removeExpiredRows(
Collector<BaseRow> collector,
long expirationTime,
MapState<Long, List<Tuple2<BaseRow, Boolean>>> rowCache,
ValueState<Long> timerState,
OnTimerContext ctx,
boolean removeLeft) throws Exception {
Iterator<Map.Entry<Long, List<Tuple2<BaseRow, Boolean>>>> iterator = row... | java | private void removeExpiredRows(
Collector<BaseRow> collector,
long expirationTime,
MapState<Long, List<Tuple2<BaseRow, Boolean>>> rowCache,
ValueState<Long> timerState,
OnTimerContext ctx,
boolean removeLeft) throws Exception {
Iterator<Map.Entry<Long, List<Tuple2<BaseRow, Boolean>>>> iterator = row... | [
"private",
"void",
"removeExpiredRows",
"(",
"Collector",
"<",
"BaseRow",
">",
"collector",
",",
"long",
"expirationTime",
",",
"MapState",
"<",
"Long",
",",
"List",
"<",
"Tuple2",
"<",
"BaseRow",
",",
"Boolean",
">",
">",
">",
"rowCache",
",",
"ValueState",... | Remove the expired rows. Register a new timer if the cache still holds valid rows
after the cleaning up.
@param collector the collector to emit results
@param expirationTime the expiration time for this cache
@param rowCache the row cache
@param timerState timer state for the opposite stream
@param ctx the context to ... | [
"Remove",
"the",
"expired",
"rows",
".",
"Register",
"a",
"new",
"timer",
"if",
"the",
"cache",
"still",
"holds",
"valid",
"rows",
"after",
"the",
"cleaning",
"up",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-table/flink-table-runtime-blink/src/main/java/org/apache/flink/table/runtime/join/TimeBoundedStreamJoin.java#L387-L439 |
123,330 | apache/flink | flink-table/flink-sql-client/src/main/java/org/apache/flink/table/client/gateway/local/ResultStore.java | ResultStore.createResult | public <T> DynamicResult<T> createResult(Environment env, TableSchema schema, ExecutionConfig config) {
final RowTypeInfo outputType = new RowTypeInfo(schema.getFieldTypes(), schema.getFieldNames());
if (env.getExecution().isStreamingExecution()) {
// determine gateway address (and port if possible)
final I... | java | public <T> DynamicResult<T> createResult(Environment env, TableSchema schema, ExecutionConfig config) {
final RowTypeInfo outputType = new RowTypeInfo(schema.getFieldTypes(), schema.getFieldNames());
if (env.getExecution().isStreamingExecution()) {
// determine gateway address (and port if possible)
final I... | [
"public",
"<",
"T",
">",
"DynamicResult",
"<",
"T",
">",
"createResult",
"(",
"Environment",
"env",
",",
"TableSchema",
"schema",
",",
"ExecutionConfig",
"config",
")",
"{",
"final",
"RowTypeInfo",
"outputType",
"=",
"new",
"RowTypeInfo",
"(",
"schema",
".",
... | Creates a result. Might start threads or opens sockets so every created result must be closed. | [
"Creates",
"a",
"result",
".",
"Might",
"start",
"threads",
"or",
"opens",
"sockets",
"so",
"every",
"created",
"result",
"must",
"be",
"closed",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-table/flink-sql-client/src/main/java/org/apache/flink/table/client/gateway/local/ResultStore.java#L60-L87 |
123,331 | apache/flink | flink-runtime/src/main/java/org/apache/flink/runtime/io/network/buffer/LocalBufferPool.java | LocalBufferPool.lazyDestroy | @Override
public void lazyDestroy() {
// NOTE: if you change this logic, be sure to update recycle() as well!
synchronized (availableMemorySegments) {
if (!isDestroyed) {
MemorySegment segment;
while ((segment = availableMemorySegments.poll()) != null) {
returnMemorySegment(segment);
}
Buf... | java | @Override
public void lazyDestroy() {
// NOTE: if you change this logic, be sure to update recycle() as well!
synchronized (availableMemorySegments) {
if (!isDestroyed) {
MemorySegment segment;
while ((segment = availableMemorySegments.poll()) != null) {
returnMemorySegment(segment);
}
Buf... | [
"@",
"Override",
"public",
"void",
"lazyDestroy",
"(",
")",
"{",
"// NOTE: if you change this logic, be sure to update recycle() as well!",
"synchronized",
"(",
"availableMemorySegments",
")",
"{",
"if",
"(",
"!",
"isDestroyed",
")",
"{",
"MemorySegment",
"segment",
";",
... | Destroy is called after the produce or consume phase of a task finishes. | [
"Destroy",
"is",
"called",
"after",
"the",
"produce",
"or",
"consume",
"phase",
"of",
"a",
"task",
"finishes",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/io/network/buffer/LocalBufferPool.java#L315-L339 |
123,332 | apache/flink | flink-libraries/flink-gelly/src/main/java/org/apache/flink/graph/bipartite/BipartiteGraph.java | BipartiteGraph.fromDataSet | public static <KT, KB, VVT, VVB, EV> BipartiteGraph<KT, KB, VVT, VVB, EV> fromDataSet(
DataSet<Vertex<KT, VVT>> topVertices,
DataSet<Vertex<KB, VVB>> bottomVertices,
DataSet<BipartiteEdge<KT, KB, EV>> edges,
ExecutionEnvironment context) {
return new BipartiteGraph<>(topVertices, bottomVertices, edges, co... | java | public static <KT, KB, VVT, VVB, EV> BipartiteGraph<KT, KB, VVT, VVB, EV> fromDataSet(
DataSet<Vertex<KT, VVT>> topVertices,
DataSet<Vertex<KB, VVB>> bottomVertices,
DataSet<BipartiteEdge<KT, KB, EV>> edges,
ExecutionEnvironment context) {
return new BipartiteGraph<>(topVertices, bottomVertices, edges, co... | [
"public",
"static",
"<",
"KT",
",",
"KB",
",",
"VVT",
",",
"VVB",
",",
"EV",
">",
"BipartiteGraph",
"<",
"KT",
",",
"KB",
",",
"VVT",
",",
"VVB",
",",
"EV",
">",
"fromDataSet",
"(",
"DataSet",
"<",
"Vertex",
"<",
"KT",
",",
"VVT",
">",
">",
"to... | Create bipartite graph from datasets.
@param topVertices dataset of top vertices in the graph
@param bottomVertices dataset of bottom vertices in the graph
@param edges dataset of edges between vertices
@param context Flink execution context
@return new bipartite graph created from provided datasets | [
"Create",
"bipartite",
"graph",
"from",
"datasets",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-libraries/flink-gelly/src/main/java/org/apache/flink/graph/bipartite/BipartiteGraph.java#L81-L87 |
123,333 | apache/flink | flink-libraries/flink-gelly/src/main/java/org/apache/flink/graph/bipartite/BipartiteGraph.java | BipartiteGraph.projectionTopSimple | public Graph<KT, VVT, Tuple2<EV, EV>> projectionTopSimple() {
DataSet<Edge<KT, Tuple2<EV, EV>>> newEdges = edges.join(edges)
.where(1)
.equalTo(1)
.with(new ProjectionTopSimple<>())
.name("Simple top projection");
return Graph.fromDataSet(topVertices, newEdges, context);
} | java | public Graph<KT, VVT, Tuple2<EV, EV>> projectionTopSimple() {
DataSet<Edge<KT, Tuple2<EV, EV>>> newEdges = edges.join(edges)
.where(1)
.equalTo(1)
.with(new ProjectionTopSimple<>())
.name("Simple top projection");
return Graph.fromDataSet(topVertices, newEdges, context);
} | [
"public",
"Graph",
"<",
"KT",
",",
"VVT",
",",
"Tuple2",
"<",
"EV",
",",
"EV",
">",
">",
"projectionTopSimple",
"(",
")",
"{",
"DataSet",
"<",
"Edge",
"<",
"KT",
",",
"Tuple2",
"<",
"EV",
",",
"EV",
">",
">",
">",
"newEdges",
"=",
"edges",
".",
... | Convert a bipartite graph into an undirected graph that contains only top vertices. An edge between two vertices
in the new graph will exist only if the original bipartite graph contains a bottom vertex they are both
connected to.
<p>The simple projection performs a single join and returns edges containing the biparti... | [
"Convert",
"a",
"bipartite",
"graph",
"into",
"an",
"undirected",
"graph",
"that",
"contains",
"only",
"top",
"vertices",
".",
"An",
"edge",
"between",
"two",
"vertices",
"in",
"the",
"new",
"graph",
"will",
"exist",
"only",
"if",
"the",
"original",
"biparti... | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-libraries/flink-gelly/src/main/java/org/apache/flink/graph/bipartite/BipartiteGraph.java#L127-L135 |
123,334 | apache/flink | flink-libraries/flink-gelly/src/main/java/org/apache/flink/graph/bipartite/BipartiteGraph.java | BipartiteGraph.projectionBottomSimple | public Graph<KB, VVB, Tuple2<EV, EV>> projectionBottomSimple() {
DataSet<Edge<KB, Tuple2<EV, EV>>> newEdges = edges.join(edges)
.where(0)
.equalTo(0)
.with(new ProjectionBottomSimple<>())
.name("Simple bottom projection");
return Graph.fromDataSet(bottomVertices, newEdges, context);
} | java | public Graph<KB, VVB, Tuple2<EV, EV>> projectionBottomSimple() {
DataSet<Edge<KB, Tuple2<EV, EV>>> newEdges = edges.join(edges)
.where(0)
.equalTo(0)
.with(new ProjectionBottomSimple<>())
.name("Simple bottom projection");
return Graph.fromDataSet(bottomVertices, newEdges, context);
} | [
"public",
"Graph",
"<",
"KB",
",",
"VVB",
",",
"Tuple2",
"<",
"EV",
",",
"EV",
">",
">",
"projectionBottomSimple",
"(",
")",
"{",
"DataSet",
"<",
"Edge",
"<",
"KB",
",",
"Tuple2",
"<",
"EV",
",",
"EV",
">",
">",
">",
"newEdges",
"=",
"edges",
"."... | Convert a bipartite graph into an undirected graph that contains only bottom vertices. An edge between two
vertices in the new graph will exist only if the original bipartite graph contains a top vertex they are both
connected to.
<p>The simple projection performs a single join and returns edges containing the biparti... | [
"Convert",
"a",
"bipartite",
"graph",
"into",
"an",
"undirected",
"graph",
"that",
"contains",
"only",
"bottom",
"vertices",
".",
"An",
"edge",
"between",
"two",
"vertices",
"in",
"the",
"new",
"graph",
"will",
"exist",
"only",
"if",
"the",
"original",
"bipa... | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-libraries/flink-gelly/src/main/java/org/apache/flink/graph/bipartite/BipartiteGraph.java#L171-L179 |
123,335 | apache/flink | flink-libraries/flink-gelly/src/main/java/org/apache/flink/graph/bipartite/BipartiteGraph.java | BipartiteGraph.projectionTopFull | public Graph<KT, VVT, Projection<KB, VVB, VVT, EV>> projectionTopFull() {
DataSet<Tuple5<KT, KB, EV, VVT, VVB>> edgesWithVertices = joinEdgeWithVertices();
DataSet<Edge<KT, Projection<KB, VVB, VVT, EV>>> newEdges = edgesWithVertices.join(edgesWithVertices)
.where(1)
.equalTo(1)
.with(new ProjectionTopFull... | java | public Graph<KT, VVT, Projection<KB, VVB, VVT, EV>> projectionTopFull() {
DataSet<Tuple5<KT, KB, EV, VVT, VVB>> edgesWithVertices = joinEdgeWithVertices();
DataSet<Edge<KT, Projection<KB, VVB, VVT, EV>>> newEdges = edgesWithVertices.join(edgesWithVertices)
.where(1)
.equalTo(1)
.with(new ProjectionTopFull... | [
"public",
"Graph",
"<",
"KT",
",",
"VVT",
",",
"Projection",
"<",
"KB",
",",
"VVB",
",",
"VVT",
",",
"EV",
">",
">",
"projectionTopFull",
"(",
")",
"{",
"DataSet",
"<",
"Tuple5",
"<",
"KT",
",",
"KB",
",",
"EV",
",",
"VVT",
",",
"VVB",
">",
">"... | Convert a bipartite graph into a graph that contains only top vertices. An edge between two vertices in the new
graph will exist only if the original bipartite graph contains at least one bottom vertex they both connect to.
<p>The full projection performs three joins and returns edges containing the connecting vertex ... | [
"Convert",
"a",
"bipartite",
"graph",
"into",
"a",
"graph",
"that",
"contains",
"only",
"top",
"vertices",
".",
"An",
"edge",
"between",
"two",
"vertices",
"in",
"the",
"new",
"graph",
"will",
"exist",
"only",
"if",
"the",
"original",
"bipartite",
"graph",
... | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-libraries/flink-gelly/src/main/java/org/apache/flink/graph/bipartite/BipartiteGraph.java#L215-L225 |
123,336 | apache/flink | flink-libraries/flink-gelly/src/main/java/org/apache/flink/graph/bipartite/BipartiteGraph.java | BipartiteGraph.projectionBottomFull | public Graph<KB, VVB, Projection<KT, VVT, VVB, EV>> projectionBottomFull() {
DataSet<Tuple5<KT, KB, EV, VVT, VVB>> edgesWithVertices = joinEdgeWithVertices();
DataSet<Edge<KB, Projection<KT, VVT, VVB, EV>>> newEdges = edgesWithVertices.join(edgesWithVertices)
.where(0)
.equalTo(0)
.with(new ProjectionBott... | java | public Graph<KB, VVB, Projection<KT, VVT, VVB, EV>> projectionBottomFull() {
DataSet<Tuple5<KT, KB, EV, VVT, VVB>> edgesWithVertices = joinEdgeWithVertices();
DataSet<Edge<KB, Projection<KT, VVT, VVB, EV>>> newEdges = edgesWithVertices.join(edgesWithVertices)
.where(0)
.equalTo(0)
.with(new ProjectionBott... | [
"public",
"Graph",
"<",
"KB",
",",
"VVB",
",",
"Projection",
"<",
"KT",
",",
"VVT",
",",
"VVB",
",",
"EV",
">",
">",
"projectionBottomFull",
"(",
")",
"{",
"DataSet",
"<",
"Tuple5",
"<",
"KT",
",",
"KB",
",",
"EV",
",",
"VVT",
",",
"VVB",
">",
... | Convert a bipartite graph into a graph that contains only bottom vertices. An edge between two vertices in the
new graph will exist only if the original bipartite graph contains at least one top vertex they both connect to.
<p>The full projection performs three joins and returns edges containing the connecting vertex ... | [
"Convert",
"a",
"bipartite",
"graph",
"into",
"a",
"graph",
"that",
"contains",
"only",
"bottom",
"vertices",
".",
"An",
"edge",
"between",
"two",
"vertices",
"in",
"the",
"new",
"graph",
"will",
"exist",
"only",
"if",
"the",
"original",
"bipartite",
"graph"... | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-libraries/flink-gelly/src/main/java/org/apache/flink/graph/bipartite/BipartiteGraph.java#L281-L291 |
123,337 | apache/flink | flink-streaming-java/src/main/java/org/apache/flink/streaming/api/environment/LocalStreamEnvironment.java | LocalStreamEnvironment.execute | @Override
public JobExecutionResult execute(String jobName) throws Exception {
// transform the streaming program into a JobGraph
StreamGraph streamGraph = getStreamGraph();
streamGraph.setJobName(jobName);
JobGraph jobGraph = streamGraph.getJobGraph();
jobGraph.setAllowQueuedScheduling(true);
Configurat... | java | @Override
public JobExecutionResult execute(String jobName) throws Exception {
// transform the streaming program into a JobGraph
StreamGraph streamGraph = getStreamGraph();
streamGraph.setJobName(jobName);
JobGraph jobGraph = streamGraph.getJobGraph();
jobGraph.setAllowQueuedScheduling(true);
Configurat... | [
"@",
"Override",
"public",
"JobExecutionResult",
"execute",
"(",
"String",
"jobName",
")",
"throws",
"Exception",
"{",
"// transform the streaming program into a JobGraph",
"StreamGraph",
"streamGraph",
"=",
"getStreamGraph",
"(",
")",
";",
"streamGraph",
".",
"setJobName... | Executes the JobGraph of the on a mini cluster of CLusterUtil with a user
specified name.
@param jobName
name of the job
@return The result of the job execution, containing elapsed time and accumulators. | [
"Executes",
"the",
"JobGraph",
"of",
"the",
"on",
"a",
"mini",
"cluster",
"of",
"CLusterUtil",
"with",
"a",
"user",
"specified",
"name",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-streaming-java/src/main/java/org/apache/flink/streaming/api/environment/LocalStreamEnvironment.java#L86-L129 |
123,338 | apache/flink | flink-runtime/src/main/java/org/apache/flink/runtime/taskexecutor/KvStateService.java | KvStateService.fromConfiguration | public static KvStateService fromConfiguration(TaskManagerServicesConfiguration taskManagerServicesConfiguration) {
KvStateRegistry kvStateRegistry = new KvStateRegistry();
QueryableStateConfiguration qsConfig = taskManagerServicesConfiguration.getQueryableStateConfig();
KvStateClientProxy kvClientProxy = null;... | java | public static KvStateService fromConfiguration(TaskManagerServicesConfiguration taskManagerServicesConfiguration) {
KvStateRegistry kvStateRegistry = new KvStateRegistry();
QueryableStateConfiguration qsConfig = taskManagerServicesConfiguration.getQueryableStateConfig();
KvStateClientProxy kvClientProxy = null;... | [
"public",
"static",
"KvStateService",
"fromConfiguration",
"(",
"TaskManagerServicesConfiguration",
"taskManagerServicesConfiguration",
")",
"{",
"KvStateRegistry",
"kvStateRegistry",
"=",
"new",
"KvStateRegistry",
"(",
")",
";",
"QueryableStateConfiguration",
"qsConfig",
"=",
... | Creates and returns the KvState service.
@param taskManagerServicesConfiguration task manager configuration
@return service for kvState related components | [
"Creates",
"and",
"returns",
"the",
"KvState",
"service",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/taskexecutor/KvStateService.java#L159-L193 |
123,339 | apache/flink | flink-java/src/main/java/org/apache/flink/api/java/summarize/aggregation/CompensatedSum.java | CompensatedSum.add | public CompensatedSum add(CompensatedSum other) {
double correctedSum = other.value() + (delta + other.delta());
double updatedValue = value + correctedSum;
double updatedDelta = correctedSum - (updatedValue - value);
return new CompensatedSum(updatedValue, updatedDelta);
} | java | public CompensatedSum add(CompensatedSum other) {
double correctedSum = other.value() + (delta + other.delta());
double updatedValue = value + correctedSum;
double updatedDelta = correctedSum - (updatedValue - value);
return new CompensatedSum(updatedValue, updatedDelta);
} | [
"public",
"CompensatedSum",
"add",
"(",
"CompensatedSum",
"other",
")",
"{",
"double",
"correctedSum",
"=",
"other",
".",
"value",
"(",
")",
"+",
"(",
"delta",
"+",
"other",
".",
"delta",
"(",
")",
")",
";",
"double",
"updatedValue",
"=",
"value",
"+",
... | Increments the Kahan sum by adding two sums, and updating the correction term for reducing numeric errors. | [
"Increments",
"the",
"Kahan",
"sum",
"by",
"adding",
"two",
"sums",
"and",
"updating",
"the",
"correction",
"term",
"for",
"reducing",
"numeric",
"errors",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-java/src/main/java/org/apache/flink/api/java/summarize/aggregation/CompensatedSum.java#L84-L89 |
123,340 | apache/flink | flink-java/src/main/java/org/apache/flink/api/java/operators/SortPartitionOperator.java | SortPartitionOperator.sortPartition | public SortPartitionOperator<T> sortPartition(int field, Order order) {
if (useKeySelector) {
throw new InvalidProgramException("Expression keys cannot be appended after a KeySelector");
}
ensureSortableKey(field);
keys.add(new Keys.ExpressionKeys<>(field, getType()));
orders.add(order);
return this;
... | java | public SortPartitionOperator<T> sortPartition(int field, Order order) {
if (useKeySelector) {
throw new InvalidProgramException("Expression keys cannot be appended after a KeySelector");
}
ensureSortableKey(field);
keys.add(new Keys.ExpressionKeys<>(field, getType()));
orders.add(order);
return this;
... | [
"public",
"SortPartitionOperator",
"<",
"T",
">",
"sortPartition",
"(",
"int",
"field",
",",
"Order",
"order",
")",
"{",
"if",
"(",
"useKeySelector",
")",
"{",
"throw",
"new",
"InvalidProgramException",
"(",
"\"Expression keys cannot be appended after a KeySelector\"",
... | Appends an additional sort order with the specified field in the specified order to the
local partition sorting of the DataSet.
@param field The field index of the additional sort order of the local partition sorting.
@param order The order of the additional sort order of the local partition sorting.
@return The DataS... | [
"Appends",
"an",
"additional",
"sort",
"order",
"with",
"the",
"specified",
"field",
"in",
"the",
"specified",
"order",
"to",
"the",
"local",
"partition",
"sorting",
"of",
"the",
"DataSet",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-java/src/main/java/org/apache/flink/api/java/operators/SortPartitionOperator.java#L106-L116 |
123,341 | apache/flink | flink-runtime/src/main/java/org/apache/flink/runtime/io/network/netty/NettyBufferPool.java | NettyBufferPool.getNumberOfAllocatedBytes | public Option<Long> getNumberOfAllocatedBytes()
throws NoSuchFieldException, IllegalAccessException {
if (directArenas != null) {
long numChunks = 0;
for (Object arena : directArenas) {
numChunks += getNumberOfAllocatedChunks(arena, "qInit");
numChunks += getNumberOfAllocatedChunks(arena, "q000");
... | java | public Option<Long> getNumberOfAllocatedBytes()
throws NoSuchFieldException, IllegalAccessException {
if (directArenas != null) {
long numChunks = 0;
for (Object arena : directArenas) {
numChunks += getNumberOfAllocatedChunks(arena, "qInit");
numChunks += getNumberOfAllocatedChunks(arena, "q000");
... | [
"public",
"Option",
"<",
"Long",
">",
"getNumberOfAllocatedBytes",
"(",
")",
"throws",
"NoSuchFieldException",
",",
"IllegalAccessException",
"{",
"if",
"(",
"directArenas",
"!=",
"null",
")",
"{",
"long",
"numChunks",
"=",
"0",
";",
"for",
"(",
"Object",
"are... | Returns the number of currently allocated bytes.
<p>The stats are gathered via Reflection and are mostly relevant for
debugging purposes.
@return Number of currently allocated bytes.
@throws NoSuchFieldException Error getting the statistics (should not
happen when the Netty version stays the
same).
@throws Illegal... | [
"Returns",
"the",
"number",
"of",
"currently",
"allocated",
"bytes",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/io/network/netty/NettyBufferPool.java#L152-L171 |
123,342 | apache/flink | flink-runtime/src/main/java/org/apache/flink/runtime/io/network/netty/NettyBufferPool.java | NettyBufferPool.getNumberOfAllocatedChunks | private long getNumberOfAllocatedChunks(Object arena, String chunkListFieldName)
throws NoSuchFieldException, IllegalAccessException {
// Each PoolArena<ByteBuffer> stores its allocated PoolChunk<ByteBuffer>
// instances grouped by usage (field qInit, q000, q025, etc.) in
// PoolChunkList<ByteBuffer> lists. E... | java | private long getNumberOfAllocatedChunks(Object arena, String chunkListFieldName)
throws NoSuchFieldException, IllegalAccessException {
// Each PoolArena<ByteBuffer> stores its allocated PoolChunk<ByteBuffer>
// instances grouped by usage (field qInit, q000, q025, etc.) in
// PoolChunkList<ByteBuffer> lists. E... | [
"private",
"long",
"getNumberOfAllocatedChunks",
"(",
"Object",
"arena",
",",
"String",
"chunkListFieldName",
")",
"throws",
"NoSuchFieldException",
",",
"IllegalAccessException",
"{",
"// Each PoolArena<ByteBuffer> stores its allocated PoolChunk<ByteBuffer>",
"// instances grouped b... | Returns the number of allocated bytes of the given arena and chunk list.
@param arena Arena to gather statistics about.
@param chunkListFieldName Chunk list to check.
@return Number of total allocated bytes by this arena.
@throws NoSuchFieldException Error getting the statistics (should not
happen whe... | [
"Returns",
"the",
"number",
"of",
"allocated",
"bytes",
"of",
"the",
"given",
"arena",
"and",
"chunk",
"list",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/io/network/netty/NettyBufferPool.java#L188-L223 |
123,343 | apache/flink | flink-connectors/flink-connector-elasticsearch-base/src/main/java/org/apache/flink/streaming/connectors/elasticsearch/ElasticsearchUpsertTableSinkBase.java | ElasticsearchUpsertTableSinkBase.validateKeyTypes | private void validateKeyTypes(int[] keyFieldIndices) {
final TypeInformation<?>[] types = getFieldTypes();
for (int keyFieldIndex : keyFieldIndices) {
final TypeInformation<?> type = types[keyFieldIndex];
if (!TypeCheckUtils.isSimpleStringRepresentation(type)) {
throw new ValidationException(
"Only s... | java | private void validateKeyTypes(int[] keyFieldIndices) {
final TypeInformation<?>[] types = getFieldTypes();
for (int keyFieldIndex : keyFieldIndices) {
final TypeInformation<?> type = types[keyFieldIndex];
if (!TypeCheckUtils.isSimpleStringRepresentation(type)) {
throw new ValidationException(
"Only s... | [
"private",
"void",
"validateKeyTypes",
"(",
"int",
"[",
"]",
"keyFieldIndices",
")",
"{",
"final",
"TypeInformation",
"<",
"?",
">",
"[",
"]",
"types",
"=",
"getFieldTypes",
"(",
")",
";",
"for",
"(",
"int",
"keyFieldIndex",
":",
"keyFieldIndices",
")",
"{... | Validate the types that are used for conversion to string. | [
"Validate",
"the",
"types",
"that",
"are",
"used",
"for",
"conversion",
"to",
"string",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-connectors/flink-connector-elasticsearch-base/src/main/java/org/apache/flink/streaming/connectors/elasticsearch/ElasticsearchUpsertTableSinkBase.java#L297-L307 |
123,344 | apache/flink | flink-runtime/src/main/java/org/apache/flink/runtime/clusterframework/overlays/AbstractContainerOverlay.java | AbstractContainerOverlay.addPathRecursively | protected void addPathRecursively(
final File sourcePath, final Path targetPath, final ContainerSpecification env) throws IOException {
final java.nio.file.Path sourceRoot = sourcePath.toPath().getParent();
Files.walkFileTree(sourcePath.toPath(), new SimpleFileVisitor<java.nio.file.Path>() {
@Override
pub... | java | protected void addPathRecursively(
final File sourcePath, final Path targetPath, final ContainerSpecification env) throws IOException {
final java.nio.file.Path sourceRoot = sourcePath.toPath().getParent();
Files.walkFileTree(sourcePath.toPath(), new SimpleFileVisitor<java.nio.file.Path>() {
@Override
pub... | [
"protected",
"void",
"addPathRecursively",
"(",
"final",
"File",
"sourcePath",
",",
"final",
"Path",
"targetPath",
",",
"final",
"ContainerSpecification",
"env",
")",
"throws",
"IOException",
"{",
"final",
"java",
".",
"nio",
".",
"file",
".",
"Path",
"sourceRoo... | Add a path recursively to the container specification.
If the path is a directory, the directory itself (not just its contents) is added to the target path.
The execute bit is preserved; permissions aren't.
@param sourcePath the path to add.
@param targetPath the target path.
@param env the specification to mutate.
... | [
"Add",
"a",
"path",
"recursively",
"to",
"the",
"container",
"specification",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/clusterframework/overlays/AbstractContainerOverlay.java#L48-L71 |
123,345 | apache/flink | flink-runtime/src/main/java/org/apache/flink/runtime/io/network/TaskEventDispatcher.java | TaskEventDispatcher.subscribeToEvent | public void subscribeToEvent(
ResultPartitionID partitionId,
EventListener<TaskEvent> eventListener,
Class<? extends TaskEvent> eventType) {
checkNotNull(partitionId);
checkNotNull(eventListener);
checkNotNull(eventType);
TaskEventHandler taskEventHandler;
synchronized (registeredHandlers) {
task... | java | public void subscribeToEvent(
ResultPartitionID partitionId,
EventListener<TaskEvent> eventListener,
Class<? extends TaskEvent> eventType) {
checkNotNull(partitionId);
checkNotNull(eventListener);
checkNotNull(eventType);
TaskEventHandler taskEventHandler;
synchronized (registeredHandlers) {
task... | [
"public",
"void",
"subscribeToEvent",
"(",
"ResultPartitionID",
"partitionId",
",",
"EventListener",
"<",
"TaskEvent",
">",
"eventListener",
",",
"Class",
"<",
"?",
"extends",
"TaskEvent",
">",
"eventType",
")",
"{",
"checkNotNull",
"(",
"partitionId",
")",
";",
... | Subscribes a listener to this dispatcher for events on a partition.
@param partitionId
ID of the partition to subscribe for (must be registered via {@link
#registerPartition(ResultPartitionID)} first!)
@param eventListener
the event listener to subscribe
@param eventType
event type to subscribe to | [
"Subscribes",
"a",
"listener",
"to",
"this",
"dispatcher",
"for",
"events",
"on",
"a",
"partition",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/io/network/TaskEventDispatcher.java#L97-L114 |
123,346 | apache/flink | flink-libraries/flink-streaming-python/src/main/java/org/apache/flink/streaming/python/util/AdapterMap.java | AdapterMap.adapt | public static PyObject adapt(Object o) {
if (o instanceof PyObject) {
return (PyObject) o;
}
return Py.java2py(o);
} | java | public static PyObject adapt(Object o) {
if (o instanceof PyObject) {
return (PyObject) o;
}
return Py.java2py(o);
} | [
"public",
"static",
"PyObject",
"adapt",
"(",
"Object",
"o",
")",
"{",
"if",
"(",
"o",
"instanceof",
"PyObject",
")",
"{",
"return",
"(",
"PyObject",
")",
"o",
";",
"}",
"return",
"Py",
".",
"java2py",
"(",
"o",
")",
";",
"}"
] | Convert java object to its corresponding PyObject representation.
@param o Java object
@return PyObject | [
"Convert",
"java",
"object",
"to",
"its",
"corresponding",
"PyObject",
"representation",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-libraries/flink-streaming-python/src/main/java/org/apache/flink/streaming/python/util/AdapterMap.java#L41-L46 |
123,347 | apache/flink | flink-runtime/src/main/java/org/apache/flink/runtime/checkpoint/hooks/MasterHooks.java | MasterHooks.reset | public static void reset(
final Collection<MasterTriggerRestoreHook<?>> hooks,
final Logger log) throws FlinkException {
for (MasterTriggerRestoreHook<?> hook : hooks) {
final String id = hook.getIdentifier();
try {
hook.reset();
}
catch (Throwable t) {
ExceptionUtils.rethrowIfFatalErrorOrOOM... | java | public static void reset(
final Collection<MasterTriggerRestoreHook<?>> hooks,
final Logger log) throws FlinkException {
for (MasterTriggerRestoreHook<?> hook : hooks) {
final String id = hook.getIdentifier();
try {
hook.reset();
}
catch (Throwable t) {
ExceptionUtils.rethrowIfFatalErrorOrOOM... | [
"public",
"static",
"void",
"reset",
"(",
"final",
"Collection",
"<",
"MasterTriggerRestoreHook",
"<",
"?",
">",
">",
"hooks",
",",
"final",
"Logger",
"log",
")",
"throws",
"FlinkException",
"{",
"for",
"(",
"MasterTriggerRestoreHook",
"<",
"?",
">",
"hook",
... | Resets the master hooks.
@param hooks The hooks to reset
@throws FlinkException Thrown, if the hooks throw an exception. | [
"Resets",
"the",
"master",
"hooks",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/checkpoint/hooks/MasterHooks.java#L61-L75 |
123,348 | apache/flink | flink-runtime/src/main/java/org/apache/flink/runtime/checkpoint/hooks/MasterHooks.java | MasterHooks.close | public static void close(
final Collection<MasterTriggerRestoreHook<?>> hooks,
final Logger log) throws FlinkException {
for (MasterTriggerRestoreHook<?> hook : hooks) {
try {
hook.close();
}
catch (Throwable t) {
log.warn("Failed to cleanly close a checkpoint master hook (" + hook.getIdentifier... | java | public static void close(
final Collection<MasterTriggerRestoreHook<?>> hooks,
final Logger log) throws FlinkException {
for (MasterTriggerRestoreHook<?> hook : hooks) {
try {
hook.close();
}
catch (Throwable t) {
log.warn("Failed to cleanly close a checkpoint master hook (" + hook.getIdentifier... | [
"public",
"static",
"void",
"close",
"(",
"final",
"Collection",
"<",
"MasterTriggerRestoreHook",
"<",
"?",
">",
">",
"hooks",
",",
"final",
"Logger",
"log",
")",
"throws",
"FlinkException",
"{",
"for",
"(",
"MasterTriggerRestoreHook",
"<",
"?",
">",
"hook",
... | Closes the master hooks.
@param hooks The hooks to close
@throws FlinkException Thrown, if the hooks throw an exception. | [
"Closes",
"the",
"master",
"hooks",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/checkpoint/hooks/MasterHooks.java#L84-L96 |
123,349 | apache/flink | flink-runtime/src/main/java/org/apache/flink/runtime/checkpoint/hooks/MasterHooks.java | MasterHooks.triggerMasterHooks | public static List<MasterState> triggerMasterHooks(
Collection<MasterTriggerRestoreHook<?>> hooks,
long checkpointId,
long timestamp,
Executor executor,
Time timeout) throws FlinkException {
final ArrayList<MasterState> states = new ArrayList<>(hooks.size());
for (MasterTriggerRestoreHook<?> hook :... | java | public static List<MasterState> triggerMasterHooks(
Collection<MasterTriggerRestoreHook<?>> hooks,
long checkpointId,
long timestamp,
Executor executor,
Time timeout) throws FlinkException {
final ArrayList<MasterState> states = new ArrayList<>(hooks.size());
for (MasterTriggerRestoreHook<?> hook :... | [
"public",
"static",
"List",
"<",
"MasterState",
">",
"triggerMasterHooks",
"(",
"Collection",
"<",
"MasterTriggerRestoreHook",
"<",
"?",
">",
">",
"hooks",
",",
"long",
"checkpointId",
",",
"long",
"timestamp",
",",
"Executor",
"executor",
",",
"Time",
"timeout"... | Triggers all given master hooks and returns state objects for each hook that
produced a state.
@param hooks The hooks to trigger
@param checkpointId The checkpoint ID of the triggering checkpoint
@param timestamp The (informational) timestamp for the triggering checkpoint
@param executor An executor that can be used f... | [
"Triggers",
"all",
"given",
"master",
"hooks",
"and",
"returns",
"state",
"objects",
"for",
"each",
"hook",
"that",
"produced",
"a",
"state",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/checkpoint/hooks/MasterHooks.java#L117-L135 |
123,350 | apache/flink | flink-runtime/src/main/java/org/apache/flink/runtime/checkpoint/hooks/MasterHooks.java | MasterHooks.restoreMasterHooks | public static void restoreMasterHooks(
final Map<String, MasterTriggerRestoreHook<?>> masterHooks,
final Collection<MasterState> states,
final long checkpointId,
final boolean allowUnmatchedState,
final Logger log) throws FlinkException {
// early out
if (states == null || states.isEmpty() || master... | java | public static void restoreMasterHooks(
final Map<String, MasterTriggerRestoreHook<?>> masterHooks,
final Collection<MasterState> states,
final long checkpointId,
final boolean allowUnmatchedState,
final Logger log) throws FlinkException {
// early out
if (states == null || states.isEmpty() || master... | [
"public",
"static",
"void",
"restoreMasterHooks",
"(",
"final",
"Map",
"<",
"String",
",",
"MasterTriggerRestoreHook",
"<",
"?",
">",
">",
"masterHooks",
",",
"final",
"Collection",
"<",
"MasterState",
">",
"states",
",",
"final",
"long",
"checkpointId",
",",
... | Calls the restore method given checkpoint master hooks and passes the given master
state to them where state with a matching name is found.
<p>If state is found and no hook with the same name is found, the method throws an
exception, unless the {@code allowUnmatchedState} flag is set.
@param masterHooks The hooks to ... | [
"Calls",
"the",
"restore",
"method",
"given",
"checkpoint",
"master",
"hooks",
"and",
"passes",
"the",
"given",
"master",
"state",
"to",
"them",
"where",
"state",
"with",
"a",
"matching",
"name",
"is",
"found",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/checkpoint/hooks/MasterHooks.java#L225-L276 |
123,351 | apache/flink | flink-runtime/src/main/java/org/apache/flink/runtime/checkpoint/hooks/MasterHooks.java | MasterHooks.wrapHook | public static <T> MasterTriggerRestoreHook<T> wrapHook(
MasterTriggerRestoreHook<T> hook,
ClassLoader userClassLoader) {
return new WrappedMasterHook<>(hook, userClassLoader);
} | java | public static <T> MasterTriggerRestoreHook<T> wrapHook(
MasterTriggerRestoreHook<T> hook,
ClassLoader userClassLoader) {
return new WrappedMasterHook<>(hook, userClassLoader);
} | [
"public",
"static",
"<",
"T",
">",
"MasterTriggerRestoreHook",
"<",
"T",
">",
"wrapHook",
"(",
"MasterTriggerRestoreHook",
"<",
"T",
">",
"hook",
",",
"ClassLoader",
"userClassLoader",
")",
"{",
"return",
"new",
"WrappedMasterHook",
"<>",
"(",
"hook",
",",
"us... | Wraps a hook such that the user-code classloader is applied when the hook is invoked.
@param hook the hook to wrap
@param userClassLoader the classloader to use | [
"Wraps",
"a",
"hook",
"such",
"that",
"the",
"user",
"-",
"code",
"classloader",
"is",
"applied",
"when",
"the",
"hook",
"is",
"invoked",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/checkpoint/hooks/MasterHooks.java#L330-L335 |
123,352 | apache/flink | flink-libraries/flink-streaming-python/src/main/java/org/apache/flink/streaming/python/util/InterpreterUtils.java | InterpreterUtils.deserializeFunction | @SuppressWarnings("unchecked")
public static <X> X deserializeFunction(RuntimeContext context, byte[] serFun) throws FlinkException {
if (!jythonInitialized) {
// This branch is only tested by end-to-end tests
String path = context.getDistributedCache().getFile(PythonConstants.FLINK_PYTHON_DC_ID).getAbsolutePa... | java | @SuppressWarnings("unchecked")
public static <X> X deserializeFunction(RuntimeContext context, byte[] serFun) throws FlinkException {
if (!jythonInitialized) {
// This branch is only tested by end-to-end tests
String path = context.getDistributedCache().getFile(PythonConstants.FLINK_PYTHON_DC_ID).getAbsolutePa... | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"static",
"<",
"X",
">",
"X",
"deserializeFunction",
"(",
"RuntimeContext",
"context",
",",
"byte",
"[",
"]",
"serFun",
")",
"throws",
"FlinkException",
"{",
"if",
"(",
"!",
"jythonInitialized",
")"... | Deserialize the given python function. If the functions class definition cannot be found we assume that this is
the first invocation of this method for a given job and load the python script containing the class definition
via jython.
@param context the RuntimeContext of the java function
@param serFun serialized pyth... | [
"Deserialize",
"the",
"given",
"python",
"function",
".",
"If",
"the",
"functions",
"class",
"definition",
"cannot",
"be",
"found",
"we",
"assume",
"that",
"this",
"is",
"the",
"first",
"invocation",
"of",
"this",
"method",
"for",
"a",
"given",
"job",
"and",... | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-libraries/flink-streaming-python/src/main/java/org/apache/flink/streaming/python/util/InterpreterUtils.java#L64-L95 |
123,353 | apache/flink | flink-libraries/flink-streaming-python/src/main/java/org/apache/flink/streaming/python/util/InterpreterUtils.java | InterpreterUtils.initAndExecPythonScript | public static void initAndExecPythonScript(PythonEnvironmentFactory factory, java.nio.file.Path scriptDirectory, String scriptName, String[] args) {
String[] fullArgs = new String[args.length + 1];
fullArgs[0] = scriptDirectory.resolve(scriptName).toString();
System.arraycopy(args, 0, fullArgs, 1, args.length);
... | java | public static void initAndExecPythonScript(PythonEnvironmentFactory factory, java.nio.file.Path scriptDirectory, String scriptName, String[] args) {
String[] fullArgs = new String[args.length + 1];
fullArgs[0] = scriptDirectory.resolve(scriptName).toString();
System.arraycopy(args, 0, fullArgs, 1, args.length);
... | [
"public",
"static",
"void",
"initAndExecPythonScript",
"(",
"PythonEnvironmentFactory",
"factory",
",",
"java",
".",
"nio",
".",
"file",
".",
"Path",
"scriptDirectory",
",",
"String",
"scriptName",
",",
"String",
"[",
"]",
"args",
")",
"{",
"String",
"[",
"]",... | Initializes the Jython interpreter and executes a python script.
@param factory environment factory
@param scriptDirectory the directory containing all required user python scripts
@param scriptName the name of the main python script
@param args Command line arguments that will be delivered to the executed python scri... | [
"Initializes",
"the",
"Jython",
"interpreter",
"and",
"executes",
"a",
"python",
"script",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-libraries/flink-streaming-python/src/main/java/org/apache/flink/streaming/python/util/InterpreterUtils.java#L105-L114 |
123,354 | apache/flink | flink-runtime/src/main/java/org/apache/flink/runtime/zookeeper/FlinkZooKeeperQuorumPeer.java | FlinkZooKeeperQuorumPeer.setRequiredProperties | private static void setRequiredProperties(Properties zkProps) {
// Set default client port
if (zkProps.getProperty("clientPort") == null) {
zkProps.setProperty("clientPort", String.valueOf(DEFAULT_ZOOKEEPER_CLIENT_PORT));
LOG.warn("No 'clientPort' configured. Set to '{}'.", DEFAULT_ZOOKEEPER_CLIENT_PORT);
... | java | private static void setRequiredProperties(Properties zkProps) {
// Set default client port
if (zkProps.getProperty("clientPort") == null) {
zkProps.setProperty("clientPort", String.valueOf(DEFAULT_ZOOKEEPER_CLIENT_PORT));
LOG.warn("No 'clientPort' configured. Set to '{}'.", DEFAULT_ZOOKEEPER_CLIENT_PORT);
... | [
"private",
"static",
"void",
"setRequiredProperties",
"(",
"Properties",
"zkProps",
")",
"{",
"// Set default client port",
"if",
"(",
"zkProps",
".",
"getProperty",
"(",
"\"clientPort\"",
")",
"==",
"null",
")",
"{",
"zkProps",
".",
"setProperty",
"(",
"\"clientP... | Sets required properties to reasonable defaults and logs it. | [
"Sets",
"required",
"properties",
"to",
"reasonable",
"defaults",
"and",
"logs",
"it",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/zookeeper/FlinkZooKeeperQuorumPeer.java#L139-L197 |
123,355 | apache/flink | flink-runtime/src/main/java/org/apache/flink/runtime/zookeeper/FlinkZooKeeperQuorumPeer.java | FlinkZooKeeperQuorumPeer.writeMyIdToDataDir | private static void writeMyIdToDataDir(Properties zkProps, int id) throws IOException {
// Check dataDir and create if necessary
if (zkProps.getProperty("dataDir") == null) {
throw new IllegalConfigurationException("No dataDir configured.");
}
File dataDir = new File(zkProps.getProperty("dataDir"));
if ... | java | private static void writeMyIdToDataDir(Properties zkProps, int id) throws IOException {
// Check dataDir and create if necessary
if (zkProps.getProperty("dataDir") == null) {
throw new IllegalConfigurationException("No dataDir configured.");
}
File dataDir = new File(zkProps.getProperty("dataDir"));
if ... | [
"private",
"static",
"void",
"writeMyIdToDataDir",
"(",
"Properties",
"zkProps",
",",
"int",
"id",
")",
"throws",
"IOException",
"{",
"// Check dataDir and create if necessary",
"if",
"(",
"zkProps",
".",
"getProperty",
"(",
"\"dataDir\"",
")",
"==",
"null",
")",
... | Write 'myid' file to the 'dataDir' in the given ZooKeeper configuration.
<blockquote>
Every machine that is part of the ZooKeeper ensemble should know about every other machine in
the ensemble. You accomplish this with the series of lines of the form
server.id=host:port:port. The parameters host and port are straightf... | [
"Write",
"myid",
"file",
"to",
"the",
"dataDir",
"in",
"the",
"given",
"ZooKeeper",
"configuration",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/zookeeper/FlinkZooKeeperQuorumPeer.java#L220-L242 |
123,356 | apache/flink | flink-table/flink-table-common/src/main/java/org/apache/flink/table/utils/TableConnectorUtils.java | TableConnectorUtils.generateRuntimeName | public static String generateRuntimeName(Class<?> clazz, String[] fields) {
String className = clazz.getSimpleName();
if (null == fields) {
return className + "(*)";
} else {
return className + "(" + String.join(", ", fields) + ")";
}
} | java | public static String generateRuntimeName(Class<?> clazz, String[] fields) {
String className = clazz.getSimpleName();
if (null == fields) {
return className + "(*)";
} else {
return className + "(" + String.join(", ", fields) + ")";
}
} | [
"public",
"static",
"String",
"generateRuntimeName",
"(",
"Class",
"<",
"?",
">",
"clazz",
",",
"String",
"[",
"]",
"fields",
")",
"{",
"String",
"className",
"=",
"clazz",
".",
"getSimpleName",
"(",
")",
";",
"if",
"(",
"null",
"==",
"fields",
")",
"{... | Returns the table connector name used for logging and web UI. | [
"Returns",
"the",
"table",
"connector",
"name",
"used",
"for",
"logging",
"and",
"web",
"UI",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-table/flink-table-common/src/main/java/org/apache/flink/table/utils/TableConnectorUtils.java#L36-L43 |
123,357 | apache/flink | flink-mesos/src/main/java/org/apache/flink/mesos/util/MesosConfiguration.java | MesosConfiguration.withFrameworkInfo | public MesosConfiguration withFrameworkInfo(Protos.FrameworkInfo.Builder frameworkInfo) {
return new MesosConfiguration(masterUrl, frameworkInfo, credential);
} | java | public MesosConfiguration withFrameworkInfo(Protos.FrameworkInfo.Builder frameworkInfo) {
return new MesosConfiguration(masterUrl, frameworkInfo, credential);
} | [
"public",
"MesosConfiguration",
"withFrameworkInfo",
"(",
"Protos",
".",
"FrameworkInfo",
".",
"Builder",
"frameworkInfo",
")",
"{",
"return",
"new",
"MesosConfiguration",
"(",
"masterUrl",
",",
"frameworkInfo",
",",
"credential",
")",
";",
"}"
] | Revise the configuration with updated framework info. | [
"Revise",
"the",
"configuration",
"with",
"updated",
"framework",
"info",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-mesos/src/main/java/org/apache/flink/mesos/util/MesosConfiguration.java#L90-L92 |
123,358 | apache/flink | flink-mesos/src/main/java/org/apache/flink/mesos/util/MesosConfiguration.java | MesosConfiguration.roles | public Set<String> roles() {
return frameworkInfo.hasRole() && !"*".equals(frameworkInfo.getRole()) ?
Collections.singleton(frameworkInfo.getRole()) : Collections.emptySet();
} | java | public Set<String> roles() {
return frameworkInfo.hasRole() && !"*".equals(frameworkInfo.getRole()) ?
Collections.singleton(frameworkInfo.getRole()) : Collections.emptySet();
} | [
"public",
"Set",
"<",
"String",
">",
"roles",
"(",
")",
"{",
"return",
"frameworkInfo",
".",
"hasRole",
"(",
")",
"&&",
"!",
"\"*\"",
".",
"equals",
"(",
"frameworkInfo",
".",
"getRole",
"(",
")",
")",
"?",
"Collections",
".",
"singleton",
"(",
"framew... | Gets the roles associated with the framework. | [
"Gets",
"the",
"roles",
"associated",
"with",
"the",
"framework",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-mesos/src/main/java/org/apache/flink/mesos/util/MesosConfiguration.java#L97-L100 |
123,359 | apache/flink | flink-mesos/src/main/java/org/apache/flink/mesos/util/MesosConfiguration.java | MesosConfiguration.createDriver | public SchedulerDriver createDriver(Scheduler scheduler, boolean implicitAcknowledgements) {
MesosSchedulerDriver schedulerDriver;
if (this.credential().isDefined()) {
schedulerDriver =
new MesosSchedulerDriver(scheduler, frameworkInfo.build(), this.masterUrl(),
implicitAcknowledgements, this.credential... | java | public SchedulerDriver createDriver(Scheduler scheduler, boolean implicitAcknowledgements) {
MesosSchedulerDriver schedulerDriver;
if (this.credential().isDefined()) {
schedulerDriver =
new MesosSchedulerDriver(scheduler, frameworkInfo.build(), this.masterUrl(),
implicitAcknowledgements, this.credential... | [
"public",
"SchedulerDriver",
"createDriver",
"(",
"Scheduler",
"scheduler",
",",
"boolean",
"implicitAcknowledgements",
")",
"{",
"MesosSchedulerDriver",
"schedulerDriver",
";",
"if",
"(",
"this",
".",
"credential",
"(",
")",
".",
"isDefined",
"(",
")",
")",
"{",
... | Create the Mesos scheduler driver based on this configuration.
@param scheduler the scheduler to use.
@param implicitAcknowledgements whether to configure the driver for implicit acknowledgements.
@return a scheduler driver. | [
"Create",
"the",
"Mesos",
"scheduler",
"driver",
"based",
"on",
"this",
"configuration",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-mesos/src/main/java/org/apache/flink/mesos/util/MesosConfiguration.java#L108-L121 |
123,360 | apache/flink | flink-mesos/src/main/java/org/apache/flink/mesos/util/MesosConfiguration.java | MesosConfiguration.logMesosConfig | public static void logMesosConfig(Logger log, MesosConfiguration config) {
Map<String, String> env = System.getenv();
Protos.FrameworkInfo.Builder info = config.frameworkInfo();
log.info("--------------------------------------------------------------------------------");
log.info(" Mesos Info:");
log.info("... | java | public static void logMesosConfig(Logger log, MesosConfiguration config) {
Map<String, String> env = System.getenv();
Protos.FrameworkInfo.Builder info = config.frameworkInfo();
log.info("--------------------------------------------------------------------------------");
log.info(" Mesos Info:");
log.info("... | [
"public",
"static",
"void",
"logMesosConfig",
"(",
"Logger",
"log",
",",
"MesosConfiguration",
"config",
")",
"{",
"Map",
"<",
"String",
",",
"String",
">",
"env",
"=",
"System",
".",
"getenv",
"(",
")",
";",
"Protos",
".",
"FrameworkInfo",
".",
"Builder",... | A utility method to log relevant Mesos connection info. | [
"A",
"utility",
"method",
"to",
"log",
"relevant",
"Mesos",
"connection",
"info",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-mesos/src/main/java/org/apache/flink/mesos/util/MesosConfiguration.java#L135-L163 |
123,361 | apache/flink | flink-core/src/main/java/org/apache/flink/util/ShutdownHookUtil.java | ShutdownHookUtil.addShutdownHook | public static Thread addShutdownHook(
final AutoCloseable service,
final String serviceName,
final Logger logger) {
checkNotNull(service);
checkNotNull(logger);
final Thread shutdownHook = new Thread(() -> {
try {
service.close();
} catch (Throwable t) {
logger.error("Error during shutdown o... | java | public static Thread addShutdownHook(
final AutoCloseable service,
final String serviceName,
final Logger logger) {
checkNotNull(service);
checkNotNull(logger);
final Thread shutdownHook = new Thread(() -> {
try {
service.close();
} catch (Throwable t) {
logger.error("Error during shutdown o... | [
"public",
"static",
"Thread",
"addShutdownHook",
"(",
"final",
"AutoCloseable",
"service",
",",
"final",
"String",
"serviceName",
",",
"final",
"Logger",
"logger",
")",
"{",
"checkNotNull",
"(",
"service",
")",
";",
"checkNotNull",
"(",
"logger",
")",
";",
"fi... | Adds a shutdown hook to the JVM and returns the Thread, which has been registered. | [
"Adds",
"a",
"shutdown",
"hook",
"to",
"the",
"JVM",
"and",
"returns",
"the",
"Thread",
"which",
"has",
"been",
"registered",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-core/src/main/java/org/apache/flink/util/ShutdownHookUtil.java#L33-L50 |
123,362 | apache/flink | flink-core/src/main/java/org/apache/flink/util/ShutdownHookUtil.java | ShutdownHookUtil.addShutdownHookThread | public static boolean addShutdownHookThread(
final Thread shutdownHook,
final String serviceName,
final Logger logger) {
checkNotNull(shutdownHook);
checkNotNull(logger);
try {
// Add JVM shutdown hook to call shutdown of service
Runtime.getRuntime().addShutdownHook(shutdownHook);
return true;
... | java | public static boolean addShutdownHookThread(
final Thread shutdownHook,
final String serviceName,
final Logger logger) {
checkNotNull(shutdownHook);
checkNotNull(logger);
try {
// Add JVM shutdown hook to call shutdown of service
Runtime.getRuntime().addShutdownHook(shutdownHook);
return true;
... | [
"public",
"static",
"boolean",
"addShutdownHookThread",
"(",
"final",
"Thread",
"shutdownHook",
",",
"final",
"String",
"serviceName",
",",
"final",
"Logger",
"logger",
")",
"{",
"checkNotNull",
"(",
"shutdownHook",
")",
";",
"checkNotNull",
"(",
"logger",
")",
... | Adds a shutdown hook to the JVM.
@param shutdownHook Shutdown hook to be registered.
@param serviceName The name of service.
@param logger The logger to log.
@return Whether the hook has been successfully registered. | [
"Adds",
"a",
"shutdown",
"hook",
"to",
"the",
"JVM",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-core/src/main/java/org/apache/flink/util/ShutdownHookUtil.java#L60-L78 |
123,363 | apache/flink | flink-core/src/main/java/org/apache/flink/util/ShutdownHookUtil.java | ShutdownHookUtil.removeShutdownHook | public static void removeShutdownHook(final Thread shutdownHook, final String serviceName, final Logger logger) {
// Do not run if this is invoked by the shutdown hook itself
if (shutdownHook == null || shutdownHook == Thread.currentThread()) {
return;
}
checkNotNull(logger);
try {
Runtime.getRuntime... | java | public static void removeShutdownHook(final Thread shutdownHook, final String serviceName, final Logger logger) {
// Do not run if this is invoked by the shutdown hook itself
if (shutdownHook == null || shutdownHook == Thread.currentThread()) {
return;
}
checkNotNull(logger);
try {
Runtime.getRuntime... | [
"public",
"static",
"void",
"removeShutdownHook",
"(",
"final",
"Thread",
"shutdownHook",
",",
"final",
"String",
"serviceName",
",",
"final",
"Logger",
"logger",
")",
"{",
"// Do not run if this is invoked by the shutdown hook itself",
"if",
"(",
"shutdownHook",
"==",
... | Removes a shutdown hook from the JVM. | [
"Removes",
"a",
"shutdown",
"hook",
"from",
"the",
"JVM",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-core/src/main/java/org/apache/flink/util/ShutdownHookUtil.java#L83-L100 |
123,364 | apache/flink | flink-runtime/src/main/java/org/apache/flink/runtime/taskexecutor/JobLeaderService.java | JobLeaderService.start | public void start(
final String initialOwnerAddress,
final RpcService initialRpcService,
final HighAvailabilityServices initialHighAvailabilityServices,
final JobLeaderListener initialJobLeaderListener) {
if (JobLeaderService.State.CREATED != state) {
throw new IllegalStateException("The service has a... | java | public void start(
final String initialOwnerAddress,
final RpcService initialRpcService,
final HighAvailabilityServices initialHighAvailabilityServices,
final JobLeaderListener initialJobLeaderListener) {
if (JobLeaderService.State.CREATED != state) {
throw new IllegalStateException("The service has a... | [
"public",
"void",
"start",
"(",
"final",
"String",
"initialOwnerAddress",
",",
"final",
"RpcService",
"initialRpcService",
",",
"final",
"HighAvailabilityServices",
"initialHighAvailabilityServices",
",",
"final",
"JobLeaderListener",
"initialJobLeaderListener",
")",
"{",
"... | Start the job leader service with the given services.
@param initialOwnerAddress to be used for establishing connections (source address)
@param initialRpcService to be used to create rpc connections
@param initialHighAvailabilityServices to create leader retrieval services for the different jobs
@param initialJobLead... | [
"Start",
"the",
"job",
"leader",
"service",
"with",
"the",
"given",
"services",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/taskexecutor/JobLeaderService.java#L116-L133 |
123,365 | apache/flink | flink-runtime/src/main/java/org/apache/flink/runtime/taskexecutor/JobLeaderService.java | JobLeaderService.stop | public void stop() throws Exception {
LOG.info("Stop job leader service.");
if (JobLeaderService.State.STARTED == state) {
for (Tuple2<LeaderRetrievalService, JobLeaderService.JobManagerLeaderListener> leaderRetrievalServiceEntry: jobLeaderServices.values()) {
LeaderRetrievalService leaderRetrievalService ... | java | public void stop() throws Exception {
LOG.info("Stop job leader service.");
if (JobLeaderService.State.STARTED == state) {
for (Tuple2<LeaderRetrievalService, JobLeaderService.JobManagerLeaderListener> leaderRetrievalServiceEntry: jobLeaderServices.values()) {
LeaderRetrievalService leaderRetrievalService ... | [
"public",
"void",
"stop",
"(",
")",
"throws",
"Exception",
"{",
"LOG",
".",
"info",
"(",
"\"Stop job leader service.\"",
")",
";",
"if",
"(",
"JobLeaderService",
".",
"State",
".",
"STARTED",
"==",
"state",
")",
"{",
"for",
"(",
"Tuple2",
"<",
"LeaderRetri... | Stop the job leader services. This implies stopping all leader retrieval services for the
different jobs and their leader retrieval listeners.
@throws Exception if an error occurs while stopping the service | [
"Stop",
"the",
"job",
"leader",
"services",
".",
"This",
"implies",
"stopping",
"all",
"leader",
"retrieval",
"services",
"for",
"the",
"different",
"jobs",
"and",
"their",
"leader",
"retrieval",
"listeners",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/taskexecutor/JobLeaderService.java#L141-L158 |
123,366 | apache/flink | flink-runtime/src/main/java/org/apache/flink/runtime/taskexecutor/JobLeaderService.java | JobLeaderService.removeJob | public void removeJob(JobID jobId) throws Exception {
Preconditions.checkState(JobLeaderService.State.STARTED == state, "The service is currently not running.");
Tuple2<LeaderRetrievalService, JobLeaderService.JobManagerLeaderListener> entry = jobLeaderServices.remove(jobId);
if (entry != null) {
LOG.info("R... | java | public void removeJob(JobID jobId) throws Exception {
Preconditions.checkState(JobLeaderService.State.STARTED == state, "The service is currently not running.");
Tuple2<LeaderRetrievalService, JobLeaderService.JobManagerLeaderListener> entry = jobLeaderServices.remove(jobId);
if (entry != null) {
LOG.info("R... | [
"public",
"void",
"removeJob",
"(",
"JobID",
"jobId",
")",
"throws",
"Exception",
"{",
"Preconditions",
".",
"checkState",
"(",
"JobLeaderService",
".",
"State",
".",
"STARTED",
"==",
"state",
",",
"\"The service is currently not running.\"",
")",
";",
"Tuple2",
"... | Remove the given job from being monitored by the job leader service.
@param jobId identifying the job to remove from monitoring
@throws Exception if an error occurred while stopping the leader retrieval service and listener | [
"Remove",
"the",
"given",
"job",
"from",
"being",
"monitored",
"by",
"the",
"job",
"leader",
"service",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/taskexecutor/JobLeaderService.java#L166-L180 |
123,367 | apache/flink | flink-runtime/src/main/java/org/apache/flink/runtime/taskexecutor/JobLeaderService.java | JobLeaderService.addJob | public void addJob(final JobID jobId, final String defaultTargetAddress) throws Exception {
Preconditions.checkState(JobLeaderService.State.STARTED == state, "The service is currently not running.");
LOG.info("Add job {} for job leader monitoring.", jobId);
final LeaderRetrievalService leaderRetrievalService = ... | java | public void addJob(final JobID jobId, final String defaultTargetAddress) throws Exception {
Preconditions.checkState(JobLeaderService.State.STARTED == state, "The service is currently not running.");
LOG.info("Add job {} for job leader monitoring.", jobId);
final LeaderRetrievalService leaderRetrievalService = ... | [
"public",
"void",
"addJob",
"(",
"final",
"JobID",
"jobId",
",",
"final",
"String",
"defaultTargetAddress",
")",
"throws",
"Exception",
"{",
"Preconditions",
".",
"checkState",
"(",
"JobLeaderService",
".",
"State",
".",
"STARTED",
"==",
"state",
",",
"\"The ser... | Add the given job to be monitored. This means that the service tries to detect leaders for
this job and then tries to establish a connection to it.
@param jobId identifying the job to monitor
@param defaultTargetAddress of the job leader
@throws Exception if an error occurs while starting the leader retrieval service | [
"Add",
"the",
"given",
"job",
"to",
"be",
"monitored",
".",
"This",
"means",
"that",
"the",
"service",
"tries",
"to",
"detect",
"leaders",
"for",
"this",
"job",
"and",
"then",
"tries",
"to",
"establish",
"a",
"connection",
"to",
"it",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/taskexecutor/JobLeaderService.java#L190-L209 |
123,368 | apache/flink | flink-runtime/src/main/java/org/apache/flink/runtime/taskexecutor/JobLeaderService.java | JobLeaderService.reconnect | public void reconnect(final JobID jobId) {
Preconditions.checkNotNull(jobId, "JobID must not be null.");
final Tuple2<LeaderRetrievalService, JobManagerLeaderListener> jobLeaderService = jobLeaderServices.get(jobId);
if (jobLeaderService != null) {
jobLeaderService.f1.reconnect();
} else {
LOG.info("Can... | java | public void reconnect(final JobID jobId) {
Preconditions.checkNotNull(jobId, "JobID must not be null.");
final Tuple2<LeaderRetrievalService, JobManagerLeaderListener> jobLeaderService = jobLeaderServices.get(jobId);
if (jobLeaderService != null) {
jobLeaderService.f1.reconnect();
} else {
LOG.info("Can... | [
"public",
"void",
"reconnect",
"(",
"final",
"JobID",
"jobId",
")",
"{",
"Preconditions",
".",
"checkNotNull",
"(",
"jobId",
",",
"\"JobID must not be null.\"",
")",
";",
"final",
"Tuple2",
"<",
"LeaderRetrievalService",
",",
"JobManagerLeaderListener",
">",
"jobLea... | Triggers reconnection to the last known leader of the given job.
@param jobId specifying the job for which to trigger reconnection | [
"Triggers",
"reconnection",
"to",
"the",
"last",
"known",
"leader",
"of",
"the",
"given",
"job",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/taskexecutor/JobLeaderService.java#L216-L226 |
123,369 | apache/flink | flink-runtime/src/main/java/org/apache/flink/runtime/taskexecutor/JobLeaderService.java | JobLeaderService.containsJob | @VisibleForTesting
public boolean containsJob(JobID jobId) {
Preconditions.checkState(JobLeaderService.State.STARTED == state, "The service is currently not running.");
return jobLeaderServices.containsKey(jobId);
} | java | @VisibleForTesting
public boolean containsJob(JobID jobId) {
Preconditions.checkState(JobLeaderService.State.STARTED == state, "The service is currently not running.");
return jobLeaderServices.containsKey(jobId);
} | [
"@",
"VisibleForTesting",
"public",
"boolean",
"containsJob",
"(",
"JobID",
"jobId",
")",
"{",
"Preconditions",
".",
"checkState",
"(",
"JobLeaderService",
".",
"State",
".",
"STARTED",
"==",
"state",
",",
"\"The service is currently not running.\"",
")",
";",
"retu... | Check whether the service monitors the given job.
@param jobId identifying the job
@return True if the given job is monitored; otherwise false | [
"Check",
"whether",
"the",
"service",
"monitors",
"the",
"given",
"job",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/taskexecutor/JobLeaderService.java#L462-L467 |
123,370 | apache/flink | flink-streaming-java/src/main/java/org/apache/flink/streaming/runtime/operators/GenericWriteAheadSink.java | GenericWriteAheadSink.saveHandleInState | private void saveHandleInState(final long checkpointId, final long timestamp) throws Exception {
//only add handle if a new OperatorState was created since the last snapshot
if (out != null) {
int subtaskIdx = getRuntimeContext().getIndexOfThisSubtask();
StreamStateHandle handle = out.closeAndGetHandle();
... | java | private void saveHandleInState(final long checkpointId, final long timestamp) throws Exception {
//only add handle if a new OperatorState was created since the last snapshot
if (out != null) {
int subtaskIdx = getRuntimeContext().getIndexOfThisSubtask();
StreamStateHandle handle = out.closeAndGetHandle();
... | [
"private",
"void",
"saveHandleInState",
"(",
"final",
"long",
"checkpointId",
",",
"final",
"long",
"timestamp",
")",
"throws",
"Exception",
"{",
"//only add handle if a new OperatorState was created since the last snapshot",
"if",
"(",
"out",
"!=",
"null",
")",
"{",
"i... | Called when a checkpoint barrier arrives. It closes any open streams to the backend
and marks them as pending for committing to the external, third-party storage system.
@param checkpointId the id of the latest received checkpoint.
@throws IOException in case something went wrong when handling the stream to the backen... | [
"Called",
"when",
"a",
"checkpoint",
"barrier",
"arrives",
".",
"It",
"closes",
"any",
"open",
"streams",
"to",
"the",
"backend",
"and",
"marks",
"them",
"as",
"pending",
"for",
"committing",
"to",
"the",
"external",
"third",
"-",
"party",
"storage",
"system... | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-streaming-java/src/main/java/org/apache/flink/streaming/runtime/operators/GenericWriteAheadSink.java#L136-L155 |
123,371 | apache/flink | flink-table/flink-table-common/src/main/java/org/apache/flink/table/descriptors/Statistics.java | Statistics.columnStats | public Statistics columnStats(String columnName, ColumnStats columnStats) {
Map<String, String> map = normalizeColumnStats(columnStats);
this.columnStats.put(columnName, map);
return this;
} | java | public Statistics columnStats(String columnName, ColumnStats columnStats) {
Map<String, String> map = normalizeColumnStats(columnStats);
this.columnStats.put(columnName, map);
return this;
} | [
"public",
"Statistics",
"columnStats",
"(",
"String",
"columnName",
",",
"ColumnStats",
"columnStats",
")",
"{",
"Map",
"<",
"String",
",",
"String",
">",
"map",
"=",
"normalizeColumnStats",
"(",
"columnStats",
")",
";",
"this",
".",
"columnStats",
".",
"put",... | Sets statistics for a column. Overwrites all existing statistics for this column.
@param columnName the column name
@param columnStats expected statistics for the column | [
"Sets",
"statistics",
"for",
"a",
"column",
".",
"Overwrites",
"all",
"existing",
"statistics",
"for",
"this",
"column",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-table/flink-table-common/src/main/java/org/apache/flink/table/descriptors/Statistics.java#L82-L86 |
123,372 | apache/flink | flink-table/flink-table-common/src/main/java/org/apache/flink/table/descriptors/Statistics.java | Statistics.columnDistinctCount | public Statistics columnDistinctCount(String columnName, Long ndv) {
this.columnStats
.computeIfAbsent(columnName, column -> new HashMap<>())
.put(DISTINCT_COUNT, String.valueOf(ndv));
return this;
} | java | public Statistics columnDistinctCount(String columnName, Long ndv) {
this.columnStats
.computeIfAbsent(columnName, column -> new HashMap<>())
.put(DISTINCT_COUNT, String.valueOf(ndv));
return this;
} | [
"public",
"Statistics",
"columnDistinctCount",
"(",
"String",
"columnName",
",",
"Long",
"ndv",
")",
"{",
"this",
".",
"columnStats",
".",
"computeIfAbsent",
"(",
"columnName",
",",
"column",
"->",
"new",
"HashMap",
"<>",
"(",
")",
")",
".",
"put",
"(",
"D... | Sets the number of distinct values statistic for the given column. | [
"Sets",
"the",
"number",
"of",
"distinct",
"values",
"statistic",
"for",
"the",
"given",
"column",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-table/flink-table-common/src/main/java/org/apache/flink/table/descriptors/Statistics.java#L91-L96 |
123,373 | apache/flink | flink-table/flink-table-common/src/main/java/org/apache/flink/table/descriptors/Statistics.java | Statistics.columnNullCount | public Statistics columnNullCount(String columnName, Long nullCount) {
this.columnStats
.computeIfAbsent(columnName, column -> new HashMap<>())
.put(NULL_COUNT, String.valueOf(nullCount));
return this;
} | java | public Statistics columnNullCount(String columnName, Long nullCount) {
this.columnStats
.computeIfAbsent(columnName, column -> new HashMap<>())
.put(NULL_COUNT, String.valueOf(nullCount));
return this;
} | [
"public",
"Statistics",
"columnNullCount",
"(",
"String",
"columnName",
",",
"Long",
"nullCount",
")",
"{",
"this",
".",
"columnStats",
".",
"computeIfAbsent",
"(",
"columnName",
",",
"column",
"->",
"new",
"HashMap",
"<>",
"(",
")",
")",
".",
"put",
"(",
... | Sets the number of null values statistic for the given column. | [
"Sets",
"the",
"number",
"of",
"null",
"values",
"statistic",
"for",
"the",
"given",
"column",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-table/flink-table-common/src/main/java/org/apache/flink/table/descriptors/Statistics.java#L101-L106 |
123,374 | apache/flink | flink-table/flink-table-common/src/main/java/org/apache/flink/table/descriptors/Statistics.java | Statistics.columnAvgLength | public Statistics columnAvgLength(String columnName, Double avgLen) {
this.columnStats
.computeIfAbsent(columnName, column -> new HashMap<>())
.put(AVG_LENGTH, String.valueOf(avgLen));
return this;
} | java | public Statistics columnAvgLength(String columnName, Double avgLen) {
this.columnStats
.computeIfAbsent(columnName, column -> new HashMap<>())
.put(AVG_LENGTH, String.valueOf(avgLen));
return this;
} | [
"public",
"Statistics",
"columnAvgLength",
"(",
"String",
"columnName",
",",
"Double",
"avgLen",
")",
"{",
"this",
".",
"columnStats",
".",
"computeIfAbsent",
"(",
"columnName",
",",
"column",
"->",
"new",
"HashMap",
"<>",
"(",
")",
")",
".",
"put",
"(",
"... | Sets the average length statistic for the given column. | [
"Sets",
"the",
"average",
"length",
"statistic",
"for",
"the",
"given",
"column",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-table/flink-table-common/src/main/java/org/apache/flink/table/descriptors/Statistics.java#L111-L116 |
123,375 | apache/flink | flink-table/flink-table-common/src/main/java/org/apache/flink/table/descriptors/Statistics.java | Statistics.columnMaxLength | public Statistics columnMaxLength(String columnName, Integer maxLen) {
this.columnStats
.computeIfAbsent(columnName, column -> new HashMap<>())
.put(MAX_LENGTH, String.valueOf(maxLen));
return this;
} | java | public Statistics columnMaxLength(String columnName, Integer maxLen) {
this.columnStats
.computeIfAbsent(columnName, column -> new HashMap<>())
.put(MAX_LENGTH, String.valueOf(maxLen));
return this;
} | [
"public",
"Statistics",
"columnMaxLength",
"(",
"String",
"columnName",
",",
"Integer",
"maxLen",
")",
"{",
"this",
".",
"columnStats",
".",
"computeIfAbsent",
"(",
"columnName",
",",
"column",
"->",
"new",
"HashMap",
"<>",
"(",
")",
")",
".",
"put",
"(",
... | Sets the maximum length statistic for the given column. | [
"Sets",
"the",
"maximum",
"length",
"statistic",
"for",
"the",
"given",
"column",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-table/flink-table-common/src/main/java/org/apache/flink/table/descriptors/Statistics.java#L121-L126 |
123,376 | apache/flink | flink-table/flink-table-common/src/main/java/org/apache/flink/table/descriptors/Statistics.java | Statistics.columnMaxValue | public Statistics columnMaxValue(String columnName, Number max) {
this.columnStats
.computeIfAbsent(columnName, column -> new HashMap<>())
.put(MAX_VALUE, String.valueOf(max));
return this;
} | java | public Statistics columnMaxValue(String columnName, Number max) {
this.columnStats
.computeIfAbsent(columnName, column -> new HashMap<>())
.put(MAX_VALUE, String.valueOf(max));
return this;
} | [
"public",
"Statistics",
"columnMaxValue",
"(",
"String",
"columnName",
",",
"Number",
"max",
")",
"{",
"this",
".",
"columnStats",
".",
"computeIfAbsent",
"(",
"columnName",
",",
"column",
"->",
"new",
"HashMap",
"<>",
"(",
")",
")",
".",
"put",
"(",
"MAX_... | Sets the maximum value statistic for the given column. | [
"Sets",
"the",
"maximum",
"value",
"statistic",
"for",
"the",
"given",
"column",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-table/flink-table-common/src/main/java/org/apache/flink/table/descriptors/Statistics.java#L131-L136 |
123,377 | apache/flink | flink-table/flink-table-common/src/main/java/org/apache/flink/table/descriptors/Statistics.java | Statistics.columnMinValue | public Statistics columnMinValue(String columnName, Number min) {
this.columnStats
.computeIfAbsent(columnName, column -> new HashMap<>())
.put(MIN_VALUE, String.valueOf(min));
return this;
} | java | public Statistics columnMinValue(String columnName, Number min) {
this.columnStats
.computeIfAbsent(columnName, column -> new HashMap<>())
.put(MIN_VALUE, String.valueOf(min));
return this;
} | [
"public",
"Statistics",
"columnMinValue",
"(",
"String",
"columnName",
",",
"Number",
"min",
")",
"{",
"this",
".",
"columnStats",
".",
"computeIfAbsent",
"(",
"columnName",
",",
"column",
"->",
"new",
"HashMap",
"<>",
"(",
")",
")",
".",
"put",
"(",
"MIN_... | Sets the minimum value statistic for the given column. | [
"Sets",
"the",
"minimum",
"value",
"statistic",
"for",
"the",
"given",
"column",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-table/flink-table-common/src/main/java/org/apache/flink/table/descriptors/Statistics.java#L141-L146 |
123,378 | apache/flink | flink-state-backends/flink-statebackend-rocksdb/src/main/java/org/apache/flink/contrib/streaming/state/RocksDBCachingPriorityQueueSet.java | RocksDBCachingPriorityQueueSet.size | @Override
public int size() {
if (allElementsInCache) {
return orderedCache.size();
} else {
int count = 0;
try (final RocksBytesIterator iterator = orderedBytesIterator()) {
while (iterator.hasNext()) {
iterator.next();
++count;
}
}
return count;
}
} | java | @Override
public int size() {
if (allElementsInCache) {
return orderedCache.size();
} else {
int count = 0;
try (final RocksBytesIterator iterator = orderedBytesIterator()) {
while (iterator.hasNext()) {
iterator.next();
++count;
}
}
return count;
}
} | [
"@",
"Override",
"public",
"int",
"size",
"(",
")",
"{",
"if",
"(",
"allElementsInCache",
")",
"{",
"return",
"orderedCache",
".",
"size",
"(",
")",
";",
"}",
"else",
"{",
"int",
"count",
"=",
"0",
";",
"try",
"(",
"final",
"RocksBytesIterator",
"itera... | This implementation comes at a relatively high cost per invocation. It should not be called repeatedly when it is
clear that the value did not change. Currently this is only truly used to realize certain higher-level tests. | [
"This",
"implementation",
"comes",
"at",
"a",
"relatively",
"high",
"cost",
"per",
"invocation",
".",
"It",
"should",
"not",
"be",
"called",
"repeatedly",
"when",
"it",
"is",
"clear",
"that",
"the",
"value",
"did",
"not",
"change",
".",
"Currently",
"this",
... | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-state-backends/flink-statebackend-rocksdb/src/main/java/org/apache/flink/contrib/streaming/state/RocksDBCachingPriorityQueueSet.java#L275-L290 |
123,379 | apache/flink | flink-runtime/src/main/java/org/apache/flink/runtime/executiongraph/failover/RestartPipelinedRegionStrategy.java | RestartPipelinedRegionStrategy.generateAllFailoverRegion | private void generateAllFailoverRegion(List<ExecutionJobVertex> newJobVerticesTopological) {
final IdentityHashMap<ExecutionVertex, ArrayList<ExecutionVertex>> vertexToRegion = new IdentityHashMap<>();
// we use the map (list -> null) to imitate an IdentityHashSet (which does not exist)
final IdentityHashMap<Arr... | java | private void generateAllFailoverRegion(List<ExecutionJobVertex> newJobVerticesTopological) {
final IdentityHashMap<ExecutionVertex, ArrayList<ExecutionVertex>> vertexToRegion = new IdentityHashMap<>();
// we use the map (list -> null) to imitate an IdentityHashSet (which does not exist)
final IdentityHashMap<Arr... | [
"private",
"void",
"generateAllFailoverRegion",
"(",
"List",
"<",
"ExecutionJobVertex",
">",
"newJobVerticesTopological",
")",
"{",
"final",
"IdentityHashMap",
"<",
"ExecutionVertex",
",",
"ArrayList",
"<",
"ExecutionVertex",
">",
">",
"vertexToRegion",
"=",
"new",
"I... | Generate all the FailoverRegion from the new added job vertexes | [
"Generate",
"all",
"the",
"FailoverRegion",
"from",
"the",
"new",
"added",
"job",
"vertexes"
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/executiongraph/failover/RestartPipelinedRegionStrategy.java#L107-L203 |
123,380 | apache/flink | flink-table/flink-table-runtime-blink/src/main/java/org/apache/flink/table/dataformat/BinaryArrayWriter.java | BinaryArrayWriter.reset | @Override
public void reset() {
this.cursor = fixedSize;
for (int i = 0; i < nullBitsSizeInBytes; i += 8) {
segment.putLong(i, 0L);
}
this.segment.putInt(0, numElements);
} | java | @Override
public void reset() {
this.cursor = fixedSize;
for (int i = 0; i < nullBitsSizeInBytes; i += 8) {
segment.putLong(i, 0L);
}
this.segment.putInt(0, numElements);
} | [
"@",
"Override",
"public",
"void",
"reset",
"(",
")",
"{",
"this",
".",
"cursor",
"=",
"fixedSize",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"nullBitsSizeInBytes",
";",
"i",
"+=",
"8",
")",
"{",
"segment",
".",
"putLong",
"(",
"i",
"... | First, reset. | [
"First",
"reset",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-table/flink-table-runtime-blink/src/main/java/org/apache/flink/table/dataformat/BinaryArrayWriter.java#L50-L57 |
123,381 | apache/flink | flink-runtime/src/main/java/org/apache/flink/runtime/net/ConnectionUtils.java | ConnectionUtils.findConnectingAddress | public static InetAddress findConnectingAddress(InetSocketAddress targetAddress,
long maxWaitMillis, long startLoggingAfter) throws IOException {
if (targetAddress == null) {
throw new NullPointerException("targetAddress must not be null");
}
if (maxWaitMillis <= 0) {
throw new IllegalArgumentExcepti... | java | public static InetAddress findConnectingAddress(InetSocketAddress targetAddress,
long maxWaitMillis, long startLoggingAfter) throws IOException {
if (targetAddress == null) {
throw new NullPointerException("targetAddress must not be null");
}
if (maxWaitMillis <= 0) {
throw new IllegalArgumentExcepti... | [
"public",
"static",
"InetAddress",
"findConnectingAddress",
"(",
"InetSocketAddress",
"targetAddress",
",",
"long",
"maxWaitMillis",
",",
"long",
"startLoggingAfter",
")",
"throws",
"IOException",
"{",
"if",
"(",
"targetAddress",
"==",
"null",
")",
"{",
"throw",
"ne... | Finds the local network address from which this machine can connect to the target
address. This method tries to establish a proper network connection to the
given target, so it only succeeds if the target socket address actually accepts
connections. The method tries various strategies multiple times and uses an exponen... | [
"Finds",
"the",
"local",
"network",
"address",
"from",
"which",
"this",
"machine",
"can",
"connect",
"to",
"the",
"target",
"address",
".",
"This",
"method",
"tries",
"to",
"establish",
"a",
"proper",
"network",
"connection",
"to",
"the",
"given",
"target",
... | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/net/ConnectionUtils.java#L105-L175 |
123,382 | apache/flink | flink-runtime/src/main/java/org/apache/flink/runtime/net/ConnectionUtils.java | ConnectionUtils.findAddressUsingStrategy | private static InetAddress findAddressUsingStrategy(AddressDetectionState strategy,
InetSocketAddress targetAddress,
boolean logging) throws IOException {
// try LOCAL_HOST strategy independent of the network interfaces
if (strategy == AddressDetectionState.LOCAL_HOST) {
InetAddress l... | java | private static InetAddress findAddressUsingStrategy(AddressDetectionState strategy,
InetSocketAddress targetAddress,
boolean logging) throws IOException {
// try LOCAL_HOST strategy independent of the network interfaces
if (strategy == AddressDetectionState.LOCAL_HOST) {
InetAddress l... | [
"private",
"static",
"InetAddress",
"findAddressUsingStrategy",
"(",
"AddressDetectionState",
"strategy",
",",
"InetSocketAddress",
"targetAddress",
",",
"boolean",
"logging",
")",
"throws",
"IOException",
"{",
"// try LOCAL_HOST strategy independent of the network interfaces",
"... | Try to find a local address which allows as to connect to the targetAddress using the given
strategy.
@param strategy Depending on the strategy, the method will enumerate all interfaces, trying to connect
to the target address
@param targetAddress The address we try to connect to
@param logging Boolean indicating the ... | [
"Try",
"to",
"find",
"a",
"local",
"address",
"which",
"allows",
"as",
"to",
"connect",
"to",
"the",
"targetAddress",
"using",
"the",
"given",
"strategy",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/net/ConnectionUtils.java#L219-L294 |
123,383 | apache/flink | flink-streaming-java/src/main/java/org/apache/flink/streaming/runtime/io/BufferSpiller.java | BufferSpiller.add | @Override
public void add(BufferOrEvent boe) throws IOException {
try {
ByteBuffer contents;
if (boe.isBuffer()) {
Buffer buf = boe.getBuffer();
contents = buf.getNioBufferReadable();
}
else {
contents = EventSerializer.toSerializedEvent(boe.getEvent());
}
headBuffer.clear();
headBu... | java | @Override
public void add(BufferOrEvent boe) throws IOException {
try {
ByteBuffer contents;
if (boe.isBuffer()) {
Buffer buf = boe.getBuffer();
contents = buf.getNioBufferReadable();
}
else {
contents = EventSerializer.toSerializedEvent(boe.getEvent());
}
headBuffer.clear();
headBu... | [
"@",
"Override",
"public",
"void",
"add",
"(",
"BufferOrEvent",
"boe",
")",
"throws",
"IOException",
"{",
"try",
"{",
"ByteBuffer",
"contents",
";",
"if",
"(",
"boe",
".",
"isBuffer",
"(",
")",
")",
"{",
"Buffer",
"buf",
"=",
"boe",
".",
"getBuffer",
"... | Adds a buffer or event to the sequence of spilled buffers and events.
@param boe The buffer or event to add and spill.
@throws IOException Thrown, if the buffer of event could not be spilled. | [
"Adds",
"a",
"buffer",
"or",
"event",
"to",
"the",
"sequence",
"of",
"spilled",
"buffers",
"and",
"events",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-streaming-java/src/main/java/org/apache/flink/streaming/runtime/io/BufferSpiller.java#L127-L155 |
123,384 | apache/flink | flink-table/flink-table-planner-blink/src/main/java/org/apache/flink/table/plan/util/KeySelectorUtil.java | KeySelectorUtil.getBaseRowSelector | public static BaseRowKeySelector getBaseRowSelector(int[] keyFields, BaseRowTypeInfo rowType) {
if (keyFields.length > 0) {
InternalType[] inputFieldTypes = rowType.getInternalTypes();
String[] inputFieldNames = rowType.getFieldNames();
InternalType[] keyFieldTypes = new InternalType[keyFields.length];
St... | java | public static BaseRowKeySelector getBaseRowSelector(int[] keyFields, BaseRowTypeInfo rowType) {
if (keyFields.length > 0) {
InternalType[] inputFieldTypes = rowType.getInternalTypes();
String[] inputFieldNames = rowType.getFieldNames();
InternalType[] keyFieldTypes = new InternalType[keyFields.length];
St... | [
"public",
"static",
"BaseRowKeySelector",
"getBaseRowSelector",
"(",
"int",
"[",
"]",
"keyFields",
",",
"BaseRowTypeInfo",
"rowType",
")",
"{",
"if",
"(",
"keyFields",
".",
"length",
">",
"0",
")",
"{",
"InternalType",
"[",
"]",
"inputFieldTypes",
"=",
"rowTyp... | Create a BaseRowKeySelector to extract keys from DataStream which type is BaseRowTypeInfo.
@param keyFields key fields
@param rowType type of DataStream to extract keys
@return the BaseRowKeySelector to extract keys from DataStream which type is BaseRowTypeInfo. | [
"Create",
"a",
"BaseRowKeySelector",
"to",
"extract",
"keys",
"from",
"DataStream",
"which",
"type",
"is",
"BaseRowTypeInfo",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-table/flink-table-planner-blink/src/main/java/org/apache/flink/table/plan/util/KeySelectorUtil.java#L45-L69 |
123,385 | apache/flink | flink-runtime/src/main/java/org/apache/flink/runtime/operators/resettable/AbstractBlockResettableIterator.java | AbstractBlockResettableIterator.close | public void close() {
synchronized (this) {
if (this.closed) {
return;
}
this.closed = true;
}
this.numRecordsInBuffer = 0;
this.numRecordsReturned = 0;
// add the full segments to the empty ones
for (int i = this.fullSegments.size() - 1; i >= 0; i--) {
this.emptySegments.add(this.full... | java | public void close() {
synchronized (this) {
if (this.closed) {
return;
}
this.closed = true;
}
this.numRecordsInBuffer = 0;
this.numRecordsReturned = 0;
// add the full segments to the empty ones
for (int i = this.fullSegments.size() - 1; i >= 0; i--) {
this.emptySegments.add(this.full... | [
"public",
"void",
"close",
"(",
")",
"{",
"synchronized",
"(",
"this",
")",
"{",
"if",
"(",
"this",
".",
"closed",
")",
"{",
"return",
";",
"}",
"this",
".",
"closed",
"=",
"true",
";",
"}",
"this",
".",
"numRecordsInBuffer",
"=",
"0",
";",
"this",... | This method closes the iterator and releases all resources. This method works both as a regular
shutdown and as a canceling method. The method may be called multiple times and will not produce
an error. | [
"This",
"method",
"closes",
"the",
"iterator",
"and",
"releases",
"all",
"resources",
".",
"This",
"method",
"works",
"both",
"as",
"a",
"regular",
"shutdown",
"and",
"as",
"a",
"canceling",
"method",
".",
"The",
"method",
"may",
"be",
"called",
"multiple",
... | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/operators/resettable/AbstractBlockResettableIterator.java#L131-L154 |
123,386 | apache/flink | flink-streaming-java/src/main/java/org/apache/flink/streaming/api/functions/source/ContinuousFileMonitoringFunction.java | ContinuousFileMonitoringFunction.listEligibleFiles | private Map<Path, FileStatus> listEligibleFiles(FileSystem fileSystem, Path path) throws IOException {
final FileStatus[] statuses;
try {
statuses = fileSystem.listStatus(path);
} catch (IOException e) {
// we may run into an IOException if files are moved while listing their status
// delay the check f... | java | private Map<Path, FileStatus> listEligibleFiles(FileSystem fileSystem, Path path) throws IOException {
final FileStatus[] statuses;
try {
statuses = fileSystem.listStatus(path);
} catch (IOException e) {
// we may run into an IOException if files are moved while listing their status
// delay the check f... | [
"private",
"Map",
"<",
"Path",
",",
"FileStatus",
">",
"listEligibleFiles",
"(",
"FileSystem",
"fileSystem",
",",
"Path",
"path",
")",
"throws",
"IOException",
"{",
"final",
"FileStatus",
"[",
"]",
"statuses",
";",
"try",
"{",
"statuses",
"=",
"fileSystem",
... | Returns the paths of the files not yet processed.
@param fileSystem The filesystem where the monitored directory resides. | [
"Returns",
"the",
"paths",
"of",
"the",
"files",
"not",
"yet",
"processed",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-streaming-java/src/main/java/org/apache/flink/streaming/api/functions/source/ContinuousFileMonitoringFunction.java#L291-L321 |
123,387 | apache/flink | flink-table/flink-table-runtime-blink/src/main/java/org/apache/flink/table/runtime/window/assigners/SessionWindowAssigner.java | SessionWindowAssigner.mergeWindow | private TimeWindow mergeWindow(TimeWindow curWindow, TimeWindow other, Collection<TimeWindow> mergedWindow) {
if (curWindow.intersects(other)) {
mergedWindow.add(other);
return curWindow.cover(other);
} else {
return curWindow;
}
} | java | private TimeWindow mergeWindow(TimeWindow curWindow, TimeWindow other, Collection<TimeWindow> mergedWindow) {
if (curWindow.intersects(other)) {
mergedWindow.add(other);
return curWindow.cover(other);
} else {
return curWindow;
}
} | [
"private",
"TimeWindow",
"mergeWindow",
"(",
"TimeWindow",
"curWindow",
",",
"TimeWindow",
"other",
",",
"Collection",
"<",
"TimeWindow",
">",
"mergedWindow",
")",
"{",
"if",
"(",
"curWindow",
".",
"intersects",
"(",
"other",
")",
")",
"{",
"mergedWindow",
"."... | Merge curWindow and other, return a new window which covers curWindow and other
if they are overlapped. Otherwise, returns the curWindow itself. | [
"Merge",
"curWindow",
"and",
"other",
"return",
"a",
"new",
"window",
"which",
"covers",
"curWindow",
"and",
"other",
"if",
"they",
"are",
"overlapped",
".",
"Otherwise",
"returns",
"the",
"curWindow",
"itself",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-table/flink-table-runtime-blink/src/main/java/org/apache/flink/table/runtime/window/assigners/SessionWindowAssigner.java#L81-L88 |
123,388 | apache/flink | flink-clients/src/main/java/org/apache/flink/client/cli/AbstractCustomCommandLine.java | AbstractCustomCommandLine.applyCommandLineOptionsToConfiguration | protected Configuration applyCommandLineOptionsToConfiguration(CommandLine commandLine) throws FlinkException {
final Configuration resultingConfiguration = new Configuration(configuration);
if (commandLine.hasOption(addressOption.getOpt())) {
String addressWithPort = commandLine.getOptionValue(addressOption.ge... | java | protected Configuration applyCommandLineOptionsToConfiguration(CommandLine commandLine) throws FlinkException {
final Configuration resultingConfiguration = new Configuration(configuration);
if (commandLine.hasOption(addressOption.getOpt())) {
String addressWithPort = commandLine.getOptionValue(addressOption.ge... | [
"protected",
"Configuration",
"applyCommandLineOptionsToConfiguration",
"(",
"CommandLine",
"commandLine",
")",
"throws",
"FlinkException",
"{",
"final",
"Configuration",
"resultingConfiguration",
"=",
"new",
"Configuration",
"(",
"configuration",
")",
";",
"if",
"(",
"co... | Override configuration settings by specified command line options.
@param commandLine containing the overriding values
@return Effective configuration with the overridden configuration settings | [
"Override",
"configuration",
"settings",
"by",
"specified",
"command",
"line",
"options",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-clients/src/main/java/org/apache/flink/client/cli/AbstractCustomCommandLine.java#L78-L93 |
123,389 | apache/flink | flink-state-backends/flink-statebackend-rocksdb/src/main/java/org/apache/flink/contrib/streaming/state/DefaultConfigurableOptionsFactory.java | DefaultConfigurableOptionsFactory.getInternal | private String getInternal(String key) {
Preconditions.checkArgument(configuredOptions.containsKey(key),
"The configuration " + key + " has not been configured.");
return configuredOptions.get(key);
} | java | private String getInternal(String key) {
Preconditions.checkArgument(configuredOptions.containsKey(key),
"The configuration " + key + " has not been configured.");
return configuredOptions.get(key);
} | [
"private",
"String",
"getInternal",
"(",
"String",
"key",
")",
"{",
"Preconditions",
".",
"checkArgument",
"(",
"configuredOptions",
".",
"containsKey",
"(",
"key",
")",
",",
"\"The configuration \"",
"+",
"key",
"+",
"\" has not been configured.\"",
")",
";",
"re... | Returns the value in string format with the given key.
@param key The configuration-key to query in string format. | [
"Returns",
"the",
"value",
"in",
"string",
"format",
"with",
"the",
"given",
"key",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-state-backends/flink-statebackend-rocksdb/src/main/java/org/apache/flink/contrib/streaming/state/DefaultConfigurableOptionsFactory.java#L419-L424 |
123,390 | apache/flink | flink-runtime/src/main/java/org/apache/flink/runtime/io/network/partition/consumer/InputChannel.java | InputChannel.increaseBackoff | protected boolean increaseBackoff() {
// Backoff is disabled
if (currentBackoff < 0) {
return false;
}
// This is the first time backing off
if (currentBackoff == 0) {
currentBackoff = initialBackoff;
return true;
}
// Continue backing off
else if (currentBackoff < maxBackoff) {
currentBa... | java | protected boolean increaseBackoff() {
// Backoff is disabled
if (currentBackoff < 0) {
return false;
}
// This is the first time backing off
if (currentBackoff == 0) {
currentBackoff = initialBackoff;
return true;
}
// Continue backing off
else if (currentBackoff < maxBackoff) {
currentBa... | [
"protected",
"boolean",
"increaseBackoff",
"(",
")",
"{",
"// Backoff is disabled",
"if",
"(",
"currentBackoff",
"<",
"0",
")",
"{",
"return",
"false",
";",
"}",
"// This is the first time backing off",
"if",
"(",
"currentBackoff",
"==",
"0",
")",
"{",
"currentBac... | Increases the current backoff and returns whether the operation was successful.
@return <code>true</code>, iff the operation was successful. Otherwise, <code>false</code>. | [
"Increases",
"the",
"current",
"backoff",
"and",
"returns",
"whether",
"the",
"operation",
"was",
"successful",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/io/network/partition/consumer/InputChannel.java#L223-L245 |
123,391 | apache/flink | flink-core/src/main/java/org/apache/flink/types/parser/FieldParser.java | FieldParser.resetErrorStateAndParse | public int resetErrorStateAndParse(byte[] bytes, int startPos, int limit, byte[] delim, T reuse) {
resetParserState();
return parseField(bytes, startPos, limit, delim, reuse);
} | java | public int resetErrorStateAndParse(byte[] bytes, int startPos, int limit, byte[] delim, T reuse) {
resetParserState();
return parseField(bytes, startPos, limit, delim, reuse);
} | [
"public",
"int",
"resetErrorStateAndParse",
"(",
"byte",
"[",
"]",
"bytes",
",",
"int",
"startPos",
",",
"int",
"limit",
",",
"byte",
"[",
"]",
"delim",
",",
"T",
"reuse",
")",
"{",
"resetParserState",
"(",
")",
";",
"return",
"parseField",
"(",
"bytes",... | Parses the value of a field from the byte array, taking care of properly reset
the state of this parser.
The start position within the byte array and the array's valid length is given.
The content of the value is delimited by a field delimiter.
@param bytes The byte array that holds the value.
@param startPos The inde... | [
"Parses",
"the",
"value",
"of",
"a",
"field",
"from",
"the",
"byte",
"array",
"taking",
"care",
"of",
"properly",
"reset",
"the",
"state",
"of",
"this",
"parser",
".",
"The",
"start",
"position",
"within",
"the",
"byte",
"array",
"and",
"the",
"array",
"... | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-core/src/main/java/org/apache/flink/types/parser/FieldParser.java#L102-L105 |
123,392 | apache/flink | flink-core/src/main/java/org/apache/flink/types/parser/FieldParser.java | FieldParser.delimiterNext | public static final boolean delimiterNext(byte[] bytes, int startPos, byte[] delim) {
for(int pos = 0; pos < delim.length; pos++) {
// check each position
if(delim[pos] != bytes[startPos+pos]) {
return false;
}
}
return true;
} | java | public static final boolean delimiterNext(byte[] bytes, int startPos, byte[] delim) {
for(int pos = 0; pos < delim.length; pos++) {
// check each position
if(delim[pos] != bytes[startPos+pos]) {
return false;
}
}
return true;
} | [
"public",
"static",
"final",
"boolean",
"delimiterNext",
"(",
"byte",
"[",
"]",
"bytes",
",",
"int",
"startPos",
",",
"byte",
"[",
"]",
"delim",
")",
"{",
"for",
"(",
"int",
"pos",
"=",
"0",
";",
"pos",
"<",
"delim",
".",
"length",
";",
"pos",
"++"... | Checks if the delimiter starts at the given start position of the byte array.
Attention: This method assumes that enough characters follow the start position for the delimiter check!
@param bytes The byte array that holds the value.
@param startPos The index of the byte array where the check for the delimiter starts.... | [
"Checks",
"if",
"the",
"delimiter",
"starts",
"at",
"the",
"given",
"start",
"position",
"of",
"the",
"byte",
"array",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-core/src/main/java/org/apache/flink/types/parser/FieldParser.java#L148-L158 |
123,393 | apache/flink | flink-core/src/main/java/org/apache/flink/types/parser/FieldParser.java | FieldParser.endsWithDelimiter | public static final boolean endsWithDelimiter(byte[] bytes, int endPos, byte[] delim) {
if (endPos < delim.length - 1) {
return false;
}
for (int pos = 0; pos < delim.length; ++pos) {
if (delim[pos] != bytes[endPos - delim.length + 1 + pos]) {
return false;
}
}
return true;
} | java | public static final boolean endsWithDelimiter(byte[] bytes, int endPos, byte[] delim) {
if (endPos < delim.length - 1) {
return false;
}
for (int pos = 0; pos < delim.length; ++pos) {
if (delim[pos] != bytes[endPos - delim.length + 1 + pos]) {
return false;
}
}
return true;
} | [
"public",
"static",
"final",
"boolean",
"endsWithDelimiter",
"(",
"byte",
"[",
"]",
"bytes",
",",
"int",
"endPos",
",",
"byte",
"[",
"]",
"delim",
")",
"{",
"if",
"(",
"endPos",
"<",
"delim",
".",
"length",
"-",
"1",
")",
"{",
"return",
"false",
";",... | Checks if the given bytes ends with the delimiter at the given end position.
@param bytes The byte array that holds the value.
@param endPos The index of the byte array where the check for the delimiter ends.
@param delim The delimiter to check for.
@return true if a delimiter ends at the given end position, false ... | [
"Checks",
"if",
"the",
"given",
"bytes",
"ends",
"with",
"the",
"delimiter",
"at",
"the",
"given",
"end",
"position",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-core/src/main/java/org/apache/flink/types/parser/FieldParser.java#L169-L179 |
123,394 | apache/flink | flink-core/src/main/java/org/apache/flink/types/parser/FieldParser.java | FieldParser.nextStringEndPos | protected final int nextStringEndPos(byte[] bytes, int startPos, int limit, byte[] delimiter) {
int endPos = startPos;
final int delimLimit = limit - delimiter.length + 1;
while (endPos < limit) {
if (endPos < delimLimit && delimiterNext(bytes, endPos, delimiter)) {
break;
}
endPos++;
}
if (en... | java | protected final int nextStringEndPos(byte[] bytes, int startPos, int limit, byte[] delimiter) {
int endPos = startPos;
final int delimLimit = limit - delimiter.length + 1;
while (endPos < limit) {
if (endPos < delimLimit && delimiterNext(bytes, endPos, delimiter)) {
break;
}
endPos++;
}
if (en... | [
"protected",
"final",
"int",
"nextStringEndPos",
"(",
"byte",
"[",
"]",
"bytes",
",",
"int",
"startPos",
",",
"int",
"limit",
",",
"byte",
"[",
"]",
"delimiter",
")",
"{",
"int",
"endPos",
"=",
"startPos",
";",
"final",
"int",
"delimLimit",
"=",
"limit",... | Returns the end position of a string. Sets the error state if the column is empty.
@return the end position of the string or -1 if an error occurred | [
"Returns",
"the",
"end",
"position",
"of",
"a",
"string",
".",
"Sets",
"the",
"error",
"state",
"if",
"the",
"column",
"is",
"empty",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-core/src/main/java/org/apache/flink/types/parser/FieldParser.java#L206-L223 |
123,395 | apache/flink | flink-core/src/main/java/org/apache/flink/types/parser/FieldParser.java | FieldParser.nextStringLength | protected static final int nextStringLength(byte[] bytes, int startPos, int length, char delimiter) {
if (length <= 0) {
throw new IllegalArgumentException("Invalid input: Empty string");
}
int limitedLength = 0;
final byte delByte = (byte) delimiter;
while (limitedLength < length && bytes[startPos + limi... | java | protected static final int nextStringLength(byte[] bytes, int startPos, int length, char delimiter) {
if (length <= 0) {
throw new IllegalArgumentException("Invalid input: Empty string");
}
int limitedLength = 0;
final byte delByte = (byte) delimiter;
while (limitedLength < length && bytes[startPos + limi... | [
"protected",
"static",
"final",
"int",
"nextStringLength",
"(",
"byte",
"[",
"]",
"bytes",
",",
"int",
"startPos",
",",
"int",
"length",
",",
"char",
"delimiter",
")",
"{",
"if",
"(",
"length",
"<=",
"0",
")",
"{",
"throw",
"new",
"IllegalArgumentException... | Returns the length of a string. Throws an exception if the column is empty.
@return the length of the string | [
"Returns",
"the",
"length",
"of",
"a",
"string",
".",
"Throws",
"an",
"exception",
"if",
"the",
"column",
"is",
"empty",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-core/src/main/java/org/apache/flink/types/parser/FieldParser.java#L230-L242 |
123,396 | apache/flink | flink-core/src/main/java/org/apache/flink/types/parser/FieldParser.java | FieldParser.getParserForType | public static <T> Class<FieldParser<T>> getParserForType(Class<T> type) {
Class<? extends FieldParser<?>> parser = PARSERS.get(type);
if (parser == null) {
return null;
} else {
@SuppressWarnings("unchecked")
Class<FieldParser<T>> typedParser = (Class<FieldParser<T>>) parser;
return typedParser;
}
... | java | public static <T> Class<FieldParser<T>> getParserForType(Class<T> type) {
Class<? extends FieldParser<?>> parser = PARSERS.get(type);
if (parser == null) {
return null;
} else {
@SuppressWarnings("unchecked")
Class<FieldParser<T>> typedParser = (Class<FieldParser<T>>) parser;
return typedParser;
}
... | [
"public",
"static",
"<",
"T",
">",
"Class",
"<",
"FieldParser",
"<",
"T",
">",
">",
"getParserForType",
"(",
"Class",
"<",
"T",
">",
"type",
")",
"{",
"Class",
"<",
"?",
"extends",
"FieldParser",
"<",
"?",
">",
">",
"parser",
"=",
"PARSERS",
".",
"... | Gets the parser for the type specified by the given class. Returns null, if no parser for that class
is known.
@param type The class of the type to get the parser for.
@return The parser for the given type, or null, if no such parser exists. | [
"Gets",
"the",
"parser",
"for",
"the",
"type",
"specified",
"by",
"the",
"given",
"class",
".",
"Returns",
"null",
"if",
"no",
"parser",
"for",
"that",
"class",
"is",
"known",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-core/src/main/java/org/apache/flink/types/parser/FieldParser.java#L273-L282 |
123,397 | apache/flink | flink-runtime/src/main/java/org/apache/flink/runtime/state/KeyGroupPartitioner.java | KeyGroupPartitioner.reportAllElementKeyGroups | protected void reportAllElementKeyGroups() {
Preconditions.checkState(partitioningSource.length >= numberOfElements);
for (int i = 0; i < numberOfElements; ++i) {
int keyGroup = KeyGroupRangeAssignment.assignToKeyGroup(
keyExtractorFunction.extractKeyFromElement(partitioningSource[i]), totalKeyGroups);
... | java | protected void reportAllElementKeyGroups() {
Preconditions.checkState(partitioningSource.length >= numberOfElements);
for (int i = 0; i < numberOfElements; ++i) {
int keyGroup = KeyGroupRangeAssignment.assignToKeyGroup(
keyExtractorFunction.extractKeyFromElement(partitioningSource[i]), totalKeyGroups);
... | [
"protected",
"void",
"reportAllElementKeyGroups",
"(",
")",
"{",
"Preconditions",
".",
"checkState",
"(",
"partitioningSource",
".",
"length",
">=",
"numberOfElements",
")",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"numberOfElements",
";",
"++",
... | This method iterates over the input data and reports the key-group for each element. | [
"This",
"method",
"iterates",
"over",
"the",
"input",
"data",
"and",
"reports",
"the",
"key",
"-",
"group",
"for",
"each",
"element",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/state/KeyGroupPartitioner.java#L147-L156 |
123,398 | apache/flink | flink-runtime/src/main/java/org/apache/flink/runtime/state/KeyGroupPartitioner.java | KeyGroupPartitioner.reportKeyGroupOfElementAtIndex | protected void reportKeyGroupOfElementAtIndex(int index, int keyGroup) {
final int keyGroupIndex = keyGroup - firstKeyGroup;
elementKeyGroups[index] = keyGroupIndex;
++counterHistogram[keyGroupIndex];
} | java | protected void reportKeyGroupOfElementAtIndex(int index, int keyGroup) {
final int keyGroupIndex = keyGroup - firstKeyGroup;
elementKeyGroups[index] = keyGroupIndex;
++counterHistogram[keyGroupIndex];
} | [
"protected",
"void",
"reportKeyGroupOfElementAtIndex",
"(",
"int",
"index",
",",
"int",
"keyGroup",
")",
"{",
"final",
"int",
"keyGroupIndex",
"=",
"keyGroup",
"-",
"firstKeyGroup",
";",
"elementKeyGroups",
"[",
"index",
"]",
"=",
"keyGroupIndex",
";",
"++",
"co... | This method reports in the bookkeeping data that the element at the given index belongs to the given key-group. | [
"This",
"method",
"reports",
"in",
"the",
"bookkeeping",
"data",
"that",
"the",
"element",
"at",
"the",
"given",
"index",
"belongs",
"to",
"the",
"given",
"key",
"-",
"group",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/state/KeyGroupPartitioner.java#L161-L165 |
123,399 | apache/flink | flink-core/src/main/java/org/apache/flink/api/common/io/ratelimiting/GuavaFlinkConnectorRateLimiter.java | GuavaFlinkConnectorRateLimiter.open | @Override
public void open(RuntimeContext runtimeContext) {
this.runtimeContext = runtimeContext;
localRateBytesPerSecond = globalRateBytesPerSecond / runtimeContext.getNumberOfParallelSubtasks();
this.rateLimiter = RateLimiter.create(localRateBytesPerSecond);
} | java | @Override
public void open(RuntimeContext runtimeContext) {
this.runtimeContext = runtimeContext;
localRateBytesPerSecond = globalRateBytesPerSecond / runtimeContext.getNumberOfParallelSubtasks();
this.rateLimiter = RateLimiter.create(localRateBytesPerSecond);
} | [
"@",
"Override",
"public",
"void",
"open",
"(",
"RuntimeContext",
"runtimeContext",
")",
"{",
"this",
".",
"runtimeContext",
"=",
"runtimeContext",
";",
"localRateBytesPerSecond",
"=",
"globalRateBytesPerSecond",
"/",
"runtimeContext",
".",
"getNumberOfParallelSubtasks",
... | Creates a rate limiter with the runtime context provided.
@param runtimeContext | [
"Creates",
"a",
"rate",
"limiter",
"with",
"the",
"runtime",
"context",
"provided",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-core/src/main/java/org/apache/flink/api/common/io/ratelimiting/GuavaFlinkConnectorRateLimiter.java#L48-L53 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.