repo stringclasses 11
values | path stringlengths 41 234 | func_name stringlengths 5 78 | original_string stringlengths 71 14.1k | language stringclasses 1
value | code stringlengths 71 14.1k | code_tokens listlengths 22 2.65k | docstring stringlengths 2 5.35k | docstring_tokens listlengths 1 369 | sha stringclasses 11
values | url stringlengths 129 339 | partition stringclasses 1
value | summary stringlengths 7 175 | input_ids listlengths 502 502 | token_type_ids listlengths 502 502 | attention_mask listlengths 502 502 | labels listlengths 502 502 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
apache/spark | sql/core/src/main/java/org/apache/spark/sql/execution/datasources/orc/OrcColumnarBatchReader.java | OrcColumnarBatchReader.initialize | @Override
public void initialize(
InputSplit inputSplit, TaskAttemptContext taskAttemptContext) throws IOException {
FileSplit fileSplit = (FileSplit)inputSplit;
Configuration conf = taskAttemptContext.getConfiguration();
Reader reader = OrcFile.createReader(
fileSplit.getPath(),
OrcFile... | java | @Override
public void initialize(
InputSplit inputSplit, TaskAttemptContext taskAttemptContext) throws IOException {
FileSplit fileSplit = (FileSplit)inputSplit;
Configuration conf = taskAttemptContext.getConfiguration();
Reader reader = OrcFile.createReader(
fileSplit.getPath(),
OrcFile... | [
"@",
"Override",
"public",
"void",
"initialize",
"(",
"InputSplit",
"inputSplit",
",",
"TaskAttemptContext",
"taskAttemptContext",
")",
"throws",
"IOException",
"{",
"FileSplit",
"fileSplit",
"=",
"(",
"FileSplit",
")",
"inputSplit",
";",
"Configuration",
"conf",
"=... | Initialize ORC file reader and batch record reader.
Please note that `initBatch` is needed to be called after this. | [
"Initialize",
"ORC",
"file",
"reader",
"and",
"batch",
"record",
"reader",
".",
"Please",
"note",
"that",
"initBatch",
"is",
"needed",
"to",
"be",
"called",
"after",
"this",
"."
] | 25ee0474f47d9c30d6f553a7892d9549f91071cf | https://github.com/apache/spark/blob/25ee0474f47d9c30d6f553a7892d9549f91071cf/sql/core/src/main/java/org/apache/spark/sql/execution/datasources/orc/OrcColumnarBatchReader.java#L118-L131 | train | Initialize the sequence header. | [
30522,
1030,
2058,
15637,
2270,
11675,
3988,
4697,
1006,
20407,
24759,
4183,
20407,
24759,
4183,
1010,
4708,
19321,
6633,
13876,
8663,
18209,
4708,
19321,
6633,
13876,
8663,
18209,
1007,
11618,
22834,
10288,
24422,
1063,
6764,
24759,
4183,
67... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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 | common/src/main/java/io/netty/util/concurrent/RejectedExecutionHandlers.java | RejectedExecutionHandlers.backoff | public static RejectedExecutionHandler backoff(final int retries, long backoffAmount, TimeUnit unit) {
ObjectUtil.checkPositive(retries, "retries");
final long backOffNanos = unit.toNanos(backoffAmount);
return new RejectedExecutionHandler() {
@Override
public void reject... | java | public static RejectedExecutionHandler backoff(final int retries, long backoffAmount, TimeUnit unit) {
ObjectUtil.checkPositive(retries, "retries");
final long backOffNanos = unit.toNanos(backoffAmount);
return new RejectedExecutionHandler() {
@Override
public void reject... | [
"public",
"static",
"RejectedExecutionHandler",
"backoff",
"(",
"final",
"int",
"retries",
",",
"long",
"backoffAmount",
",",
"TimeUnit",
"unit",
")",
"{",
"ObjectUtil",
".",
"checkPositive",
"(",
"retries",
",",
"\"retries\"",
")",
";",
"final",
"long",
"backOf... | Tries to backoff when the task can not be added due restrictions for an configured amount of time. This
is only done if the task was added from outside of the event loop which means
{@link EventExecutor#inEventLoop()} returns {@code false}. | [
"Tries",
"to",
"backoff",
"when",
"the",
"task",
"can",
"not",
"be",
"added",
"due",
"restrictions",
"for",
"an",
"configured",
"amount",
"of",
"time",
".",
"This",
"is",
"only",
"done",
"if",
"the",
"task",
"was",
"added",
"from",
"outside",
"of",
"the"... | ba06eafa1c1824bd154f1a380019e7ea2edf3c4c | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/common/src/main/java/io/netty/util/concurrent/RejectedExecutionHandlers.java#L49-L71 | train | Create a RejectedExecutionHandler that retries the specified number of times. | [
30522,
2270,
10763,
5837,
10288,
8586,
13700,
11774,
3917,
2067,
7245,
1006,
2345,
20014,
2128,
21011,
1010,
2146,
2067,
7245,
22591,
16671,
1010,
2051,
19496,
2102,
3131,
1007,
1063,
4874,
21823,
2140,
1012,
4638,
6873,
28032,
3512,
1006,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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 | buffer/src/main/java/io/netty/buffer/Unpooled.java | Unpooled.copiedBuffer | public static ByteBuf copiedBuffer(ByteBuf... buffers) {
switch (buffers.length) {
case 0:
return EMPTY_BUFFER;
case 1:
return copiedBuffer(buffers[0]);
}
// Merge the specified buffers into one buffer.
ByteOrder order = null;
int length =... | java | public static ByteBuf copiedBuffer(ByteBuf... buffers) {
switch (buffers.length) {
case 0:
return EMPTY_BUFFER;
case 1:
return copiedBuffer(buffers[0]);
}
// Merge the specified buffers into one buffer.
ByteOrder order = null;
int length =... | [
"public",
"static",
"ByteBuf",
"copiedBuffer",
"(",
"ByteBuf",
"...",
"buffers",
")",
"{",
"switch",
"(",
"buffers",
".",
"length",
")",
"{",
"case",
"0",
":",
"return",
"EMPTY_BUFFER",
";",
"case",
"1",
":",
"return",
"copiedBuffer",
"(",
"buffers",
"[",
... | Creates a new buffer whose content is a merged copy of the specified
{@code buffers}' readable bytes. The new buffer's {@code readerIndex}
and {@code writerIndex} are {@code 0} and the sum of all buffers'
{@code readableBytes} respectively.
@throws IllegalArgumentException
if the specified buffers' endianness are dif... | [
"Creates",
"a",
"new",
"buffer",
"whose",
"content",
"is",
"a",
"merged",
"copy",
"of",
"the",
"specified",
"{",
"@code",
"buffers",
"}",
"readable",
"bytes",
".",
"The",
"new",
"buffer",
"s",
"{",
"@code",
"readerIndex",
"}",
"and",
"{",
"@code",
"write... | ba06eafa1c1824bd154f1a380019e7ea2edf3c4c | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/buffer/src/main/java/io/netty/buffer/Unpooled.java#L469-L512 | train | Returns a new byte buffer that contains all of the specified buffers. | [
30522,
2270,
10763,
24880,
8569,
2546,
15826,
8569,
12494,
1006,
24880,
8569,
2546,
1012,
1012,
1012,
17698,
2015,
1007,
1063,
6942,
1006,
17698,
2015,
1012,
3091,
1007,
1063,
2553,
1014,
1024,
2709,
4064,
1035,
17698,
1025,
2553,
1015,
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... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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/WindowedStream.java | WindowedStream.apply | @Deprecated
public <R> SingleOutputStreamOperator<R> apply(ReduceFunction<T> reduceFunction, WindowFunction<T, R, K, W> function) {
TypeInformation<T> inType = input.getType();
TypeInformation<R> resultType = getWindowFunctionReturnType(function, inType);
return apply(reduceFunction, function, resultType);
} | java | @Deprecated
public <R> SingleOutputStreamOperator<R> apply(ReduceFunction<T> reduceFunction, WindowFunction<T, R, K, W> function) {
TypeInformation<T> inType = input.getType();
TypeInformation<R> resultType = getWindowFunctionReturnType(function, inType);
return apply(reduceFunction, function, resultType);
} | [
"@",
"Deprecated",
"public",
"<",
"R",
">",
"SingleOutputStreamOperator",
"<",
"R",
">",
"apply",
"(",
"ReduceFunction",
"<",
"T",
">",
"reduceFunction",
",",
"WindowFunction",
"<",
"T",
",",
"R",
",",
"K",
",",
"W",
">",
"function",
")",
"{",
"TypeInfor... | Applies the given window function to each window. The window function is called for each
evaluation of the window for each key individually. The output of the window function is
interpreted as a regular non-windowed stream.
<p>Arriving data is incrementally aggregated using the given reducer.
@param reduceFunction Th... | [
"Applies",
"the",
"given",
"window",
"function",
"to",
"each",
"window",
".",
"The",
"window",
"function",
"is",
"called",
"for",
"each",
"evaluation",
"of",
"the",
"window",
"for",
"each",
"key",
"individually",
".",
"The",
"output",
"of",
"the",
"window",
... | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-streaming-java/src/main/java/org/apache/flink/streaming/api/datastream/WindowedStream.java#L1136-L1142 | train | Applies a window function to the input stream. | [
30522,
1030,
2139,
28139,
12921,
2270,
1026,
1054,
1028,
2309,
5833,
18780,
21422,
25918,
8844,
1026,
1054,
1028,
6611,
1006,
5547,
11263,
27989,
1026,
1056,
1028,
5547,
11263,
27989,
1010,
3332,
11263,
27989,
1026,
1056,
1010,
1054,
1010,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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 | launcher/src/main/java/org/apache/spark/launcher/Main.java | Main.prepareWindowsCommand | private static String prepareWindowsCommand(List<String> cmd, Map<String, String> childEnv) {
StringBuilder cmdline = new StringBuilder();
for (Map.Entry<String, String> e : childEnv.entrySet()) {
cmdline.append(String.format("set %s=%s", e.getKey(), e.getValue()));
cmdline.append(" && ");
}
... | java | private static String prepareWindowsCommand(List<String> cmd, Map<String, String> childEnv) {
StringBuilder cmdline = new StringBuilder();
for (Map.Entry<String, String> e : childEnv.entrySet()) {
cmdline.append(String.format("set %s=%s", e.getKey(), e.getValue()));
cmdline.append(" && ");
}
... | [
"private",
"static",
"String",
"prepareWindowsCommand",
"(",
"List",
"<",
"String",
">",
"cmd",
",",
"Map",
"<",
"String",
",",
"String",
">",
"childEnv",
")",
"{",
"StringBuilder",
"cmdline",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"for",
"(",
"Map",
... | Prepare a command line for execution from a Windows batch script.
The method quotes all arguments so that spaces are handled as expected. Quotes within arguments
are "double quoted" (which is batch for escaping a quote). This page has more details about
quoting and other batch script fun stuff: http://ss64.com/nt/synt... | [
"Prepare",
"a",
"command",
"line",
"for",
"execution",
"from",
"a",
"Windows",
"batch",
"script",
"."
] | 25ee0474f47d9c30d6f553a7892d9549f91071cf | https://github.com/apache/spark/blob/25ee0474f47d9c30d6f553a7892d9549f91071cf/launcher/src/main/java/org/apache/spark/launcher/Main.java#L125-L136 | train | Prepare Windows command line for batch script execution. | [
30522,
2797,
10763,
5164,
7374,
11101,
15568,
9006,
2386,
2094,
1006,
2862,
1026,
5164,
1028,
4642,
2094,
1010,
4949,
1026,
5164,
1010,
5164,
1028,
2775,
2368,
2615,
1007,
1063,
5164,
8569,
23891,
2099,
4642,
19422,
3170,
1027,
2047,
5164,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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 | common/unsafe/src/main/java/org/apache/spark/unsafe/types/UTF8String.java | UTF8String.subStringIndex | public UTF8String subStringIndex(UTF8String delim, int count) {
if (delim.numBytes == 0 || count == 0) {
return EMPTY_UTF8;
}
if (count > 0) {
int idx = -1;
while (count > 0) {
idx = find(delim, idx + 1);
if (idx >= 0) {
count --;
} else {
// can... | java | public UTF8String subStringIndex(UTF8String delim, int count) {
if (delim.numBytes == 0 || count == 0) {
return EMPTY_UTF8;
}
if (count > 0) {
int idx = -1;
while (count > 0) {
idx = find(delim, idx + 1);
if (idx >= 0) {
count --;
} else {
// can... | [
"public",
"UTF8String",
"subStringIndex",
"(",
"UTF8String",
"delim",
",",
"int",
"count",
")",
"{",
"if",
"(",
"delim",
".",
"numBytes",
"==",
"0",
"||",
"count",
"==",
"0",
")",
"{",
"return",
"EMPTY_UTF8",
";",
"}",
"if",
"(",
"count",
">",
"0",
"... | Returns the substring from string str before count occurrences of the delimiter delim.
If count is positive, everything the left of the final delimiter (counting from left) is
returned. If count is negative, every to the right of the final delimiter (counting from the
right) is returned. subStringIndex performs a case-... | [
"Returns",
"the",
"substring",
"from",
"string",
"str",
"before",
"count",
"occurrences",
"of",
"the",
"delimiter",
"delim",
".",
"If",
"count",
"is",
"positive",
"everything",
"the",
"left",
"of",
"the",
"final",
"delimiter",
"(",
"counting",
"from",
"left",
... | 25ee0474f47d9c30d6f553a7892d9549f91071cf | https://github.com/apache/spark/blob/25ee0474f47d9c30d6f553a7892d9549f91071cf/common/unsafe/src/main/java/org/apache/spark/unsafe/types/UTF8String.java#L771-L813 | train | Returns the index of the first substring of this string in the specified string. | [
30522,
2270,
21183,
2546,
2620,
3367,
4892,
4942,
3367,
4892,
22254,
10288,
1006,
21183,
2546,
2620,
3367,
4892,
3972,
5714,
1010,
20014,
4175,
1007,
1063,
2065,
1006,
3972,
5714,
1012,
15903,
17250,
2015,
1027,
1027,
1014,
1064,
1064,
4175... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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-core/src/main/java/org/apache/flink/api/common/io/DelimitedInputFormat.java | DelimitedInputFormat.readLine | protected final boolean readLine() throws IOException {
if (this.stream == null || this.overLimit) {
return false;
}
int countInWrapBuffer = 0;
// position of matching positions in the delimiter byte array
int delimPos = 0;
while (true) {
if (this.readPos >= this.limit) {
// readBuffer is compl... | java | protected final boolean readLine() throws IOException {
if (this.stream == null || this.overLimit) {
return false;
}
int countInWrapBuffer = 0;
// position of matching positions in the delimiter byte array
int delimPos = 0;
while (true) {
if (this.readPos >= this.limit) {
// readBuffer is compl... | [
"protected",
"final",
"boolean",
"readLine",
"(",
")",
"throws",
"IOException",
"{",
"if",
"(",
"this",
".",
"stream",
"==",
"null",
"||",
"this",
".",
"overLimit",
")",
"{",
"return",
"false",
";",
"}",
"int",
"countInWrapBuffer",
"=",
"0",
";",
"// pos... | -------------------------------------------------------------------------------------------- | [
"--------------------------------------------------------------------------------------------"
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-core/src/main/java/org/apache/flink/api/common/io/DelimitedInputFormat.java#L541-L652 | train | Read a line from the input stream. | [
30522,
5123,
2345,
22017,
20898,
3191,
4179,
1006,
1007,
11618,
22834,
10288,
24422,
1063,
2065,
1006,
2023,
1012,
5460,
1027,
1027,
19701,
1064,
1064,
2023,
1012,
2058,
17960,
4183,
1007,
1063,
2709,
6270,
1025,
1065,
20014,
4175,
2378,
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... |
netty/netty | codec-http/src/main/java/io/netty/handler/codec/http/HttpUtil.java | HttpUtil.getMimeType | public static CharSequence getMimeType(CharSequence contentTypeValue) {
if (contentTypeValue == null) {
throw new NullPointerException("contentTypeValue");
}
int indexOfSemicolon = AsciiString.indexOfIgnoreCaseAscii(contentTypeValue, SEMICOLON, 0);
if (indexOfSemicolon != As... | java | public static CharSequence getMimeType(CharSequence contentTypeValue) {
if (contentTypeValue == null) {
throw new NullPointerException("contentTypeValue");
}
int indexOfSemicolon = AsciiString.indexOfIgnoreCaseAscii(contentTypeValue, SEMICOLON, 0);
if (indexOfSemicolon != As... | [
"public",
"static",
"CharSequence",
"getMimeType",
"(",
"CharSequence",
"contentTypeValue",
")",
"{",
"if",
"(",
"contentTypeValue",
"==",
"null",
")",
"{",
"throw",
"new",
"NullPointerException",
"(",
"\"contentTypeValue\"",
")",
";",
"}",
"int",
"indexOfSemicolon"... | Fetch MIME type part from Content-Type header value as a char sequence.
@param contentTypeValue Content-Type header value to parse
@return the MIME type as a {@code CharSequence} from message's Content-Type header
or {@code null} if content-type header or MIME type part of this header are not presented
<p/>
"content-t... | [
"Fetch",
"MIME",
"type",
"part",
"from",
"Content",
"-",
"Type",
"header",
"value",
"as",
"a",
"char",
"sequence",
"."
] | ba06eafa1c1824bd154f1a380019e7ea2edf3c4c | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/codec-http/src/main/java/io/netty/handler/codec/http/HttpUtil.java#L506-L517 | train | Gets the mime type from the content type value. | [
30522,
2270,
10763,
25869,
3366,
4226,
5897,
2131,
4328,
11368,
18863,
1006,
25869,
3366,
4226,
5897,
4180,
13874,
10175,
5657,
1007,
1063,
2065,
1006,
4180,
13874,
10175,
5657,
1027,
1027,
19701,
1007,
1063,
5466,
2047,
19701,
8400,
7869,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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 | buffer/src/main/java/io/netty/buffer/ByteBufUtil.java | ByteBufUtil.getBytes | public static byte[] getBytes(ByteBuf buf, int start, int length, boolean copy) {
int capacity = buf.capacity();
if (isOutOfBounds(start, length, capacity)) {
throw new IndexOutOfBoundsException("expected: " + "0 <= start(" + start + ") <= start + length(" + length
+ ") <... | java | public static byte[] getBytes(ByteBuf buf, int start, int length, boolean copy) {
int capacity = buf.capacity();
if (isOutOfBounds(start, length, capacity)) {
throw new IndexOutOfBoundsException("expected: " + "0 <= start(" + start + ") <= start + length(" + length
+ ") <... | [
"public",
"static",
"byte",
"[",
"]",
"getBytes",
"(",
"ByteBuf",
"buf",
",",
"int",
"start",
",",
"int",
"length",
",",
"boolean",
"copy",
")",
"{",
"int",
"capacity",
"=",
"buf",
".",
"capacity",
"(",
")",
";",
"if",
"(",
"isOutOfBounds",
"(",
"sta... | Return an array of the underlying storage from {@code buf} into a byte array.
The copy will start at {@code start} and copy {@code length} bytes.
If {@code copy} is true a copy will be made of the memory.
If {@code copy} is false the underlying storage will be shared, if possible. | [
"Return",
"an",
"array",
"of",
"the",
"underlying",
"storage",
"from",
"{"
] | ba06eafa1c1824bd154f1a380019e7ea2edf3c4c | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/buffer/src/main/java/io/netty/buffer/ByteBufUtil.java#L839-L858 | train | Get bytes from a buffer. | [
30522,
2270,
10763,
24880,
1031,
1033,
2131,
3762,
4570,
1006,
24880,
8569,
2546,
30524,
3091,
1010,
3977,
1007,
1007,
1063,
5466,
2047,
5950,
5833,
11253,
15494,
3366,
2595,
24422,
1006,
1000,
3517,
1024,
1000,
1009,
1000,
1014,
1026,
1027... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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-core/src/main/java/org/apache/flink/api/common/typeutils/NestedSerializersSnapshotDelegate.java | NestedSerializersSnapshotDelegate.readNestedSerializerSnapshots | public static NestedSerializersSnapshotDelegate readNestedSerializerSnapshots(DataInputView in, ClassLoader cl) throws IOException {
final int magicNumber = in.readInt();
if (magicNumber != MAGIC_NUMBER) {
throw new IOException(String.format("Corrupt data, magic number mismatch. Expected %8x, found %8x",
MA... | java | public static NestedSerializersSnapshotDelegate readNestedSerializerSnapshots(DataInputView in, ClassLoader cl) throws IOException {
final int magicNumber = in.readInt();
if (magicNumber != MAGIC_NUMBER) {
throw new IOException(String.format("Corrupt data, magic number mismatch. Expected %8x, found %8x",
MA... | [
"public",
"static",
"NestedSerializersSnapshotDelegate",
"readNestedSerializerSnapshots",
"(",
"DataInputView",
"in",
",",
"ClassLoader",
"cl",
")",
"throws",
"IOException",
"{",
"final",
"int",
"magicNumber",
"=",
"in",
".",
"readInt",
"(",
")",
";",
"if",
"(",
"... | Reads the composite snapshot of all the contained serializers. | [
"Reads",
"the",
"composite",
"snapshot",
"of",
"all",
"the",
"contained",
"serializers",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-core/src/main/java/org/apache/flink/api/common/typeutils/NestedSerializersSnapshotDelegate.java#L166-L186 | train | Read a list of nested serializer snapshots. | [
30522,
2270,
10763,
9089,
2098,
8043,
4818,
17629,
4757,
2532,
4523,
12326,
9247,
29107,
2618,
3191,
5267,
3064,
8043,
4818,
17629,
2015,
2532,
4523,
12326,
2015,
1006,
2951,
2378,
18780,
8584,
1999,
1010,
2465,
11066,
2121,
18856,
1007,
11... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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-filesystems/flink-fs-hadoop-shaded/src/main/java/org/apache/hadoop/conf/Configuration.java | Configuration.getDouble | public double getDouble(String name, double defaultValue) {
String valueString = getTrimmed(name);
if (valueString == null)
return defaultValue;
return Double.parseDouble(valueString);
} | java | public double getDouble(String name, double defaultValue) {
String valueString = getTrimmed(name);
if (valueString == null)
return defaultValue;
return Double.parseDouble(valueString);
} | [
"public",
"double",
"getDouble",
"(",
"String",
"name",
",",
"double",
"defaultValue",
")",
"{",
"String",
"valueString",
"=",
"getTrimmed",
"(",
"name",
")",
";",
"if",
"(",
"valueString",
"==",
"null",
")",
"return",
"defaultValue",
";",
"return",
"Double"... | Get the value of the <code>name</code> property as a <code>double</code>.
If no such property exists, the provided default value is returned,
or if the specified value is not a valid <code>double</code>,
then an error is thrown.
@param name property name.
@param defaultValue default value.
@throws NumberFormatExceptio... | [
"Get",
"the",
"value",
"of",
"the",
"<code",
">",
"name<",
"/",
"code",
">",
"property",
"as",
"a",
"<code",
">",
"double<",
"/",
"code",
">",
".",
"If",
"no",
"such",
"property",
"exists",
"the",
"provided",
"default",
"value",
"is",
"returned",
"or",... | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-filesystems/flink-fs-hadoop-shaded/src/main/java/org/apache/hadoop/conf/Configuration.java#L1507-L1512 | train | Get the double value of the specified attribute as a double. | [
30522,
2270,
3313,
2131,
26797,
3468,
1006,
5164,
2171,
1010,
3313,
12398,
10175,
5657,
1007,
1063,
5164,
5300,
18886,
3070,
1027,
2131,
18886,
20058,
2094,
1006,
2171,
1007,
1025,
2065,
1006,
5300,
18886,
3070,
1027,
1027,
19701,
1007,
270... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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 | buffer/src/main/java/io/netty/buffer/CompositeByteBuf.java | CompositeByteBuf.addComponents | private CompositeByteBuf addComponents(boolean increaseIndex, int cIndex, Iterable<ByteBuf> buffers) {
if (buffers instanceof ByteBuf) {
// If buffers also implements ByteBuf (e.g. CompositeByteBuf), it has to go to addComponent(ByteBuf).
return addComponent(increaseIndex, cIndex, (ByteB... | java | private CompositeByteBuf addComponents(boolean increaseIndex, int cIndex, Iterable<ByteBuf> buffers) {
if (buffers instanceof ByteBuf) {
// If buffers also implements ByteBuf (e.g. CompositeByteBuf), it has to go to addComponent(ByteBuf).
return addComponent(increaseIndex, cIndex, (ByteB... | [
"private",
"CompositeByteBuf",
"addComponents",
"(",
"boolean",
"increaseIndex",
",",
"int",
"cIndex",
",",
"Iterable",
"<",
"ByteBuf",
">",
"buffers",
")",
"{",
"if",
"(",
"buffers",
"instanceof",
"ByteBuf",
")",
"{",
"// If buffers also implements ByteBuf (e.g. Comp... | but we do in the most common case that the Iterable is a Collection) | [
"but",
"we",
"do",
"in",
"the",
"most",
"common",
"case",
"that",
"the",
"Iterable",
"is",
"a",
"Collection",
")"
] | ba06eafa1c1824bd154f1a380019e7ea2edf3c4c | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/buffer/src/main/java/io/netty/buffer/CompositeByteBuf.java#L488-L514 | train | Add components from a list of buffers to this CompositeByteBuf. | [
30522,
2797,
12490,
3762,
2618,
8569,
2546,
5587,
9006,
29513,
7666,
1006,
22017,
20898,
3623,
22254,
10288,
1010,
20014,
25022,
13629,
2595,
1010,
2009,
6906,
3468,
1026,
24880,
8569,
2546,
1028,
17698,
2015,
1007,
1063,
2065,
1006,
17698,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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 | handler/src/main/java/io/netty/handler/ssl/SslContext.java | SslContext.newClientContext | @Deprecated
public static SslContext newClientContext(
File certChainFile, TrustManagerFactory trustManagerFactory) throws SSLException {
return newClientContext(null, certChainFile, trustManagerFactory);
} | java | @Deprecated
public static SslContext newClientContext(
File certChainFile, TrustManagerFactory trustManagerFactory) throws SSLException {
return newClientContext(null, certChainFile, trustManagerFactory);
} | [
"@",
"Deprecated",
"public",
"static",
"SslContext",
"newClientContext",
"(",
"File",
"certChainFile",
",",
"TrustManagerFactory",
"trustManagerFactory",
")",
"throws",
"SSLException",
"{",
"return",
"newClientContext",
"(",
"null",
",",
"certChainFile",
",",
"trustMana... | Creates a new client-side {@link SslContext}.
@param certChainFile an X.509 certificate chain file in PEM format.
{@code null} to use the system default
@param trustManagerFactory the {@link TrustManagerFactory} that provides the {@link TrustManager}s
that verifies the certificates sent from servers.
{@code null} to u... | [
"Creates",
"a",
"new",
"client",
"-",
"side",
"{",
"@link",
"SslContext",
"}",
"."
] | ba06eafa1c1824bd154f1a380019e7ea2edf3c4c | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/handler/src/main/java/io/netty/handler/ssl/SslContext.java#L495-L499 | train | Create a new SslContext using the specified trust manager factory. | [
30522,
1030,
2139,
28139,
12921,
2270,
10763,
7020,
22499,
10111,
18413,
2047,
20464,
11638,
8663,
18209,
1006,
5371,
8292,
5339,
24925,
2078,
8873,
2571,
1010,
3404,
24805,
4590,
21450,
3404,
24805,
4590,
21450,
1007,
11618,
7020,
2571,
2595... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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/corpus/io/IOUtil.java | IOUtil.readBytesFromOtherInputStream | public static byte[] readBytesFromOtherInputStream(InputStream is) throws IOException
{
ByteArrayOutputStream data = new ByteArrayOutputStream();
int readBytes;
byte[] buffer = new byte[Math.max(is.available(), 4096)]; // 最低4KB的缓冲区
while ((readBytes = is.read(buffer, 0, buffer.leng... | java | public static byte[] readBytesFromOtherInputStream(InputStream is) throws IOException
{
ByteArrayOutputStream data = new ByteArrayOutputStream();
int readBytes;
byte[] buffer = new byte[Math.max(is.available(), 4096)]; // 最低4KB的缓冲区
while ((readBytes = is.read(buffer, 0, buffer.leng... | [
"public",
"static",
"byte",
"[",
"]",
"readBytesFromOtherInputStream",
"(",
"InputStream",
"is",
")",
"throws",
"IOException",
"{",
"ByteArrayOutputStream",
"data",
"=",
"new",
"ByteArrayOutputStream",
"(",
")",
";",
"int",
"readBytes",
";",
"byte",
"[",
"]",
"b... | 将非FileInputStream的某InputStream中的全部数据读入到字节数组中
@param is
@return
@throws IOException | [
"将非FileInputStream的某InputStream中的全部数据读入到字节数组中"
] | a538d0722ab2e4980a9dcd9ea40324fc3ddba7ce | https://github.com/hankcs/HanLP/blob/a538d0722ab2e4980a9dcd9ea40324fc3ddba7ce/src/main/java/com/hankcs/hanlp/corpus/io/IOUtil.java#L268-L283 | train | readBytesFromOtherInputStream This method is used to read bytes from other input stream. | [
30522,
2270,
10763,
24880,
1031,
1033,
3191,
3762,
4570,
19699,
19506,
12399,
2378,
18780,
21422,
1006,
20407,
25379,
2003,
1007,
11618,
22834,
10288,
24422,
1063,
24880,
2906,
9447,
5833,
18780,
21422,
2951,
1027,
2047,
24880,
2906,
9447,
58... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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/hash/CompactingHashTable.java | CompactingHashTable.compactPartition | private void compactPartition(final int partitionNumber) throws IOException {
// do nothing if table was closed, parameter is invalid or no garbage exists
if (this.closed || partitionNumber >= this.partitions.size() || this.partitions.get(partitionNumber).isCompacted()) {
return;
}
// release all segments ow... | java | private void compactPartition(final int partitionNumber) throws IOException {
// do nothing if table was closed, parameter is invalid or no garbage exists
if (this.closed || partitionNumber >= this.partitions.size() || this.partitions.get(partitionNumber).isCompacted()) {
return;
}
// release all segments ow... | [
"private",
"void",
"compactPartition",
"(",
"final",
"int",
"partitionNumber",
")",
"throws",
"IOException",
"{",
"// do nothing if table was closed, parameter is invalid or no garbage exists",
"if",
"(",
"this",
".",
"closed",
"||",
"partitionNumber",
">=",
"this",
".",
... | Compacts (garbage collects) partition with copy-compact strategy using compaction partition
@param partitionNumber partition to compact
@throws IOException | [
"Compacts",
"(",
"garbage",
"collects",
")",
"partition",
"with",
"copy",
"-",
"compact",
"strategy",
"using",
"compaction",
"partition"
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/operators/hash/CompactingHashTable.java#L1056-L1129 | train | Compacts the given partition. | [
30522,
2797,
11675,
9233,
19362,
3775,
3508,
1006,
2345,
20014,
13571,
19172,
5677,
1007,
11618,
22834,
10288,
24422,
1063,
1013,
1013,
2079,
2498,
2065,
2795,
2001,
2701,
1010,
16381,
2003,
19528,
2030,
2053,
13044,
6526,
2065,
1006,
2023,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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/sql/SqlBuilder.java | SqlBuilder.join | public SqlBuilder join(String tableName, Join join) {
if (StrUtil.isBlank(tableName)) {
throw new DbRuntimeException("Table name is blank !");
}
if (null != join) {
sql.append(StrUtil.SPACE).append(join).append(" JOIN ");
if (null != wrapper) {
// 包装表名
tableName = wrapper.wrap(tableName... | java | public SqlBuilder join(String tableName, Join join) {
if (StrUtil.isBlank(tableName)) {
throw new DbRuntimeException("Table name is blank !");
}
if (null != join) {
sql.append(StrUtil.SPACE).append(join).append(" JOIN ");
if (null != wrapper) {
// 包装表名
tableName = wrapper.wrap(tableName... | [
"public",
"SqlBuilder",
"join",
"(",
"String",
"tableName",
",",
"Join",
"join",
")",
"{",
"if",
"(",
"StrUtil",
".",
"isBlank",
"(",
"tableName",
")",
")",
"{",
"throw",
"new",
"DbRuntimeException",
"(",
"\"Table name is blank !\"",
")",
";",
"}",
"if",
"... | 多表关联
@param tableName 被关联的表名
@param join 内联方式
@return 自己 | [
"多表关联"
] | bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-db/src/main/java/cn/hutool/db/sql/SqlBuilder.java#L439-L453 | train | Appends a JOIN clause to the SQL statement. | [
30522,
2270,
29296,
8569,
23891,
2099,
3693,
1006,
5164,
2795,
18442,
1010,
3693,
3693,
1007,
1063,
2065,
1006,
2358,
22134,
4014,
1012,
2003,
28522,
8950,
1006,
2795,
18442,
1007,
1007,
1063,
5466,
2047,
16962,
15532,
7292,
10288,
24422,
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... |
looly/hutool | hutool-core/src/main/java/cn/hutool/core/util/ZipUtil.java | ZipUtil.deflater | private static void deflater(InputStream in, OutputStream out, int level) {
final DeflaterOutputStream ios = (out instanceof DeflaterOutputStream) ? (DeflaterOutputStream) out : new DeflaterOutputStream(out, new Deflater(level, true));
IoUtil.copy(in, ios);
try {
ios.finish();
} catch (IOException e) {
... | java | private static void deflater(InputStream in, OutputStream out, int level) {
final DeflaterOutputStream ios = (out instanceof DeflaterOutputStream) ? (DeflaterOutputStream) out : new DeflaterOutputStream(out, new Deflater(level, true));
IoUtil.copy(in, ios);
try {
ios.finish();
} catch (IOException e) {
... | [
"private",
"static",
"void",
"deflater",
"(",
"InputStream",
"in",
",",
"OutputStream",
"out",
",",
"int",
"level",
")",
"{",
"final",
"DeflaterOutputStream",
"ios",
"=",
"(",
"out",
"instanceof",
"DeflaterOutputStream",
")",
"?",
"(",
"DeflaterOutputStream",
")... | 将普通数据流压缩成zlib到out中
@param in zlib数据流
@param out 输出
@param level 压缩级别,0~9 | [
"将普通数据流压缩成zlib到out中"
] | bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/util/ZipUtil.java#L941-L949 | train | Write the contents of the input stream to the output stream using a compressed version of the output stream. | [
30522,
2797,
10763,
11675,
13366,
13806,
2099,
1006,
20407,
25379,
1999,
1010,
27852,
25379,
2041,
1010,
20014,
2504,
1007,
1063,
2345,
13366,
13806,
22494,
25856,
16446,
25379,
16380,
1027,
1006,
2041,
6013,
11253,
13366,
13806,
22494,
25856,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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-core/sharding-core-rewrite/src/main/java/org/apache/shardingsphere/core/rewrite/SQLRewriteEngine.java | SQLRewriteEngine.rewrite | public SQLBuilder rewrite(final boolean isSingleRouting) {
SQLBuilder result = new SQLBuilder(parameters);
if (sqlTokens.isEmpty()) {
return appendOriginalLiterals(result);
}
appendInitialLiterals(!isSingleRouting, result);
appendTokensAndPlaceholders(!isSingleRouting... | java | public SQLBuilder rewrite(final boolean isSingleRouting) {
SQLBuilder result = new SQLBuilder(parameters);
if (sqlTokens.isEmpty()) {
return appendOriginalLiterals(result);
}
appendInitialLiterals(!isSingleRouting, result);
appendTokensAndPlaceholders(!isSingleRouting... | [
"public",
"SQLBuilder",
"rewrite",
"(",
"final",
"boolean",
"isSingleRouting",
")",
"{",
"SQLBuilder",
"result",
"=",
"new",
"SQLBuilder",
"(",
"parameters",
")",
";",
"if",
"(",
"sqlTokens",
".",
"isEmpty",
"(",
")",
")",
"{",
"return",
"appendOriginalLiteral... | rewrite SQL.
@param isSingleRouting is rewrite
@return SQL builder | [
"rewrite",
"SQL",
"."
] | f88fd29fc345dfb31fdce12e9e96cbfa0fd2402d | https://github.com/apache/incubator-shardingsphere/blob/f88fd29fc345dfb31fdce12e9e96cbfa0fd2402d/sharding-core/sharding-core-rewrite/src/main/java/org/apache/shardingsphere/core/rewrite/SQLRewriteEngine.java#L145-L154 | train | Rewrite the SQL. | [
30522,
2270,
29296,
8569,
23891,
2099,
2128,
26373,
1006,
2345,
22017,
20898,
26354,
2075,
3917,
5833,
2075,
1007,
1063,
29296,
8569,
23891,
2099,
2765,
1027,
2047,
29296,
8569,
23891,
2099,
1006,
11709,
1007,
1025,
2065,
1006,
29296,
18715,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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-core/src/main/java/org/apache/flink/api/common/ExecutionConfig.java | ExecutionConfig.getRegisteredKryoTypes | public LinkedHashSet<Class<?>> getRegisteredKryoTypes() {
if (isForceKryoEnabled()) {
// if we force kryo, we must also return all the types that
// were previously only registered as POJO
LinkedHashSet<Class<?>> result = new LinkedHashSet<>();
result.addAll(registeredKryoTypes);
for(Class<?> t : regis... | java | public LinkedHashSet<Class<?>> getRegisteredKryoTypes() {
if (isForceKryoEnabled()) {
// if we force kryo, we must also return all the types that
// were previously only registered as POJO
LinkedHashSet<Class<?>> result = new LinkedHashSet<>();
result.addAll(registeredKryoTypes);
for(Class<?> t : regis... | [
"public",
"LinkedHashSet",
"<",
"Class",
"<",
"?",
">",
">",
"getRegisteredKryoTypes",
"(",
")",
"{",
"if",
"(",
"isForceKryoEnabled",
"(",
")",
")",
"{",
"// if we force kryo, we must also return all the types that",
"// were previously only registered as POJO",
"LinkedHas... | Returns the registered Kryo types. | [
"Returns",
"the",
"registered",
"Kryo",
"types",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-core/src/main/java/org/apache/flink/api/common/ExecutionConfig.java#L887-L902 | train | Returns the set of types that have been registered as POJO type. | [
30522,
2270,
5799,
14949,
7898,
3388,
1026,
2465,
1026,
1029,
1028,
1028,
2131,
2890,
24063,
6850,
21638,
7677,
13874,
2015,
1006,
1007,
1063,
2065,
1006,
2003,
14821,
21638,
7677,
8189,
23242,
1006,
1007,
1007,
1063,
1013,
1013,
2065,
2057... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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/lang/Console.java | Console.log | public static void log(Throwable t, String template, Object... values) {
out.println(StrUtil.format(template, values));
if (null != t) {
t.printStackTrace();
out.flush();
}
} | java | public static void log(Throwable t, String template, Object... values) {
out.println(StrUtil.format(template, values));
if (null != t) {
t.printStackTrace();
out.flush();
}
} | [
"public",
"static",
"void",
"log",
"(",
"Throwable",
"t",
",",
"String",
"template",
",",
"Object",
"...",
"values",
")",
"{",
"out",
".",
"println",
"(",
"StrUtil",
".",
"format",
"(",
"template",
",",
"values",
")",
")",
";",
"if",
"(",
"null",
"!=... | 同 System.out.println()方法,打印控制台日志
@param t 异常对象
@param template 文本模板,被替换的部分用 {} 表示
@param values 值 | [
"同",
"System",
".",
"out",
".",
"println",
"()",
"方法,打印控制台日志"
] | bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/lang/Console.java#L107-L113 | train | Log a throwable with a formatted message. | [
30522,
2270,
10763,
11675,
8833,
1006,
5466,
3085,
1056,
1010,
5164,
23561,
1010,
4874,
1012,
1012,
1012,
5300,
1007,
1063,
2041,
1012,
6140,
19666,
1006,
2358,
22134,
4014,
1012,
4289,
1006,
23561,
1010,
5300,
1007,
1007,
1025,
2065,
1006,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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/iterative/concurrent/SuperstepBarrier.java | SuperstepBarrier.onEvent | @Override
public void onEvent(TaskEvent event) {
if (event instanceof TerminationEvent) {
terminationSignaled = true;
}
else if (event instanceof AllWorkersDoneEvent) {
AllWorkersDoneEvent wde = (AllWorkersDoneEvent) event;
aggregatorNames = wde.getAggregatorNames();
aggregates = wde.getAggregates(us... | java | @Override
public void onEvent(TaskEvent event) {
if (event instanceof TerminationEvent) {
terminationSignaled = true;
}
else if (event instanceof AllWorkersDoneEvent) {
AllWorkersDoneEvent wde = (AllWorkersDoneEvent) event;
aggregatorNames = wde.getAggregatorNames();
aggregates = wde.getAggregates(us... | [
"@",
"Override",
"public",
"void",
"onEvent",
"(",
"TaskEvent",
"event",
")",
"{",
"if",
"(",
"event",
"instanceof",
"TerminationEvent",
")",
"{",
"terminationSignaled",
"=",
"true",
";",
"}",
"else",
"if",
"(",
"event",
"instanceof",
"AllWorkersDoneEvent",
")... | Barrier will release the waiting thread if an event occurs. | [
"Barrier",
"will",
"release",
"the",
"waiting",
"thread",
"if",
"an",
"event",
"occurs",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/iterative/concurrent/SuperstepBarrier.java#L66-L81 | train | Called by the TaskEventListener to process the termination event. | [
30522,
1030,
2058,
15637,
2270,
11675,
2028,
15338,
1006,
4708,
18697,
3372,
2724,
1007,
1063,
2065,
1006,
2724,
6013,
11253,
18287,
18697,
3372,
1007,
1063,
18287,
5332,
16989,
3709,
1027,
2995,
1025,
1065,
2842,
2065,
1006,
2724,
6013,
11... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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/src/main/java/io/netty/handler/codec/LineBasedFrameDecoder.java | LineBasedFrameDecoder.findEndOfLine | private int findEndOfLine(final ByteBuf buffer) {
int totalLength = buffer.readableBytes();
int i = buffer.forEachByte(buffer.readerIndex() + offset, totalLength - offset, ByteProcessor.FIND_LF);
if (i >= 0) {
offset = 0;
if (i > 0 && buffer.getByte(i - 1) == '\r') {
... | java | private int findEndOfLine(final ByteBuf buffer) {
int totalLength = buffer.readableBytes();
int i = buffer.forEachByte(buffer.readerIndex() + offset, totalLength - offset, ByteProcessor.FIND_LF);
if (i >= 0) {
offset = 0;
if (i > 0 && buffer.getByte(i - 1) == '\r') {
... | [
"private",
"int",
"findEndOfLine",
"(",
"final",
"ByteBuf",
"buffer",
")",
"{",
"int",
"totalLength",
"=",
"buffer",
".",
"readableBytes",
"(",
")",
";",
"int",
"i",
"=",
"buffer",
".",
"forEachByte",
"(",
"buffer",
".",
"readerIndex",
"(",
")",
"+",
"of... | Returns the index in the buffer of the end of line found.
Returns -1 if no end of line was found in the buffer. | [
"Returns",
"the",
"index",
"in",
"the",
"buffer",
"of",
"the",
"end",
"of",
"line",
"found",
".",
"Returns",
"-",
"1",
"if",
"no",
"end",
"of",
"line",
"was",
"found",
"in",
"the",
"buffer",
"."
] | ba06eafa1c1824bd154f1a380019e7ea2edf3c4c | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/codec/src/main/java/io/netty/handler/codec/LineBasedFrameDecoder.java#L167-L179 | train | Find the end of line. | [
30522,
2797,
20014,
2424,
10497,
11253,
4179,
1006,
2345,
24880,
8569,
2546,
17698,
1007,
1063,
20014,
2561,
7770,
13512,
2232,
1027,
17698,
1012,
3191,
3085,
3762,
4570,
1006,
1007,
1025,
20014,
1045,
1027,
17698,
1012,
18921,
6776,
3762,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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-configuration-processor/src/json-shade/java/org/springframework/boot/configurationprocessor/json/JSONArray.java | JSONArray.getJSONObject | public JSONObject getJSONObject(int index) throws JSONException {
Object object = get(index);
if (object instanceof JSONObject) {
return (JSONObject) object;
}
else {
throw JSON.typeMismatch(index, object, "JSONObject");
}
} | java | public JSONObject getJSONObject(int index) throws JSONException {
Object object = get(index);
if (object instanceof JSONObject) {
return (JSONObject) object;
}
else {
throw JSON.typeMismatch(index, object, "JSONObject");
}
} | [
"public",
"JSONObject",
"getJSONObject",
"(",
"int",
"index",
")",
"throws",
"JSONException",
"{",
"Object",
"object",
"=",
"get",
"(",
"index",
")",
";",
"if",
"(",
"object",
"instanceof",
"JSONObject",
")",
"{",
"return",
"(",
"JSONObject",
")",
"object",
... | Returns the value at {@code index} if it exists and is a {@code
JSONObject}.
@param index the index to get the value from
@return the object at {@code index}
@throws JSONException if the value doesn't exist or is not a {@code
JSONObject}. | [
"Returns",
"the",
"value",
"at",
"{"
] | 0b27f7c70e164b2b1a96477f1d9c1acba56790c1 | https://github.com/spring-projects/spring-boot/blob/0b27f7c70e164b2b1a96477f1d9c1acba56790c1/spring-boot-project/spring-boot-tools/spring-boot-configuration-processor/src/json-shade/java/org/springframework/boot/configurationprocessor/json/JSONArray.java#L558-L566 | train | Gets the JSONObject at the given index. | [
30522,
2270,
1046,
3385,
16429,
20614,
2131,
22578,
17175,
2497,
20614,
1006,
20014,
5950,
1007,
11618,
1046,
3385,
10288,
24422,
1063,
4874,
4874,
1027,
2131,
1006,
5950,
1007,
1025,
2065,
1006,
4874,
6013,
11253,
1046,
3385,
16429,
20614,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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/recognition/nr/JapanesePersonRecognition.java | JapanesePersonRecognition.insertName | private static void insertName(String name, int activeLine, WordNet wordNetOptimum, WordNet wordNetAll)
{
if (isBadCase(name)) return;
wordNetOptimum.insert(activeLine, new Vertex(Predefine.TAG_PEOPLE, name, new CoreDictionary.Attribute(Nature.nrj), WORD_ID), wordNetAll);
} | java | private static void insertName(String name, int activeLine, WordNet wordNetOptimum, WordNet wordNetAll)
{
if (isBadCase(name)) return;
wordNetOptimum.insert(activeLine, new Vertex(Predefine.TAG_PEOPLE, name, new CoreDictionary.Attribute(Nature.nrj), WORD_ID), wordNetAll);
} | [
"private",
"static",
"void",
"insertName",
"(",
"String",
"name",
",",
"int",
"activeLine",
",",
"WordNet",
"wordNetOptimum",
",",
"WordNet",
"wordNetAll",
")",
"{",
"if",
"(",
"isBadCase",
"(",
"name",
")",
")",
"return",
";",
"wordNetOptimum",
".",
"insert... | 插入日本人名
@param name
@param activeLine
@param wordNetOptimum
@param wordNetAll | [
"插入日本人名"
] | a538d0722ab2e4980a9dcd9ea40324fc3ddba7ce | https://github.com/hankcs/HanLP/blob/a538d0722ab2e4980a9dcd9ea40324fc3ddba7ce/src/main/java/com/hankcs/hanlp/recognition/nr/JapanesePersonRecognition.java#L121-L125 | train | Insert name into the wordNetOptimum wordNetAll. | [
30522,
2797,
10763,
11675,
19274,
18442,
1006,
5164,
2171,
1010,
20014,
3161,
4179,
1010,
2773,
7159,
2773,
7159,
7361,
3775,
27147,
1010,
2773,
7159,
2773,
7159,
8095,
1007,
1063,
2065,
1006,
2003,
9024,
18382,
1006,
2171,
1007,
1007,
2709... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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-connectors/flink-connector-kafka/src/main/java/org/apache/flink/streaming/connectors/kafka/internal/KafkaConsumerThread.java | KafkaConsumerThread.reassignPartitions | @VisibleForTesting
void reassignPartitions(List<KafkaTopicPartitionState<TopicPartition>> newPartitions) throws Exception {
if (newPartitions.size() == 0) {
return;
}
hasAssignedPartitions = true;
boolean reassignmentStarted = false;
// since the reassignment may introduce several Kafka blocking calls th... | java | @VisibleForTesting
void reassignPartitions(List<KafkaTopicPartitionState<TopicPartition>> newPartitions) throws Exception {
if (newPartitions.size() == 0) {
return;
}
hasAssignedPartitions = true;
boolean reassignmentStarted = false;
// since the reassignment may introduce several Kafka blocking calls th... | [
"@",
"VisibleForTesting",
"void",
"reassignPartitions",
"(",
"List",
"<",
"KafkaTopicPartitionState",
"<",
"TopicPartition",
">",
">",
"newPartitions",
")",
"throws",
"Exception",
"{",
"if",
"(",
"newPartitions",
".",
"size",
"(",
")",
"==",
"0",
")",
"{",
"re... | Reestablishes the assigned partitions for the consumer.
The reassigned partitions consists of the provided new partitions and whatever partitions
was already previously assigned to the consumer.
<p>The reassignment process is protected against wakeup calls, so that after
this method returns, the consumer is either unt... | [
"Reestablishes",
"the",
"assigned",
"partitions",
"for",
"the",
"consumer",
".",
"The",
"reassigned",
"partitions",
"consists",
"of",
"the",
"provided",
"new",
"partitions",
"and",
"whatever",
"partitions",
"was",
"already",
"previously",
"assigned",
"to",
"the",
... | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-connectors/flink-connector-kafka/src/main/java/org/apache/flink/streaming/connectors/kafka/internal/KafkaConsumerThread.java#L372-L473 | train | Reassign partitions to the new partitions. | [
30522,
1030,
5710,
13028,
4355,
2075,
11675,
2128,
12054,
23773,
19362,
3775,
9285,
1006,
2862,
1026,
10556,
24316,
10610,
24330,
19362,
3775,
9285,
12259,
1026,
8476,
19362,
3775,
3508,
1028,
1028,
2047,
19362,
3775,
9285,
1007,
11618,
6453,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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/sort/LargeRecordHandler.java | LargeRecordHandler.close | public void close() throws IOException {
// we go on closing and deleting files in the presence of failures.
// we remember the first exception to occur and re-throw it later
Throwable ex = null;
synchronized (this) {
if (closed) {
return;
}
closed = true;
// close the writers
i... | java | public void close() throws IOException {
// we go on closing and deleting files in the presence of failures.
// we remember the first exception to occur and re-throw it later
Throwable ex = null;
synchronized (this) {
if (closed) {
return;
}
closed = true;
// close the writers
i... | [
"public",
"void",
"close",
"(",
")",
"throws",
"IOException",
"{",
"// we go on closing and deleting files in the presence of failures.",
"// we remember the first exception to occur and re-throw it later",
"Throwable",
"ex",
"=",
"null",
";",
"synchronized",
"(",
"this",
")",
... | Closes all structures and deletes all temporary files.
Even in the presence of failures, this method will try and continue closing
files and deleting temporary files.
@throws IOException Thrown if an error occurred while closing/deleting the files. | [
"Closes",
"all",
"structures",
"and",
"deletes",
"all",
"temporary",
"files",
".",
"Even",
"in",
"the",
"presence",
"of",
"failures",
"this",
"method",
"will",
"try",
"and",
"continue",
"closing",
"files",
"and",
"deleting",
"temporary",
"files",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/operators/sort/LargeRecordHandler.java#L280-L373 | train | Closes the underlying file system. | [
30522,
2270,
11675,
2485,
1006,
1007,
11618,
22834,
10288,
24422,
1063,
1013,
1013,
2057,
2175,
2006,
5494,
1998,
3972,
20624,
3070,
6764,
1999,
1996,
3739,
1997,
15428,
1012,
1013,
1013,
2057,
3342,
1996,
2034,
6453,
2000,
5258,
1998,
2128... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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-poi/src/main/java/cn/hutool/poi/excel/ExcelWriter.java | ExcelWriter.writeHeadRow | public ExcelWriter writeHeadRow(Iterable<?> rowData) {
Assert.isFalse(this.isClosed, "ExcelWriter has been closed!");
RowUtil.writeRow(this.sheet.createRow(this.currentRow.getAndIncrement()), rowData, this.styleSet, true);
return this;
} | java | public ExcelWriter writeHeadRow(Iterable<?> rowData) {
Assert.isFalse(this.isClosed, "ExcelWriter has been closed!");
RowUtil.writeRow(this.sheet.createRow(this.currentRow.getAndIncrement()), rowData, this.styleSet, true);
return this;
} | [
"public",
"ExcelWriter",
"writeHeadRow",
"(",
"Iterable",
"<",
"?",
">",
"rowData",
")",
"{",
"Assert",
".",
"isFalse",
"(",
"this",
".",
"isClosed",
",",
"\"ExcelWriter has been closed!\"",
")",
";",
"RowUtil",
".",
"writeRow",
"(",
"this",
".",
"sheet",
".... | 写出一行标题数据<br>
本方法只是将数据写入Workbook中的Sheet,并不写出到文件<br>
写出的起始行为当前行号,可使用{@link #getCurrentRow()}方法调用,根据写出的的行数,当前行号自动+1<br>
样式为默认标题样式,可使用{@link #getHeadCellStyle()}方法调用后自定义默认样式
@param rowData 一行的数据
@return this | [
"写出一行标题数据<br",
">",
"本方法只是将数据写入Workbook中的Sheet,并不写出到文件<br",
">",
"写出的起始行为当前行号,可使用",
"{",
"@link",
"#getCurrentRow",
"()",
"}",
"方法调用,根据写出的的行数,当前行号自动",
"+",
"1<br",
">",
"样式为默认标题样式,可使用",
"{",
"@link",
"#getHeadCellStyle",
"()",
"}",
"方法调用后自定义默认样式"
] | bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-poi/src/main/java/cn/hutool/poi/excel/ExcelWriter.java#L655-L659 | train | Writes a single row to the head of the file. | [
30522,
2270,
24970,
15994,
4339,
4974,
10524,
1006,
2009,
6906,
3468,
1026,
1029,
1028,
5216,
2850,
2696,
1007,
1063,
20865,
1012,
2003,
7011,
4877,
2063,
1006,
2023,
1012,
2003,
20464,
24768,
1010,
1000,
24970,
15994,
2038,
2042,
2701,
999... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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-connectors/flink-connector-kafka-0.8/src/main/java/org/apache/flink/streaming/connectors/kafka/internals/SimpleConsumerThread.java | SimpleConsumerThread.run | @Override
public void run() {
LOG.info("Starting to fetch from {}", this.partitions);
// set up the config values
try {
// create the Kafka consumer that we actually use for fetching
consumer = new SimpleConsumer(broker.host(), broker.port(), soTimeout, bufferSize, clientId);
// replace earliest of la... | java | @Override
public void run() {
LOG.info("Starting to fetch from {}", this.partitions);
// set up the config values
try {
// create the Kafka consumer that we actually use for fetching
consumer = new SimpleConsumer(broker.host(), broker.port(), soTimeout, bufferSize, clientId);
// replace earliest of la... | [
"@",
"Override",
"public",
"void",
"run",
"(",
")",
"{",
"LOG",
".",
"info",
"(",
"\"Starting to fetch from {}\"",
",",
"this",
".",
"partitions",
")",
";",
"// set up the config values",
"try",
"{",
"// create the Kafka consumer that we actually use for fetching",
"con... | ------------------------------------------------------------------------ | [
"------------------------------------------------------------------------"
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-connectors/flink-connector-kafka-0.8/src/main/java/org/apache/flink/streaming/connectors/kafka/internals/SimpleConsumerThread.java#L140-L415 | train | This method is called by the worker thread to start the actual work of fetching Kafka partitions. | [
30522,
1030,
2058,
15637,
2270,
11675,
2448,
1006,
1007,
1063,
8833,
1012,
18558,
1006,
1000,
3225,
2000,
18584,
2013,
1063,
1065,
1000,
1010,
2023,
1012,
13571,
2015,
1007,
1025,
1013,
1013,
2275,
2039,
1996,
9530,
8873,
2290,
5300,
3046,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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-core/src/main/java/org/apache/flink/configuration/Configuration.java | Configuration.getInteger | @PublicEvolving
public int getInteger(ConfigOption<Integer> configOption) {
Object o = getValueOrDefaultFromOption(configOption);
return convertToInt(o, configOption.defaultValue());
} | java | @PublicEvolving
public int getInteger(ConfigOption<Integer> configOption) {
Object o = getValueOrDefaultFromOption(configOption);
return convertToInt(o, configOption.defaultValue());
} | [
"@",
"PublicEvolving",
"public",
"int",
"getInteger",
"(",
"ConfigOption",
"<",
"Integer",
">",
"configOption",
")",
"{",
"Object",
"o",
"=",
"getValueOrDefaultFromOption",
"(",
"configOption",
")",
";",
"return",
"convertToInt",
"(",
"o",
",",
"configOption",
"... | Returns the value associated with the given config option as an integer.
@param configOption The configuration option
@return the (default) value associated with the given config option | [
"Returns",
"the",
"value",
"associated",
"with",
"the",
"given",
"config",
"option",
"as",
"an",
"integer",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-core/src/main/java/org/apache/flink/configuration/Configuration.java#L219-L223 | train | Returns the value associated with the given config option as an int. | [
30522,
1030,
2270,
6777,
4747,
6455,
2270,
20014,
2131,
18447,
26320,
1006,
9530,
8873,
3995,
16790,
1026,
16109,
1028,
9530,
8873,
3995,
16790,
1007,
1063,
4874,
1051,
1027,
2131,
10175,
5657,
8551,
12879,
23505,
19699,
19506,
16790,
1006,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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-examples/flink-examples-batch/src/main/java/org/apache/flink/examples/java/relational/util/WebLogDataGenerator.java | WebLogDataGenerator.genRanks | private static void genRanks(int noDocs, String path) {
Random rand = new Random(Calendar.getInstance().getTimeInMillis());
try (BufferedWriter fw = new BufferedWriter(new FileWriter(path))) {
for (int i = 0; i < noDocs; i++) {
// Rank
StringBuilder rank = new StringBuilder(rand.nextInt(100) + "|");
... | java | private static void genRanks(int noDocs, String path) {
Random rand = new Random(Calendar.getInstance().getTimeInMillis());
try (BufferedWriter fw = new BufferedWriter(new FileWriter(path))) {
for (int i = 0; i < noDocs; i++) {
// Rank
StringBuilder rank = new StringBuilder(rand.nextInt(100) + "|");
... | [
"private",
"static",
"void",
"genRanks",
"(",
"int",
"noDocs",
",",
"String",
"path",
")",
"{",
"Random",
"rand",
"=",
"new",
"Random",
"(",
"Calendar",
".",
"getInstance",
"(",
")",
".",
"getTimeInMillis",
"(",
")",
")",
";",
"try",
"(",
"BufferedWriter... | Generates the files for the ranks relation. The ranks entries apply the
following format: <br />
<code>Rank | URL | Average Duration |\n</code>
@param noDocs
Number of entries in the documents relation
@param path
Output path for the ranks relation | [
"Generates",
"the",
"files",
"for",
"the",
"ranks",
"relation",
".",
"The",
"ranks",
"entries",
"apply",
"the",
"following",
"format",
":",
"<br",
"/",
">",
"<code",
">",
"Rank",
"|",
"URL",
"|",
"Average",
"Duration",
"|",
"\\",
"n<",
"/",
"code",
">"... | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-examples/flink-examples-batch/src/main/java/org/apache/flink/examples/java/relational/util/WebLogDataGenerator.java#L136-L154 | train | Generate ranks for a file. | [
30522,
2797,
10763,
11675,
8991,
26763,
2015,
1006,
20014,
7293,
10085,
2015,
1010,
5164,
4130,
1007,
1063,
6721,
14566,
1027,
2047,
6721,
1006,
8094,
1012,
2131,
7076,
30524,
1045,
1026,
7293,
10085,
2015,
1025,
1045,
1009,
1009,
1007,
106... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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 | client-adapter/launcher/src/main/java/com/alibaba/otter/canal/adapter/launcher/rest/CommonRest.java | CommonRest.count | @GetMapping("/count/{type}/{key}/{task}")
public Map<String, Object> count(@PathVariable String type, @PathVariable String key, @PathVariable String task) {
OuterAdapter adapter = loader.getExtension(type, key);
return adapter.count(task);
} | java | @GetMapping("/count/{type}/{key}/{task}")
public Map<String, Object> count(@PathVariable String type, @PathVariable String key, @PathVariable String task) {
OuterAdapter adapter = loader.getExtension(type, key);
return adapter.count(task);
} | [
"@",
"GetMapping",
"(",
"\"/count/{type}/{key}/{task}\"",
")",
"public",
"Map",
"<",
"String",
",",
"Object",
">",
"count",
"(",
"@",
"PathVariable",
"String",
"type",
",",
"@",
"PathVariable",
"String",
"key",
",",
"@",
"PathVariable",
"String",
"task",
")",
... | 统计总数 curl http://127.0.0.1:8081/count/rdb/oracle1/mytest_user.yml
@param type 类型 hbase, es
@param key adapter key
@param task 任务名对应配置文件名 mytest_person2.yml
@return | [
"统计总数",
"curl",
"http",
":",
"//",
"127",
".",
"0",
".",
"0",
".",
"1",
":",
"8081",
"/",
"count",
"/",
"rdb",
"/",
"oracle1",
"/",
"mytest_user",
".",
"yml"
] | 8f088cddc0755f4350c5aaae95c6e4002d90a40f | https://github.com/alibaba/canal/blob/8f088cddc0755f4350c5aaae95c6e4002d90a40f/client-adapter/launcher/src/main/java/com/alibaba/otter/canal/adapter/launcher/rest/CommonRest.java#L134-L138 | train | Count the number of items in a single resource. | [
30522,
1030,
2131,
2863,
14853,
1006,
1000,
1013,
4175,
1013,
1063,
2828,
1065,
1013,
1063,
3145,
1065,
1013,
1063,
4708,
1065,
1000,
1007,
2270,
4949,
1026,
5164,
1010,
4874,
1028,
4175,
1006,
1030,
4130,
10755,
19210,
5164,
2828,
1010,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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-filesystems/flink-fs-hadoop-shaded/src/main/java/org/apache/hadoop/conf/Configuration.java | Configuration.getPasswordFromConfig | protected char[] getPasswordFromConfig(String name) {
char[] pass = null;
if (getBoolean(CredentialProvider.CLEAR_TEXT_FALLBACK,
CommonConfigurationKeysPublic.
HADOOP_SECURITY_CREDENTIAL_CLEAR_TEXT_FALLBACK_DEFAULT)) {
String passStr = get(name);
if (passStr != null) {
pass = passStr.toCharArray... | java | protected char[] getPasswordFromConfig(String name) {
char[] pass = null;
if (getBoolean(CredentialProvider.CLEAR_TEXT_FALLBACK,
CommonConfigurationKeysPublic.
HADOOP_SECURITY_CREDENTIAL_CLEAR_TEXT_FALLBACK_DEFAULT)) {
String passStr = get(name);
if (passStr != null) {
pass = passStr.toCharArray... | [
"protected",
"char",
"[",
"]",
"getPasswordFromConfig",
"(",
"String",
"name",
")",
"{",
"char",
"[",
"]",
"pass",
"=",
"null",
";",
"if",
"(",
"getBoolean",
"(",
"CredentialProvider",
".",
"CLEAR_TEXT_FALLBACK",
",",
"CommonConfigurationKeysPublic",
".",
"HADOO... | Fallback to clear text passwords in configuration.
@param name
@return clear text password or null | [
"Fallback",
"to",
"clear",
"text",
"passwords",
"in",
"configuration",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-filesystems/flink-fs-hadoop-shaded/src/main/java/org/apache/hadoop/conf/Configuration.java#L2249-L2260 | train | Get the password from the configuration | [
30522,
5123,
25869,
1031,
1033,
2131,
15194,
18351,
19699,
5358,
8663,
8873,
2290,
1006,
5164,
2171,
1007,
1063,
25869,
1031,
1033,
3413,
1027,
19701,
1025,
2065,
1006,
2131,
5092,
9890,
2319,
1006,
13675,
14728,
19909,
21572,
17258,
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/spark | sql/hive-thriftserver/src/main/java/org/apache/hive/service/cli/operation/SQLOperation.java | SQLOperation.getCurrentUGI | private UserGroupInformation getCurrentUGI(HiveConf opConfig) throws HiveSQLException {
try {
return Utils.getUGI();
} catch (Exception e) {
throw new HiveSQLException("Unable to get current user", e);
}
} | java | private UserGroupInformation getCurrentUGI(HiveConf opConfig) throws HiveSQLException {
try {
return Utils.getUGI();
} catch (Exception e) {
throw new HiveSQLException("Unable to get current user", e);
}
} | [
"private",
"UserGroupInformation",
"getCurrentUGI",
"(",
"HiveConf",
"opConfig",
")",
"throws",
"HiveSQLException",
"{",
"try",
"{",
"return",
"Utils",
".",
"getUGI",
"(",
")",
";",
"}",
"catch",
"(",
"Exception",
"e",
")",
"{",
"throw",
"new",
"HiveSQLExcepti... | Returns the current UGI on the stack
@param opConfig
@return UserGroupInformation
@throws HiveSQLException | [
"Returns",
"the",
"current",
"UGI",
"on",
"the",
"stack"
] | 25ee0474f47d9c30d6f553a7892d9549f91071cf | https://github.com/apache/spark/blob/25ee0474f47d9c30d6f553a7892d9549f91071cf/sql/hive-thriftserver/src/main/java/org/apache/hive/service/cli/operation/SQLOperation.java#L255-L261 | train | Get the UserGroupInformation for the current user | [
30522,
2797,
5310,
17058,
2378,
14192,
3370,
2131,
10841,
14343,
3372,
15916,
2072,
1006,
26736,
8663,
2546,
6728,
8663,
8873,
2290,
1007,
11618,
26736,
2015,
4160,
2571,
2595,
24422,
1063,
3046,
1063,
2709,
21183,
12146,
1012,
2131,
15916,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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/sort/FixedLengthRecordSorter.java | FixedLengthRecordSorter.reset | @Override
public void reset() {
// reset all offsets
this.numRecords = 0;
this.currentSortBufferOffset = 0;
this.sortBufferBytes = 0;
// return all memory
this.freeMemory.addAll(this.sortBuffer);
this.sortBuffer.clear();
// grab first buffers
this.currentSortBufferSegment = nextMemorySegment();... | java | @Override
public void reset() {
// reset all offsets
this.numRecords = 0;
this.currentSortBufferOffset = 0;
this.sortBufferBytes = 0;
// return all memory
this.freeMemory.addAll(this.sortBuffer);
this.sortBuffer.clear();
// grab first buffers
this.currentSortBufferSegment = nextMemorySegment();... | [
"@",
"Override",
"public",
"void",
"reset",
"(",
")",
"{",
"// reset all offsets",
"this",
".",
"numRecords",
"=",
"0",
";",
"this",
".",
"currentSortBufferOffset",
"=",
"0",
";",
"this",
".",
"sortBufferBytes",
"=",
"0",
";",
"// return all memory",
"this",
... | Resets the sort buffer back to the state where it is empty. All contained data is discarded. | [
"Resets",
"the",
"sort",
"buffer",
"back",
"to",
"the",
"state",
"where",
"it",
"is",
"empty",
".",
"All",
"contained",
"data",
"is",
"discarded",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/operators/sort/FixedLengthRecordSorter.java#L155-L170 | train | Resets the sort buffer. | [
30522,
1030,
2058,
15637,
2270,
11675,
25141,
1006,
1007,
1063,
1013,
1013,
25141,
2035,
16396,
2015,
2023,
1012,
16371,
2213,
2890,
27108,
5104,
1027,
1014,
1025,
2023,
1012,
14731,
11589,
8569,
12494,
27475,
3388,
1027,
1014,
1025,
2023,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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-table/flink-sql-client/src/main/java/org/apache/flink/table/client/cli/CliChangelogResultView.java | CliChangelogResultView.getHelpOptions | private List<Tuple2<String, String>> getHelpOptions() {
final List<Tuple2<String, String>> options = new ArrayList<>();
options.add(Tuple2.of("Q", CliStrings.RESULT_QUIT));
options.add(Tuple2.of("R", CliStrings.RESULT_REFRESH));
options.add(Tuple2.of("+", CliStrings.RESULT_INC_REFRESH));
options.add(Tuple2.... | java | private List<Tuple2<String, String>> getHelpOptions() {
final List<Tuple2<String, String>> options = new ArrayList<>();
options.add(Tuple2.of("Q", CliStrings.RESULT_QUIT));
options.add(Tuple2.of("R", CliStrings.RESULT_REFRESH));
options.add(Tuple2.of("+", CliStrings.RESULT_INC_REFRESH));
options.add(Tuple2.... | [
"private",
"List",
"<",
"Tuple2",
"<",
"String",
",",
"String",
">",
">",
"getHelpOptions",
"(",
")",
"{",
"final",
"List",
"<",
"Tuple2",
"<",
"String",
",",
"String",
">",
">",
"options",
"=",
"new",
"ArrayList",
"<>",
"(",
")",
";",
"options",
"."... | -------------------------------------------------------------------------------------------- | [
"--------------------------------------------------------------------------------------------"
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-table/flink-sql-client/src/main/java/org/apache/flink/table/client/cli/CliChangelogResultView.java#L269-L281 | train | Get help options. | [
30522,
2797,
2862,
1026,
10722,
10814,
2475,
1026,
5164,
1010,
5164,
1028,
1028,
2131,
16001,
16340,
9285,
1006,
1007,
1063,
2345,
2862,
1026,
10722,
10814,
2475,
1026,
5164,
1010,
5164,
1028,
1028,
7047,
1027,
2047,
9140,
9863,
1026,
1028,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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/bean/copier/BeanCopier.java | BeanCopier.mapToBean | private void mapToBean(Map<?, ?> map, Object bean) {
valueProviderToBean(new MapValueProvider(map, this.copyOptions.ignoreCase), bean);
} | java | private void mapToBean(Map<?, ?> map, Object bean) {
valueProviderToBean(new MapValueProvider(map, this.copyOptions.ignoreCase), bean);
} | [
"private",
"void",
"mapToBean",
"(",
"Map",
"<",
"?",
",",
"?",
">",
"map",
",",
"Object",
"bean",
")",
"{",
"valueProviderToBean",
"(",
"new",
"MapValueProvider",
"(",
"map",
",",
"this",
".",
"copyOptions",
".",
"ignoreCase",
")",
",",
"bean",
")",
"... | Map转Bean属性拷贝
@param map Map
@param bean Bean | [
"Map转Bean属性拷贝"
] | bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/bean/copier/BeanCopier.java#L127-L129 | train | Converts the given map to the bean. | [
30522,
30524,
14068,
1007,
1063,
3643,
21572,
17258,
8743,
20891,
2319,
1006,
2047,
4949,
10175,
5657,
21572,
17258,
2121,
1006,
4949,
1010,
2023,
1012,
6100,
7361,
9285,
1012,
8568,
18382,
1007,
1010,
14068,
1007,
1025,
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... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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/lang/ObjectId.java | ObjectId.getMachinePiece | private static int getMachinePiece() {
// 机器码
int machinePiece;
try {
StringBuilder netSb = new StringBuilder();
// 返回机器所有的网络接口
Enumeration<NetworkInterface> e = NetworkInterface.getNetworkInterfaces();
// 遍历网络接口
while (e.hasMoreElements()) {
NetworkInterface ni = e.nextElement();
... | java | private static int getMachinePiece() {
// 机器码
int machinePiece;
try {
StringBuilder netSb = new StringBuilder();
// 返回机器所有的网络接口
Enumeration<NetworkInterface> e = NetworkInterface.getNetworkInterfaces();
// 遍历网络接口
while (e.hasMoreElements()) {
NetworkInterface ni = e.nextElement();
... | [
"private",
"static",
"int",
"getMachinePiece",
"(",
")",
"{",
"// 机器码\r",
"int",
"machinePiece",
";",
"try",
"{",
"StringBuilder",
"netSb",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"// 返回机器所有的网络接口\r",
"Enumeration",
"<",
"NetworkInterface",
">",
"e",
"=",
"... | 获取机器码片段
@return 机器码片段 | [
"获取机器码片段"
] | bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/lang/ObjectId.java#L125-L145 | train | Gets the machinePiece field from the System. in | [
30522,
2797,
10763,
20014,
2131,
22911,
14014,
11198,
1006,
1007,
1063,
1013,
1013,
100,
100,
100,
20014,
3698,
11198,
1025,
3046,
1063,
5164,
8569,
23891,
2099,
16996,
2497,
1027,
2047,
5164,
8569,
23891,
2099,
1006,
1007,
1025,
1013,
1013... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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/highavailability/HighAvailabilityServicesUtils.java | HighAvailabilityServicesUtils.getJobManagerAddress | public static Tuple2<String, Integer> getJobManagerAddress(Configuration configuration) throws ConfigurationException {
final String hostname = configuration.getString(JobManagerOptions.ADDRESS);
final int port = configuration.getInteger(JobManagerOptions.PORT);
if (hostname == null) {
throw new Configuratio... | java | public static Tuple2<String, Integer> getJobManagerAddress(Configuration configuration) throws ConfigurationException {
final String hostname = configuration.getString(JobManagerOptions.ADDRESS);
final int port = configuration.getInteger(JobManagerOptions.PORT);
if (hostname == null) {
throw new Configuratio... | [
"public",
"static",
"Tuple2",
"<",
"String",
",",
"Integer",
">",
"getJobManagerAddress",
"(",
"Configuration",
"configuration",
")",
"throws",
"ConfigurationException",
"{",
"final",
"String",
"hostname",
"=",
"configuration",
".",
"getString",
"(",
"JobManagerOption... | Returns the JobManager's hostname and port extracted from the given
{@link Configuration}.
@param configuration Configuration to extract the JobManager's address from
@return The JobManager's hostname and port
@throws ConfigurationException if the JobManager's address cannot be extracted from the configuration | [
"Returns",
"the",
"JobManager",
"s",
"hostname",
"and",
"port",
"extracted",
"from",
"the",
"given",
"{",
"@link",
"Configuration",
"}",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/highavailability/HighAvailabilityServicesUtils.java#L144-L161 | train | Get the hostname and port from the configuration. | [
30522,
2270,
10763,
10722,
10814,
2475,
1026,
5164,
1010,
16109,
1028,
2131,
5558,
25526,
5162,
4590,
4215,
16200,
4757,
1006,
9563,
9563,
1007,
11618,
9563,
10288,
24422,
1063,
2345,
5164,
3677,
18442,
1027,
9563,
30524,
1027,
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... |
looly/hutool | hutool-core/src/main/java/cn/hutool/core/lang/ClassScaner.java | ClassScaner.scanJar | private void scanJar(JarFile jar) {
String name;
for (JarEntry entry : new EnumerationIter<>(jar.entries())) {
name = StrUtil.removePrefix(entry.getName(), StrUtil.SLASH);
if (name.startsWith(this.packagePath)) {
if (name.endsWith(FileUtil.CLASS_EXT) && false == entry.isDirectory()) {
final Str... | java | private void scanJar(JarFile jar) {
String name;
for (JarEntry entry : new EnumerationIter<>(jar.entries())) {
name = StrUtil.removePrefix(entry.getName(), StrUtil.SLASH);
if (name.startsWith(this.packagePath)) {
if (name.endsWith(FileUtil.CLASS_EXT) && false == entry.isDirectory()) {
final Str... | [
"private",
"void",
"scanJar",
"(",
"JarFile",
"jar",
")",
"{",
"String",
"name",
";",
"for",
"(",
"JarEntry",
"entry",
":",
"new",
"EnumerationIter",
"<>",
"(",
"jar",
".",
"entries",
"(",
")",
")",
")",
"{",
"name",
"=",
"StrUtil",
".",
"removePrefix"... | 扫描jar包
@param jar jar包 | [
"扫描jar包"
] | bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/lang/ClassScaner.java#L242-L255 | train | Scan the jar file for classes in the package path. | [
30522,
2797,
11675,
13594,
16084,
1006,
15723,
8873,
2571,
15723,
1007,
1063,
5164,
2171,
1025,
2005,
1006,
15723,
4765,
2854,
4443,
1024,
2047,
4372,
17897,
8156,
21646,
1026,
1028,
1006,
15723,
1012,
10445,
1006,
1007,
1007,
1007,
1063,
2... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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-cron/src/main/java/cn/hutool/cron/CronUtil.java | CronUtil.schedule | public static String schedule(String schedulingPattern, Task task) {
return scheduler.schedule(schedulingPattern, task);
} | java | public static String schedule(String schedulingPattern, Task task) {
return scheduler.schedule(schedulingPattern, task);
} | [
"public",
"static",
"String",
"schedule",
"(",
"String",
"schedulingPattern",
",",
"Task",
"task",
")",
"{",
"return",
"scheduler",
".",
"schedule",
"(",
"schedulingPattern",
",",
"task",
")",
";",
"}"
] | 加入定时任务
@param schedulingPattern 定时任务执行时间的crontab表达式
@param task 任务
@return 定时任务ID | [
"加入定时任务"
] | bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-cron/src/main/java/cn/hutool/cron/CronUtil.java#L70-L72 | train | Schedule a task. | [
30522,
2270,
10763,
5164,
6134,
1006,
5164,
19940,
4502,
12079,
2078,
1010,
4708,
4708,
1007,
1063,
2709,
6134,
2099,
1012,
6134,
1006,
19940,
4502,
12079,
2078,
1010,
4708,
1007,
1025,
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... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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-core/src/main/java/org/apache/flink/types/StringValue.java | StringValue.append | public Appendable append(StringValue csq, int start, int end) {
final int otherLen = end - start;
grow(this.len + otherLen);
System.arraycopy(csq.value, start, this.value, this.len, otherLen);
this.len += otherLen;
return this;
} | java | public Appendable append(StringValue csq, int start, int end) {
final int otherLen = end - start;
grow(this.len + otherLen);
System.arraycopy(csq.value, start, this.value, this.len, otherLen);
this.len += otherLen;
return this;
} | [
"public",
"Appendable",
"append",
"(",
"StringValue",
"csq",
",",
"int",
"start",
",",
"int",
"end",
")",
"{",
"final",
"int",
"otherLen",
"=",
"end",
"-",
"start",
";",
"grow",
"(",
"this",
".",
"len",
"+",
"otherLen",
")",
";",
"System",
".",
"arra... | /*
(non-Javadoc)
@see java.lang.Appendable#append(java.lang.CharSequence, int, int) | [
"/",
"*",
"(",
"non",
"-",
"Javadoc",
")"
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-core/src/main/java/org/apache/flink/types/StringValue.java#L465-L471 | train | Append a string value to this string value. | [
30522,
2270,
10439,
10497,
3085,
10439,
10497,
1006,
5164,
10175,
5657,
20116,
4160,
1010,
20014,
2707,
1010,
20014,
2203,
1007,
1063,
2345,
20014,
2060,
7770,
1027,
2203,
1011,
2707,
1025,
4982,
1006,
2023,
1012,
18798,
1009,
2060,
7770,
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... |
looly/hutool | hutool-core/src/main/java/cn/hutool/core/lang/Assert.java | Assert.isFalse | public static void isFalse(boolean expression, String errorMsgTemplate, Object... params) throws IllegalArgumentException {
if (expression) {
throw new IllegalArgumentException(StrUtil.format(errorMsgTemplate, params));
}
} | java | public static void isFalse(boolean expression, String errorMsgTemplate, Object... params) throws IllegalArgumentException {
if (expression) {
throw new IllegalArgumentException(StrUtil.format(errorMsgTemplate, params));
}
} | [
"public",
"static",
"void",
"isFalse",
"(",
"boolean",
"expression",
",",
"String",
"errorMsgTemplate",
",",
"Object",
"...",
"params",
")",
"throws",
"IllegalArgumentException",
"{",
"if",
"(",
"expression",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"... | 断言是否为假,如果为 {@code true} 抛出 {@code IllegalArgumentException} 异常<br>
<pre class="code">
Assert.isFalse(i < 0, "The value must be greater than zero");
</pre>
@param expression 波尔值
@param errorMsgTemplate 错误抛出异常附带的消息模板,变量用{}代替
@param params 参数列表
@throws IllegalArgumentException if expression is {@code false} | [
"断言是否为假,如果为",
"{",
"@code",
"true",
"}",
"抛出",
"{",
"@code",
"IllegalArgumentException",
"}",
"异常<br",
">"
] | bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/lang/Assert.java#L63-L67 | train | Method isFalse. | [
30522,
2270,
10763,
11675,
2003,
7011,
4877,
2063,
1006,
22017,
20898,
3670,
1010,
5164,
7561,
5244,
13512,
6633,
15725,
1010,
4874,
1012,
1012,
1012,
11498,
5244,
1007,
11618,
6206,
2906,
22850,
15781,
2595,
24422,
1063,
2065,
1006,
3670,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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/checkpoint/CheckpointCoordinator.java | CheckpointCoordinator.shutdown | public void shutdown(JobStatus jobStatus) throws Exception {
synchronized (lock) {
if (!shutdown) {
shutdown = true;
LOG.info("Stopping checkpoint coordinator for job {}.", job);
periodicScheduling = false;
triggerRequestQueued = false;
// shut down the hooks
MasterHooks.close(masterHooks... | java | public void shutdown(JobStatus jobStatus) throws Exception {
synchronized (lock) {
if (!shutdown) {
shutdown = true;
LOG.info("Stopping checkpoint coordinator for job {}.", job);
periodicScheduling = false;
triggerRequestQueued = false;
// shut down the hooks
MasterHooks.close(masterHooks... | [
"public",
"void",
"shutdown",
"(",
"JobStatus",
"jobStatus",
")",
"throws",
"Exception",
"{",
"synchronized",
"(",
"lock",
")",
"{",
"if",
"(",
"!",
"shutdown",
")",
"{",
"shutdown",
"=",
"true",
";",
"LOG",
".",
"info",
"(",
"\"Stopping checkpoint coordinat... | Shuts down the checkpoint coordinator.
<p>After this method has been called, the coordinator does not accept
and further messages and cannot trigger any further checkpoints. | [
"Shuts",
"down",
"the",
"checkpoint",
"coordinator",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/checkpoint/CheckpointCoordinator.java#L323-L349 | train | Shutdown the coordinator for the given job. | [
30522,
2270,
11675,
3844,
7698,
1006,
5841,
29336,
2271,
5841,
29336,
2271,
1007,
11618,
6453,
1063,
25549,
1006,
5843,
1007,
1063,
2065,
1006,
999,
3844,
7698,
1007,
1063,
3844,
7698,
1027,
2995,
1025,
8833,
1012,
18558,
1006,
1000,
7458,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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-libraries/flink-streaming-python/src/main/java/org/apache/flink/streaming/python/api/datastream/PythonDataStream.java | PythonDataStream.key_by | public PythonKeyedStream key_by(KeySelector<PyObject, PyKey> selector) throws IOException {
return new PythonKeyedStream(stream.keyBy(new PythonKeySelector(selector)));
} | java | public PythonKeyedStream key_by(KeySelector<PyObject, PyKey> selector) throws IOException {
return new PythonKeyedStream(stream.keyBy(new PythonKeySelector(selector)));
} | [
"public",
"PythonKeyedStream",
"key_by",
"(",
"KeySelector",
"<",
"PyObject",
",",
"PyKey",
">",
"selector",
")",
"throws",
"IOException",
"{",
"return",
"new",
"PythonKeyedStream",
"(",
"stream",
".",
"keyBy",
"(",
"new",
"PythonKeySelector",
"(",
"selector",
"... | A thin wrapper layer over {@link DataStream#keyBy(KeySelector)}.
@param selector The KeySelector to be used for extracting the key for partitioning
@return The {@link PythonDataStream} with partitioned state (i.e. {@link PythonKeyedStream}) | [
"A",
"thin",
"wrapper",
"layer",
"over",
"{",
"@link",
"DataStream#keyBy",
"(",
"KeySelector",
")",
"}",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-libraries/flink-streaming-python/src/main/java/org/apache/flink/streaming/python/api/datastream/PythonDataStream.java#L135-L137 | train | Key by. | [
30522,
2270,
18750,
14839,
2098,
21422,
3145,
1035,
2011,
1006,
6309,
12260,
16761,
1026,
1052,
7677,
2497,
20614,
1010,
1052,
15922,
3240,
1028,
27000,
1007,
11618,
22834,
10288,
24422,
1063,
2709,
2047,
18750,
14839,
2098,
21422,
1006,
5460... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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/model/perceptron/model/LinearModel.java | LinearModel.save | public void save(String modelFile) throws IOException
{
DataOutputStream out = new DataOutputStream(new BufferedOutputStream(IOUtil.newOutputStream(modelFile)));
save(out);
out.close();
} | java | public void save(String modelFile) throws IOException
{
DataOutputStream out = new DataOutputStream(new BufferedOutputStream(IOUtil.newOutputStream(modelFile)));
save(out);
out.close();
} | [
"public",
"void",
"save",
"(",
"String",
"modelFile",
")",
"throws",
"IOException",
"{",
"DataOutputStream",
"out",
"=",
"new",
"DataOutputStream",
"(",
"new",
"BufferedOutputStream",
"(",
"IOUtil",
".",
"newOutputStream",
"(",
"modelFile",
")",
")",
")",
";",
... | 保存到路径
@param modelFile
@throws IOException | [
"保存到路径"
] | a538d0722ab2e4980a9dcd9ea40324fc3ddba7ce | https://github.com/hankcs/HanLP/blob/a538d0722ab2e4980a9dcd9ea40324fc3ddba7ce/src/main/java/com/hankcs/hanlp/model/perceptron/model/LinearModel.java#L160-L165 | train | Saves the current class to a file. | [
30522,
2270,
11675,
3828,
1006,
5164,
2944,
8873,
2571,
1007,
11618,
22834,
10288,
24422,
1063,
2951,
5833,
18780,
21422,
2041,
1027,
2047,
2951,
5833,
18780,
21422,
1006,
2047,
17698,
26010,
4904,
18780,
21422,
1006,
22834,
21823,
2140,
1012... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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/corpus/io/ByteArrayFileStream.java | ByteArrayFileStream.ensureAvailableBytes | @Override
protected void ensureAvailableBytes(int size)
{
if (offset + size > bufferSize)
{
try
{
int availableBytes = (int) (fileChannel.size() - fileChannel.position());
ByteBuffer byteBuffer = ByteBuffer.allocate(Math.min(availableBytes,... | java | @Override
protected void ensureAvailableBytes(int size)
{
if (offset + size > bufferSize)
{
try
{
int availableBytes = (int) (fileChannel.size() - fileChannel.position());
ByteBuffer byteBuffer = ByteBuffer.allocate(Math.min(availableBytes,... | [
"@",
"Override",
"protected",
"void",
"ensureAvailableBytes",
"(",
"int",
"size",
")",
"{",
"if",
"(",
"offset",
"+",
"size",
">",
"bufferSize",
")",
"{",
"try",
"{",
"int",
"availableBytes",
"=",
"(",
"int",
")",
"(",
"fileChannel",
".",
"size",
"(",
... | 确保buffer数组余有size个字节
@param size | [
"确保buffer数组余有size个字节"
] | a538d0722ab2e4980a9dcd9ea40324fc3ddba7ce | https://github.com/hankcs/HanLP/blob/a538d0722ab2e4980a9dcd9ea40324fc3ddba7ce/src/main/java/com/hankcs/hanlp/corpus/io/ByteArrayFileStream.java#L75-L102 | train | Ensure available bytes. | [
30522,
1030,
2058,
15637,
5123,
11675,
5676,
12462,
11733,
3468,
3762,
4570,
1006,
20014,
2946,
1007,
1063,
2065,
1006,
16396,
1009,
2946,
1028,
17698,
5332,
4371,
1007,
1063,
3046,
1063,
20014,
2800,
3762,
4570,
1027,
1006,
20014,
1007,
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... |
looly/hutool | hutool-core/src/main/java/cn/hutool/core/util/HexUtil.java | HexUtil.decodeHexStr | public static String decodeHexStr(String hexStr, Charset charset) {
if (StrUtil.isEmpty(hexStr)) {
return hexStr;
}
return decodeHexStr(hexStr.toCharArray(), charset);
} | java | public static String decodeHexStr(String hexStr, Charset charset) {
if (StrUtil.isEmpty(hexStr)) {
return hexStr;
}
return decodeHexStr(hexStr.toCharArray(), charset);
} | [
"public",
"static",
"String",
"decodeHexStr",
"(",
"String",
"hexStr",
",",
"Charset",
"charset",
")",
"{",
"if",
"(",
"StrUtil",
".",
"isEmpty",
"(",
"hexStr",
")",
")",
"{",
"return",
"hexStr",
";",
"}",
"return",
"decodeHexStr",
"(",
"hexStr",
".",
"t... | 将十六进制字符数组转换为字符串
@param hexStr 十六进制String
@param charset 编码
@return 字符串 | [
"将十六进制字符数组转换为字符串"
] | bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/util/HexUtil.java#L142-L147 | train | Decodes a hex string. | [
30522,
2270,
10763,
5164,
21933,
25383,
10288,
3367,
2099,
1006,
5164,
2002,
2595,
3367,
2099,
1010,
25869,
13462,
25869,
13462,
1007,
1063,
2065,
1006,
2358,
22134,
4014,
1012,
2003,
6633,
13876,
2100,
1006,
2002,
2595,
3367,
2099,
1007,
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... |
SeleniumHQ/selenium | java/client/src/org/openqa/selenium/support/ui/ExpectedConditions.java | ExpectedConditions.invisibilityOfAllElements | public static ExpectedCondition<Boolean> invisibilityOfAllElements(
final List<WebElement> elements) {
return new ExpectedCondition<Boolean>() {
@Override
public Boolean apply(WebDriver webDriver) {
return elements.stream().allMatch(ExpectedConditions::isInvisible);
}
@Override... | java | public static ExpectedCondition<Boolean> invisibilityOfAllElements(
final List<WebElement> elements) {
return new ExpectedCondition<Boolean>() {
@Override
public Boolean apply(WebDriver webDriver) {
return elements.stream().allMatch(ExpectedConditions::isInvisible);
}
@Override... | [
"public",
"static",
"ExpectedCondition",
"<",
"Boolean",
">",
"invisibilityOfAllElements",
"(",
"final",
"List",
"<",
"WebElement",
">",
"elements",
")",
"{",
"return",
"new",
"ExpectedCondition",
"<",
"Boolean",
">",
"(",
")",
"{",
"@",
"Override",
"public",
... | An expectation for checking all elements from given list to be invisible
@param elements used to check their invisibility
@return Boolean true when all elements are not visible anymore | [
"An",
"expectation",
"for",
"checking",
"all",
"elements",
"from",
"given",
"list",
"to",
"be",
"invisible"
] | 7af172729f17b20269c8ca4ea6f788db48616535 | https://github.com/SeleniumHQ/selenium/blob/7af172729f17b20269c8ca4ea6f788db48616535/java/client/src/org/openqa/selenium/support/ui/ExpectedConditions.java#L1309-L1323 | train | An expectation for checking that all elements in a list are invisible. | [
30522,
2270,
10763,
3517,
8663,
20562,
1026,
22017,
20898,
1028,
1999,
11365,
13464,
11253,
24164,
16930,
11187,
1006,
2345,
2862,
1026,
4773,
12260,
3672,
1028,
3787,
1007,
1063,
2709,
2047,
3517,
8663,
20562,
1026,
22017,
20898,
1028,
1006,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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-core/sharding-core-parse/sharding-core-parse-common/src/main/java/org/apache/shardingsphere/core/parse/old/parser/clause/TableReferencesClauseParser.java | TableReferencesClauseParser.parse | public final void parse(final SQLStatement sqlStatement, final boolean isSingleTableOnly) {
do {
parseTableReference(sqlStatement, isSingleTableOnly);
} while (lexerEngine.skipIfEqual(Symbol.COMMA));
} | java | public final void parse(final SQLStatement sqlStatement, final boolean isSingleTableOnly) {
do {
parseTableReference(sqlStatement, isSingleTableOnly);
} while (lexerEngine.skipIfEqual(Symbol.COMMA));
} | [
"public",
"final",
"void",
"parse",
"(",
"final",
"SQLStatement",
"sqlStatement",
",",
"final",
"boolean",
"isSingleTableOnly",
")",
"{",
"do",
"{",
"parseTableReference",
"(",
"sqlStatement",
",",
"isSingleTableOnly",
")",
";",
"}",
"while",
"(",
"lexerEngine",
... | Parse table references.
@param sqlStatement SQL statement
@param isSingleTableOnly is parse single table only | [
"Parse",
"table",
"references",
"."
] | f88fd29fc345dfb31fdce12e9e96cbfa0fd2402d | https://github.com/apache/incubator-shardingsphere/blob/f88fd29fc345dfb31fdce12e9e96cbfa0fd2402d/sharding-core/sharding-core-parse/sharding-core-parse-common/src/main/java/org/apache/shardingsphere/core/parse/old/parser/clause/TableReferencesClauseParser.java#L77-L81 | train | Parse a single table reference. | [
30522,
2270,
2345,
11675,
11968,
3366,
1006,
2345,
29296,
9153,
18532,
4765,
29296,
9153,
18532,
4765,
1010,
2345,
22017,
20898,
26354,
2075,
7485,
3085,
2239,
2135,
1007,
1063,
2079,
1063,
11968,
13462,
3085,
2890,
25523,
1006,
29296,
9153,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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/clusterframework/ContaineredTaskManagerParameters.java | ContaineredTaskManagerParameters.create | public static ContaineredTaskManagerParameters create(
Configuration config,
long containerMemoryMB,
int numSlots) {
// (1) try to compute how much memory used by container
final long cutoffMB = calculateCutoffMB(config, containerMemoryMB);
// (2) split the remaining Java memory between heap and off-hea... | java | public static ContaineredTaskManagerParameters create(
Configuration config,
long containerMemoryMB,
int numSlots) {
// (1) try to compute how much memory used by container
final long cutoffMB = calculateCutoffMB(config, containerMemoryMB);
// (2) split the remaining Java memory between heap and off-hea... | [
"public",
"static",
"ContaineredTaskManagerParameters",
"create",
"(",
"Configuration",
"config",
",",
"long",
"containerMemoryMB",
",",
"int",
"numSlots",
")",
"{",
"// (1) try to compute how much memory used by container",
"final",
"long",
"cutoffMB",
"=",
"calculateCutoffM... | Computes the parameters to be used to start a TaskManager Java process.
@param config The Flink configuration.
@param containerMemoryMB The size of the complete container, in megabytes.
@return The parameters to start the TaskManager processes with. | [
"Computes",
"the",
"parameters",
"to",
"be",
"used",
"to",
"start",
"a",
"TaskManager",
"Java",
"process",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/clusterframework/ContaineredTaskManagerParameters.java#L152-L179 | train | Create a new containered task manager parameters from the configuration. | [
30522,
2270,
10763,
11661,
2098,
10230,
22287,
5162,
4590,
28689,
22828,
2015,
3443,
1006,
9563,
9530,
8873,
2290,
1010,
2146,
11661,
4168,
5302,
2854,
14905,
1010,
20014,
16371,
5244,
10994,
2015,
1007,
1063,
1013,
1013,
1006,
1015,
1007,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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-libraries/flink-cep/src/main/java/org/apache/flink/cep/pattern/Pattern.java | Pattern.notFollowedBy | public Pattern<T, T> notFollowedBy(final String name) {
if (quantifier.hasProperty(Quantifier.QuantifierProperty.OPTIONAL)) {
throw new UnsupportedOperationException(
"Specifying a pattern with an optional path to NOT condition is not supported yet. " +
"You can simulate such pattern with two independent... | java | public Pattern<T, T> notFollowedBy(final String name) {
if (quantifier.hasProperty(Quantifier.QuantifierProperty.OPTIONAL)) {
throw new UnsupportedOperationException(
"Specifying a pattern with an optional path to NOT condition is not supported yet. " +
"You can simulate such pattern with two independent... | [
"public",
"Pattern",
"<",
"T",
",",
"T",
">",
"notFollowedBy",
"(",
"final",
"String",
"name",
")",
"{",
"if",
"(",
"quantifier",
".",
"hasProperty",
"(",
"Quantifier",
".",
"QuantifierProperty",
".",
"OPTIONAL",
")",
")",
"{",
"throw",
"new",
"Unsupported... | Appends a new pattern to the existing one. The new pattern enforces that there is no event matching this pattern
between the preceding pattern and succeeding this one.
<p><b>NOTE:</b> There has to be other pattern after this one.
@param name Name of the new pattern
@return A new pattern which is appended to this one | [
"Appends",
"a",
"new",
"pattern",
"to",
"the",
"existing",
"one",
".",
"The",
"new",
"pattern",
"enforces",
"that",
"there",
"is",
"no",
"event",
"matching",
"this",
"pattern",
"between",
"the",
"preceding",
"pattern",
"and",
"succeeding",
"this",
"one",
"."... | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-libraries/flink-cep/src/main/java/org/apache/flink/cep/pattern/Pattern.java#L303-L311 | train | Creates a pattern that is not followed by this one. | [
30522,
2270,
5418,
1026,
1056,
1010,
1056,
1028,
2025,
14876,
7174,
15557,
3762,
1006,
2345,
5164,
2171,
1007,
1063,
2065,
1006,
24110,
3775,
8873,
2121,
1012,
2038,
21572,
4842,
3723,
1006,
24110,
3775,
8873,
2121,
1012,
24110,
3775,
8873,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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/core/src/main/java/org/apache/spark/sql/execution/datasources/orc/OrcColumnarBatchReader.java | OrcColumnarBatchReader.nextBatch | private boolean nextBatch() throws IOException {
recordReader.nextBatch(wrap.batch());
int batchSize = wrap.batch().size;
if (batchSize == 0) {
return false;
}
columnarBatch.setNumRows(batchSize);
for (int i = 0; i < requiredFields.length; i++) {
if (requestedDataColIds[i] != -1) {
... | java | private boolean nextBatch() throws IOException {
recordReader.nextBatch(wrap.batch());
int batchSize = wrap.batch().size;
if (batchSize == 0) {
return false;
}
columnarBatch.setNumRows(batchSize);
for (int i = 0; i < requiredFields.length; i++) {
if (requestedDataColIds[i] != -1) {
... | [
"private",
"boolean",
"nextBatch",
"(",
")",
"throws",
"IOException",
"{",
"recordReader",
".",
"nextBatch",
"(",
"wrap",
".",
"batch",
"(",
")",
")",
";",
"int",
"batchSize",
"=",
"wrap",
".",
"batch",
"(",
")",
".",
"size",
";",
"if",
"(",
"batchSize... | Return true if there exists more data in the next batch. If exists, prepare the next batch
by copying from ORC VectorizedRowBatch columns to Spark ColumnarBatch columns. | [
"Return",
"true",
"if",
"there",
"exists",
"more",
"data",
"in",
"the",
"next",
"batch",
".",
"If",
"exists",
"prepare",
"the",
"next",
"batch",
"by",
"copying",
"from",
"ORC",
"VectorizedRowBatch",
"columns",
"to",
"Spark",
"ColumnarBatch",
"columns",
"."
] | 25ee0474f47d9c30d6f553a7892d9549f91071cf | https://github.com/apache/spark/blob/25ee0474f47d9c30d6f553a7892d9549f91071cf/sql/core/src/main/java/org/apache/spark/sql/execution/datasources/orc/OrcColumnarBatchReader.java#L195-L209 | train | This method is called to read the next batch of data from the record reader. | [
30522,
2797,
22017,
20898,
2279,
14479,
2818,
1006,
1007,
11618,
22834,
10288,
24422,
1063,
2501,
16416,
4063,
1012,
2279,
14479,
2818,
1006,
10236,
1012,
14108,
1006,
1007,
1007,
1025,
20014,
14108,
5332,
4371,
1027,
10236,
1012,
14108,
1006... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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-libraries/flink-gelly/src/main/java/org/apache/flink/graph/asm/translate/Translate.java | Translate.translateVertexValues | @SuppressWarnings("unchecked")
public static <K, OLD, NEW> DataSet<Vertex<K, NEW>> translateVertexValues(DataSet<Vertex<K, OLD>> vertices, TranslateFunction<OLD, NEW> translator, int parallelism) {
Preconditions.checkNotNull(vertices);
Preconditions.checkNotNull(translator);
Class<Vertex<K, NEW>> vertexClass = ... | java | @SuppressWarnings("unchecked")
public static <K, OLD, NEW> DataSet<Vertex<K, NEW>> translateVertexValues(DataSet<Vertex<K, OLD>> vertices, TranslateFunction<OLD, NEW> translator, int parallelism) {
Preconditions.checkNotNull(vertices);
Preconditions.checkNotNull(translator);
Class<Vertex<K, NEW>> vertexClass = ... | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"static",
"<",
"K",
",",
"OLD",
",",
"NEW",
">",
"DataSet",
"<",
"Vertex",
"<",
"K",
",",
"NEW",
">",
">",
"translateVertexValues",
"(",
"DataSet",
"<",
"Vertex",
"<",
"K",
",",
"OLD",
">",
... | Translate {@link Vertex} values using the given {@link TranslateFunction}.
@param vertices input vertices
@param translator implements conversion from {@code OLD} to {@code NEW}
@param parallelism operator parallelism
@param <K> vertex ID type
@param <OLD> old vertex value type
@param <NEW> new vertex value type
@retu... | [
"Translate",
"{",
"@link",
"Vertex",
"}",
"values",
"using",
"the",
"given",
"{",
"@link",
"TranslateFunction",
"}",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-libraries/flink-gelly/src/main/java/org/apache/flink/graph/asm/translate/Translate.java#L236-L261 | train | Translate the vertex values of a DataSet of vertices using a TranslateFunction. | [
30522,
1030,
16081,
9028,
5582,
2015,
1006,
1000,
4895,
5403,
18141,
1000,
1007,
2270,
10763,
1026,
1047,
1010,
2214,
1010,
2047,
1028,
2951,
13462,
1026,
19449,
1026,
1047,
1010,
2047,
1028,
1028,
17637,
16874,
10288,
10175,
15808,
1006,
2... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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/deployment/TaskDeploymentDescriptor.java | TaskDeploymentDescriptor.getSerializedTaskInformation | @Nullable
public SerializedValue<TaskInformation> getSerializedTaskInformation() {
if (serializedTaskInformation instanceof NonOffloaded) {
NonOffloaded<TaskInformation> taskInformation =
(NonOffloaded<TaskInformation>) serializedTaskInformation;
return taskInformation.serializedValue;
} else {
throw ... | java | @Nullable
public SerializedValue<TaskInformation> getSerializedTaskInformation() {
if (serializedTaskInformation instanceof NonOffloaded) {
NonOffloaded<TaskInformation> taskInformation =
(NonOffloaded<TaskInformation>) serializedTaskInformation;
return taskInformation.serializedValue;
} else {
throw ... | [
"@",
"Nullable",
"public",
"SerializedValue",
"<",
"TaskInformation",
">",
"getSerializedTaskInformation",
"(",
")",
"{",
"if",
"(",
"serializedTaskInformation",
"instanceof",
"NonOffloaded",
")",
"{",
"NonOffloaded",
"<",
"TaskInformation",
">",
"taskInformation",
"=",... | Return the sub task's serialized task information.
@return serialized task information (may be <tt>null</tt> before a call to {@link
#loadBigData(PermanentBlobService)}). | [
"Return",
"the",
"sub",
"task",
"s",
"serialized",
"task",
"information",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/deployment/TaskDeploymentDescriptor.java#L209-L219 | train | Returns the serialized task information. | [
30522,
1030,
19701,
3085,
2270,
27289,
10175,
5657,
1026,
4708,
2378,
14192,
3370,
1028,
4152,
11610,
28931,
10230,
4939,
14192,
3370,
1006,
1007,
1063,
2065,
1006,
27289,
10230,
4939,
14192,
3370,
6013,
11253,
2512,
7245,
17468,
1007,
1063,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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/util/HashUtil.java | HashUtil.dekHash | public static int dekHash(String str) {
int hash = str.length();
for (int i = 0; i < str.length(); i++) {
hash = ((hash << 5) ^ (hash >> 27)) ^ str.charAt(i);
}
return hash & 0x7FFFFFFF;
} | java | public static int dekHash(String str) {
int hash = str.length();
for (int i = 0; i < str.length(); i++) {
hash = ((hash << 5) ^ (hash >> 27)) ^ str.charAt(i);
}
return hash & 0x7FFFFFFF;
} | [
"public",
"static",
"int",
"dekHash",
"(",
"String",
"str",
")",
"{",
"int",
"hash",
"=",
"str",
".",
"length",
"(",
")",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"str",
".",
"length",
"(",
")",
";",
"i",
"++",
")",
"{",
"hash",
... | DEK算法
@param str 字符串
@return hash值 | [
"DEK算法"
] | bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/util/HashUtil.java#L330-L338 | train | Returns the hash value of the string. | [
30522,
2270,
10763,
20014,
2139,
15256,
4095,
1006,
5164,
2358,
2099,
1007,
1063,
20014,
23325,
1027,
2358,
2099,
1012,
3091,
1006,
1007,
1025,
2005,
1006,
20014,
1045,
1027,
1014,
1025,
1045,
1026,
2358,
2099,
1012,
3091,
1006,
1007,
1025,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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/lang/ObjectId.java | ObjectId.isValid | public static boolean isValid(String s) {
if (s == null) {
return false;
}
s = StrUtil.removeAll(s, "-");
final int len = s.length();
if (len != 24) {
return false;
}
char c;
for (int i = 0; i < len; i++) {
c = s.charAt(i);
if (c >= '0' && c <= '9') {
continue;
}
i... | java | public static boolean isValid(String s) {
if (s == null) {
return false;
}
s = StrUtil.removeAll(s, "-");
final int len = s.length();
if (len != 24) {
return false;
}
char c;
for (int i = 0; i < len; i++) {
c = s.charAt(i);
if (c >= '0' && c <= '9') {
continue;
}
i... | [
"public",
"static",
"boolean",
"isValid",
"(",
"String",
"s",
")",
"{",
"if",
"(",
"s",
"==",
"null",
")",
"{",
"return",
"false",
";",
"}",
"s",
"=",
"StrUtil",
".",
"removeAll",
"(",
"s",
",",
"\"-\"",
")",
";",
"final",
"int",
"len",
"=",
"s",... | 给定的字符串是否为有效的ObjectId
@param s 字符串
@return 是否为有效的ObjectId | [
"给定的字符串是否为有效的ObjectId"
] | bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/lang/ObjectId.java#L44-L69 | train | Checks if the given string is a valid UUID. | [
30522,
2270,
10763,
22017,
20898,
2003,
10175,
3593,
1006,
5164,
1055,
1007,
1063,
2065,
1006,
1055,
1027,
1027,
19701,
1007,
1063,
2709,
6270,
1025,
1065,
1055,
1027,
2358,
22134,
4014,
1012,
6366,
8095,
1006,
1055,
1010,
1000,
1011,
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/AtomicDisposableReferenceCounter.java | AtomicDisposableReferenceCounter.decrement | public boolean decrement() {
synchronized (lock) {
if (isDisposed) {
return false;
}
referenceCount--;
if (referenceCount <= disposeOnReferenceCount) {
isDisposed = true;
}
return isDisposed;
}
} | java | public boolean decrement() {
synchronized (lock) {
if (isDisposed) {
return false;
}
referenceCount--;
if (referenceCount <= disposeOnReferenceCount) {
isDisposed = true;
}
return isDisposed;
}
} | [
"public",
"boolean",
"decrement",
"(",
")",
"{",
"synchronized",
"(",
"lock",
")",
"{",
"if",
"(",
"isDisposed",
")",
"{",
"return",
"false",
";",
"}",
"referenceCount",
"--",
";",
"if",
"(",
"referenceCount",
"<=",
"disposeOnReferenceCount",
")",
"{",
"is... | Decrements the reference count and returns whether the reference counter entered the disposed
state.
<p>
If the method returns <code>true</code>, the decrement operation disposed the counter.
Otherwise it returns <code>false</code>. | [
"Decrements",
"the",
"reference",
"count",
"and",
"returns",
"whether",
"the",
"reference",
"counter",
"entered",
"the",
"disposed",
"state",
".",
"<p",
">",
"If",
"the",
"method",
"returns",
"<code",
">",
"true<",
"/",
"code",
">",
"the",
"decrement",
"oper... | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/util/AtomicDisposableReferenceCounter.java#L68-L82 | train | Decrement the reference count of the object. | [
30522,
2270,
22017,
20898,
11703,
28578,
4765,
1006,
1007,
1063,
25549,
1006,
5843,
1007,
1063,
2065,
1006,
2003,
10521,
19155,
1007,
1063,
2709,
6270,
1025,
1065,
4431,
3597,
16671,
1011,
1011,
1025,
2065,
1006,
4431,
3597,
16671,
1026,
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... |
redisson/redisson | redisson/src/main/java/org/redisson/config/Config.java | Config.fromJSON | public static Config fromJSON(InputStream inputStream) throws IOException {
ConfigSupport support = new ConfigSupport();
return support.fromJSON(inputStream, Config.class);
} | java | public static Config fromJSON(InputStream inputStream) throws IOException {
ConfigSupport support = new ConfigSupport();
return support.fromJSON(inputStream, Config.class);
} | [
"public",
"static",
"Config",
"fromJSON",
"(",
"InputStream",
"inputStream",
")",
"throws",
"IOException",
"{",
"ConfigSupport",
"support",
"=",
"new",
"ConfigSupport",
"(",
")",
";",
"return",
"support",
".",
"fromJSON",
"(",
"inputStream",
",",
"Config",
".",
... | Read config object stored in JSON format from <code>InputStream</code>
@param inputStream object
@return config
@throws IOException error | [
"Read",
"config",
"object",
"stored",
"in",
"JSON",
"format",
"from",
"<code",
">",
"InputStream<",
"/",
"code",
">"
] | d3acc0249b2d5d658d36d99e2c808ce49332ea44 | https://github.com/redisson/redisson/blob/d3acc0249b2d5d658d36d99e2c808ce49332ea44/redisson/src/main/java/org/redisson/config/Config.java#L568-L571 | train | Creates a Config object from a JSON input stream. | [
30522,
2270,
10763,
9530,
8873,
2290,
2013,
22578,
2239,
1006,
20407,
25379,
20407,
25379,
1007,
11618,
22834,
10288,
24422,
1063,
9530,
8873,
5620,
6279,
6442,
2490,
1027,
2047,
9530,
8873,
5620,
6279,
6442,
1006,
1007,
1025,
2709,
2490,
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... |
looly/hutool | hutool-db/src/main/java/cn/hutool/db/meta/MetaUtil.java | MetaUtil.getTableMeta | @SuppressWarnings("resource")
public static Table getTableMeta(DataSource ds, String tableName) {
final Table table = Table.create(tableName);
Connection conn = null;
ResultSet rs = null;
try {
conn = ds.getConnection();
final DatabaseMetaData metaData = conn.getMetaData();
// 获得主键
rs = me... | java | @SuppressWarnings("resource")
public static Table getTableMeta(DataSource ds, String tableName) {
final Table table = Table.create(tableName);
Connection conn = null;
ResultSet rs = null;
try {
conn = ds.getConnection();
final DatabaseMetaData metaData = conn.getMetaData();
// 获得主键
rs = me... | [
"@",
"SuppressWarnings",
"(",
"\"resource\"",
")",
"public",
"static",
"Table",
"getTableMeta",
"(",
"DataSource",
"ds",
",",
"String",
"tableName",
")",
"{",
"final",
"Table",
"table",
"=",
"Table",
".",
"create",
"(",
"tableName",
")",
";",
"Connection",
"... | 获得表的元信息
@param ds 数据源
@param tableName 表名
@return Table对象 | [
"获得表的元信息"
] | bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-db/src/main/java/cn/hutool/db/meta/MetaUtil.java#L164-L190 | train | Gets the table meta data. | [
30522,
1030,
16081,
9028,
5582,
2015,
1006,
1000,
7692,
1000,
1007,
2270,
10763,
2795,
2131,
10880,
11368,
2050,
1006,
2951,
6499,
3126,
3401,
16233,
1010,
5164,
2795,
18442,
1007,
1063,
2345,
2795,
2795,
1027,
2795,
1012,
3443,
1006,
2795,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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/text/StrSpliter.java | StrSpliter.split | public static List<String> split(String str, String separator, int limit, boolean isTrim, boolean ignoreEmpty, boolean ignoreCase){
if(StrUtil.isEmpty(str)){
return new ArrayList<String>(0);
}
if(limit == 1){
return addToList(new ArrayList<String>(1), str, isTrim, ignoreEmpty);
}
if(StrUtil.i... | java | public static List<String> split(String str, String separator, int limit, boolean isTrim, boolean ignoreEmpty, boolean ignoreCase){
if(StrUtil.isEmpty(str)){
return new ArrayList<String>(0);
}
if(limit == 1){
return addToList(new ArrayList<String>(1), str, isTrim, ignoreEmpty);
}
if(StrUtil.i... | [
"public",
"static",
"List",
"<",
"String",
">",
"split",
"(",
"String",
"str",
",",
"String",
"separator",
",",
"int",
"limit",
",",
"boolean",
"isTrim",
",",
"boolean",
"ignoreEmpty",
",",
"boolean",
"ignoreCase",
")",
"{",
"if",
"(",
"StrUtil",
".",
"i... | 切分字符串
@param str 被切分的字符串
@param separator 分隔符字符串
@param limit 限制分片数
@param isTrim 是否去除切分字符串后每个元素两边的空格
@param ignoreEmpty 是否忽略空串
@param ignoreCase 是否忽略大小写
@return 切分后的集合
@since 3.2.1 | [
"切分字符串"
] | bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/text/StrSpliter.java#L289-L323 | train | Split a String into a list of strings. | [
30522,
2270,
10763,
2862,
1026,
5164,
1028,
3975,
1006,
5164,
2358,
2099,
1010,
5164,
19802,
25879,
2953,
1010,
20014,
5787,
1010,
22017,
20898,
21541,
20026,
1010,
22017,
20898,
8568,
6633,
13876,
2100,
1010,
22017,
20898,
8568,
18382,
1007,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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-optimizer/src/main/java/org/apache/flink/optimizer/dag/SolutionSetNode.java | SolutionSetNode.setCandidateProperties | public void setCandidateProperties(GlobalProperties gProps, LocalProperties lProps, Channel initialInput) {
this.cachedPlans = Collections.<PlanNode>singletonList(new SolutionSetPlanNode(this, "SolutionSet ("+this.getOperator().getName()+")", gProps, lProps, initialInput));
} | java | public void setCandidateProperties(GlobalProperties gProps, LocalProperties lProps, Channel initialInput) {
this.cachedPlans = Collections.<PlanNode>singletonList(new SolutionSetPlanNode(this, "SolutionSet ("+this.getOperator().getName()+")", gProps, lProps, initialInput));
} | [
"public",
"void",
"setCandidateProperties",
"(",
"GlobalProperties",
"gProps",
",",
"LocalProperties",
"lProps",
",",
"Channel",
"initialInput",
")",
"{",
"this",
".",
"cachedPlans",
"=",
"Collections",
".",
"<",
"PlanNode",
">",
"singletonList",
"(",
"new",
"Solu... | -------------------------------------------------------------------------------------------- | [
"--------------------------------------------------------------------------------------------"
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-optimizer/src/main/java/org/apache/flink/optimizer/dag/SolutionSetNode.java#L48-L50 | train | Sets the candidate properties of this solution set. | [
30522,
2270,
11675,
2275,
9336,
4305,
13701,
21572,
4842,
7368,
1006,
3795,
21572,
4842,
7368,
14246,
18981,
2015,
1010,
2334,
21572,
4842,
7368,
6948,
18981,
2015,
1010,
3149,
3988,
2378,
18780,
1007,
1063,
2023,
1012,
17053,
18927,
5802,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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 | server/src/main/java/com/alibaba/otter/canal/common/MQMessageUtils.java | MQMessageUtils.messagePartition | @SuppressWarnings("unchecked")
public static Message[] messagePartition(Message message, Integer partitionsNum, String pkHashConfigs) {
if (partitionsNum == null) {
partitionsNum = 1;
}
Message[] partitionMessages = new Message[partitionsNum];
List<Entry>[] partitionEntri... | java | @SuppressWarnings("unchecked")
public static Message[] messagePartition(Message message, Integer partitionsNum, String pkHashConfigs) {
if (partitionsNum == null) {
partitionsNum = 1;
}
Message[] partitionMessages = new Message[partitionsNum];
List<Entry>[] partitionEntri... | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"static",
"Message",
"[",
"]",
"messagePartition",
"(",
"Message",
"message",
",",
"Integer",
"partitionsNum",
",",
"String",
"pkHashConfigs",
")",
"{",
"if",
"(",
"partitionsNum",
"==",
"null",
")",
... | 将 message 分区
@param partitionsNum 分区数
@param pkHashConfigs 分区库表主键正则表达式
@return 分区message数组 | [
"将",
"message",
"分区"
] | 8f088cddc0755f4350c5aaae95c6e4002d90a40f | https://github.com/alibaba/canal/blob/8f088cddc0755f4350c5aaae95c6e4002d90a40f/server/src/main/java/com/alibaba/otter/canal/common/MQMessageUtils.java#L170-L267 | train | Partition a message into several messages. | [
30522,
1030,
16081,
9028,
5582,
2015,
1006,
1000,
4895,
5403,
18141,
1000,
1007,
2270,
10763,
4471,
1031,
1033,
4471,
19362,
3775,
3508,
1006,
4471,
4471,
1010,
16109,
13571,
2015,
19172,
1010,
5164,
1052,
15256,
4095,
8663,
8873,
5620,
100... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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-core/sharding-core-common/src/main/java/org/apache/shardingsphere/core/config/DataSourceConfiguration.java | DataSourceConfiguration.getDataSourceConfiguration | public static DataSourceConfiguration getDataSourceConfiguration(final DataSource dataSource) {
DataSourceConfiguration result = new DataSourceConfiguration(dataSource.getClass().getName());
result.getProperties().putAll(findAllGetterProperties(dataSource));
return result;
} | java | public static DataSourceConfiguration getDataSourceConfiguration(final DataSource dataSource) {
DataSourceConfiguration result = new DataSourceConfiguration(dataSource.getClass().getName());
result.getProperties().putAll(findAllGetterProperties(dataSource));
return result;
} | [
"public",
"static",
"DataSourceConfiguration",
"getDataSourceConfiguration",
"(",
"final",
"DataSource",
"dataSource",
")",
"{",
"DataSourceConfiguration",
"result",
"=",
"new",
"DataSourceConfiguration",
"(",
"dataSource",
".",
"getClass",
"(",
")",
".",
"getName",
"("... | Get data source configuration.
@param dataSource data source
@return data source configuration | [
"Get",
"data",
"source",
"configuration",
"."
] | f88fd29fc345dfb31fdce12e9e96cbfa0fd2402d | https://github.com/apache/incubator-shardingsphere/blob/f88fd29fc345dfb31fdce12e9e96cbfa0fd2402d/sharding-core/sharding-core-common/src/main/java/org/apache/shardingsphere/core/config/DataSourceConfiguration.java#L69-L73 | train | Gets the DataSourceConfiguration. | [
30522,
2270,
10763,
2951,
6499,
3126,
3401,
8663,
8873,
27390,
3370,
2131,
2850,
10230,
8162,
3401,
8663,
8873,
27390,
3370,
1006,
2345,
2951,
6499,
3126,
3401,
2951,
6499,
3126,
3401,
1007,
1063,
2951,
6499,
3126,
3401,
8663,
8873,
27390,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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 | handler/src/main/java/io/netty/handler/ssl/ReferenceCountedOpenSslContext.java | ReferenceCountedOpenSslContext.toNegotiator | @SuppressWarnings("deprecation")
static OpenSslApplicationProtocolNegotiator toNegotiator(ApplicationProtocolConfig config) {
if (config == null) {
return NONE_PROTOCOL_NEGOTIATOR;
}
switch (config.protocol()) {
case NONE:
return NONE_PROTOCOL_NEGOTIA... | java | @SuppressWarnings("deprecation")
static OpenSslApplicationProtocolNegotiator toNegotiator(ApplicationProtocolConfig config) {
if (config == null) {
return NONE_PROTOCOL_NEGOTIATOR;
}
switch (config.protocol()) {
case NONE:
return NONE_PROTOCOL_NEGOTIA... | [
"@",
"SuppressWarnings",
"(",
"\"deprecation\"",
")",
"static",
"OpenSslApplicationProtocolNegotiator",
"toNegotiator",
"(",
"ApplicationProtocolConfig",
"config",
")",
"{",
"if",
"(",
"config",
"==",
"null",
")",
"{",
"return",
"NONE_PROTOCOL_NEGOTIATOR",
";",
"}",
"... | Translate a {@link ApplicationProtocolConfig} object to a
{@link OpenSslApplicationProtocolNegotiator} object.
@param config The configuration which defines the translation
@return The results of the translation | [
"Translate",
"a",
"{",
"@link",
"ApplicationProtocolConfig",
"}",
"object",
"to",
"a",
"{",
"@link",
"OpenSslApplicationProtocolNegotiator",
"}",
"object",
"."
] | ba06eafa1c1824bd154f1a380019e7ea2edf3c4c | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/handler/src/main/java/io/netty/handler/ssl/ReferenceCountedOpenSslContext.java#L605-L640 | train | Converts an application protocol configuration to an OpenSsl application protocol negotiator. | [
30522,
1030,
16081,
9028,
5582,
2015,
1006,
1000,
2139,
28139,
10719,
1000,
1007,
10763,
7480,
14540,
29098,
19341,
3508,
21572,
3406,
25778,
2638,
3995,
10711,
4263,
4309,
3995,
10711,
4263,
1006,
4646,
21572,
3406,
25778,
8663,
8873,
2290,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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/taskmanager/Task.java | Task.onPartitionStateUpdate | @VisibleForTesting
void onPartitionStateUpdate(
IntermediateDataSetID intermediateDataSetId,
ResultPartitionID resultPartitionId,
ExecutionState producerState) throws IOException, InterruptedException {
if (executionState == ExecutionState.RUNNING) {
final SingleInputGate inputGate = inputGatesById.get(... | java | @VisibleForTesting
void onPartitionStateUpdate(
IntermediateDataSetID intermediateDataSetId,
ResultPartitionID resultPartitionId,
ExecutionState producerState) throws IOException, InterruptedException {
if (executionState == ExecutionState.RUNNING) {
final SingleInputGate inputGate = inputGatesById.get(... | [
"@",
"VisibleForTesting",
"void",
"onPartitionStateUpdate",
"(",
"IntermediateDataSetID",
"intermediateDataSetId",
",",
"ResultPartitionID",
"resultPartitionId",
",",
"ExecutionState",
"producerState",
")",
"throws",
"IOException",
",",
"InterruptedException",
"{",
"if",
"(",... | Answer to a partition state check issued after a failed partition request. | [
"Answer",
"to",
"a",
"partition",
"state",
"check",
"issued",
"after",
"a",
"failed",
"partition",
"request",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/taskmanager/Task.java#L1258-L1311 | train | Called when the partition state of the task is updated. | [
30522,
1030,
5710,
13028,
4355,
2075,
11675,
2006,
19362,
3775,
9285,
12259,
6279,
13701,
1006,
7783,
2850,
18260,
3775,
2094,
7783,
2850,
18260,
3775,
2094,
1010,
2765,
19362,
3775,
3508,
3593,
2765,
19362,
3775,
3508,
3593,
1010,
22679,
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/DataStream.java | DataStream.writeAsCsv | @PublicEvolving
public DataStreamSink<T> writeAsCsv(String path, WriteMode writeMode) {
return writeAsCsv(path, writeMode, CsvOutputFormat.DEFAULT_LINE_DELIMITER, CsvOutputFormat.DEFAULT_FIELD_DELIMITER);
} | java | @PublicEvolving
public DataStreamSink<T> writeAsCsv(String path, WriteMode writeMode) {
return writeAsCsv(path, writeMode, CsvOutputFormat.DEFAULT_LINE_DELIMITER, CsvOutputFormat.DEFAULT_FIELD_DELIMITER);
} | [
"@",
"PublicEvolving",
"public",
"DataStreamSink",
"<",
"T",
">",
"writeAsCsv",
"(",
"String",
"path",
",",
"WriteMode",
"writeMode",
")",
"{",
"return",
"writeAsCsv",
"(",
"path",
",",
"writeMode",
",",
"CsvOutputFormat",
".",
"DEFAULT_LINE_DELIMITER",
",",
"Cs... | Writes a DataStream to the file specified by the path parameter.
<p>For every field of an element of the DataStream the result of {@link Object#toString()}
is written. This method can only be used on data streams of tuples.
@param path
the path pointing to the location the text file is written to
@param writeMode
Con... | [
"Writes",
"a",
"DataStream",
"to",
"the",
"file",
"specified",
"by",
"the",
"path",
"parameter",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-streaming-java/src/main/java/org/apache/flink/streaming/api/datastream/DataStream.java#L1080-L1083 | train | Write the data stream to a CSV file. | [
30522,
1030,
2270,
6777,
4747,
6455,
2270,
2951,
21422,
11493,
2243,
1026,
1056,
1028,
4339,
3022,
6169,
2615,
1006,
5164,
4130,
1010,
4339,
5302,
3207,
30524,
1035,
3972,
27605,
3334,
1010,
20116,
6767,
4904,
18780,
14192,
4017,
1012,
1239... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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 | handler/src/main/java/io/netty/handler/ssl/SslUtils.java | SslUtils.addIfSupported | static void addIfSupported(Set<String> supported, List<String> enabled, String... names) {
for (String n: names) {
if (supported.contains(n)) {
enabled.add(n);
}
}
} | java | static void addIfSupported(Set<String> supported, List<String> enabled, String... names) {
for (String n: names) {
if (supported.contains(n)) {
enabled.add(n);
}
}
} | [
"static",
"void",
"addIfSupported",
"(",
"Set",
"<",
"String",
">",
"supported",
",",
"List",
"<",
"String",
">",
"enabled",
",",
"String",
"...",
"names",
")",
"{",
"for",
"(",
"String",
"n",
":",
"names",
")",
"{",
"if",
"(",
"supported",
".",
"con... | Add elements from {@code names} into {@code enabled} if they are in {@code supported}. | [
"Add",
"elements",
"from",
"{"
] | ba06eafa1c1824bd154f1a380019e7ea2edf3c4c | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/handler/src/main/java/io/netty/handler/ssl/SslUtils.java#L135-L141 | train | Add if supported and enabled | [
30522,
10763,
11675,
5587,
10128,
6342,
9397,
15613,
1006,
2275,
1026,
5164,
1028,
3569,
1010,
2862,
1026,
5164,
1028,
9124,
1010,
5164,
1012,
1012,
1012,
3415,
1007,
1063,
2005,
1006,
5164,
1050,
1024,
3415,
1007,
1063,
2065,
1006,
3569,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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/ShardingSchema.java | ShardingSchema.renew | @Subscribe
public synchronized void renew(final ShardingRuleChangedEvent shardingRuleChangedEvent) {
if (getName().equals(shardingRuleChangedEvent.getShardingSchemaName())) {
shardingRule = new OrchestrationShardingRule(shardingRuleChangedEvent.getShardingRuleConfiguration(), getDataSources().ke... | java | @Subscribe
public synchronized void renew(final ShardingRuleChangedEvent shardingRuleChangedEvent) {
if (getName().equals(shardingRuleChangedEvent.getShardingSchemaName())) {
shardingRule = new OrchestrationShardingRule(shardingRuleChangedEvent.getShardingRuleConfiguration(), getDataSources().ke... | [
"@",
"Subscribe",
"public",
"synchronized",
"void",
"renew",
"(",
"final",
"ShardingRuleChangedEvent",
"shardingRuleChangedEvent",
")",
"{",
"if",
"(",
"getName",
"(",
")",
".",
"equals",
"(",
"shardingRuleChangedEvent",
".",
"getShardingSchemaName",
"(",
")",
")",
... | Renew sharding rule.
@param shardingRuleChangedEvent sharding rule changed event. | [
"Renew",
"sharding",
"rule",
"."
] | f88fd29fc345dfb31fdce12e9e96cbfa0fd2402d | https://github.com/apache/incubator-shardingsphere/blob/f88fd29fc345dfb31fdce12e9e96cbfa0fd2402d/sharding-proxy/sharding-proxy-backend/src/main/java/org/apache/shardingsphere/shardingproxy/backend/schema/ShardingSchema.java#L79-L84 | train | Renew sharding rule. | [
30522,
1030,
4942,
29234,
2270,
25549,
11675,
20687,
1006,
2345,
21146,
17080,
3070,
6820,
2571,
22305,
14728,
15338,
21146,
17080,
3070,
6820,
2571,
22305,
14728,
15338,
1007,
1063,
2065,
1006,
2131,
18442,
1006,
1007,
1012,
19635,
1006,
211... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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 | dbsync/src/main/java/com/taobao/tddl/dbsync/binlog/event/RowsLogBuffer.java | RowsLogBuffer.mysqlToJavaType | static int mysqlToJavaType(int type, final int meta, boolean isBinary) {
int javaType;
if (type == LogEvent.MYSQL_TYPE_STRING) {
if (meta >= 256) {
int byte0 = meta >> 8;
if ((byte0 & 0x30) != 0x30) {
/* a long CHAR() field: see #37... | java | static int mysqlToJavaType(int type, final int meta, boolean isBinary) {
int javaType;
if (type == LogEvent.MYSQL_TYPE_STRING) {
if (meta >= 256) {
int byte0 = meta >> 8;
if ((byte0 & 0x30) != 0x30) {
/* a long CHAR() field: see #37... | [
"static",
"int",
"mysqlToJavaType",
"(",
"int",
"type",
",",
"final",
"int",
"meta",
",",
"boolean",
"isBinary",
")",
"{",
"int",
"javaType",
";",
"if",
"(",
"type",
"==",
"LogEvent",
".",
"MYSQL_TYPE_STRING",
")",
"{",
"if",
"(",
"meta",
">=",
"256",
... | Maps the given MySQL type to the correct JDBC type. | [
"Maps",
"the",
"given",
"MySQL",
"type",
"to",
"the",
"correct",
"JDBC",
"type",
"."
] | 8f088cddc0755f4350c5aaae95c6e4002d90a40f | https://github.com/alibaba/canal/blob/8f088cddc0755f4350c5aaae95c6e4002d90a40f/dbsync/src/main/java/com/taobao/tddl/dbsync/binlog/event/RowsLogBuffer.java#L132-L269 | train | Convert a MySQL type to the Java type. | [
30522,
10763,
20014,
2026,
2015,
4160,
23223,
3900,
22879,
18863,
1006,
20014,
2828,
1010,
2345,
20014,
18804,
1010,
22017,
20898,
2003,
21114,
2854,
1007,
1063,
20014,
9262,
13874,
1025,
2065,
1006,
2828,
1027,
1027,
8833,
18697,
3372,
1012,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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-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 | train | Merge two time windows. | [
30522,
2797,
2051,
11101,
5004,
13590,
11101,
5004,
1006,
2051,
11101,
5004,
12731,
27349,
3527,
2860,
1010,
2051,
11101,
5004,
2060,
1010,
3074,
1026,
2051,
11101,
5004,
1028,
5314,
11101,
5004,
1007,
1063,
2065,
1006,
12731,
27349,
3527,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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/text/csv/CsvRow.java | CsvRow.getFieldMap | public Map<String, String> getFieldMap() {
if (headerMap == null) {
throw new IllegalStateException("No header available");
}
final Map<String, String> fieldMap = new LinkedHashMap<>(headerMap.size());
String key;
Integer col;
String val;
for (final Map.Entry<String, Integer> header : headerMap.entryS... | java | public Map<String, String> getFieldMap() {
if (headerMap == null) {
throw new IllegalStateException("No header available");
}
final Map<String, String> fieldMap = new LinkedHashMap<>(headerMap.size());
String key;
Integer col;
String val;
for (final Map.Entry<String, Integer> header : headerMap.entryS... | [
"public",
"Map",
"<",
"String",
",",
"String",
">",
"getFieldMap",
"(",
")",
"{",
"if",
"(",
"headerMap",
"==",
"null",
")",
"{",
"throw",
"new",
"IllegalStateException",
"(",
"\"No header available\"",
")",
";",
"}",
"final",
"Map",
"<",
"String",
",",
... | 获取标题与字段值对应的Map
@return an unmodifiable map of header names and field values of this row
@throws IllegalStateException CSV文件无标题行抛出此异常 | [
"获取标题与字段值对应的Map"
] | bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/text/csv/CsvRow.java#L80-L97 | train | Gets the field map. | [
30522,
2270,
4949,
1026,
5164,
1010,
5164,
1028,
2131,
3790,
2863,
2361,
1006,
1007,
1063,
2065,
1006,
20346,
2863,
2361,
1027,
1027,
19701,
1007,
1063,
5466,
2047,
6206,
9153,
17389,
2595,
24422,
1006,
1000,
2053,
20346,
2800,
1000,
1007,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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/Select.java | Select.deselectAll | @Override
public void deselectAll() {
if (!isMultiple()) {
throw new UnsupportedOperationException(
"You may only deselect all options of a multi-select");
}
for (WebElement option : getOptions()) {
setSelected(option, false);
}
} | java | @Override
public void deselectAll() {
if (!isMultiple()) {
throw new UnsupportedOperationException(
"You may only deselect all options of a multi-select");
}
for (WebElement option : getOptions()) {
setSelected(option, false);
}
} | [
"@",
"Override",
"public",
"void",
"deselectAll",
"(",
")",
"{",
"if",
"(",
"!",
"isMultiple",
"(",
")",
")",
"{",
"throw",
"new",
"UnsupportedOperationException",
"(",
"\"You may only deselect all options of a multi-select\"",
")",
";",
"}",
"for",
"(",
"WebEleme... | Clear all selected entries. This is only valid when the SELECT supports multiple selections.
@throws UnsupportedOperationException If the SELECT does not support multiple selections | [
"Clear",
"all",
"selected",
"entries",
".",
"This",
"is",
"only",
"valid",
"when",
"the",
"SELECT",
"supports",
"multiple",
"selections",
"."
] | 7af172729f17b20269c8ca4ea6f788db48616535 | https://github.com/SeleniumHQ/selenium/blob/7af172729f17b20269c8ca4ea6f788db48616535/java/client/src/org/openqa/selenium/support/ui/Select.java#L200-L210 | train | Deselect all options of a multi - select. | [
30522,
1030,
2058,
15637,
2270,
11675,
4078,
12260,
25572,
3363,
1006,
1007,
1063,
2065,
1006,
999,
2003,
12274,
7096,
11514,
2571,
1006,
1007,
1007,
1063,
5466,
2047,
4895,
6342,
9397,
15613,
25918,
3370,
10288,
24422,
1006,
1000,
2017,
20... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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/mining/word/TfIdf.java | TfIdf.tfIdf | public static <TERM> Map<TERM, Double> tfIdf(Map<TERM, Double> tf, Map<TERM, Double> idf)
{
return tfIdf(tf, idf, Normalization.NONE);
} | java | public static <TERM> Map<TERM, Double> tfIdf(Map<TERM, Double> tf, Map<TERM, Double> idf)
{
return tfIdf(tf, idf, Normalization.NONE);
} | [
"public",
"static",
"<",
"TERM",
">",
"Map",
"<",
"TERM",
",",
"Double",
">",
"tfIdf",
"(",
"Map",
"<",
"TERM",
",",
"Double",
">",
"tf",
",",
"Map",
"<",
"TERM",
",",
"Double",
">",
"idf",
")",
"{",
"return",
"tfIdf",
"(",
"tf",
",",
"idf",
",... | 计算文档的tf-idf(不正规化)
@param tf 词频
@param idf 倒排频率
@param <TERM> 词语类型
@return 一个词语->tf-idf的Map | [
"计算文档的tf",
"-",
"idf(不正规化)"
] | a538d0722ab2e4980a9dcd9ea40324fc3ddba7ce | https://github.com/hankcs/HanLP/blob/a538d0722ab2e4980a9dcd9ea40324fc3ddba7ce/src/main/java/com/hankcs/hanlp/mining/word/TfIdf.java#L217-L220 | train | Get the TF IDF map. | [
30522,
2270,
10763,
1026,
2744,
1028,
4949,
1026,
2744,
1010,
3313,
1028,
1056,
8873,
20952,
1006,
4949,
1026,
2744,
1010,
3313,
1028,
1056,
2546,
1010,
4949,
1026,
2744,
1010,
3313,
1028,
24011,
1007,
1063,
2709,
1056,
8873,
20952,
1006,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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 | common/src/main/java/io/netty/util/concurrent/PromiseCombiner.java | PromiseCombiner.finish | public void finish(Promise<Void> aggregatePromise) {
ObjectUtil.checkNotNull(aggregatePromise, "aggregatePromise");
checkInEventLoop();
if (this.aggregatePromise != null) {
throw new IllegalStateException("Already finished");
}
this.aggregatePromise = aggregatePromise... | java | public void finish(Promise<Void> aggregatePromise) {
ObjectUtil.checkNotNull(aggregatePromise, "aggregatePromise");
checkInEventLoop();
if (this.aggregatePromise != null) {
throw new IllegalStateException("Already finished");
}
this.aggregatePromise = aggregatePromise... | [
"public",
"void",
"finish",
"(",
"Promise",
"<",
"Void",
">",
"aggregatePromise",
")",
"{",
"ObjectUtil",
".",
"checkNotNull",
"(",
"aggregatePromise",
",",
"\"aggregatePromise\"",
")",
";",
"checkInEventLoop",
"(",
")",
";",
"if",
"(",
"this",
".",
"aggregate... | <p>Sets the promise to be notified when all combined futures have finished. If all combined futures succeed,
then the aggregate promise will succeed. If one or more combined futures fails, then the aggregate promise will
fail with the cause of one of the failed futures. If more than one combined future fails, then exac... | [
"<p",
">",
"Sets",
"the",
"promise",
"to",
"be",
"notified",
"when",
"all",
"combined",
"futures",
"have",
"finished",
".",
"If",
"all",
"combined",
"futures",
"succeed",
"then",
"the",
"aggregate",
"promise",
"will",
"succeed",
".",
"If",
"one",
"or",
"mo... | ba06eafa1c1824bd154f1a380019e7ea2edf3c4c | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/common/src/main/java/io/netty/util/concurrent/PromiseCombiner.java#L151-L161 | train | Finishes the aggregate process. | [
30522,
2270,
11675,
3926,
1006,
4872,
1026,
11675,
1028,
9572,
21572,
28732,
1007,
1063,
4874,
21823,
2140,
1012,
4638,
17048,
11231,
3363,
1006,
9572,
21572,
28732,
1010,
1000,
9572,
21572,
28732,
1000,
1007,
1025,
4638,
3170,
15338,
4135,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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/recognition/nr/PersonRecognition.java | PersonRecognition.roleObserve | public static List<EnumItem<NR>> roleObserve(List<Vertex> wordSegResult)
{
List<EnumItem<NR>> tagList = new LinkedList<EnumItem<NR>>();
Iterator<Vertex> iterator = wordSegResult.iterator();
iterator.next();
tagList.add(new EnumItem<NR>(NR.A, NR.K)); // 始##始 A K
while (iterat... | java | public static List<EnumItem<NR>> roleObserve(List<Vertex> wordSegResult)
{
List<EnumItem<NR>> tagList = new LinkedList<EnumItem<NR>>();
Iterator<Vertex> iterator = wordSegResult.iterator();
iterator.next();
tagList.add(new EnumItem<NR>(NR.A, NR.K)); // 始##始 A K
while (iterat... | [
"public",
"static",
"List",
"<",
"EnumItem",
"<",
"NR",
">",
">",
"roleObserve",
"(",
"List",
"<",
"Vertex",
">",
"wordSegResult",
")",
"{",
"List",
"<",
"EnumItem",
"<",
"NR",
">>",
"tagList",
"=",
"new",
"LinkedList",
"<",
"EnumItem",
"<",
"NR",
">",... | 角色观察(从模型中加载所有词语对应的所有角色,允许进行一些规则补充)
@param wordSegResult 粗分结果
@return | [
"角色观察",
"(",
"从模型中加载所有词语对应的所有角色",
"允许进行一些规则补充",
")"
] | a538d0722ab2e4980a9dcd9ea40324fc3ddba7ce | https://github.com/hankcs/HanLP/blob/a538d0722ab2e4980a9dcd9ea40324fc3ddba7ce/src/main/java/com/hankcs/hanlp/recognition/nr/PersonRecognition.java#L80-L118 | train | roleObserve method. | [
30522,
2270,
10763,
2862,
1026,
4372,
12717,
18532,
1026,
17212,
1028,
1028,
2535,
16429,
8043,
3726,
1006,
2862,
1026,
19449,
1028,
2616,
13910,
6072,
11314,
1007,
1063,
2862,
1026,
4372,
12717,
18532,
1026,
17212,
1028,
1028,
6415,
9863,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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-jdbc/sharding-jdbc-core/src/main/java/org/apache/shardingsphere/shardingjdbc/jdbc/adapter/AbstractConnectionAdapter.java | AbstractConnectionAdapter.getConnection | public final Connection getConnection(final String dataSourceName) throws SQLException {
return getConnections(ConnectionMode.MEMORY_STRICTLY, dataSourceName, 1).get(0);
} | java | public final Connection getConnection(final String dataSourceName) throws SQLException {
return getConnections(ConnectionMode.MEMORY_STRICTLY, dataSourceName, 1).get(0);
} | [
"public",
"final",
"Connection",
"getConnection",
"(",
"final",
"String",
"dataSourceName",
")",
"throws",
"SQLException",
"{",
"return",
"getConnections",
"(",
"ConnectionMode",
".",
"MEMORY_STRICTLY",
",",
"dataSourceName",
",",
"1",
")",
".",
"get",
"(",
"0",
... | Get database connection.
@param dataSourceName data source name
@return database connection
@throws SQLException SQL exception | [
"Get",
"database",
"connection",
"."
] | f88fd29fc345dfb31fdce12e9e96cbfa0fd2402d | https://github.com/apache/incubator-shardingsphere/blob/f88fd29fc345dfb31fdce12e9e96cbfa0fd2402d/sharding-jdbc/sharding-jdbc-core/src/main/java/org/apache/shardingsphere/shardingjdbc/jdbc/adapter/AbstractConnectionAdapter.java#L95-L97 | train | Get a connection from the specified datasource. | [
30522,
2270,
2345,
4434,
2131,
8663,
2638,
7542,
1006,
2345,
5164,
2951,
6499,
3126,
27524,
14074,
1007,
11618,
29296,
10288,
24422,
1063,
2709,
2131,
8663,
2638,
22014,
1006,
4434,
5302,
3207,
1012,
3638,
1035,
9975,
1010,
2951,
6499,
3126... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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/collection/trie/bintrie/BinTrie.java | BinTrie.commonPrefixSearchWithValue | public LinkedList<Map.Entry<String, V>> commonPrefixSearchWithValue(char[] chars, int begin)
{
LinkedList<Map.Entry<String, V>> result = new LinkedList<Map.Entry<String, V>>();
StringBuilder sb = new StringBuilder();
BaseNode branch = this;
for (int i = begin; i < chars.length; ++i)
... | java | public LinkedList<Map.Entry<String, V>> commonPrefixSearchWithValue(char[] chars, int begin)
{
LinkedList<Map.Entry<String, V>> result = new LinkedList<Map.Entry<String, V>>();
StringBuilder sb = new StringBuilder();
BaseNode branch = this;
for (int i = begin; i < chars.length; ++i)
... | [
"public",
"LinkedList",
"<",
"Map",
".",
"Entry",
"<",
"String",
",",
"V",
">",
">",
"commonPrefixSearchWithValue",
"(",
"char",
"[",
"]",
"chars",
",",
"int",
"begin",
")",
"{",
"LinkedList",
"<",
"Map",
".",
"Entry",
"<",
"String",
",",
"V",
">",
"... | 前缀查询,通过字符数组来表示字符串可以优化运行速度
@param chars 字符串的字符数组
@param begin 开始的下标
@return | [
"前缀查询,通过字符数组来表示字符串可以优化运行速度"
] | a538d0722ab2e4980a9dcd9ea40324fc3ddba7ce | https://github.com/hankcs/HanLP/blob/a538d0722ab2e4980a9dcd9ea40324fc3ddba7ce/src/main/java/com/hankcs/hanlp/collection/trie/bintrie/BinTrie.java#L254-L272 | train | Common prefix search with value. | [
30522,
2270,
5799,
9863,
1026,
4949,
1012,
4443,
1026,
5164,
1010,
1058,
1028,
1028,
2691,
28139,
8873,
2595,
17310,
11140,
24415,
10175,
5657,
1006,
25869,
1031,
1033,
25869,
2015,
1010,
20014,
4088,
1007,
1063,
5799,
9863,
1026,
4949,
101... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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-core/sharding-core-common/src/main/java/org/apache/shardingsphere/core/spi/NewInstanceServiceLoader.java | NewInstanceServiceLoader.register | public static <T> void register(final Class<T> service) {
for (T each : ServiceLoader.load(service)) {
registerServiceClass(service, each);
}
} | java | public static <T> void register(final Class<T> service) {
for (T each : ServiceLoader.load(service)) {
registerServiceClass(service, each);
}
} | [
"public",
"static",
"<",
"T",
">",
"void",
"register",
"(",
"final",
"Class",
"<",
"T",
">",
"service",
")",
"{",
"for",
"(",
"T",
"each",
":",
"ServiceLoader",
".",
"load",
"(",
"service",
")",
")",
"{",
"registerServiceClass",
"(",
"service",
",",
... | Register SPI service into map for new instance.
@param service service type
@param <T> type of service | [
"Register",
"SPI",
"service",
"into",
"map",
"for",
"new",
"instance",
"."
] | f88fd29fc345dfb31fdce12e9e96cbfa0fd2402d | https://github.com/apache/incubator-shardingsphere/blob/f88fd29fc345dfb31fdce12e9e96cbfa0fd2402d/sharding-core/sharding-core-common/src/main/java/org/apache/shardingsphere/core/spi/NewInstanceServiceLoader.java#L48-L52 | train | Registers a service class. | [
30522,
2270,
10763,
1026,
1056,
1028,
11675,
4236,
1006,
2345,
2465,
1026,
1056,
1028,
2326,
1007,
1063,
2005,
1006,
1056,
2169,
1024,
2326,
11066,
2121,
1012,
7170,
1006,
2326,
1007,
1007,
1063,
18687,
2121,
7903,
8586,
27102,
1006,
2326,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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-filesystems/flink-fs-hadoop-shaded/src/main/java/org/apache/hadoop/conf/Configuration.java | Configuration.convertStorageUnit | private double convertStorageUnit(double value, StorageUnit sourceUnit,
StorageUnit targetUnit) {
double byteValue = sourceUnit.toBytes(value);
return targetUnit.fromBytes(byteValue);
} | java | private double convertStorageUnit(double value, StorageUnit sourceUnit,
StorageUnit targetUnit) {
double byteValue = sourceUnit.toBytes(value);
return targetUnit.fromBytes(byteValue);
} | [
"private",
"double",
"convertStorageUnit",
"(",
"double",
"value",
",",
"StorageUnit",
"sourceUnit",
",",
"StorageUnit",
"targetUnit",
")",
"{",
"double",
"byteValue",
"=",
"sourceUnit",
".",
"toBytes",
"(",
"value",
")",
";",
"return",
"targetUnit",
".",
"fromB... | convert the value from one storage unit to another.
@param value - value
@param sourceUnit - Source unit to convert from
@param targetUnit - target unit.
@return double. | [
"convert",
"the",
"value",
"from",
"one",
"storage",
"unit",
"to",
"another",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-filesystems/flink-fs-hadoop-shaded/src/main/java/org/apache/hadoop/conf/Configuration.java#L1788-L1792 | train | Convert a double value from the source to the target. | [
30522,
2797,
3313,
19884,
4263,
4270,
19496,
2102,
1006,
3313,
3643,
1010,
5527,
19496,
2102,
3120,
19496,
2102,
1010,
5527,
19496,
2102,
4539,
19496,
2102,
1007,
1063,
3313,
24880,
10175,
5657,
1027,
3120,
19496,
2102,
1012,
11291,
4570,
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/SingleOutputStreamOperator.java | SingleOutputStreamOperator.getSideOutput | public <X> DataStream<X> getSideOutput(OutputTag<X> sideOutputTag) {
if (wasSplitApplied) {
throw new UnsupportedOperationException("getSideOutput() and split() may not be called on the same DataStream. " +
"As a work-around, please add a no-op map function before the split() call.");
}
sideOutputTag = cl... | java | public <X> DataStream<X> getSideOutput(OutputTag<X> sideOutputTag) {
if (wasSplitApplied) {
throw new UnsupportedOperationException("getSideOutput() and split() may not be called on the same DataStream. " +
"As a work-around, please add a no-op map function before the split() call.");
}
sideOutputTag = cl... | [
"public",
"<",
"X",
">",
"DataStream",
"<",
"X",
">",
"getSideOutput",
"(",
"OutputTag",
"<",
"X",
">",
"sideOutputTag",
")",
"{",
"if",
"(",
"wasSplitApplied",
")",
"{",
"throw",
"new",
"UnsupportedOperationException",
"(",
"\"getSideOutput() and split() may not ... | Gets the {@link DataStream} that contains the elements that are emitted from an operation
into the side output with the given {@link OutputTag}.
@see org.apache.flink.streaming.api.functions.ProcessFunction.Context#output(OutputTag, Object) | [
"Gets",
"the",
"{",
"@link",
"DataStream",
"}",
"that",
"contains",
"the",
"elements",
"that",
"are",
"emitted",
"from",
"an",
"operation",
"into",
"the",
"side",
"output",
"with",
"the",
"given",
"{",
"@link",
"OutputTag",
"}",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-streaming-java/src/main/java/org/apache/flink/streaming/api/datastream/SingleOutputStreamOperator.java#L409-L431 | train | Gets the side output of this DataStream. | [
30522,
2270,
1026,
1060,
1028,
2951,
21422,
1026,
1060,
1028,
4152,
5178,
5833,
18780,
1006,
6434,
15900,
1026,
1060,
1028,
2217,
5833,
18780,
15900,
1007,
1063,
2065,
1006,
2001,
13102,
27606,
9397,
8751,
2094,
1007,
1063,
5466,
2047,
4895... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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/environment/StreamExecutionEnvironment.java | StreamExecutionEnvironment.fromParallelCollection | public <OUT> DataStreamSource<OUT> fromParallelCollection(SplittableIterator<OUT> iterator, Class<OUT> type) {
return fromParallelCollection(iterator, TypeExtractor.getForClass(type));
} | java | public <OUT> DataStreamSource<OUT> fromParallelCollection(SplittableIterator<OUT> iterator, Class<OUT> type) {
return fromParallelCollection(iterator, TypeExtractor.getForClass(type));
} | [
"public",
"<",
"OUT",
">",
"DataStreamSource",
"<",
"OUT",
">",
"fromParallelCollection",
"(",
"SplittableIterator",
"<",
"OUT",
">",
"iterator",
",",
"Class",
"<",
"OUT",
">",
"type",
")",
"{",
"return",
"fromParallelCollection",
"(",
"iterator",
",",
"TypeEx... | Creates a new data stream that contains elements in the iterator. The iterator is splittable,
allowing the framework to create a parallel data stream source that returns the elements in
the iterator.
<p>Because the iterator will remain unmodified until the actual execution happens, the type
of data returned by the ite... | [
"Creates",
"a",
"new",
"data",
"stream",
"that",
"contains",
"elements",
"in",
"the",
"iterator",
".",
"The",
"iterator",
"is",
"splittable",
"allowing",
"the",
"framework",
"to",
"create",
"a",
"parallel",
"data",
"stream",
"source",
"that",
"returns",
"the",... | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-streaming-java/src/main/java/org/apache/flink/streaming/api/environment/StreamExecutionEnvironment.java#L888-L890 | train | Creates a DataStreamSource from a parallel collection of data. | [
30522,
2270,
1026,
2041,
1028,
2951,
21422,
6499,
3126,
3401,
1026,
2041,
1028,
2013,
28689,
6216,
22499,
6216,
7542,
1006,
3975,
10880,
21646,
8844,
1026,
2041,
1028,
2009,
6906,
4263,
1010,
2465,
1026,
2041,
1028,
2828,
1007,
1063,
2709,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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/jdbc/DataSourceProperties.java | DataSourceProperties.determineDatabaseName | public String determineDatabaseName() {
if (this.generateUniqueName) {
if (this.uniqueName == null) {
this.uniqueName = UUID.randomUUID().toString();
}
return this.uniqueName;
}
if (StringUtils.hasLength(this.name)) {
return this.name;
}
if (this.embeddedDatabaseConnection != EmbeddedDatabaseC... | java | public String determineDatabaseName() {
if (this.generateUniqueName) {
if (this.uniqueName == null) {
this.uniqueName = UUID.randomUUID().toString();
}
return this.uniqueName;
}
if (StringUtils.hasLength(this.name)) {
return this.name;
}
if (this.embeddedDatabaseConnection != EmbeddedDatabaseC... | [
"public",
"String",
"determineDatabaseName",
"(",
")",
"{",
"if",
"(",
"this",
".",
"generateUniqueName",
")",
"{",
"if",
"(",
"this",
".",
"uniqueName",
"==",
"null",
")",
"{",
"this",
".",
"uniqueName",
"=",
"UUID",
".",
"randomUUID",
"(",
")",
".",
... | Determine the name to used based on this configuration.
@return the database name to use or {@code null}
@since 2.0.0 | [
"Determine",
"the",
"name",
"to",
"used",
"based",
"on",
"this",
"configuration",
"."
] | 0b27f7c70e164b2b1a96477f1d9c1acba56790c1 | https://github.com/spring-projects/spring-boot/blob/0b27f7c70e164b2b1a96477f1d9c1acba56790c1/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/jdbc/DataSourceProperties.java#L295-L309 | train | Determine the name of the database. | [
30522,
2270,
5164,
4340,
6790,
15058,
18442,
1006,
1007,
1063,
2065,
1006,
2023,
1012,
9699,
19496,
4226,
18442,
1007,
1063,
2065,
1006,
2023,
1012,
4310,
18442,
1027,
1027,
19701,
1007,
1063,
2023,
1012,
4310,
18442,
1027,
1057,
21272,
101... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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-java/src/main/java/org/apache/flink/api/java/RemoteEnvironment.java | RemoteEnvironment.dispose | protected void dispose() {
// Remove shutdown hook to prevent resource leaks
ShutdownHookUtil.removeShutdownHook(shutdownHook, getClass().getSimpleName(), LOG);
try {
PlanExecutor executor = this.executor;
if (executor != null) {
executor.stop();
}
}
catch (Exception e) {
throw new RuntimeExc... | java | protected void dispose() {
// Remove shutdown hook to prevent resource leaks
ShutdownHookUtil.removeShutdownHook(shutdownHook, getClass().getSimpleName(), LOG);
try {
PlanExecutor executor = this.executor;
if (executor != null) {
executor.stop();
}
}
catch (Exception e) {
throw new RuntimeExc... | [
"protected",
"void",
"dispose",
"(",
")",
"{",
"// Remove shutdown hook to prevent resource leaks",
"ShutdownHookUtil",
".",
"removeShutdownHook",
"(",
"shutdownHook",
",",
"getClass",
"(",
")",
".",
"getSimpleName",
"(",
")",
",",
"LOG",
")",
";",
"try",
"{",
"Pl... | ------------------------------------------------------------------------ | [
"------------------------------------------------------------------------"
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-java/src/main/java/org/apache/flink/api/java/RemoteEnvironment.java#L227-L240 | train | Dispose of the session. | [
30522,
5123,
11675,
27764,
1006,
1007,
1063,
1013,
1013,
6366,
3844,
7698,
8103,
30524,
1007,
1025,
3046,
1063,
4946,
2595,
8586,
16161,
2099,
4654,
8586,
16161,
2099,
1027,
2023,
1012,
4654,
8586,
16161,
2099,
1025,
2065,
1006,
4654,
8586,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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... |
networknt/light-4j | consul/src/main/java/com/networknt/consul/ConsulRegistry.java | ConsulRegistry.updateServiceCache | private void updateServiceCache(String serviceName, ConcurrentHashMap<String, List<URL>> serviceUrls, boolean needNotify) {
if (serviceUrls != null && !serviceUrls.isEmpty()) {
List<URL> urls = serviceCache.get(serviceName);
if (urls == null) {
if(logger.isDebugEnabled())... | java | private void updateServiceCache(String serviceName, ConcurrentHashMap<String, List<URL>> serviceUrls, boolean needNotify) {
if (serviceUrls != null && !serviceUrls.isEmpty()) {
List<URL> urls = serviceCache.get(serviceName);
if (urls == null) {
if(logger.isDebugEnabled())... | [
"private",
"void",
"updateServiceCache",
"(",
"String",
"serviceName",
",",
"ConcurrentHashMap",
"<",
"String",
",",
"List",
"<",
"URL",
">",
">",
"serviceUrls",
",",
"boolean",
"needNotify",
")",
"{",
"if",
"(",
"serviceUrls",
"!=",
"null",
"&&",
"!",
"serv... | update service cache of the serviceName.
update local cache when service list changed,
if need notify, notify service
@param serviceName
@param serviceUrls
@param needNotify | [
"update",
"service",
"cache",
"of",
"the",
"serviceName",
".",
"update",
"local",
"cache",
"when",
"service",
"list",
"changed",
"if",
"need",
"notify",
"notify",
"service"
] | 2a60257c60663684c8f6dc8b5ea3cf184e534db6 | https://github.com/networknt/light-4j/blob/2a60257c60663684c8f6dc8b5ea3cf184e534db6/consul/src/main/java/com/networknt/consul/ConsulRegistry.java#L230-L263 | train | Update service cache. | [
30522,
2797,
11675,
14409,
2121,
7903,
19281,
5403,
1006,
5164,
2326,
18442,
1010,
16483,
14949,
22444,
2361,
1026,
5164,
1010,
2862,
1026,
24471,
2140,
1028,
1028,
2326,
3126,
4877,
1010,
22017,
20898,
2342,
17048,
8757,
1007,
1063,
2065,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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 | common/src/main/java/io/netty/util/AsciiString.java | AsciiString.copy | public void copy(int srcIdx, byte[] dst, int dstIdx, int length) {
if (isOutOfBounds(srcIdx, length, length())) {
throw new IndexOutOfBoundsException("expected: " + "0 <= srcIdx(" + srcIdx + ") <= srcIdx + length("
+ length + ") <= srcLen(" + length() + ')');
}
... | java | public void copy(int srcIdx, byte[] dst, int dstIdx, int length) {
if (isOutOfBounds(srcIdx, length, length())) {
throw new IndexOutOfBoundsException("expected: " + "0 <= srcIdx(" + srcIdx + ") <= srcIdx + length("
+ length + ") <= srcLen(" + length() + ')');
}
... | [
"public",
"void",
"copy",
"(",
"int",
"srcIdx",
",",
"byte",
"[",
"]",
"dst",
",",
"int",
"dstIdx",
",",
"int",
"length",
")",
"{",
"if",
"(",
"isOutOfBounds",
"(",
"srcIdx",
",",
"length",
",",
"length",
"(",
")",
")",
")",
"{",
"throw",
"new",
... | Copies the content of this string to a byte array.
@param srcIdx the starting offset of characters to copy.
@param dst the destination byte array.
@param dstIdx the starting offset in the destination byte array.
@param length the number of characters to copy. | [
"Copies",
"the",
"content",
"of",
"this",
"string",
"to",
"a",
"byte",
"array",
"."
] | ba06eafa1c1824bd154f1a380019e7ea2edf3c4c | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/common/src/main/java/io/netty/util/AsciiString.java#L410-L417 | train | Copy the contents of this array into the specified byte array. | [
30522,
2270,
11675,
6100,
1006,
20014,
5034,
6895,
2094,
2595,
1010,
24880,
1031,
1033,
16233,
2102,
1010,
20014,
16233,
3775,
2094,
2595,
1010,
20014,
3091,
1007,
1063,
2065,
1006,
11163,
16161,
26337,
28819,
2015,
1006,
5034,
6895,
2094,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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... |
redisson/redisson | redisson/src/main/java/org/redisson/liveobject/core/RedissonObjectBuilder.java | RedissonObjectBuilder.getFieldCodec | private Codec getFieldCodec(Class<?> rEntity, Class<? extends RObject> rObjectClass, String fieldName) throws Exception {
Field field = ClassUtils.getDeclaredField(rEntity, fieldName);
if (field.isAnnotationPresent(RObjectField.class)) {
RObjectField anno = field.getAnnotation(RObjectField.c... | java | private Codec getFieldCodec(Class<?> rEntity, Class<? extends RObject> rObjectClass, String fieldName) throws Exception {
Field field = ClassUtils.getDeclaredField(rEntity, fieldName);
if (field.isAnnotationPresent(RObjectField.class)) {
RObjectField anno = field.getAnnotation(RObjectField.c... | [
"private",
"Codec",
"getFieldCodec",
"(",
"Class",
"<",
"?",
">",
"rEntity",
",",
"Class",
"<",
"?",
"extends",
"RObject",
">",
"rObjectClass",
",",
"String",
"fieldName",
")",
"throws",
"Exception",
"{",
"Field",
"field",
"=",
"ClassUtils",
".",
"getDeclare... | WARNING: rEntity has to be the class of @This object. | [
"WARNING",
":",
"rEntity",
"has",
"to",
"be",
"the",
"class",
"of"
] | d3acc0249b2d5d658d36d99e2c808ce49332ea44 | https://github.com/redisson/redisson/blob/d3acc0249b2d5d658d36d99e2c808ce49332ea44/redisson/src/main/java/org/redisson/liveobject/core/RedissonObjectBuilder.java#L145-L154 | train | Gets the field codec. | [
30522,
2797,
3642,
2278,
2131,
3790,
16044,
2278,
1006,
2465,
1026,
1029,
1028,
9278,
3012,
1010,
2465,
1026,
1029,
8908,
6487,
20614,
1028,
6487,
20614,
26266,
1010,
5164,
2492,
18442,
1007,
11618,
6453,
1063,
2492,
2492,
1027,
2465,
21823... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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-table/flink-table-runtime-blink/src/main/java/org/apache/flink/table/runtime/rank/AbstractTopNFunction.java | AbstractTopNFunction.delete | protected void delete(Collector<BaseRow> out, BaseRow inputRow) {
BaseRowUtil.setRetract(inputRow);
out.collect(inputRow);
} | java | protected void delete(Collector<BaseRow> out, BaseRow inputRow) {
BaseRowUtil.setRetract(inputRow);
out.collect(inputRow);
} | [
"protected",
"void",
"delete",
"(",
"Collector",
"<",
"BaseRow",
">",
"out",
",",
"BaseRow",
"inputRow",
")",
"{",
"BaseRowUtil",
".",
"setRetract",
"(",
"inputRow",
")",
";",
"out",
".",
"collect",
"(",
"inputRow",
")",
";",
"}"
] | This is similar to [[retract()]] but always send retraction message regardless of generateRetraction is true or
not. | [
"This",
"is",
"similar",
"to",
"[[",
"retract",
"()",
"]]",
"but",
"always",
"send",
"retraction",
"message",
"regardless",
"of",
"generateRetraction",
"is",
"true",
"or",
"not",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-table/flink-table-runtime-blink/src/main/java/org/apache/flink/table/runtime/rank/AbstractTopNFunction.java#L252-L255 | train | Delete the row from the table. | [
30522,
5123,
11675,
3972,
12870,
1006,
10018,
1026,
2918,
10524,
1028,
2041,
1010,
2918,
10524,
7953,
10524,
1007,
1063,
2918,
10524,
21823,
2140,
1012,
2275,
13465,
22648,
2102,
1006,
7953,
10524,
1007,
1025,
2041,
1012,
8145,
1006,
7953,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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-table/flink-table-common/src/main/java/org/apache/flink/table/descriptors/DescriptorProperties.java | DescriptorProperties.putCharacter | public void putCharacter(String key, char c) {
checkNotNull(key);
put(key, Character.toString(c));
} | java | public void putCharacter(String key, char c) {
checkNotNull(key);
put(key, Character.toString(c));
} | [
"public",
"void",
"putCharacter",
"(",
"String",
"key",
",",
"char",
"c",
")",
"{",
"checkNotNull",
"(",
"key",
")",
";",
"put",
"(",
"key",
",",
"Character",
".",
"toString",
"(",
"c",
")",
")",
";",
"}"
] | Adds a character under the given key. | [
"Adds",
"a",
"character",
"under",
"the",
"given",
"key",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-table/flink-table-common/src/main/java/org/apache/flink/table/descriptors/DescriptorProperties.java#L155-L158 | train | Put a Character object into the mapping for the given key. | [
30522,
2270,
11675,
2404,
7507,
22648,
3334,
1006,
5164,
3145,
1010,
25869,
1039,
1007,
1063,
4638,
17048,
11231,
3363,
1006,
3145,
1007,
1025,
2404,
1006,
3145,
1010,
2839,
1012,
2000,
3367,
4892,
1006,
1039,
1007,
1007,
1025,
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... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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/SettingLoader.java | SettingLoader.store | public void store(String absolutePath) {
PrintWriter writer = null;
try {
writer = FileUtil.getPrintWriter(absolutePath, charset, false);
store(writer);
} catch (IOException e) {
throw new IORuntimeException(e, "Store Setting to [{}] error!", absolutePath);
} finally {
IoUtil.close(writer);
... | java | public void store(String absolutePath) {
PrintWriter writer = null;
try {
writer = FileUtil.getPrintWriter(absolutePath, charset, false);
store(writer);
} catch (IOException e) {
throw new IORuntimeException(e, "Store Setting to [{}] error!", absolutePath);
} finally {
IoUtil.close(writer);
... | [
"public",
"void",
"store",
"(",
"String",
"absolutePath",
")",
"{",
"PrintWriter",
"writer",
"=",
"null",
";",
"try",
"{",
"writer",
"=",
"FileUtil",
".",
"getPrintWriter",
"(",
"absolutePath",
",",
"charset",
",",
"false",
")",
";",
"store",
"(",
"writer"... | 持久化当前设置,会覆盖掉之前的设置<br>
持久化会不会保留之前的分组
@param absolutePath 设置文件的绝对路径 | [
"持久化当前设置,会覆盖掉之前的设置<br",
">",
"持久化会不会保留之前的分组"
] | bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-setting/src/main/java/cn/hutool/setting/SettingLoader.java#L162-L172 | train | Stores the contents of the specified absolute path in the file system. | [
30522,
2270,
11675,
3573,
1006,
5164,
7619,
15069,
1007,
1063,
6140,
15994,
3213,
1027,
19701,
1025,
3046,
1063,
3213,
1027,
5371,
21823,
2140,
1012,
2131,
16550,
15994,
1006,
7619,
15069,
1010,
25869,
13462,
1010,
6270,
1007,
1025,
3573,
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... |
spring-projects/spring-boot | spring-boot-project/spring-boot/src/main/java/org/springframework/boot/BeanDefinitionLoader.java | BeanDefinitionLoader.setBeanNameGenerator | public void setBeanNameGenerator(BeanNameGenerator beanNameGenerator) {
this.annotatedReader.setBeanNameGenerator(beanNameGenerator);
this.xmlReader.setBeanNameGenerator(beanNameGenerator);
this.scanner.setBeanNameGenerator(beanNameGenerator);
} | java | public void setBeanNameGenerator(BeanNameGenerator beanNameGenerator) {
this.annotatedReader.setBeanNameGenerator(beanNameGenerator);
this.xmlReader.setBeanNameGenerator(beanNameGenerator);
this.scanner.setBeanNameGenerator(beanNameGenerator);
} | [
"public",
"void",
"setBeanNameGenerator",
"(",
"BeanNameGenerator",
"beanNameGenerator",
")",
"{",
"this",
".",
"annotatedReader",
".",
"setBeanNameGenerator",
"(",
"beanNameGenerator",
")",
";",
"this",
".",
"xmlReader",
".",
"setBeanNameGenerator",
"(",
"beanNameGener... | Set the bean name generator to be used by the underlying readers and scanner.
@param beanNameGenerator the bean name generator | [
"Set",
"the",
"bean",
"name",
"generator",
"to",
"be",
"used",
"by",
"the",
"underlying",
"readers",
"and",
"scanner",
"."
] | 0b27f7c70e164b2b1a96477f1d9c1acba56790c1 | https://github.com/spring-projects/spring-boot/blob/0b27f7c70e164b2b1a96477f1d9c1acba56790c1/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/BeanDefinitionLoader.java#L95-L99 | train | Sets the bean name generator. | [
30522,
2270,
11675,
2275,
4783,
25789,
4168,
6914,
6906,
4263,
1006,
14068,
18442,
6914,
6906,
4263,
14068,
18442,
6914,
6906,
4263,
1007,
1063,
2023,
1012,
5754,
17287,
3064,
16416,
4063,
1012,
2275,
4783,
25789,
4168,
6914,
6906,
4263,
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... |
alibaba/canal | common/src/main/java/com/alibaba/otter/canal/common/zookeeper/running/ServerRunningMonitor.java | ServerRunningMonitor.check | public boolean check() {
String path = ZookeeperPathUtils.getDestinationServerRunning(destination);
try {
byte[] bytes = zkClient.readData(path);
ServerRunningData eventData = JsonUtils.unmarshalFromByte(bytes, ServerRunningData.class);
activeData = eventData;// 更新下为最... | java | public boolean check() {
String path = ZookeeperPathUtils.getDestinationServerRunning(destination);
try {
byte[] bytes = zkClient.readData(path);
ServerRunningData eventData = JsonUtils.unmarshalFromByte(bytes, ServerRunningData.class);
activeData = eventData;// 更新下为最... | [
"public",
"boolean",
"check",
"(",
")",
"{",
"String",
"path",
"=",
"ZookeeperPathUtils",
".",
"getDestinationServerRunning",
"(",
"destination",
")",
";",
"try",
"{",
"byte",
"[",
"]",
"bytes",
"=",
"zkClient",
".",
"readData",
"(",
"path",
")",
";",
"Ser... | 检查当前的状态 | [
"检查当前的状态"
] | 8f088cddc0755f4350c5aaae95c6e4002d90a40f | https://github.com/alibaba/canal/blob/8f088cddc0755f4350c5aaae95c6e4002d90a40f/common/src/main/java/com/alibaba/otter/canal/common/zookeeper/running/ServerRunningMonitor.java#L177-L202 | train | check if the canal is running in the node | [
30522,
2270,
22017,
20898,
4638,
1006,
1007,
1063,
5164,
4130,
1027,
9201,
13106,
15069,
21823,
4877,
1012,
2131,
6155,
13770,
9285,
2121,
6299,
15532,
5582,
1006,
7688,
1007,
1025,
3046,
1063,
24880,
1031,
1033,
27507,
1027,
1062,
2243,
20... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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/StartMojo.java | StartMojo.execute | public <T> T execute(long wait, int maxAttempts, Callable<T> callback)
throws Exception {
getLog().debug("Waiting for spring application to start...");
for (int i = 0; i < maxAttempts; i++) {
T result = callback.call();
if (result != null) {
return result;
}
String message = "Spring application i... | java | public <T> T execute(long wait, int maxAttempts, Callable<T> callback)
throws Exception {
getLog().debug("Waiting for spring application to start...");
for (int i = 0; i < maxAttempts; i++) {
T result = callback.call();
if (result != null) {
return result;
}
String message = "Spring application i... | [
"public",
"<",
"T",
">",
"T",
"execute",
"(",
"long",
"wait",
",",
"int",
"maxAttempts",
",",
"Callable",
"<",
"T",
">",
"callback",
")",
"throws",
"Exception",
"{",
"getLog",
"(",
")",
".",
"debug",
"(",
"\"Waiting for spring application to start...\"",
")"... | Execute a task, retrying it on failure.
@param <T> the result type
@param wait the wait time
@param maxAttempts the maximum number of attempts
@param callback the task to execute (possibly multiple times). The callback should
return {@code null} to indicate that another attempt should be made
@return the result
@throws... | [
"Execute",
"a",
"task",
"retrying",
"it",
"on",
"failure",
"."
] | 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/StartMojo.java#L257-L282 | train | Execute the given callable waiting for the application to start before the configured timeout. | [
30522,
2270,
1026,
1056,
1028,
1056,
15389,
1006,
2146,
3524,
1010,
20014,
4098,
19321,
6633,
22798,
1010,
2655,
3085,
1026,
1056,
1028,
2655,
5963,
1007,
11618,
6453,
1063,
2131,
21197,
1006,
1007,
1012,
2139,
8569,
2290,
1006,
1000,
3403,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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-configuration-processor/src/json-shade/java/org/springframework/boot/configurationprocessor/json/JSONArray.java | JSONArray.optInt | public int optInt(int index, int fallback) {
Object object = opt(index);
Integer result = JSON.toInteger(object);
return result != null ? result : fallback;
} | java | public int optInt(int index, int fallback) {
Object object = opt(index);
Integer result = JSON.toInteger(object);
return result != null ? result : fallback;
} | [
"public",
"int",
"optInt",
"(",
"int",
"index",
",",
"int",
"fallback",
")",
"{",
"Object",
"object",
"=",
"opt",
"(",
"index",
")",
";",
"Integer",
"result",
"=",
"JSON",
".",
"toInteger",
"(",
"object",
")",
";",
"return",
"result",
"!=",
"null",
"... | Returns the value at {@code index} if it exists and is an int or can be coerced to
an int. Returns {@code fallback} otherwise.
@param index the index to get the value from
@param fallback the fallback value
@return the value at {@code index} of {@code fallback} | [
"Returns",
"the",
"value",
"at",
"{"
] | 0b27f7c70e164b2b1a96477f1d9c1acba56790c1 | https://github.com/spring-projects/spring-boot/blob/0b27f7c70e164b2b1a96477f1d9c1acba56790c1/spring-boot-project/spring-boot-tools/spring-boot-configuration-processor/src/json-shade/java/org/springframework/boot/configurationprocessor/json/JSONArray.java#L436-L440 | train | Get the optional int value associated with an index. | [
30522,
2270,
20014,
23569,
18447,
1006,
20014,
5950,
1010,
20014,
2991,
5963,
1007,
1063,
4874,
4874,
1027,
23569,
1006,
5950,
1007,
1025,
16109,
2765,
1027,
1046,
3385,
1012,
2000,
18447,
26320,
1006,
4874,
1007,
1025,
2709,
2765,
999,
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... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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-extra/src/main/java/cn/hutool/extra/ftp/Ftp.java | Ftp.upload | public boolean upload(String path, String fileName, InputStream fileStream) {
try {
client.setFileType(FTPClient.BINARY_FILE_TYPE);
} catch (IOException e) {
throw new FtpException(e);
}
if(StrUtil.isNotBlank(path)) {
mkDirs(path);
boolean isOk = cd(path);
if(false == isOk) {
re... | java | public boolean upload(String path, String fileName, InputStream fileStream) {
try {
client.setFileType(FTPClient.BINARY_FILE_TYPE);
} catch (IOException e) {
throw new FtpException(e);
}
if(StrUtil.isNotBlank(path)) {
mkDirs(path);
boolean isOk = cd(path);
if(false == isOk) {
re... | [
"public",
"boolean",
"upload",
"(",
"String",
"path",
",",
"String",
"fileName",
",",
"InputStream",
"fileStream",
")",
"{",
"try",
"{",
"client",
".",
"setFileType",
"(",
"FTPClient",
".",
"BINARY_FILE_TYPE",
")",
";",
"}",
"catch",
"(",
"IOException",
"e",... | 上传文件到指定目录,可选:
<pre>
1. path为null或""上传到当前路径
2. path为相对路径则相对于当前路径的子路径
3. path为绝对路径则上传到此路径
</pre>
@param path 服务端路径,可以为{@code null} 或者相对路径或绝对路径
@param fileName 文件名
@param fileStream 文件流
@return 是否上传成功 | [
"上传文件到指定目录,可选:"
] | bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-extra/src/main/java/cn/hutool/extra/ftp/Ftp.java#L405-L425 | train | Uploads a file to the server. | [
30522,
2270,
22017,
20898,
2039,
11066,
1006,
5164,
4130,
1010,
5164,
5371,
18442,
1010,
20407,
25379,
6764,
25379,
1007,
1063,
3046,
1063,
7396,
1012,
2275,
8873,
7485,
18863,
1006,
3027,
15042,
8751,
3372,
1012,
12441,
1035,
5371,
1035,
2... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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/text/TextProtocolBackendHandlerFactory.java | TextProtocolBackendHandlerFactory.newInstance | public static TextProtocolBackendHandler newInstance(final String sql, final BackendConnection backendConnection) {
if (sql.toUpperCase().startsWith(ShardingCTLBackendHandlerFactory.SCTL)) {
return ShardingCTLBackendHandlerFactory.newInstance(sql, backendConnection);
}
// TODO use sq... | java | public static TextProtocolBackendHandler newInstance(final String sql, final BackendConnection backendConnection) {
if (sql.toUpperCase().startsWith(ShardingCTLBackendHandlerFactory.SCTL)) {
return ShardingCTLBackendHandlerFactory.newInstance(sql, backendConnection);
}
// TODO use sq... | [
"public",
"static",
"TextProtocolBackendHandler",
"newInstance",
"(",
"final",
"String",
"sql",
",",
"final",
"BackendConnection",
"backendConnection",
")",
"{",
"if",
"(",
"sql",
".",
"toUpperCase",
"(",
")",
".",
"startsWith",
"(",
"ShardingCTLBackendHandlerFactory"... | Create new instance of text protocol backend handler.
@param sql SQL to be executed
@param backendConnection backend connection
@return instance of text protocol backend handler | [
"Create",
"new",
"instance",
"of",
"text",
"protocol",
"backend",
"handler",
"."
] | f88fd29fc345dfb31fdce12e9e96cbfa0fd2402d | https://github.com/apache/incubator-shardingsphere/blob/f88fd29fc345dfb31fdce12e9e96cbfa0fd2402d/sharding-proxy/sharding-proxy-backend/src/main/java/org/apache/shardingsphere/shardingproxy/backend/text/TextProtocolBackendHandlerFactory.java#L61-L75 | train | Create new instance of backend handler. | [
30522,
2270,
10763,
3793,
21572,
3406,
25778,
5963,
10497,
11774,
3917,
2047,
7076,
26897,
1006,
2345,
5164,
29296,
1010,
2345,
2067,
10497,
8663,
2638,
7542,
2067,
10497,
8663,
2638,
7542,
1007,
1063,
2065,
1006,
29296,
1012,
2000,
29547,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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 | dbsync/src/main/java/com/taobao/tddl/dbsync/binlog/LogBuffer.java | LogBuffer.getFullString | public final String getFullString(final int pos, final int len, String charsetName) {
if (pos + len > limit || pos < 0) throw new IllegalArgumentException("limit excceed: "
+ (pos < 0 ? pos : (pos + len)));
try {
... | java | public final String getFullString(final int pos, final int len, String charsetName) {
if (pos + len > limit || pos < 0) throw new IllegalArgumentException("limit excceed: "
+ (pos < 0 ? pos : (pos + len)));
try {
... | [
"public",
"final",
"String",
"getFullString",
"(",
"final",
"int",
"pos",
",",
"final",
"int",
"len",
",",
"String",
"charsetName",
")",
"{",
"if",
"(",
"pos",
"+",
"len",
">",
"limit",
"||",
"pos",
"<",
"0",
")",
"throw",
"new",
"IllegalArgumentExceptio... | Return fix-length string from buffer without null-terminate checking. Fix
bug #17 {@link https://github.com/AlibabaTech/canal/issues/17 } | [
"Return",
"fix",
"-",
"length",
"string",
"from",
"buffer",
"without",
"null",
"-",
"terminate",
"checking",
".",
"Fix",
"bug",
"#17",
"{"
] | 8f088cddc0755f4350c5aaae95c6e4002d90a40f | https://github.com/alibaba/canal/blob/8f088cddc0755f4350c5aaae95c6e4002d90a40f/dbsync/src/main/java/com/taobao/tddl/dbsync/binlog/LogBuffer.java#L1106-L1115 | train | Gets a full string of bytes from the buffer. | [
30522,
2270,
2345,
5164,
2131,
3993,
4877,
18886,
3070,
1006,
2345,
20014,
13433,
2015,
1010,
2345,
20014,
18798,
1010,
5164,
25869,
13462,
18442,
1007,
1063,
2065,
1006,
13433,
2015,
1009,
18798,
1028,
5787,
1064,
1064,
13433,
2015,
1026,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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/recognition/nr/JapanesePersonRecognition.java | JapanesePersonRecognition.recognition | public static void recognition(List<Vertex> segResult, WordNet wordNetOptimum, WordNet wordNetAll)
{
StringBuilder sbName = new StringBuilder();
int appendTimes = 0;
char[] charArray = wordNetAll.charArray;
DoubleArrayTrie<Character>.LongestSearcher searcher = JapanesePersonDictionar... | java | public static void recognition(List<Vertex> segResult, WordNet wordNetOptimum, WordNet wordNetAll)
{
StringBuilder sbName = new StringBuilder();
int appendTimes = 0;
char[] charArray = wordNetAll.charArray;
DoubleArrayTrie<Character>.LongestSearcher searcher = JapanesePersonDictionar... | [
"public",
"static",
"void",
"recognition",
"(",
"List",
"<",
"Vertex",
">",
"segResult",
",",
"WordNet",
"wordNetOptimum",
",",
"WordNet",
"wordNetAll",
")",
"{",
"StringBuilder",
"sbName",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"int",
"appendTimes",
"=",... | 执行识别
@param segResult 粗分结果
@param wordNetOptimum 粗分结果对应的词图
@param wordNetAll 全词图 | [
"执行识别"
] | a538d0722ab2e4980a9dcd9ea40324fc3ddba7ce | https://github.com/hankcs/HanLP/blob/a538d0722ab2e4980a9dcd9ea40324fc3ddba7ce/src/main/java/com/hankcs/hanlp/recognition/nr/JapanesePersonRecognition.java#L43-L100 | train | Recognition method. | [
30522,
2270,
10763,
11675,
5038,
1006,
2862,
1026,
19449,
1028,
7367,
17603,
23722,
2102,
1010,
2773,
7159,
2773,
7159,
7361,
3775,
27147,
1010,
2773,
7159,
2773,
7159,
8095,
1007,
1063,
5164,
8569,
23891,
2099,
24829,
18442,
1027,
2047,
51... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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-clients/src/main/java/org/apache/flink/client/program/PackagedProgram.java | PackagedProgram.getPlan | private Plan getPlan() throws ProgramInvocationException {
if (this.plan == null) {
Thread.currentThread().setContextClassLoader(this.userCodeClassLoader);
this.plan = createPlanFromProgram(this.program, this.args);
}
return this.plan;
} | java | private Plan getPlan() throws ProgramInvocationException {
if (this.plan == null) {
Thread.currentThread().setContextClassLoader(this.userCodeClassLoader);
this.plan = createPlanFromProgram(this.program, this.args);
}
return this.plan;
} | [
"private",
"Plan",
"getPlan",
"(",
")",
"throws",
"ProgramInvocationException",
"{",
"if",
"(",
"this",
".",
"plan",
"==",
"null",
")",
"{",
"Thread",
".",
"currentThread",
"(",
")",
".",
"setContextClassLoader",
"(",
"this",
".",
"userCodeClassLoader",
")",
... | Returns the plan as generated from the Pact Assembler.
@return The program's plan.
@throws ProgramInvocationException Thrown, if an error occurred in the program while
creating the program's {@link Plan}. | [
"Returns",
"the",
"plan",
"as",
"generated",
"from",
"the",
"Pact",
"Assembler",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-clients/src/main/java/org/apache/flink/client/program/PackagedProgram.java#L481-L488 | train | Get the plan from the program. | [
30522,
2797,
2933,
2131,
24759,
2319,
1006,
1007,
11618,
2565,
2378,
19152,
10288,
24422,
1063,
2065,
1006,
2023,
1012,
2933,
1027,
1027,
19701,
1007,
1063,
11689,
1012,
2783,
2705,
16416,
2094,
1006,
1007,
1012,
2275,
8663,
18209,
26266,
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/environment/StreamExecutionEnvironment.java | StreamExecutionEnvironment.addSource | public <OUT> DataStreamSource<OUT> addSource(SourceFunction<OUT> function, String sourceName) {
return addSource(function, sourceName, null);
} | java | public <OUT> DataStreamSource<OUT> addSource(SourceFunction<OUT> function, String sourceName) {
return addSource(function, sourceName, null);
} | [
"public",
"<",
"OUT",
">",
"DataStreamSource",
"<",
"OUT",
">",
"addSource",
"(",
"SourceFunction",
"<",
"OUT",
">",
"function",
",",
"String",
"sourceName",
")",
"{",
"return",
"addSource",
"(",
"function",
",",
"sourceName",
",",
"null",
")",
";",
"}"
] | Adds a data source with a custom type information thus opening a
{@link DataStream}. Only in very special cases does the user need to
support type information. Otherwise use
{@link #addSource(org.apache.flink.streaming.api.functions.source.SourceFunction)}
@param function
the user defined function
@param sourceName
Na... | [
"Adds",
"a",
"data",
"source",
"with",
"a",
"custom",
"type",
"information",
"thus",
"opening",
"a",
"{",
"@link",
"DataStream",
"}",
".",
"Only",
"in",
"very",
"special",
"cases",
"does",
"the",
"user",
"need",
"to",
"support",
"type",
"information",
".",... | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-streaming-java/src/main/java/org/apache/flink/streaming/api/environment/StreamExecutionEnvironment.java#L1411-L1413 | train | Add a data stream source to the data stream. | [
30522,
2270,
1026,
2041,
1028,
2951,
21422,
6499,
3126,
3401,
1026,
2041,
1028,
9909,
8162,
3401,
1006,
3120,
11263,
27989,
1026,
2041,
1028,
30524,
18442,
1010,
19701,
1007,
1025,
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... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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/io/network/partition/ResultPartition.java | ResultPartition.releaseMemory | @Override
public void releaseMemory(int toRelease) throws IOException {
checkArgument(toRelease > 0);
for (ResultSubpartition subpartition : subpartitions) {
toRelease -= subpartition.releaseMemory();
// Only release as much memory as needed
if (toRelease <= 0) {
break;
}
}
} | java | @Override
public void releaseMemory(int toRelease) throws IOException {
checkArgument(toRelease > 0);
for (ResultSubpartition subpartition : subpartitions) {
toRelease -= subpartition.releaseMemory();
// Only release as much memory as needed
if (toRelease <= 0) {
break;
}
}
} | [
"@",
"Override",
"public",
"void",
"releaseMemory",
"(",
"int",
"toRelease",
")",
"throws",
"IOException",
"{",
"checkArgument",
"(",
"toRelease",
">",
"0",
")",
";",
"for",
"(",
"ResultSubpartition",
"subpartition",
":",
"subpartitions",
")",
"{",
"toRelease",
... | Releases buffers held by this result partition.
<p>This is a callback from the buffer pool, which is registered for result partitions, which
are back pressure-free. | [
"Releases",
"buffers",
"held",
"by",
"this",
"result",
"partition",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/io/network/partition/ResultPartition.java#L373-L385 | train | Release the memory allocated by this result partition. | [
30522,
1030,
2058,
15637,
2270,
11675,
2713,
4168,
5302,
2854,
1006,
20014,
9538,
19738,
3366,
1007,
11618,
22834,
10288,
24422,
1063,
4638,
2906,
22850,
4765,
1006,
9538,
19738,
3366,
1028,
1014,
1007,
1025,
2005,
1006,
3463,
12083,
19362,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.