repo stringclasses 11 values | path stringlengths 41 214 | func_name stringlengths 7 82 | original_string stringlengths 77 11.9k | language stringclasses 1 value | code stringlengths 77 11.9k | code_tokens sequencelengths 22 1.57k | docstring stringlengths 2 2.27k | docstring_tokens sequencelengths 1 352 | sha stringclasses 11 values | url stringlengths 129 319 | partition stringclasses 1 value | summary stringlengths 7 191 | input_ids sequencelengths 502 502 | token_type_ids sequencelengths 502 502 | attention_mask sequencelengths 502 502 | labels sequencelengths 502 502 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
apache/flink | flink-table/flink-table-runtime-blink/src/main/java/org/apache/flink/table/runtime/functions/SqlFunctionUtils.java | SqlFunctionUtils.lpad | public static String lpad(String base, int len, String pad) {
if (len < 0 || "".equals(pad)) {
return null;
} else if (len == 0) {
return "";
}
char[] data = new char[len];
char[] baseChars = base.toCharArray();
char[] padChars = pad.toCharArray();
// the length of the padding needed
int pos = Math.max(len - base.length(), 0);
// copy the padding
for (int i = 0; i < pos; i += pad.length()) {
for (int j = 0; j < pad.length() && j < pos - i; j++) {
data[i + j] = padChars[j];
}
}
// copy the base
int i = 0;
while (pos + i < len && i < base.length()) {
data[pos + i] = baseChars[i];
i += 1;
}
return new String(data);
} | java | public static String lpad(String base, int len, String pad) {
if (len < 0 || "".equals(pad)) {
return null;
} else if (len == 0) {
return "";
}
char[] data = new char[len];
char[] baseChars = base.toCharArray();
char[] padChars = pad.toCharArray();
// the length of the padding needed
int pos = Math.max(len - base.length(), 0);
// copy the padding
for (int i = 0; i < pos; i += pad.length()) {
for (int j = 0; j < pad.length() && j < pos - i; j++) {
data[i + j] = padChars[j];
}
}
// copy the base
int i = 0;
while (pos + i < len && i < base.length()) {
data[pos + i] = baseChars[i];
i += 1;
}
return new String(data);
} | [
"public",
"static",
"String",
"lpad",
"(",
"String",
"base",
",",
"int",
"len",
",",
"String",
"pad",
")",
"{",
"if",
"(",
"len",
"<",
"0",
"||",
"\"\"",
".",
"equals",
"(",
"pad",
")",
")",
"{",
"return",
"null",
";",
"}",
"else",
"if",
"(",
"... | Returns the string str left-padded with the string pad to a length of len characters.
If str is longer than len, the return value is shortened to len characters. | [
"Returns",
"the",
"string",
"str",
"left",
"-",
"padded",
"with",
"the",
"string",
"pad",
"to",
"a",
"length",
"of",
"len",
"characters",
".",
"If",
"str",
"is",
"longer",
"than",
"len",
"the",
"return",
"value",
"is",
"shortened",
"to",
"len",
"characte... | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-table/flink-table-runtime-blink/src/main/java/org/apache/flink/table/runtime/functions/SqlFunctionUtils.java#L221-L250 | train | Returns a string of length len with the specified padding string. | [
30522,
2270,
10763,
5164,
6948,
4215,
1006,
5164,
2918,
1010,
20014,
18798,
1010,
5164,
11687,
1007,
1063,
2065,
1006,
18798,
1026,
1014,
1064,
1064,
1000,
1000,
1012,
19635,
1006,
11687,
1007,
1007,
1063,
2709,
19701,
1025,
1065,
2842,
206... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
spring-projects/spring-boot | spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/reactive/error/DefaultErrorWebExceptionHandler.java | DefaultErrorWebExceptionHandler.acceptsTextHtml | protected RequestPredicate acceptsTextHtml() {
return (serverRequest) -> {
try {
List<MediaType> acceptedMediaTypes = serverRequest.headers().accept();
acceptedMediaTypes.remove(MediaType.ALL);
MediaType.sortBySpecificityAndQuality(acceptedMediaTypes);
return acceptedMediaTypes.stream()
.anyMatch(MediaType.TEXT_HTML::isCompatibleWith);
} | java | protected RequestPredicate acceptsTextHtml() {
return (serverRequest) -> {
try {
List<MediaType> acceptedMediaTypes = serverRequest.headers().accept();
acceptedMediaTypes.remove(MediaType.ALL);
MediaType.sortBySpecificityAndQuality(acceptedMediaTypes);
return acceptedMediaTypes.stream()
.anyMatch(MediaType.TEXT_HTML::isCompatibleWith);
} | [
"protected",
"RequestPredicate",
"acceptsTextHtml",
"(",
")",
"{",
"return",
"(",
"serverRequest",
")",
"-",
">",
"{",
"try",
"{",
"List",
"<",
"MediaType",
">",
"acceptedMediaTypes",
"=",
"serverRequest",
".",
"headers",
"(",
")",
".",
"accept",
"(",
")",
... | Predicate that checks whether the current request explicitly support
{@code "text/html"} media type.
<p>
The "match-all" media type is not considered here.
@return the request predicate | [
"Predicate",
"that",
"checks",
"whether",
"the",
"current",
"request",
"explicitly",
"support",
"{"
] | 0b27f7c70e164b2b1a96477f1d9c1acba56790c1 | https://github.com/spring-projects/spring-boot/blob/0b27f7c70e164b2b1a96477f1d9c1acba56790c1/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/reactive/error/DefaultErrorWebExceptionHandler.java#L177-L185 | train | Checks if the request accepts text html. | [
30522,
5123,
5227,
28139,
16467,
13385,
18209,
11039,
19968,
1006,
1007,
1063,
2709,
1006,
8241,
2890,
15500,
1007,
1011,
1028,
1063,
3046,
1063,
2862,
1026,
2865,
13874,
1028,
3970,
16969,
13874,
2015,
1027,
8241,
2890,
15500,
1012,
20346,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
spring-projects/spring-boot | spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/main/java/org/springframework/boot/maven/AbstractRunMojo.java | AbstractRunMojo.resolveJvmArguments | protected RunArguments resolveJvmArguments() {
StringBuilder stringBuilder = new StringBuilder();
if (this.systemPropertyVariables != null) {
stringBuilder.append(this.systemPropertyVariables.entrySet().stream()
.map((e) -> SystemPropertyFormatter.format(e.getKey(), e.getValue()))
.collect(Collectors.joining(" ")));
}
if (this.jvmArguments != null) {
stringBuilder.append(" ").append(this.jvmArguments);
}
return new RunArguments(stringBuilder.toString());
} | java | protected RunArguments resolveJvmArguments() {
StringBuilder stringBuilder = new StringBuilder();
if (this.systemPropertyVariables != null) {
stringBuilder.append(this.systemPropertyVariables.entrySet().stream()
.map((e) -> SystemPropertyFormatter.format(e.getKey(), e.getValue()))
.collect(Collectors.joining(" ")));
}
if (this.jvmArguments != null) {
stringBuilder.append(" ").append(this.jvmArguments);
}
return new RunArguments(stringBuilder.toString());
} | [
"protected",
"RunArguments",
"resolveJvmArguments",
"(",
")",
"{",
"StringBuilder",
"stringBuilder",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"if",
"(",
"this",
".",
"systemPropertyVariables",
"!=",
"null",
")",
"{",
"stringBuilder",
".",
"append",
"(",
"this... | Resolve the JVM arguments to use.
@return a {@link RunArguments} defining the JVM arguments | [
"Resolve",
"the",
"JVM",
"arguments",
"to",
"use",
"."
] | 0b27f7c70e164b2b1a96477f1d9c1acba56790c1 | https://github.com/spring-projects/spring-boot/blob/0b27f7c70e164b2b1a96477f1d9c1acba56790c1/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/main/java/org/springframework/boot/maven/AbstractRunMojo.java#L354-L365 | train | Resolve the JVM arguments. | [
30522,
5123,
2448,
2906,
22850,
11187,
10663,
3501,
2615,
7849,
22850,
11187,
1006,
1007,
1063,
5164,
8569,
23891,
2099,
5164,
8569,
23891,
2099,
1027,
2047,
5164,
8569,
23891,
2099,
1006,
1007,
1025,
2065,
1006,
2023,
1012,
2291,
21572,
48... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
spring-projects/spring-boot | spring-boot-project/spring-boot-devtools/src/main/java/org/springframework/boot/devtools/livereload/LiveReloadServer.java | LiveReloadServer.createConnection | protected Connection createConnection(Socket socket, InputStream inputStream,
OutputStream outputStream) throws IOException {
return new Connection(socket, inputStream, outputStream);
} | java | protected Connection createConnection(Socket socket, InputStream inputStream,
OutputStream outputStream) throws IOException {
return new Connection(socket, inputStream, outputStream);
} | [
"protected",
"Connection",
"createConnection",
"(",
"Socket",
"socket",
",",
"InputStream",
"inputStream",
",",
"OutputStream",
"outputStream",
")",
"throws",
"IOException",
"{",
"return",
"new",
"Connection",
"(",
"socket",
",",
"inputStream",
",",
"outputStream",
... | Factory method used to create the {@link Connection}.
@param socket the source socket
@param inputStream the socket input stream
@param outputStream the socket output stream
@return a connection
@throws IOException in case of I/O errors | [
"Factory",
"method",
"used",
"to",
"create",
"the",
"{"
] | 0b27f7c70e164b2b1a96477f1d9c1acba56790c1 | https://github.com/spring-projects/spring-boot/blob/0b27f7c70e164b2b1a96477f1d9c1acba56790c1/spring-boot-project/spring-boot-devtools/src/main/java/org/springframework/boot/devtools/livereload/LiveReloadServer.java#L236-L239 | train | Creates a new connection to the server. | [
30522,
5123,
4434,
3443,
8663,
2638,
7542,
1006,
22278,
22278,
1010,
20407,
25379,
20407,
25379,
1010,
27852,
25379,
27852,
25379,
1007,
11618,
22834,
10288,
24422,
1063,
2709,
2047,
4434,
1006,
22278,
1010,
20407,
25379,
1010,
27852,
25379,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
apache/spark | sql/hive-thriftserver/src/main/java/org/apache/hive/service/cli/EmbeddedCLIServiceClient.java | EmbeddedCLIServiceClient.getFunctions | @Override
public OperationHandle getFunctions(SessionHandle sessionHandle,
String catalogName, String schemaName, String functionName)
throws HiveSQLException {
return cliService.getFunctions(sessionHandle, catalogName, schemaName, functionName);
} | java | @Override
public OperationHandle getFunctions(SessionHandle sessionHandle,
String catalogName, String schemaName, String functionName)
throws HiveSQLException {
return cliService.getFunctions(sessionHandle, catalogName, schemaName, functionName);
} | [
"@",
"Override",
"public",
"OperationHandle",
"getFunctions",
"(",
"SessionHandle",
"sessionHandle",
",",
"String",
"catalogName",
",",
"String",
"schemaName",
",",
"String",
"functionName",
")",
"throws",
"HiveSQLException",
"{",
"return",
"cliService",
".",
"getFunc... | /* (non-Javadoc)
@see org.apache.hive.service.cli.CLIServiceClient#getFunctions(org.apache.hive.service.cli.SessionHandle, java.lang.String) | [
"/",
"*",
"(",
"non",
"-",
"Javadoc",
")"
] | 25ee0474f47d9c30d6f553a7892d9549f91071cf | https://github.com/apache/spark/blob/25ee0474f47d9c30d6f553a7892d9549f91071cf/sql/hive-thriftserver/src/main/java/org/apache/hive/service/cli/EmbeddedCLIServiceClient.java#L145-L150 | train | Get the function handle for a sequence of Hive functions. | [
30522,
1030,
2058,
15637,
2270,
3169,
11774,
2571,
2131,
11263,
27989,
2015,
1006,
5219,
11774,
2571,
5219,
11774,
2571,
1010,
5164,
12105,
18442,
1010,
5164,
8040,
28433,
18442,
1010,
5164,
3853,
18442,
1007,
11618,
26736,
2015,
4160,
2571,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
apache/flink | flink-streaming-java/src/main/java/org/apache/flink/streaming/api/datastream/AllWindowedStream.java | AllWindowedStream.min | public SingleOutputStreamOperator<T> min(int positionToMin) {
return aggregate(new ComparableAggregator<>(positionToMin, input.getType(), AggregationFunction.AggregationType.MIN, input.getExecutionConfig()));
} | java | public SingleOutputStreamOperator<T> min(int positionToMin) {
return aggregate(new ComparableAggregator<>(positionToMin, input.getType(), AggregationFunction.AggregationType.MIN, input.getExecutionConfig()));
} | [
"public",
"SingleOutputStreamOperator",
"<",
"T",
">",
"min",
"(",
"int",
"positionToMin",
")",
"{",
"return",
"aggregate",
"(",
"new",
"ComparableAggregator",
"<>",
"(",
"positionToMin",
",",
"input",
".",
"getType",
"(",
")",
",",
"AggregationFunction",
".",
... | Applies an aggregation that that gives the minimum value of every window
of the data stream at the given position.
@param positionToMin The position to minimize
@return The transformed DataStream. | [
"Applies",
"an",
"aggregation",
"that",
"that",
"gives",
"the",
"minimum",
"value",
"of",
"every",
"window",
"of",
"the",
"data",
"stream",
"at",
"the",
"given",
"position",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-streaming-java/src/main/java/org/apache/flink/streaming/api/datastream/AllWindowedStream.java#L1404-L1406 | train | Applies an aggregation that reduces the minimum value of the data stream at the given position. | [
30522,
2270,
2309,
5833,
18780,
21422,
25918,
8844,
1026,
1056,
1028,
8117,
1006,
20014,
2597,
20389,
2378,
1007,
1063,
2709,
9572,
1006,
2047,
12435,
8490,
17603,
20697,
2953,
1026,
1028,
1006,
2597,
20389,
2378,
1010,
7953,
1012,
2131,
13... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
hankcs/HanLP | src/main/java/com/hankcs/hanlp/summary/TextRankKeyword.java | TextRankKeyword.getTermAndRank | public Map<String, Float> getTermAndRank(String content, int size)
{
Map<String, Float> map = getTermAndRank(content);
Map<String, Float> result = top(size, map);
return result;
} | java | public Map<String, Float> getTermAndRank(String content, int size)
{
Map<String, Float> map = getTermAndRank(content);
Map<String, Float> result = top(size, map);
return result;
} | [
"public",
"Map",
"<",
"String",
",",
"Float",
">",
"getTermAndRank",
"(",
"String",
"content",
",",
"int",
"size",
")",
"{",
"Map",
"<",
"String",
",",
"Float",
">",
"map",
"=",
"getTermAndRank",
"(",
"content",
")",
";",
"Map",
"<",
"String",
",",
"... | 返回分数最高的前size个分词结果和对应的rank
@param content
@param size
@return | [
"返回分数最高的前size个分词结果和对应的rank"
] | a538d0722ab2e4980a9dcd9ea40324fc3ddba7ce | https://github.com/hankcs/HanLP/blob/a538d0722ab2e4980a9dcd9ea40324fc3ddba7ce/src/main/java/com/hankcs/hanlp/summary/TextRankKeyword.java#L82-L88 | train | Get getTermAndRank map. | [
30522,
2270,
4949,
1026,
5164,
1010,
14257,
1028,
2131,
3334,
2386,
24914,
2243,
1006,
5164,
4180,
1010,
20014,
2946,
1007,
1063,
4949,
1026,
5164,
1010,
14257,
1028,
4949,
1027,
2131,
3334,
2386,
24914,
2243,
30524,
1007,
1025,
2709,
2765,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
netty/netty | codec-http/src/main/java/io/netty/handler/codec/http/multipart/HttpPostRequestEncoder.java | HttpPostRequestEncoder.addBodyFileUpload | public void addBodyFileUpload(String name, File file, String contentType, boolean isText)
throws ErrorDataEncoderException {
addBodyFileUpload(name, file.getName(), file, contentType, isText);
} | java | public void addBodyFileUpload(String name, File file, String contentType, boolean isText)
throws ErrorDataEncoderException {
addBodyFileUpload(name, file.getName(), file, contentType, isText);
} | [
"public",
"void",
"addBodyFileUpload",
"(",
"String",
"name",
",",
"File",
"file",
",",
"String",
"contentType",
",",
"boolean",
"isText",
")",
"throws",
"ErrorDataEncoderException",
"{",
"addBodyFileUpload",
"(",
"name",
",",
"file",
".",
"getName",
"(",
")",
... | Add a file as a FileUpload
@param name
the name of the parameter
@param file
the file to be uploaded (if not Multipart mode, only the filename will be included)
@param contentType
the associated contentType for the File
@param isText
True if this file should be transmitted in Text format (else binary)
@throws NullPointerException
for name and file
@throws ErrorDataEncoderException
if the encoding is in error or if the finalize were already done | [
"Add",
"a",
"file",
"as",
"a",
"FileUpload"
] | ba06eafa1c1824bd154f1a380019e7ea2edf3c4c | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/codec-http/src/main/java/io/netty/handler/codec/http/multipart/HttpPostRequestEncoder.java#L360-L363 | train | addBodyFileUpload This method is used to add a file to the application body. | [
30522,
2270,
11675,
5587,
23684,
8873,
2571,
6279,
11066,
1006,
5164,
2171,
1010,
5371,
5371,
1010,
5164,
4180,
13874,
1010,
22017,
20898,
21541,
10288,
2102,
1007,
11618,
7561,
2850,
2696,
2368,
16044,
2890,
2595,
24422,
1063,
5587,
23684,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
apache/flink | flink-streaming-java/src/main/java/org/apache/flink/streaming/api/graph/StreamGraphGenerator.java | StreamGraphGenerator.transformSelect | private <T> Collection<Integer> transformSelect(SelectTransformation<T> select) {
StreamTransformation<T> input = select.getInput();
Collection<Integer> resultIds = transform(input);
// the recursive transform might have already transformed this
if (alreadyTransformed.containsKey(select)) {
return alreadyTransformed.get(select);
}
List<Integer> virtualResultIds = new ArrayList<>();
for (int inputId : resultIds) {
int virtualId = StreamTransformation.getNewNodeId();
streamGraph.addVirtualSelectNode(inputId, virtualId, select.getSelectedNames());
virtualResultIds.add(virtualId);
}
return virtualResultIds;
} | java | private <T> Collection<Integer> transformSelect(SelectTransformation<T> select) {
StreamTransformation<T> input = select.getInput();
Collection<Integer> resultIds = transform(input);
// the recursive transform might have already transformed this
if (alreadyTransformed.containsKey(select)) {
return alreadyTransformed.get(select);
}
List<Integer> virtualResultIds = new ArrayList<>();
for (int inputId : resultIds) {
int virtualId = StreamTransformation.getNewNodeId();
streamGraph.addVirtualSelectNode(inputId, virtualId, select.getSelectedNames());
virtualResultIds.add(virtualId);
}
return virtualResultIds;
} | [
"private",
"<",
"T",
">",
"Collection",
"<",
"Integer",
">",
"transformSelect",
"(",
"SelectTransformation",
"<",
"T",
">",
"select",
")",
"{",
"StreamTransformation",
"<",
"T",
">",
"input",
"=",
"select",
".",
"getInput",
"(",
")",
";",
"Collection",
"<"... | Transforms a {@code SelectTransformation}.
<p>For this we create a virtual node in the {@code StreamGraph} holds the selected names.
@see org.apache.flink.streaming.api.graph.StreamGraphGenerator | [
"Transforms",
"a",
"{",
"@code",
"SelectTransformation",
"}",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-streaming-java/src/main/java/org/apache/flink/streaming/api/graph/StreamGraphGenerator.java#L289-L306 | train | This method is called by the recursive transform method. | [
30522,
2797,
1026,
1056,
1028,
3074,
1026,
16109,
1028,
21743,
12260,
6593,
1006,
7276,
6494,
3619,
14192,
3370,
1026,
1056,
1028,
7276,
1007,
1063,
5460,
6494,
3619,
14192,
3370,
1026,
1056,
1028,
7953,
1027,
7276,
1012,
2131,
2378,
18780,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
alibaba/canal | parse/src/main/java/com/alibaba/otter/canal/parse/inbound/mysql/MysqlConnection.java | MysqlConnection.loadBinlogFormat | private void loadBinlogFormat() {
ResultSetPacket rs = null;
try {
rs = query("show variables like 'binlog_format'");
} catch (IOException e) {
throw new CanalParseException(e);
}
List<String> columnValues = rs.getFieldValues();
if (columnValues == null || columnValues.size() != 2) {
logger.warn("unexpected binlog format query result, this may cause unexpected result, so throw exception to request network to io shutdown.");
throw new IllegalStateException("unexpected binlog format query result:" + rs.getFieldValues());
}
binlogFormat = BinlogFormat.valuesOf(columnValues.get(1));
if (binlogFormat == null) {
throw new IllegalStateException("unexpected binlog format query result:" + rs.getFieldValues());
}
} | java | private void loadBinlogFormat() {
ResultSetPacket rs = null;
try {
rs = query("show variables like 'binlog_format'");
} catch (IOException e) {
throw new CanalParseException(e);
}
List<String> columnValues = rs.getFieldValues();
if (columnValues == null || columnValues.size() != 2) {
logger.warn("unexpected binlog format query result, this may cause unexpected result, so throw exception to request network to io shutdown.");
throw new IllegalStateException("unexpected binlog format query result:" + rs.getFieldValues());
}
binlogFormat = BinlogFormat.valuesOf(columnValues.get(1));
if (binlogFormat == null) {
throw new IllegalStateException("unexpected binlog format query result:" + rs.getFieldValues());
}
} | [
"private",
"void",
"loadBinlogFormat",
"(",
")",
"{",
"ResultSetPacket",
"rs",
"=",
"null",
";",
"try",
"{",
"rs",
"=",
"query",
"(",
"\"show variables like 'binlog_format'\"",
")",
";",
"}",
"catch",
"(",
"IOException",
"e",
")",
"{",
"throw",
"new",
"Canal... | 获取一下binlog format格式 | [
"获取一下binlog",
"format格式"
] | 8f088cddc0755f4350c5aaae95c6e4002d90a40f | https://github.com/alibaba/canal/blob/8f088cddc0755f4350c5aaae95c6e4002d90a40f/parse/src/main/java/com/alibaba/otter/canal/parse/inbound/mysql/MysqlConnection.java#L466-L484 | train | Load binlog format from database. | [
30522,
2797,
11675,
7170,
8428,
21197,
14192,
4017,
1006,
1007,
1063,
3463,
3388,
23947,
3388,
12667,
1027,
19701,
1025,
3046,
1063,
12667,
1027,
23032,
1006,
1000,
2265,
10857,
2066,
1005,
8026,
21197,
1035,
4289,
1005,
1000,
1007,
1025,
1... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
apache/flink | flink-streaming-java/src/main/java/org/apache/flink/streaming/api/datastream/KeyedStream.java | KeyedStream.validateKeyTypeIsHashable | private boolean validateKeyTypeIsHashable(TypeInformation<?> type) {
try {
return (type instanceof PojoTypeInfo)
? !type.getTypeClass().getMethod("hashCode").getDeclaringClass().equals(Object.class)
: !(type instanceof PrimitiveArrayTypeInfo || type instanceof BasicArrayTypeInfo || type instanceof ObjectArrayTypeInfo);
} catch (NoSuchMethodException ignored) {
// this should never happen as we are just searching for the hashCode() method.
}
return false;
} | java | private boolean validateKeyTypeIsHashable(TypeInformation<?> type) {
try {
return (type instanceof PojoTypeInfo)
? !type.getTypeClass().getMethod("hashCode").getDeclaringClass().equals(Object.class)
: !(type instanceof PrimitiveArrayTypeInfo || type instanceof BasicArrayTypeInfo || type instanceof ObjectArrayTypeInfo);
} catch (NoSuchMethodException ignored) {
// this should never happen as we are just searching for the hashCode() method.
}
return false;
} | [
"private",
"boolean",
"validateKeyTypeIsHashable",
"(",
"TypeInformation",
"<",
"?",
">",
"type",
")",
"{",
"try",
"{",
"return",
"(",
"type",
"instanceof",
"PojoTypeInfo",
")",
"?",
"!",
"type",
".",
"getTypeClass",
"(",
")",
".",
"getMethod",
"(",
"\"hashC... | Validates that a given type of element (as encoded by the provided {@link TypeInformation}) can be
used as a key in the {@code DataStream.keyBy()} operation.
@param type The {@link TypeInformation} of the type to check.
@return {@code false} if:
<ol>
<li>it is a POJO type but does not override the {@link #hashCode()} method and relies on
the {@link Object#hashCode()} implementation.</li>
<li>it is an array of any type (see {@link PrimitiveArrayTypeInfo}, {@link BasicArrayTypeInfo},
{@link ObjectArrayTypeInfo}).</li>
</ol>,
{@code true} otherwise. | [
"Validates",
"that",
"a",
"given",
"type",
"of",
"element",
"(",
"as",
"encoded",
"by",
"the",
"provided",
"{",
"@link",
"TypeInformation",
"}",
")",
"can",
"be",
"used",
"as",
"a",
"key",
"in",
"the",
"{",
"@code",
"DataStream",
".",
"keyBy",
"()",
"}... | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-streaming-java/src/main/java/org/apache/flink/streaming/api/datastream/KeyedStream.java#L216-L225 | train | Validate that the key type is hashable. | [
30522,
2797,
22017,
20898,
9398,
3686,
14839,
13874,
24032,
7377,
3468,
1006,
2828,
2378,
14192,
3370,
1026,
1029,
1028,
2828,
30524,
2828,
1012,
2131,
13874,
26266,
1006,
1007,
1012,
2131,
11368,
6806,
2094,
1006,
1000,
23325,
16044,
1000,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
apache/flink | flink-runtime/src/main/java/org/apache/flink/runtime/util/EnvironmentInformation.java | EnvironmentInformation.getVersion | public static String getVersion() {
String version = EnvironmentInformation.class.getPackage().getImplementationVersion();
return version != null ? version : UNKNOWN;
} | java | public static String getVersion() {
String version = EnvironmentInformation.class.getPackage().getImplementationVersion();
return version != null ? version : UNKNOWN;
} | [
"public",
"static",
"String",
"getVersion",
"(",
")",
"{",
"String",
"version",
"=",
"EnvironmentInformation",
".",
"class",
".",
"getPackage",
"(",
")",
".",
"getImplementationVersion",
"(",
")",
";",
"return",
"version",
"!=",
"null",
"?",
"version",
":",
... | Returns the version of the code as String. If version == null, then the JobManager does not run from a
Maven build. An example is a source code checkout, compile, and run from inside an IDE.
@return The version string. | [
"Returns",
"the",
"version",
"of",
"the",
"code",
"as",
"String",
".",
"If",
"version",
"==",
"null",
"then",
"the",
"JobManager",
"does",
"not",
"run",
"from",
"a",
"Maven",
"build",
".",
"An",
"example",
"is",
"a",
"source",
"code",
"checkout",
"compil... | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/util/EnvironmentInformation.java#L49-L52 | train | Get the version of the application. | [
30522,
2270,
10763,
5164,
2131,
27774,
1006,
1007,
1063,
5164,
2544,
1027,
4044,
2378,
14192,
3370,
1012,
2465,
1012,
2131,
23947,
4270,
1006,
1007,
1012,
2131,
5714,
10814,
3672,
3370,
27774,
1006,
1007,
1025,
2709,
2544,
999,
1027,
19701,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
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 | train | Report the key group of the element at the given index. | [
30522,
5123,
11675,
3189,
14839,
17058,
11253,
12260,
3672,
20363,
3207,
2595,
1006,
20014,
5950,
1010,
20014,
3145,
17058,
1007,
1063,
2345,
20014,
3145,
17058,
22254,
10288,
1027,
3145,
17058,
1011,
2034,
14839,
17058,
1025,
5783,
14839,
17... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
looly/hutool | hutool-db/src/main/java/cn/hutool/db/AbstractDb.java | AbstractDb.executeBatch | public int[] executeBatch(String... sqls) throws SQLException {
Connection conn = null;
try {
conn = this.getConnection();
return SqlExecutor.executeBatch(conn, sqls);
} catch (SQLException e) {
throw e;
} finally {
this.closeConnection(conn);
}
} | java | public int[] executeBatch(String... sqls) throws SQLException {
Connection conn = null;
try {
conn = this.getConnection();
return SqlExecutor.executeBatch(conn, sqls);
} catch (SQLException e) {
throw e;
} finally {
this.closeConnection(conn);
}
} | [
"public",
"int",
"[",
"]",
"executeBatch",
"(",
"String",
"...",
"sqls",
")",
"throws",
"SQLException",
"{",
"Connection",
"conn",
"=",
"null",
";",
"try",
"{",
"conn",
"=",
"this",
".",
"getConnection",
"(",
")",
";",
"return",
"SqlExecutor",
".",
"exec... | 批量执行非查询语句
@param sqls SQL列表
@return 每个SQL执行影响的行数
@throws SQLException SQL执行异常
@since 4.5.6 | [
"批量执行非查询语句"
] | bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-db/src/main/java/cn/hutool/db/AbstractDb.java#L226-L236 | train | Executes a batch of SQL statements. | [
30522,
2270,
20014,
1031,
1033,
15389,
14479,
2818,
1006,
5164,
1012,
1012,
1012,
29296,
2015,
1007,
11618,
29296,
10288,
24422,
1063,
4434,
9530,
2078,
1027,
19701,
1025,
3046,
1063,
9530,
2078,
1027,
2023,
1012,
2131,
8663,
2638,
7542,
10... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
apache/flink | flink-runtime/src/main/java/org/apache/flink/runtime/zookeeper/ZooKeeperStateHandleStore.java | ZooKeeperStateHandleStore.deleteChildren | public void deleteChildren() throws Exception {
final String path = "/" + client.getNamespace();
LOG.info("Removing {} from ZooKeeper", path);
ZKPaths.deleteChildren(client.getZookeeperClient().getZooKeeper(), path, true);
} | java | public void deleteChildren() throws Exception {
final String path = "/" + client.getNamespace();
LOG.info("Removing {} from ZooKeeper", path);
ZKPaths.deleteChildren(client.getZookeeperClient().getZooKeeper(), path, true);
} | [
"public",
"void",
"deleteChildren",
"(",
")",
"throws",
"Exception",
"{",
"final",
"String",
"path",
"=",
"\"/\"",
"+",
"client",
".",
"getNamespace",
"(",
")",
";",
"LOG",
".",
"info",
"(",
"\"Removing {} from ZooKeeper\"",
",",
"path",
")",
";",
"ZKPaths",... | Recursively deletes all children.
@throws Exception ZK errors | [
"Recursively",
"deletes",
"all",
"children",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/zookeeper/ZooKeeperStateHandleStore.java#L433-L437 | train | Delete all the children of the namespace. | [
30522,
2270,
11675,
3972,
12870,
19339,
7389,
1006,
1007,
11618,
6453,
1063,
2345,
5164,
4130,
1027,
1000,
1013,
1000,
1009,
7396,
1012,
2131,
18442,
23058,
1006,
1007,
1025,
8833,
1012,
18558,
1006,
1000,
9268,
1063,
1065,
2013,
9201,
1310... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
looly/hutool | hutool-core/src/main/java/cn/hutool/core/annotation/AnnotationUtil.java | AnnotationUtil.toCombination | public static CombinationAnnotationElement toCombination(AnnotatedElement annotationEle) {
if(annotationEle instanceof CombinationAnnotationElement) {
return (CombinationAnnotationElement)annotationEle;
}
return new CombinationAnnotationElement(annotationEle);
} | java | public static CombinationAnnotationElement toCombination(AnnotatedElement annotationEle) {
if(annotationEle instanceof CombinationAnnotationElement) {
return (CombinationAnnotationElement)annotationEle;
}
return new CombinationAnnotationElement(annotationEle);
} | [
"public",
"static",
"CombinationAnnotationElement",
"toCombination",
"(",
"AnnotatedElement",
"annotationEle",
")",
"{",
"if",
"(",
"annotationEle",
"instanceof",
"CombinationAnnotationElement",
")",
"{",
"return",
"(",
"CombinationAnnotationElement",
")",
"annotationEle",
... | 将指定的被注解的元素转换为组合注解元素
@param annotationEle 注解元素
@return 组合注解元素 | [
"将指定的被注解的元素转换为组合注解元素"
] | bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/annotation/AnnotationUtil.java#L36-L41 | train | Converts an annotated element to a combination annotation element. | [
30522,
2270,
10763,
5257,
11639,
17287,
3508,
12260,
3672,
2000,
18274,
12758,
1006,
5754,
17287,
3064,
12260,
3672,
5754,
17287,
3508,
12260,
1007,
1063,
2065,
30524,
1065,
102,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
apache/incubator-shardingsphere | sharding-proxy/sharding-proxy-backend/src/main/java/org/apache/shardingsphere/shardingproxy/backend/schema/MasterSlaveSchema.java | MasterSlaveSchema.renew | @Subscribe
public synchronized void renew(final MasterSlaveRuleChangedEvent masterSlaveRuleChangedEvent) {
if (getName().equals(masterSlaveRuleChangedEvent.getShardingSchemaName())) {
masterSlaveRule = new OrchestrationMasterSlaveRule(masterSlaveRuleChangedEvent.getMasterSlaveRuleConfiguration());
}
} | java | @Subscribe
public synchronized void renew(final MasterSlaveRuleChangedEvent masterSlaveRuleChangedEvent) {
if (getName().equals(masterSlaveRuleChangedEvent.getShardingSchemaName())) {
masterSlaveRule = new OrchestrationMasterSlaveRule(masterSlaveRuleChangedEvent.getMasterSlaveRuleConfiguration());
}
} | [
"@",
"Subscribe",
"public",
"synchronized",
"void",
"renew",
"(",
"final",
"MasterSlaveRuleChangedEvent",
"masterSlaveRuleChangedEvent",
")",
"{",
"if",
"(",
"getName",
"(",
")",
".",
"equals",
"(",
"masterSlaveRuleChangedEvent",
".",
"getShardingSchemaName",
"(",
")"... | Renew master-slave rule.
@param masterSlaveRuleChangedEvent master-slave rule changed event. | [
"Renew",
"master",
"-",
"slave",
"rule",
"."
] | f88fd29fc345dfb31fdce12e9e96cbfa0fd2402d | https://github.com/apache/incubator-shardingsphere/blob/f88fd29fc345dfb31fdce12e9e96cbfa0fd2402d/sharding-proxy/sharding-proxy-backend/src/main/java/org/apache/shardingsphere/shardingproxy/backend/schema/MasterSlaveSchema.java#L74-L79 | train | Renew master slave rule. | [
30522,
1030,
4942,
29234,
2270,
25549,
11675,
20687,
1006,
2345,
5972,
14973,
2121,
9307,
22305,
14728,
15338,
5972,
14973,
2121,
9307,
22305,
14728,
15338,
1007,
1063,
2065,
1006,
2131,
18442,
1006,
1007,
1012,
19635,
1006,
5972,
14973,
2121... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
apache/flink | flink-runtime/src/main/java/org/apache/flink/runtime/history/FsJobArchivist.java | FsJobArchivist.getArchivedJsons | public static Collection<ArchivedJson> getArchivedJsons(Path file) throws IOException {
try (FSDataInputStream input = file.getFileSystem().open(file);
ByteArrayOutputStream output = new ByteArrayOutputStream()) {
IOUtils.copyBytes(input, output);
JsonNode archive = mapper.readTree(output.toByteArray());
Collection<ArchivedJson> archives = new ArrayList<>();
for (JsonNode archivePart : archive.get(ARCHIVE)) {
String path = archivePart.get(PATH).asText();
String json = archivePart.get(JSON).asText();
archives.add(new ArchivedJson(path, json));
}
return archives;
}
} | java | public static Collection<ArchivedJson> getArchivedJsons(Path file) throws IOException {
try (FSDataInputStream input = file.getFileSystem().open(file);
ByteArrayOutputStream output = new ByteArrayOutputStream()) {
IOUtils.copyBytes(input, output);
JsonNode archive = mapper.readTree(output.toByteArray());
Collection<ArchivedJson> archives = new ArrayList<>();
for (JsonNode archivePart : archive.get(ARCHIVE)) {
String path = archivePart.get(PATH).asText();
String json = archivePart.get(JSON).asText();
archives.add(new ArchivedJson(path, json));
}
return archives;
}
} | [
"public",
"static",
"Collection",
"<",
"ArchivedJson",
">",
"getArchivedJsons",
"(",
"Path",
"file",
")",
"throws",
"IOException",
"{",
"try",
"(",
"FSDataInputStream",
"input",
"=",
"file",
".",
"getFileSystem",
"(",
")",
".",
"open",
"(",
"file",
")",
";",... | Reads the given archive file and returns a {@link Collection} of contained {@link ArchivedJson}.
@param file archive to extract
@return collection of archived jsons
@throws IOException if the file can't be opened, read or doesn't contain valid json | [
"Reads",
"the",
"given",
"archive",
"file",
"and",
"returns",
"a",
"{",
"@link",
"Collection",
"}",
"of",
"contained",
"{",
"@link",
"ArchivedJson",
"}",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/history/FsJobArchivist.java#L107-L122 | train | Get all archived jsons from a file. | [
30522,
2270,
10763,
3074,
1026,
9749,
22578,
2239,
1028,
2131,
2906,
5428,
7178,
22578,
5644,
1006,
4130,
5371,
1007,
11618,
22834,
10288,
24422,
1063,
3046,
1006,
1042,
16150,
6790,
2378,
18780,
21422,
7953,
1027,
5371,
1012,
2131,
8873,
4... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
apache/flink | flink-runtime/src/main/java/org/apache/flink/runtime/executiongraph/Execution.java | Execution.releaseAssignedResource | private void releaseAssignedResource(@Nullable Throwable cause) {
assertRunningInJobMasterMainThread();
final LogicalSlot slot = assignedResource;
if (slot != null) {
ComponentMainThreadExecutor jobMasterMainThreadExecutor =
getVertex().getExecutionGraph().getJobMasterMainThreadExecutor();
slot.releaseSlot(cause)
.whenComplete((Object ignored, Throwable throwable) -> {
jobMasterMainThreadExecutor.assertRunningInMainThread();
if (throwable != null) {
releaseFuture.completeExceptionally(throwable);
} else {
releaseFuture.complete(null);
}
});
} else {
// no assigned resource --> we can directly complete the release future
releaseFuture.complete(null);
}
} | java | private void releaseAssignedResource(@Nullable Throwable cause) {
assertRunningInJobMasterMainThread();
final LogicalSlot slot = assignedResource;
if (slot != null) {
ComponentMainThreadExecutor jobMasterMainThreadExecutor =
getVertex().getExecutionGraph().getJobMasterMainThreadExecutor();
slot.releaseSlot(cause)
.whenComplete((Object ignored, Throwable throwable) -> {
jobMasterMainThreadExecutor.assertRunningInMainThread();
if (throwable != null) {
releaseFuture.completeExceptionally(throwable);
} else {
releaseFuture.complete(null);
}
});
} else {
// no assigned resource --> we can directly complete the release future
releaseFuture.complete(null);
}
} | [
"private",
"void",
"releaseAssignedResource",
"(",
"@",
"Nullable",
"Throwable",
"cause",
")",
"{",
"assertRunningInJobMasterMainThread",
"(",
")",
";",
"final",
"LogicalSlot",
"slot",
"=",
"assignedResource",
";",
"if",
"(",
"slot",
"!=",
"null",
")",
"{",
"Com... | Releases the assigned resource and completes the release future
once the assigned resource has been successfully released.
@param cause for the resource release, null if none | [
"Releases",
"the",
"assigned",
"resource",
"and",
"completes",
"the",
"release",
"future",
"once",
"the",
"assigned",
"resource",
"has",
"been",
"successfully",
"released",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/executiongraph/Execution.java#L1259-L1282 | train | Releases the assigned resource. | [
30522,
2797,
11675,
2713,
12054,
23773,
2098,
6072,
8162,
3401,
1006,
1030,
19701,
3085,
5466,
3085,
3426,
1007,
1063,
20865,
15532,
5582,
2378,
5558,
25526,
24268,
24238,
2705,
16416,
2094,
1006,
1007,
1025,
2345,
11177,
14540,
4140,
10453,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
netty/netty | transport/src/main/java/io/netty/bootstrap/ServerBootstrap.java | ServerBootstrap.childAttr | public <T> ServerBootstrap childAttr(AttributeKey<T> childKey, T value) {
if (childKey == null) {
throw new NullPointerException("childKey");
}
if (value == null) {
childAttrs.remove(childKey);
} else {
childAttrs.put(childKey, value);
}
return this;
} | java | public <T> ServerBootstrap childAttr(AttributeKey<T> childKey, T value) {
if (childKey == null) {
throw new NullPointerException("childKey");
}
if (value == null) {
childAttrs.remove(childKey);
} else {
childAttrs.put(childKey, value);
}
return this;
} | [
"public",
"<",
"T",
">",
"ServerBootstrap",
"childAttr",
"(",
"AttributeKey",
"<",
"T",
">",
"childKey",
",",
"T",
"value",
")",
"{",
"if",
"(",
"childKey",
"==",
"null",
")",
"{",
"throw",
"new",
"NullPointerException",
"(",
"\"childKey\"",
")",
";",
"}... | Set the specific {@link AttributeKey} with the given value on every child {@link Channel}. If the value is
{@code null} the {@link AttributeKey} is removed | [
"Set",
"the",
"specific",
"{"
] | ba06eafa1c1824bd154f1a380019e7ea2edf3c4c | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/transport/src/main/java/io/netty/bootstrap/ServerBootstrap.java#L117-L127 | train | Add a child attribute. | [
30522,
2270,
1026,
1056,
1028,
8241,
27927,
20528,
2361,
2775,
19321,
2099,
1006,
17961,
14839,
1026,
1056,
1028,
2775,
14839,
1010,
1056,
3643,
1007,
1063,
2065,
1006,
2775,
14839,
1027,
1027,
19701,
1007,
1063,
5466,
2047,
19701,
8400,
78... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
apache/incubator-shardingsphere | sharding-proxy/sharding-proxy-transport/sharding-proxy-transport-postgresql/src/main/java/org/apache/shardingsphere/shardingproxy/transport/postgresql/packet/command/PostgreSQLCommandPacketFactory.java | PostgreSQLCommandPacketFactory.newInstance | public static PostgreSQLCommandPacket newInstance(
final PostgreSQLCommandPacketType commandPacketType, final PostgreSQLPacketPayload payload, final int connectionId) throws SQLException {
switch (commandPacketType) {
case QUERY:
return new PostgreSQLComQueryPacket(payload);
case PARSE:
return new PostgreSQLComParsePacket(payload);
case BIND:
return new PostgreSQLComBindPacket(payload, connectionId);
case DESCRIBE:
return new PostgreSQLComDescribePacket(payload);
case EXECUTE:
return new PostgreSQLComExecutePacket(payload);
case SYNC:
return new PostgreSQLComSyncPacket(payload);
case TERMINATE:
return new PostgreSQLComTerminationPacket(payload);
default:
return new PostgreSQLUnsupportedCommandPacket(commandPacketType.getValue());
}
} | java | public static PostgreSQLCommandPacket newInstance(
final PostgreSQLCommandPacketType commandPacketType, final PostgreSQLPacketPayload payload, final int connectionId) throws SQLException {
switch (commandPacketType) {
case QUERY:
return new PostgreSQLComQueryPacket(payload);
case PARSE:
return new PostgreSQLComParsePacket(payload);
case BIND:
return new PostgreSQLComBindPacket(payload, connectionId);
case DESCRIBE:
return new PostgreSQLComDescribePacket(payload);
case EXECUTE:
return new PostgreSQLComExecutePacket(payload);
case SYNC:
return new PostgreSQLComSyncPacket(payload);
case TERMINATE:
return new PostgreSQLComTerminationPacket(payload);
default:
return new PostgreSQLUnsupportedCommandPacket(commandPacketType.getValue());
}
} | [
"public",
"static",
"PostgreSQLCommandPacket",
"newInstance",
"(",
"final",
"PostgreSQLCommandPacketType",
"commandPacketType",
",",
"final",
"PostgreSQLPacketPayload",
"payload",
",",
"final",
"int",
"connectionId",
")",
"throws",
"SQLException",
"{",
"switch",
"(",
"com... | Create new instance of command packet.
@param commandPacketType command packet type for PostgreSQL
@param payload packet payload for PostgreSQL
@param connectionId connection id
@return command packet for PostgreSQL
@throws SQLException SQL exception | [
"Create",
"new",
"instance",
"of",
"command",
"packet",
"."
] | f88fd29fc345dfb31fdce12e9e96cbfa0fd2402d | https://github.com/apache/incubator-shardingsphere/blob/f88fd29fc345dfb31fdce12e9e96cbfa0fd2402d/sharding-proxy/sharding-proxy-transport/sharding-proxy-transport-postgresql/src/main/java/org/apache/shardingsphere/shardingproxy/transport/postgresql/packet/command/PostgreSQLCommandPacketFactory.java#L51-L71 | train | Create a new instance of a PostgreSQLCommandPacket. | [
30522,
2270,
10763,
2695,
17603,
2015,
4160,
22499,
14760,
4859,
23947,
3388,
2047,
7076,
26897,
1006,
2345,
2695,
17603,
2015,
4160,
22499,
14760,
4859,
23947,
6582,
18863,
3094,
23947,
6582,
18863,
1010,
2345,
2695,
17603,
2015,
4160,
14277... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
SeleniumHQ/selenium | java/client/src/org/openqa/selenium/support/ui/ExpectedConditions.java | ExpectedConditions.elementToBeClickable | public static ExpectedCondition<WebElement> elementToBeClickable(final By locator) {
return new ExpectedCondition<WebElement>() {
@Override
public WebElement apply(WebDriver driver) {
WebElement element = visibilityOfElementLocated(locator).apply(driver);
try {
if (element != null && element.isEnabled()) {
return element;
}
return null;
} catch (StaleElementReferenceException e) {
return null;
}
}
@Override
public String toString() {
return "element to be clickable: " + locator;
}
};
} | java | public static ExpectedCondition<WebElement> elementToBeClickable(final By locator) {
return new ExpectedCondition<WebElement>() {
@Override
public WebElement apply(WebDriver driver) {
WebElement element = visibilityOfElementLocated(locator).apply(driver);
try {
if (element != null && element.isEnabled()) {
return element;
}
return null;
} catch (StaleElementReferenceException e) {
return null;
}
}
@Override
public String toString() {
return "element to be clickable: " + locator;
}
};
} | [
"public",
"static",
"ExpectedCondition",
"<",
"WebElement",
">",
"elementToBeClickable",
"(",
"final",
"By",
"locator",
")",
"{",
"return",
"new",
"ExpectedCondition",
"<",
"WebElement",
">",
"(",
")",
"{",
"@",
"Override",
"public",
"WebElement",
"apply",
"(",
... | An expectation for checking an element is visible and enabled such that you can click it.
@param locator used to find the element
@return the WebElement once it is located and clickable (visible and enabled) | [
"An",
"expectation",
"for",
"checking",
"an",
"element",
"is",
"visible",
"and",
"enabled",
"such",
"that",
"you",
"can",
"click",
"it",
"."
] | 7af172729f17b20269c8ca4ea6f788db48616535 | https://github.com/SeleniumHQ/selenium/blob/7af172729f17b20269c8ca4ea6f788db48616535/java/client/src/org/openqa/selenium/support/ui/ExpectedConditions.java#L637-L657 | train | An expectation for checking that an element is clickable. | [
30522,
2270,
10763,
3517,
8663,
20562,
1026,
4773,
12260,
3672,
1028,
5783,
3406,
4783,
20464,
6799,
3085,
1006,
2345,
2011,
8840,
11266,
2953,
1007,
1063,
2709,
2047,
3517,
8663,
20562,
1026,
4773,
12260,
3672,
1028,
1006,
1007,
1063,
1030... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
looly/hutool | hutool-setting/src/main/java/cn/hutool/setting/Setting.java | Setting.load | synchronized public boolean load() {
if (null == this.settingLoader) {
settingLoader = new SettingLoader(this.groupedMap, this.charset, this.isUseVariable);
}
return settingLoader.load(new UrlResource(this.settingUrl));
} | java | synchronized public boolean load() {
if (null == this.settingLoader) {
settingLoader = new SettingLoader(this.groupedMap, this.charset, this.isUseVariable);
}
return settingLoader.load(new UrlResource(this.settingUrl));
} | [
"synchronized",
"public",
"boolean",
"load",
"(",
")",
"{",
"if",
"(",
"null",
"==",
"this",
".",
"settingLoader",
")",
"{",
"settingLoader",
"=",
"new",
"SettingLoader",
"(",
"this",
".",
"groupedMap",
",",
"this",
".",
"charset",
",",
"this",
".",
"isU... | 重新加载配置文件
@return 是否加载成功 | [
"重新加载配置文件"
] | bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-setting/src/main/java/cn/hutool/setting/Setting.java#L168-L173 | train | Load the setting. | [
30522,
25549,
2270,
22017,
20898,
7170,
1006,
1007,
1063,
2065,
1006,
19701,
1027,
1027,
2023,
1012,
4292,
11066,
2121,
1007,
1063,
4292,
11066,
2121,
1027,
2047,
4292,
11066,
2121,
1006,
2023,
1012,
15131,
2863,
2361,
1010,
2023,
1012,
258... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
apache/flink | flink-runtime/src/main/java/org/apache/flink/runtime/operators/resettable/NonReusingBlockResettableIterator.java | NonReusingBlockResettableIterator.reopen | public void reopen(Iterator<T> input) throws IOException {
this.input = input;
this.noMoreBlocks = false;
this.closed = false;
nextBlock();
} | java | public void reopen(Iterator<T> input) throws IOException {
this.input = input;
this.noMoreBlocks = false;
this.closed = false;
nextBlock();
} | [
"public",
"void",
"reopen",
"(",
"Iterator",
"<",
"T",
">",
"input",
")",
"throws",
"IOException",
"{",
"this",
".",
"input",
"=",
"input",
";",
"this",
".",
"noMoreBlocks",
"=",
"false",
";",
"this",
".",
"closed",
"=",
"false",
";",
"nextBlock",
"(",... | ------------------------------------------------------------------------ | [
"------------------------------------------------------------------------"
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/operators/resettable/NonReusingBlockResettableIterator.java#L74-L81 | train | Reopen the iterator. | [
30522,
2270,
11675,
2128,
26915,
1006,
2009,
6906,
4263,
1026,
1056,
1028,
7953,
1007,
11618,
22834,
10288,
24422,
1063,
2023,
1012,
7953,
1027,
7953,
1025,
2023,
1012,
2053,
5974,
23467,
2015,
1027,
6270,
1025,
2023,
1012,
2701,
1027,
6270... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
End of preview. Expand
in Data Studio
README.md exists but content is empty.
- Downloads last month
- 6