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/flink | flink-runtime/src/main/java/org/apache/flink/runtime/webmonitor/retriever/LeaderRetriever.java | LeaderRetriever.getLeaderNow | public Optional<Tuple2<String, UUID>> getLeaderNow() throws Exception {
CompletableFuture<Tuple2<String, UUID>> leaderFuture = this.atomicLeaderFuture.get();
if (leaderFuture != null) {
if (leaderFuture.isDone()) {
return Optional.of(leaderFuture.get());
} else {
return Optional.empty();
}
} else... | java | public Optional<Tuple2<String, UUID>> getLeaderNow() throws Exception {
CompletableFuture<Tuple2<String, UUID>> leaderFuture = this.atomicLeaderFuture.get();
if (leaderFuture != null) {
if (leaderFuture.isDone()) {
return Optional.of(leaderFuture.get());
} else {
return Optional.empty();
}
} else... | [
"public",
"Optional",
"<",
"Tuple2",
"<",
"String",
",",
"UUID",
">",
">",
"getLeaderNow",
"(",
")",
"throws",
"Exception",
"{",
"CompletableFuture",
"<",
"Tuple2",
"<",
"String",
",",
"UUID",
">",
">",
"leaderFuture",
"=",
"this",
".",
"atomicLeaderFuture",... | Returns the current leader information if available. Otherwise it returns an
empty optional.
@return The current leader information if available. Otherwise it returns an
empty optional.
@throws Exception if the leader future has been completed with an exception | [
"Returns",
"the",
"current",
"leader",
"information",
"if",
"available",
".",
"Otherwise",
"it",
"returns",
"an",
"empty",
"optional",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/webmonitor/retriever/LeaderRetriever.java#L52-L63 | train | Get the current leader. | [
30522,
2270,
11887,
1026,
10722,
10814,
2475,
1026,
5164,
1010,
1057,
21272,
1028,
1028,
2131,
19000,
19779,
1006,
1007,
11618,
6453,
1063,
4012,
10814,
10880,
11263,
11244,
1026,
10722,
10814,
2475,
1026,
5164,
1010,
1057,
21272,
1028,
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... |
apache/flink | flink-runtime/src/main/java/org/apache/flink/runtime/state/memory/MemoryStateBackend.java | MemoryStateBackend.createCheckpointStorage | @Override
public CheckpointStorage createCheckpointStorage(JobID jobId) throws IOException {
return new MemoryBackendCheckpointStorage(jobId, getCheckpointPath(), getSavepointPath(), maxStateSize);
} | java | @Override
public CheckpointStorage createCheckpointStorage(JobID jobId) throws IOException {
return new MemoryBackendCheckpointStorage(jobId, getCheckpointPath(), getSavepointPath(), maxStateSize);
} | [
"@",
"Override",
"public",
"CheckpointStorage",
"createCheckpointStorage",
"(",
"JobID",
"jobId",
")",
"throws",
"IOException",
"{",
"return",
"new",
"MemoryBackendCheckpointStorage",
"(",
"jobId",
",",
"getCheckpointPath",
"(",
")",
",",
"getSavepointPath",
"(",
")",... | ------------------------------------------------------------------------ | [
"------------------------------------------------------------------------"
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/state/memory/MemoryStateBackend.java#L293-L296 | train | Create a checkpoint storage. | [
30522,
1030,
2058,
15637,
2270,
26520,
23809,
4270,
3443,
5403,
3600,
26521,
4263,
4270,
1006,
3105,
3593,
3105,
3593,
1007,
11618,
22834,
10288,
24422,
1063,
2709,
2047,
3638,
5963,
10497,
5403,
3600,
26521,
4263,
4270,
1006,
3105,
3593,
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/TypeUtil.java | TypeUtil.getTypeArgument | public static Type getTypeArgument(Type type, int index) {
final Type[] typeArguments = getTypeArguments(type);
if (null != typeArguments && typeArguments.length > index) {
return typeArguments[index];
}
return null;
} | java | public static Type getTypeArgument(Type type, int index) {
final Type[] typeArguments = getTypeArguments(type);
if (null != typeArguments && typeArguments.length > index) {
return typeArguments[index];
}
return null;
} | [
"public",
"static",
"Type",
"getTypeArgument",
"(",
"Type",
"type",
",",
"int",
"index",
")",
"{",
"final",
"Type",
"[",
"]",
"typeArguments",
"=",
"getTypeArguments",
"(",
"type",
")",
";",
"if",
"(",
"null",
"!=",
"typeArguments",
"&&",
"typeArguments",
... | 获得给定类的泛型参数
@param type 被检查的类型,必须是已经确定泛型类型的类
@param index 泛型类型的索引号,既第几个泛型类型
@return {@link Type} | [
"获得给定类的泛型参数"
] | bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/util/TypeUtil.java#L209-L215 | train | Gets the type argument at the given index. | [
30522,
2270,
10763,
2828,
2131,
13874,
2906,
22850,
4765,
1006,
2828,
2828,
1010,
20014,
5950,
1007,
1063,
2345,
2828,
1031,
1033,
2828,
2906,
22850,
11187,
1027,
2131,
13874,
2906,
22850,
11187,
1006,
2828,
1007,
1025,
2065,
1006,
19701,
9... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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.fnvHash | public static int fnvHash(byte[] data) {
final int p = 16777619;
int hash = (int) 2166136261L;
for (byte b : data) {
hash = (hash ^ b) * p;
}
hash += hash << 13;
hash ^= hash >> 7;
hash += hash << 3;
hash ^= hash >> 17;
hash += hash << 5;
return hash;
} | java | public static int fnvHash(byte[] data) {
final int p = 16777619;
int hash = (int) 2166136261L;
for (byte b : data) {
hash = (hash ^ b) * p;
}
hash += hash << 13;
hash ^= hash >> 7;
hash += hash << 3;
hash ^= hash >> 17;
hash += hash << 5;
return hash;
} | [
"public",
"static",
"int",
"fnvHash",
"(",
"byte",
"[",
"]",
"data",
")",
"{",
"final",
"int",
"p",
"=",
"16777619",
";",
"int",
"hash",
"=",
"(",
"int",
")",
"2166136261L",
";",
"for",
"(",
"byte",
"b",
":",
"data",
")",
"{",
"hash",
"=",
"(",
... | 改进的32位FNV算法1
@param data 数组
@return hash结果 | [
"改进的32位FNV算法1"
] | bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/util/HashUtil.java#L144-L156 | train | Returns a 32 - bit hash of the given byte array. | [
30522,
2270,
10763,
20014,
1042,
2078,
2615,
14949,
2232,
1006,
24880,
1031,
1033,
2951,
1007,
1063,
2345,
20014,
1052,
1027,
16785,
2581,
2581,
2575,
16147,
1025,
20014,
23325,
1027,
1006,
20014,
1007,
20294,
2575,
17134,
2575,
23833,
2487,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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/deduplicate/DeduplicateFunctionHelper.java | DeduplicateFunctionHelper.processFirstRow | static void processFirstRow(BaseRow currentRow, ValueState<Boolean> state, Collector<BaseRow> out)
throws Exception {
// Check message should be accumulate
Preconditions.checkArgument(BaseRowUtil.isAccumulateMsg(currentRow));
// ignore record with timestamp bigger than preRow
if (state.value() != null) {
... | java | static void processFirstRow(BaseRow currentRow, ValueState<Boolean> state, Collector<BaseRow> out)
throws Exception {
// Check message should be accumulate
Preconditions.checkArgument(BaseRowUtil.isAccumulateMsg(currentRow));
// ignore record with timestamp bigger than preRow
if (state.value() != null) {
... | [
"static",
"void",
"processFirstRow",
"(",
"BaseRow",
"currentRow",
",",
"ValueState",
"<",
"Boolean",
">",
"state",
",",
"Collector",
"<",
"BaseRow",
">",
"out",
")",
"throws",
"Exception",
"{",
"// Check message should be accumulate",
"Preconditions",
".",
"checkAr... | Processes element to deduplicate on keys, sends current element if it is first row.
@param currentRow latest row received by deduplicate function
@param state state of function
@param out underlying collector
@throws Exception | [
"Processes",
"element",
"to",
"deduplicate",
"on",
"keys",
"sends",
"current",
"element",
"if",
"it",
"is",
"first",
"row",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-table/flink-table-runtime-blink/src/main/java/org/apache/flink/table/runtime/deduplicate/DeduplicateFunctionHelper.java#L66-L76 | train | Process the first row of the table. | [
30522,
10763,
11675,
2832,
8873,
12096,
10524,
1006,
2918,
10524,
2783,
10524,
1010,
5300,
12259,
1026,
22017,
20898,
1028,
2110,
1010,
10018,
1026,
2918,
10524,
1028,
2041,
1007,
11618,
6453,
1063,
1013,
1013,
4638,
4471,
2323,
2022,
27598,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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/parquet/VectorizedRleValuesReader.java | VectorizedRleValuesReader.readIntegers | public void readIntegers(
int total,
WritableColumnVector c,
int rowId,
int level,
VectorizedValuesReader data) throws IOException {
int left = total;
while (left > 0) {
if (this.currentCount == 0) this.readNextGroup();
int n = Math.min(left, this.currentCount);
s... | java | public void readIntegers(
int total,
WritableColumnVector c,
int rowId,
int level,
VectorizedValuesReader data) throws IOException {
int left = total;
while (left > 0) {
if (this.currentCount == 0) this.readNextGroup();
int n = Math.min(left, this.currentCount);
s... | [
"public",
"void",
"readIntegers",
"(",
"int",
"total",
",",
"WritableColumnVector",
"c",
",",
"int",
"rowId",
",",
"int",
"level",
",",
"VectorizedValuesReader",
"data",
")",
"throws",
"IOException",
"{",
"int",
"left",
"=",
"total",
";",
"while",
"(",
"left... | Reads `total` ints into `c` filling them in starting at `c[rowId]`. This reader
reads the definition levels and then will read from `data` for the non-null values.
If the value is null, c will be populated with `nullValue`. Note that `nullValue` is only
necessary for readIntegers because we also use it to decode dictio... | [
"Reads",
"total",
"ints",
"into",
"c",
"filling",
"them",
"in",
"starting",
"at",
"c",
"[",
"rowId",
"]",
".",
"This",
"reader",
"reads",
"the",
"definition",
"levels",
"and",
"then",
"will",
"read",
"from",
"data",
"for",
"the",
"non",
"-",
"null",
"v... | 25ee0474f47d9c30d6f553a7892d9549f91071cf | https://github.com/apache/spark/blob/25ee0474f47d9c30d6f553a7892d9549f91071cf/sql/core/src/main/java/org/apache/spark/sql/execution/datasources/parquet/VectorizedRleValuesReader.java#L172-L204 | train | read integers. | [
30522,
2270,
11675,
3191,
18447,
26320,
2015,
1006,
20014,
2561,
1010,
25697,
3085,
25778,
2819,
2078,
3726,
16761,
1039,
1010,
20014,
5216,
3593,
1010,
20014,
2504,
1010,
9207,
3550,
10175,
15808,
16416,
4063,
2951,
1007,
11618,
22834,
10288... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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-planner/src/main/java/org/apache/calcite/sql/validate/SqlValidatorImpl.java | SqlValidatorImpl.validateModality | private void validateModality(SqlNode query) {
final SqlModality modality = deduceModality(query);
if (query instanceof SqlSelect) {
final SqlSelect select = (SqlSelect) query;
validateModality(select, modality, true);
} else if (query.getKind() == SqlKind.VALUES) {
switch (modality) {
case STREAM:
... | java | private void validateModality(SqlNode query) {
final SqlModality modality = deduceModality(query);
if (query instanceof SqlSelect) {
final SqlSelect select = (SqlSelect) query;
validateModality(select, modality, true);
} else if (query.getKind() == SqlKind.VALUES) {
switch (modality) {
case STREAM:
... | [
"private",
"void",
"validateModality",
"(",
"SqlNode",
"query",
")",
"{",
"final",
"SqlModality",
"modality",
"=",
"deduceModality",
"(",
"query",
")",
";",
"if",
"(",
"query",
"instanceof",
"SqlSelect",
")",
"{",
"final",
"SqlSelect",
"select",
"=",
"(",
"S... | Validates that a query can deliver the modality it promises. Only called
on the top-most SELECT or set operator in the tree. | [
"Validates",
"that",
"a",
"query",
"can",
"deliver",
"the",
"modality",
"it",
"promises",
".",
"Only",
"called",
"on",
"the",
"top",
"-",
"most",
"SELECT",
"or",
"set",
"operator",
"in",
"the",
"tree",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-table/flink-table-planner/src/main/java/org/apache/calcite/sql/validate/SqlValidatorImpl.java#L3550-L3571 | train | Validate the modality of a query. | [
30522,
2797,
11675,
9398,
3686,
5302,
9305,
3012,
1006,
29296,
3630,
3207,
23032,
1007,
1063,
2345,
29296,
5302,
9305,
3012,
16913,
23732,
1027,
2139,
8566,
3401,
5302,
9305,
3012,
1006,
23032,
1007,
1025,
2065,
1006,
23032,
6013,
11253,
29... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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/tokenizer/NotionalTokenizer.java | NotionalTokenizer.seg2sentence | public static List<List<Term>> seg2sentence(String text)
{
List<List<Term>> sentenceList = SEGMENT.seg2sentence(text);
for (List<Term> sentence : sentenceList)
{
ListIterator<Term> listIterator = sentence.listIterator();
while (listIterator.hasNext())
{
... | java | public static List<List<Term>> seg2sentence(String text)
{
List<List<Term>> sentenceList = SEGMENT.seg2sentence(text);
for (List<Term> sentence : sentenceList)
{
ListIterator<Term> listIterator = sentence.listIterator();
while (listIterator.hasNext())
{
... | [
"public",
"static",
"List",
"<",
"List",
"<",
"Term",
">",
">",
"seg2sentence",
"(",
"String",
"text",
")",
"{",
"List",
"<",
"List",
"<",
"Term",
">>",
"sentenceList",
"=",
"SEGMENT",
".",
"seg2sentence",
"(",
"text",
")",
";",
"for",
"(",
"List",
"... | 切分为句子形式
@param text
@return | [
"切分为句子形式"
] | a538d0722ab2e4980a9dcd9ea40324fc3ddba7ce | https://github.com/hankcs/HanLP/blob/a538d0722ab2e4980a9dcd9ea40324fc3ddba7ce/src/main/java/com/hankcs/hanlp/tokenizer/NotionalTokenizer.java#L67-L83 | train | seg2sentence This method is used to convert a text to a list of lists of lists of lists of lists of terms. | [
30522,
2270,
10763,
2862,
1026,
2862,
1026,
2744,
1028,
1028,
7367,
2290,
2475,
5054,
6528,
3401,
1006,
5164,
3793,
1007,
1063,
2862,
1026,
2862,
1026,
2744,
1028,
1028,
6251,
9863,
1027,
6903,
1012,
7367,
2290,
2475,
5054,
6528,
3401,
10... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
apache/flink | flink-table/flink-table-planner/src/main/java/org/apache/flink/table/operations/AggregateOperationFactory.java | AggregateOperationFactory.createWindowAggregate | public TableOperation createWindowAggregate(
List<Expression> groupings,
List<Expression> aggregates,
List<Expression> windowProperties,
ResolvedGroupWindow window,
TableOperation child) {
validateGroupings(groupings);
validateAggregates(aggregates);
validateWindowProperties(windowProperties, windo... | java | public TableOperation createWindowAggregate(
List<Expression> groupings,
List<Expression> aggregates,
List<Expression> windowProperties,
ResolvedGroupWindow window,
TableOperation child) {
validateGroupings(groupings);
validateAggregates(aggregates);
validateWindowProperties(windowProperties, windo... | [
"public",
"TableOperation",
"createWindowAggregate",
"(",
"List",
"<",
"Expression",
">",
"groupings",
",",
"List",
"<",
"Expression",
">",
"aggregates",
",",
"List",
"<",
"Expression",
">",
"windowProperties",
",",
"ResolvedGroupWindow",
"window",
",",
"TableOperat... | Creates a valid {@link WindowAggregateTableOperation} operation.
@param groupings expressions describing grouping key of aggregates
@param aggregates expressions describing aggregation functions
@param windowProperties expressions describing window properties
@param window grouping window of this aggregation
@param ch... | [
"Creates",
"a",
"valid",
"{",
"@link",
"WindowAggregateTableOperation",
"}",
"operation",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-table/flink-table-planner/src/main/java/org/apache/flink/table/operations/AggregateOperationFactory.java#L127-L164 | train | Creates a WindowAggregateTableOperation. | [
30522,
2270,
2795,
25918,
3370,
3443,
11101,
21293,
13871,
2890,
5867,
1006,
2862,
1026,
3670,
1028,
19765,
2015,
1010,
2862,
1026,
3670,
1028,
9572,
2015,
1010,
2862,
1026,
3670,
1028,
3332,
21572,
4842,
7368,
1010,
10395,
17058,
11101,
50... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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 | dump/src/main/java/com/networknt/dump/UrlDumper.java | UrlDumper.putDumpInfoTo | @Override
protected void putDumpInfoTo(Map<String, Object> result) {
if(StringUtils.isNotBlank(this.url)) {
result.put(DumpConstants.URL, this.url);
}
} | java | @Override
protected void putDumpInfoTo(Map<String, Object> result) {
if(StringUtils.isNotBlank(this.url)) {
result.put(DumpConstants.URL, this.url);
}
} | [
"@",
"Override",
"protected",
"void",
"putDumpInfoTo",
"(",
"Map",
"<",
"String",
",",
"Object",
">",
"result",
")",
"{",
"if",
"(",
"StringUtils",
".",
"isNotBlank",
"(",
"this",
".",
"url",
")",
")",
"{",
"result",
".",
"put",
"(",
"DumpConstants",
"... | put this.url to result
@param result a Map you want to put dumping info to. | [
"put",
"this",
".",
"url",
"to",
"result"
] | 2a60257c60663684c8f6dc8b5ea3cf184e534db6 | https://github.com/networknt/light-4j/blob/2a60257c60663684c8f6dc8b5ea3cf184e534db6/dump/src/main/java/com/networknt/dump/UrlDumper.java#L48-L53 | train | Put the dump info to the result map. | [
30522,
1030,
2058,
15637,
5123,
11675,
2404,
8566,
8737,
2378,
14876,
3406,
1006,
4949,
1026,
5164,
1010,
4874,
1028,
2765,
1007,
1063,
2065,
1006,
5164,
30524,
2140,
1010,
2023,
1012,
24471,
2140,
1007,
1025,
1065,
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... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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/webservices/client/WebServiceTemplateBuilder.java | WebServiceTemplateBuilder.build | public <T extends WebServiceTemplate> T build(Class<T> webServiceTemplateClass) {
Assert.notNull(webServiceTemplateClass,
"WebServiceTemplateClass must not be null");
return configure(BeanUtils.instantiateClass(webServiceTemplateClass));
} | java | public <T extends WebServiceTemplate> T build(Class<T> webServiceTemplateClass) {
Assert.notNull(webServiceTemplateClass,
"WebServiceTemplateClass must not be null");
return configure(BeanUtils.instantiateClass(webServiceTemplateClass));
} | [
"public",
"<",
"T",
"extends",
"WebServiceTemplate",
">",
"T",
"build",
"(",
"Class",
"<",
"T",
">",
"webServiceTemplateClass",
")",
"{",
"Assert",
".",
"notNull",
"(",
"webServiceTemplateClass",
",",
"\"WebServiceTemplateClass must not be null\"",
")",
";",
"return... | Build a new {@link WebServiceTemplate} instance of the specified type and configure
it using this builder.
@param <T> the type of web service template
@param webServiceTemplateClass the template type to create
@return a configured {@link WebServiceTemplate} instance.
@see WebServiceTemplateBuilder#build()
@see #configu... | [
"Build",
"a",
"new",
"{"
] | 0b27f7c70e164b2b1a96477f1d9c1acba56790c1 | https://github.com/spring-projects/spring-boot/blob/0b27f7c70e164b2b1a96477f1d9c1acba56790c1/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/webservices/client/WebServiceTemplateBuilder.java#L486-L490 | train | Build a WebServiceTemplate instance from a class. | [
30522,
2270,
1026,
1056,
8908,
4773,
8043,
7903,
12870,
8737,
13806,
1028,
1056,
3857,
1006,
2465,
1026,
1056,
1028,
4773,
8043,
7903,
12870,
8737,
13806,
26266,
1007,
1063,
20865,
1012,
2025,
11231,
3363,
1006,
4773,
8043,
7903,
12870,
873... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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/utility/LexiconUtility.java | LexiconUtility.setAttribute | public static boolean setAttribute(String word, String natureWithFrequency)
{
CoreDictionary.Attribute attribute = CoreDictionary.Attribute.create(natureWithFrequency);
return setAttribute(word, attribute);
} | java | public static boolean setAttribute(String word, String natureWithFrequency)
{
CoreDictionary.Attribute attribute = CoreDictionary.Attribute.create(natureWithFrequency);
return setAttribute(word, attribute);
} | [
"public",
"static",
"boolean",
"setAttribute",
"(",
"String",
"word",
",",
"String",
"natureWithFrequency",
")",
"{",
"CoreDictionary",
".",
"Attribute",
"attribute",
"=",
"CoreDictionary",
".",
"Attribute",
".",
"create",
"(",
"natureWithFrequency",
")",
";",
"re... | 设置某个单词的属性
@param word
@param natureWithFrequency
@return | [
"设置某个单词的属性"
] | a538d0722ab2e4980a9dcd9ea40324fc3ddba7ce | https://github.com/hankcs/HanLP/blob/a538d0722ab2e4980a9dcd9ea40324fc3ddba7ce/src/main/java/com/hankcs/hanlp/utility/LexiconUtility.java#L137-L141 | train | Sets the attribute for a CID . | [
30522,
2270,
10763,
22017,
20898,
2275,
19321,
3089,
8569,
2618,
1006,
5164,
2773,
1010,
5164,
3267,
24415,
19699,
2063,
4226,
9407,
1007,
1063,
4563,
29201,
3258,
5649,
1012,
17961,
17961,
1027,
4563,
29201,
3258,
5649,
1012,
17961,
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-streaming-java/src/main/java/org/apache/flink/streaming/api/datastream/DataStream.java | DataStream.process | @PublicEvolving
public <R> SingleOutputStreamOperator<R> process(ProcessFunction<T, R> processFunction) {
TypeInformation<R> outType = TypeExtractor.getUnaryOperatorReturnType(
processFunction,
ProcessFunction.class,
0,
1,
TypeExtractor.NO_INDEX,
getType(),
Utils.getCallLocationName(),
true)... | java | @PublicEvolving
public <R> SingleOutputStreamOperator<R> process(ProcessFunction<T, R> processFunction) {
TypeInformation<R> outType = TypeExtractor.getUnaryOperatorReturnType(
processFunction,
ProcessFunction.class,
0,
1,
TypeExtractor.NO_INDEX,
getType(),
Utils.getCallLocationName(),
true)... | [
"@",
"PublicEvolving",
"public",
"<",
"R",
">",
"SingleOutputStreamOperator",
"<",
"R",
">",
"process",
"(",
"ProcessFunction",
"<",
"T",
",",
"R",
">",
"processFunction",
")",
"{",
"TypeInformation",
"<",
"R",
">",
"outType",
"=",
"TypeExtractor",
".",
"get... | Applies the given {@link ProcessFunction} on the input stream, thereby
creating a transformed output stream.
<p>The function will be called for every element in the input streams and can produce zero
or more output elements.
@param processFunction The {@link ProcessFunction} that is called for each element
in the str... | [
"Applies",
"the",
"given",
"{",
"@link",
"ProcessFunction",
"}",
"on",
"the",
"input",
"stream",
"thereby",
"creating",
"a",
"transformed",
"output",
"stream",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-streaming-java/src/main/java/org/apache/flink/streaming/api/datastream/DataStream.java#L632-L646 | train | Process a single output stream. | [
30522,
1030,
2270,
6777,
4747,
6455,
2270,
1026,
1054,
1028,
2309,
5833,
18780,
21422,
25918,
8844,
1026,
1054,
1028,
2832,
1006,
2832,
11263,
27989,
1026,
1056,
1010,
1054,
1028,
2832,
11263,
27989,
1007,
1063,
2828,
2378,
14192,
3370,
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... |
spring-projects/spring-boot | spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/servlet/AbstractFilterRegistrationBean.java | AbstractFilterRegistrationBean.configure | @Override
protected void configure(FilterRegistration.Dynamic registration) {
super.configure(registration);
EnumSet<DispatcherType> dispatcherTypes = this.dispatcherTypes;
if (dispatcherTypes == null) {
dispatcherTypes = EnumSet.of(DispatcherType.REQUEST);
}
Set<String> servletNames = new LinkedHashSet<>... | java | @Override
protected void configure(FilterRegistration.Dynamic registration) {
super.configure(registration);
EnumSet<DispatcherType> dispatcherTypes = this.dispatcherTypes;
if (dispatcherTypes == null) {
dispatcherTypes = EnumSet.of(DispatcherType.REQUEST);
}
Set<String> servletNames = new LinkedHashSet<>... | [
"@",
"Override",
"protected",
"void",
"configure",
"(",
"FilterRegistration",
".",
"Dynamic",
"registration",
")",
"{",
"super",
".",
"configure",
"(",
"registration",
")",
";",
"EnumSet",
"<",
"DispatcherType",
">",
"dispatcherTypes",
"=",
"this",
".",
"dispatc... | Configure registration settings. Subclasses can override this method to perform
additional configuration if required.
@param registration the registration | [
"Configure",
"registration",
"settings",
".",
"Subclasses",
"can",
"override",
"this",
"method",
"to",
"perform",
"additional",
"configuration",
"if",
"required",
"."
] | 0b27f7c70e164b2b1a96477f1d9c1acba56790c1 | https://github.com/spring-projects/spring-boot/blob/0b27f7c70e164b2b1a96477f1d9c1acba56790c1/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/servlet/AbstractFilterRegistrationBean.java#L223-L249 | train | Override configure to add the mappings for the filter. | [
30522,
1030,
2058,
15637,
5123,
11675,
9530,
8873,
27390,
2063,
1006,
11307,
2890,
24063,
8156,
1012,
8790,
8819,
1007,
1063,
3565,
1012,
9530,
8873,
27390,
2063,
1006,
8819,
1007,
1025,
4372,
18163,
3388,
1026,
18365,
15010,
5051,
1028,
18... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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/util/NetUtils.java | NetUtils.unresolvedHostToNormalizedString | public static String unresolvedHostToNormalizedString(String host) {
// Return loopback interface address if host is null
// This represents the behavior of {@code InetAddress.getByName } and RFC 3330
if (host == null) {
host = InetAddress.getLoopbackAddress().getHostAddress();
} else {
host = host.trim()... | java | public static String unresolvedHostToNormalizedString(String host) {
// Return loopback interface address if host is null
// This represents the behavior of {@code InetAddress.getByName } and RFC 3330
if (host == null) {
host = InetAddress.getLoopbackAddress().getHostAddress();
} else {
host = host.trim()... | [
"public",
"static",
"String",
"unresolvedHostToNormalizedString",
"(",
"String",
"host",
")",
"{",
"// Return loopback interface address if host is null",
"// This represents the behavior of {@code InetAddress.getByName } and RFC 3330",
"if",
"(",
"host",
"==",
"null",
")",
"{",
... | Returns an address in a normalized format for Akka.
When an IPv6 address is specified, it normalizes the IPv6 address to avoid
complications with the exact URL match policy of Akka.
@param host The hostname, IPv4 or IPv6 address
@return host which will be normalized if it is an IPv6 address | [
"Returns",
"an",
"address",
"in",
"a",
"normalized",
"format",
"for",
"Akka",
".",
"When",
"an",
"IPv6",
"address",
"is",
"specified",
"it",
"normalizes",
"the",
"IPv6",
"address",
"to",
"avoid",
"complications",
"with",
"the",
"exact",
"URL",
"match",
"poli... | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-core/src/main/java/org/apache/flink/util/NetUtils.java#L130-L155 | train | Converts an unresolved host string to a normalized string. | [
30522,
2270,
10763,
5164,
4895,
6072,
16116,
15006,
15474,
2953,
9067,
3550,
3367,
4892,
1006,
5164,
3677,
1007,
1063,
1013,
1013,
2709,
7077,
5963,
8278,
4769,
2065,
3677,
2003,
19701,
1013,
1013,
2023,
5836,
1996,
5248,
1997,
1063,
1030,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
apache/flink | flink-streaming-java/src/main/java/org/apache/flink/streaming/api/graph/StreamGraphGenerator.java | StreamGraphGenerator.transformSplit | private <T> Collection<Integer> transformSplit(SplitTransformation<T> split) {
StreamTransformation<T> input = split.getInput();
Collection<Integer> resultIds = transform(input);
validateSplitTransformation(input);
// the recursive transform call might have transformed this already
if (alreadyTransformed.c... | java | private <T> Collection<Integer> transformSplit(SplitTransformation<T> split) {
StreamTransformation<T> input = split.getInput();
Collection<Integer> resultIds = transform(input);
validateSplitTransformation(input);
// the recursive transform call might have transformed this already
if (alreadyTransformed.c... | [
"private",
"<",
"T",
">",
"Collection",
"<",
"Integer",
">",
"transformSplit",
"(",
"SplitTransformation",
"<",
"T",
">",
"split",
")",
"{",
"StreamTransformation",
"<",
"T",
">",
"input",
"=",
"split",
".",
"getInput",
"(",
")",
";",
"Collection",
"<",
... | Transforms a {@code SplitTransformation}.
<p>We add the output selector to previously transformed nodes. | [
"Transforms",
"a",
"{",
"@code",
"SplitTransformation",
"}",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-streaming-java/src/main/java/org/apache/flink/streaming/api/graph/StreamGraphGenerator.java#L263-L280 | train | Transform a split transformation. | [
30522,
2797,
1026,
1056,
1028,
3074,
1026,
16109,
1028,
21743,
24759,
4183,
1006,
3975,
6494,
3619,
14192,
3370,
1026,
1056,
1028,
3975,
1007,
1063,
5460,
6494,
3619,
14192,
3370,
1026,
1056,
1028,
7953,
1027,
3975,
1012,
2131,
2378,
18780,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
apache/flink | flink-runtime/src/main/java/org/apache/flink/runtime/rest/handler/legacy/backpressure/StackTraceSampleCoordinator.java | StackTraceSampleCoordinator.cancelStackTraceSample | public void cancelStackTraceSample(int sampleId, Throwable cause) {
synchronized (lock) {
if (isShutDown) {
return;
}
PendingStackTraceSample sample = pendingSamples.remove(sampleId);
if (sample != null) {
if (cause != null) {
LOG.info("Cancelling sample " + sampleId, cause);
} else {
... | java | public void cancelStackTraceSample(int sampleId, Throwable cause) {
synchronized (lock) {
if (isShutDown) {
return;
}
PendingStackTraceSample sample = pendingSamples.remove(sampleId);
if (sample != null) {
if (cause != null) {
LOG.info("Cancelling sample " + sampleId, cause);
} else {
... | [
"public",
"void",
"cancelStackTraceSample",
"(",
"int",
"sampleId",
",",
"Throwable",
"cause",
")",
"{",
"synchronized",
"(",
"lock",
")",
"{",
"if",
"(",
"isShutDown",
")",
"{",
"return",
";",
"}",
"PendingStackTraceSample",
"sample",
"=",
"pendingSamples",
"... | Cancels a pending sample.
@param sampleId ID of the sample to cancel.
@param cause Cause of the cancelling (can be <code>null</code>). | [
"Cancels",
"a",
"pending",
"sample",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/rest/handler/legacy/backpressure/StackTraceSampleCoordinator.java#L192-L210 | train | Cancels a pending stack trace sample. | [
30522,
2270,
11675,
17542,
9153,
3600,
6494,
9623,
16613,
2571,
1006,
20014,
7099,
3593,
1010,
5466,
3085,
3426,
1007,
1063,
25549,
1006,
5843,
1007,
1063,
2065,
1006,
26354,
6979,
2102,
7698,
1007,
1063,
2709,
1025,
1065,
14223,
9153,
3600... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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/context/properties/source/ConfigurationPropertyName.java | ConfigurationPropertyName.adapt | static ConfigurationPropertyName adapt(CharSequence name, char separator,
Function<CharSequence, CharSequence> elementValueProcessor) {
Assert.notNull(name, "Name must not be null");
if (name.length() == 0) {
return EMPTY;
}
Elements elements = new ElementsParser(name, separator)
.parse(elementValuePr... | java | static ConfigurationPropertyName adapt(CharSequence name, char separator,
Function<CharSequence, CharSequence> elementValueProcessor) {
Assert.notNull(name, "Name must not be null");
if (name.length() == 0) {
return EMPTY;
}
Elements elements = new ElementsParser(name, separator)
.parse(elementValuePr... | [
"static",
"ConfigurationPropertyName",
"adapt",
"(",
"CharSequence",
"name",
",",
"char",
"separator",
",",
"Function",
"<",
"CharSequence",
",",
"CharSequence",
">",
"elementValueProcessor",
")",
"{",
"Assert",
".",
"notNull",
"(",
"name",
",",
"\"Name must not be ... | Create a {@link ConfigurationPropertyName} by adapting the given source. The name
is split into elements around the given {@code separator}. This method is more
lenient than {@link #of} in that it allows mixed case names and '{@code _}'
characters. Other invalid characters are stripped out during parsing.
<p>
The {@cod... | [
"Create",
"a",
"{"
] | 0b27f7c70e164b2b1a96477f1d9c1acba56790c1 | https://github.com/spring-projects/spring-boot/blob/0b27f7c70e164b2b1a96477f1d9c1acba56790c1/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/properties/source/ConfigurationPropertyName.java#L567-L579 | train | Adapt a configuration property name. | [
30522,
10763,
9563,
21572,
4842,
25680,
14074,
15581,
1006,
25869,
3366,
4226,
5897,
2171,
1010,
25869,
19802,
25879,
2953,
1010,
3853,
1026,
25869,
3366,
4226,
5897,
1010,
25869,
3366,
4226,
5897,
1028,
5783,
10175,
5657,
21572,
9623,
21748,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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/IdcardUtil.java | IdcardUtil.isvalidCard15 | public static boolean isvalidCard15(String idCard) {
if (CHINA_ID_MIN_LENGTH != idCard.length()) {
return false;
}
if (Validator.isNumber(idCard)) {
// 省份
String proCode = idCard.substring(0, 2);
if (null == cityCodes.get(proCode)) {
return false;
}
//校验生日(两位年份,补充为19XX)
if(fa... | java | public static boolean isvalidCard15(String idCard) {
if (CHINA_ID_MIN_LENGTH != idCard.length()) {
return false;
}
if (Validator.isNumber(idCard)) {
// 省份
String proCode = idCard.substring(0, 2);
if (null == cityCodes.get(proCode)) {
return false;
}
//校验生日(两位年份,补充为19XX)
if(fa... | [
"public",
"static",
"boolean",
"isvalidCard15",
"(",
"String",
"idCard",
")",
"{",
"if",
"(",
"CHINA_ID_MIN_LENGTH",
"!=",
"idCard",
".",
"length",
"(",
")",
")",
"{",
"return",
"false",
";",
"}",
"if",
"(",
"Validator",
".",
"isNumber",
"(",
"idCard",
"... | 验证15位身份编码是否合法
@param idCard 身份编码
@return 是否合法 | [
"验证15位身份编码是否合法"
] | bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/util/IdcardUtil.java#L237-L256 | train | Checks if the given ID card is a valid Chinese ID. | [
30522,
2270,
10763,
22017,
20898,
2003,
10175,
3593,
11522,
16068,
1006,
5164,
8909,
11522,
1007,
1063,
2065,
1006,
2859,
1035,
8909,
1035,
8117,
1035,
3091,
999,
1027,
8909,
11522,
1012,
3091,
1006,
1007,
1007,
1063,
2709,
6270,
1025,
1065... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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/collection/CollUtil.java | CollUtil.newBlockingQueue | public static <T> BlockingQueue<T> newBlockingQueue(int capacity, boolean isLinked) {
BlockingQueue<T> queue;
if (isLinked) {
queue = new LinkedBlockingDeque<>(capacity);
} else {
queue = new ArrayBlockingQueue<>(capacity);
}
return queue;
} | java | public static <T> BlockingQueue<T> newBlockingQueue(int capacity, boolean isLinked) {
BlockingQueue<T> queue;
if (isLinked) {
queue = new LinkedBlockingDeque<>(capacity);
} else {
queue = new ArrayBlockingQueue<>(capacity);
}
return queue;
} | [
"public",
"static",
"<",
"T",
">",
"BlockingQueue",
"<",
"T",
">",
"newBlockingQueue",
"(",
"int",
"capacity",
",",
"boolean",
"isLinked",
")",
"{",
"BlockingQueue",
"<",
"T",
">",
"queue",
";",
"if",
"(",
"isLinked",
")",
"{",
"queue",
"=",
"new",
"Li... | 新建{@link BlockingQueue}<br>
在队列为空时,获取元素的线程会等待队列变为非空。当队列满时,存储元素的线程会等待队列可用。
@param capacity 容量
@param isLinked 是否为链表形式
@return {@link BlockingQueue}
@since 3.3.0 | [
"新建",
"{",
"@link",
"BlockingQueue",
"}",
"<br",
">",
"在队列为空时,获取元素的线程会等待队列变为非空。当队列满时,存储元素的线程会等待队列可用。"
] | bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/collection/CollUtil.java#L719-L727 | train | Creates a new BlockingQueue of the specified capacity. | [
30522,
2270,
10763,
1026,
1056,
1028,
10851,
4226,
5657,
1026,
1056,
1028,
2047,
23467,
2075,
4226,
5657,
1006,
20014,
3977,
1010,
22017,
20898,
2003,
13767,
2098,
1007,
1063,
10851,
4226,
5657,
1026,
1056,
1028,
24240,
1025,
2065,
1006,
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... |
apache/flink | flink-libraries/flink-gelly/src/main/java/org/apache/flink/graph/utils/proxy/OptionalBoolean.java | OptionalBoolean.mergeWith | public void mergeWith(OptionalBoolean other) {
if (state == other.state) {
// no change in state
} else if (state == State.UNSET) {
state = other.state;
} else if (other.state == State.UNSET) {
// no change in state
} else {
state = State.CONFLICTING;
}
} | java | public void mergeWith(OptionalBoolean other) {
if (state == other.state) {
// no change in state
} else if (state == State.UNSET) {
state = other.state;
} else if (other.state == State.UNSET) {
// no change in state
} else {
state = State.CONFLICTING;
}
} | [
"public",
"void",
"mergeWith",
"(",
"OptionalBoolean",
"other",
")",
"{",
"if",
"(",
"state",
"==",
"other",
".",
"state",
")",
"{",
"// no change in state",
"}",
"else",
"if",
"(",
"state",
"==",
"State",
".",
"UNSET",
")",
"{",
"state",
"=",
"other",
... | State transitions.
- if the states are the same then no change
- if either state is unset then change to the other state
- if the states are conflicting then set to the conflicting state
@param other object from which to merge state | [
"State",
"transitions",
".",
"-",
"if",
"the",
"states",
"are",
"the",
"same",
"then",
"no",
"change",
"-",
"if",
"either",
"state",
"is",
"unset",
"then",
"change",
"to",
"the",
"other",
"state",
"-",
"if",
"the",
"states",
"are",
"conflicting",
"then",... | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-libraries/flink-gelly/src/main/java/org/apache/flink/graph/utils/proxy/OptionalBoolean.java#L127-L137 | train | Merge two boolean states. | [
30522,
2270,
11675,
13590,
24415,
1006,
11887,
5092,
9890,
2319,
2060,
1007,
1063,
2065,
1006,
2110,
1027,
1027,
2060,
1012,
2110,
1007,
1063,
1013,
1013,
2053,
2689,
1999,
2110,
1065,
2842,
2065,
1006,
2110,
1027,
1027,
2110,
1012,
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... |
spring-projects/spring-boot | spring-boot-project/spring-boot/src/main/java/org/springframework/boot/webservices/client/WebServiceTemplateBuilder.java | WebServiceTemplateBuilder.customizers | public WebServiceTemplateBuilder customizers(
Collection<? extends WebServiceTemplateCustomizer> customizers) {
Assert.notNull(customizers, "Customizers must not be null");
return new WebServiceTemplateBuilder(this.detectHttpMessageSender,
this.interceptors, this.internalCustomizers,
append(Collections.<... | java | public WebServiceTemplateBuilder customizers(
Collection<? extends WebServiceTemplateCustomizer> customizers) {
Assert.notNull(customizers, "Customizers must not be null");
return new WebServiceTemplateBuilder(this.detectHttpMessageSender,
this.interceptors, this.internalCustomizers,
append(Collections.<... | [
"public",
"WebServiceTemplateBuilder",
"customizers",
"(",
"Collection",
"<",
"?",
"extends",
"WebServiceTemplateCustomizer",
">",
"customizers",
")",
"{",
"Assert",
".",
"notNull",
"(",
"customizers",
",",
"\"Customizers must not be null\"",
")",
";",
"return",
"new",
... | Set {@link WebServiceTemplateCustomizer WebServiceTemplateCustomizers} that should
be applied to the {@link WebServiceTemplate}. Customizers are applied in the order
that they were added after builder configuration has been applied. Setting this
value will replace any previously configured customizers.
@param customize... | [
"Set",
"{"
] | 0b27f7c70e164b2b1a96477f1d9c1acba56790c1 | https://github.com/spring-projects/spring-boot/blob/0b27f7c70e164b2b1a96477f1d9c1acba56790c1/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/webservices/client/WebServiceTemplateBuilder.java#L282-L291 | train | Create a new builder with customizers. | [
30522,
2270,
4773,
8043,
7903,
12870,
8737,
13806,
8569,
23891,
2099,
7661,
17629,
2015,
1006,
3074,
1026,
1029,
8908,
4773,
8043,
7903,
12870,
8737,
13806,
7874,
20389,
17629,
1028,
7661,
17629,
2015,
1007,
1063,
20865,
1012,
2025,
11231,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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/operators/SingleInputOperator.java | SingleInputOperator.addInput | @Deprecated
@SuppressWarnings("unchecked")
public void addInput(List<Operator<IN>> inputs) {
this.input = Operator.createUnionCascade(this.input, inputs.toArray(new Operator[inputs.size()]));
} | java | @Deprecated
@SuppressWarnings("unchecked")
public void addInput(List<Operator<IN>> inputs) {
this.input = Operator.createUnionCascade(this.input, inputs.toArray(new Operator[inputs.size()]));
} | [
"@",
"Deprecated",
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"void",
"addInput",
"(",
"List",
"<",
"Operator",
"<",
"IN",
">",
">",
"inputs",
")",
"{",
"this",
".",
"input",
"=",
"Operator",
".",
"createUnionCascade",
"(",
"this",
".",
... | Adds to the input the union of the given operators.
@param inputs The operator(s) that form the input.
@deprecated This method will be removed in future versions. Use the {@link Union} operator instead. | [
"Adds",
"to",
"the",
"input",
"the",
"union",
"of",
"the",
"given",
"operators",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-core/src/main/java/org/apache/flink/api/common/operators/SingleInputOperator.java#L152-L156 | train | Add an input list to the union of the existing inputs. | [
30522,
1030,
2139,
28139,
12921,
1030,
16081,
9028,
5582,
2015,
1006,
1000,
4895,
5403,
18141,
1000,
1007,
2270,
11675,
5587,
2378,
18780,
1006,
2862,
1026,
6872,
1026,
1999,
1028,
1028,
20407,
1007,
1063,
2023,
1012,
7953,
1027,
6872,
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... |
looly/hutool | hutool-core/src/main/java/cn/hutool/core/collection/CollUtil.java | CollUtil.valuesOfKeys | public static <K, V> ArrayList<V> valuesOfKeys(Map<K, V> map, Iterator<K> keys) {
final ArrayList<V> values = new ArrayList<>();
while (keys.hasNext()) {
values.add(map.get(keys.next()));
}
return values;
} | java | public static <K, V> ArrayList<V> valuesOfKeys(Map<K, V> map, Iterator<K> keys) {
final ArrayList<V> values = new ArrayList<>();
while (keys.hasNext()) {
values.add(map.get(keys.next()));
}
return values;
} | [
"public",
"static",
"<",
"K",
",",
"V",
">",
"ArrayList",
"<",
"V",
">",
"valuesOfKeys",
"(",
"Map",
"<",
"K",
",",
"V",
">",
"map",
",",
"Iterator",
"<",
"K",
">",
"keys",
")",
"{",
"final",
"ArrayList",
"<",
"V",
">",
"values",
"=",
"new",
"A... | 从Map中获取指定键列表对应的值列表<br>
如果key在map中不存在或key对应值为null,则返回值列表对应位置的值也为null
@param <K> 键类型
@param <V> 值类型
@param map {@link Map}
@param keys 键列表
@return 值列表
@since 3.0.9 | [
"从Map中获取指定键列表对应的值列表<br",
">",
"如果key在map中不存在或key对应值为null,则返回值列表对应位置的值也为null"
] | bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/collection/CollUtil.java#L2010-L2016 | train | Gets the values of the given keys from the given map. | [
30522,
2270,
10763,
1026,
1047,
1010,
1058,
1028,
9140,
9863,
1026,
1058,
1028,
5300,
11253,
14839,
2015,
1006,
4949,
1026,
1047,
1010,
1058,
1028,
4949,
1010,
2009,
6906,
4263,
1026,
1047,
1028,
6309,
1007,
1063,
2345,
9140,
9863,
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... |
apache/spark | launcher/src/main/java/org/apache/spark/launcher/AbstractLauncher.java | AbstractLauncher.setConf | public T setConf(String key, String value) {
checkNotNull(key, "key");
checkNotNull(value, "value");
checkArgument(key.startsWith("spark."), "'key' must start with 'spark.'");
builder.conf.put(key, value);
return self();
} | java | public T setConf(String key, String value) {
checkNotNull(key, "key");
checkNotNull(value, "value");
checkArgument(key.startsWith("spark."), "'key' must start with 'spark.'");
builder.conf.put(key, value);
return self();
} | [
"public",
"T",
"setConf",
"(",
"String",
"key",
",",
"String",
"value",
")",
"{",
"checkNotNull",
"(",
"key",
",",
"\"key\"",
")",
";",
"checkNotNull",
"(",
"value",
",",
"\"value\"",
")",
";",
"checkArgument",
"(",
"key",
".",
"startsWith",
"(",
"\"spar... | Set a single configuration value for the application.
@param key Configuration key.
@param value The value to use.
@return This launcher. | [
"Set",
"a",
"single",
"configuration",
"value",
"for",
"the",
"application",
"."
] | 25ee0474f47d9c30d6f553a7892d9549f91071cf | https://github.com/apache/spark/blob/25ee0474f47d9c30d6f553a7892d9549f91071cf/launcher/src/main/java/org/apache/spark/launcher/AbstractLauncher.java#L58-L64 | train | Sets a configuration value for the specified key. | [
30522,
2270,
1056,
2275,
8663,
2546,
1006,
5164,
3145,
1010,
5164,
3643,
1007,
1063,
4638,
17048,
11231,
3363,
1006,
3145,
1010,
1000,
3145,
1000,
1007,
1025,
4638,
17048,
11231,
3363,
1006,
3643,
1010,
1000,
3643,
1000,
1007,
1025,
4638,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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/ReflectUtil.java | ReflectUtil.getMethods | public static Method[] getMethods(Class<?> beanClass) throws SecurityException {
Method[] allMethods = METHODS_CACHE.get(beanClass);
if (null != allMethods) {
return allMethods;
}
allMethods = getMethodsDirectly(beanClass, true);
return METHODS_CACHE.put(beanClass, allMethods);
} | java | public static Method[] getMethods(Class<?> beanClass) throws SecurityException {
Method[] allMethods = METHODS_CACHE.get(beanClass);
if (null != allMethods) {
return allMethods;
}
allMethods = getMethodsDirectly(beanClass, true);
return METHODS_CACHE.put(beanClass, allMethods);
} | [
"public",
"static",
"Method",
"[",
"]",
"getMethods",
"(",
"Class",
"<",
"?",
">",
"beanClass",
")",
"throws",
"SecurityException",
"{",
"Method",
"[",
"]",
"allMethods",
"=",
"METHODS_CACHE",
".",
"get",
"(",
"beanClass",
")",
";",
"if",
"(",
"null",
"!... | 获得一个类中所有方法列表,包括其父类中的方法
@param beanClass 类
@return 方法列表
@throws SecurityException 安全检查异常 | [
"获得一个类中所有方法列表,包括其父类中的方法"
] | bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/util/ReflectUtil.java#L571-L579 | train | Returns all methods of the specified class including any inherited interfaces. | [
30522,
2270,
10763,
4118,
1031,
1033,
2131,
11368,
6806,
5104,
1006,
2465,
1026,
1029,
1028,
14068,
26266,
1007,
11618,
3036,
10288,
24422,
1063,
4118,
1031,
1033,
2035,
11368,
6806,
5104,
1027,
4725,
1035,
17053,
1012,
2131,
1006,
14068,
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/spark | sql/hive-thriftserver/src/main/java/org/apache/hive/service/cli/operation/SQLOperation.java | SQLOperation.getConfigForOperation | private HiveConf getConfigForOperation() throws HiveSQLException {
HiveConf sqlOperationConf = getParentSession().getHiveConf();
if (!getConfOverlay().isEmpty() || shouldRunAsync()) {
// clone the parent session config for this query
sqlOperationConf = new HiveConf(sqlOperationConf);
// apply... | java | private HiveConf getConfigForOperation() throws HiveSQLException {
HiveConf sqlOperationConf = getParentSession().getHiveConf();
if (!getConfOverlay().isEmpty() || shouldRunAsync()) {
// clone the parent session config for this query
sqlOperationConf = new HiveConf(sqlOperationConf);
// apply... | [
"private",
"HiveConf",
"getConfigForOperation",
"(",
")",
"throws",
"HiveSQLException",
"{",
"HiveConf",
"sqlOperationConf",
"=",
"getParentSession",
"(",
")",
".",
"getHiveConf",
"(",
")",
";",
"if",
"(",
"!",
"getConfOverlay",
"(",
")",
".",
"isEmpty",
"(",
... | If there are query specific settings to overlay, then create a copy of config
There are two cases we need to clone the session config that's being passed to hive driver
1. Async query -
If the client changes a config setting, that shouldn't reflect in the execution already underway
2. confOverlay -
The query specific s... | [
"If",
"there",
"are",
"query",
"specific",
"settings",
"to",
"overlay",
"then",
"create",
"a",
"copy",
"of",
"config",
"There",
"are",
"two",
"cases",
"we",
"need",
"to",
"clone",
"the",
"session",
"config",
"that",
"s",
"being",
"passed",
"to",
"hive",
... | 25ee0474f47d9c30d6f553a7892d9549f91071cf | https://github.com/apache/spark/blob/25ee0474f47d9c30d6f553a7892d9549f91071cf/sql/hive-thriftserver/src/main/java/org/apache/hive/service/cli/operation/SQLOperation.java#L443-L459 | train | Get the config for this operation. | [
30522,
2797,
26736,
8663,
2546,
2131,
8663,
8873,
25708,
14604,
29487,
1006,
1007,
30524,
2065,
1006,
999,
2131,
8663,
14876,
6299,
8485,
1006,
1007,
1012,
2003,
6633,
13876,
2100,
1006,
1007,
1064,
1064,
2323,
26605,
6508,
12273,
1006,
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/flink | flink-runtime/src/main/java/org/apache/flink/runtime/state/filesystem/AbstractFsCheckpointStorage.java | AbstractFsCheckpointStorage.getCheckpointDirectoryForJob | protected static Path getCheckpointDirectoryForJob(Path baseCheckpointPath, JobID jobId) {
return new Path(baseCheckpointPath, jobId.toString());
} | java | protected static Path getCheckpointDirectoryForJob(Path baseCheckpointPath, JobID jobId) {
return new Path(baseCheckpointPath, jobId.toString());
} | [
"protected",
"static",
"Path",
"getCheckpointDirectoryForJob",
"(",
"Path",
"baseCheckpointPath",
",",
"JobID",
"jobId",
")",
"{",
"return",
"new",
"Path",
"(",
"baseCheckpointPath",
",",
"jobId",
".",
"toString",
"(",
")",
")",
";",
"}"
] | Builds directory into which a specific job checkpoints, meaning the directory inside which
it creates the checkpoint-specific subdirectories.
<p>This method only succeeds if a base checkpoint directory has been set; otherwise
the method fails with an exception.
@param jobId The ID of the job
@return The job's checkpo... | [
"Builds",
"directory",
"into",
"which",
"a",
"specific",
"job",
"checkpoints",
"meaning",
"the",
"directory",
"inside",
"which",
"it",
"creates",
"the",
"checkpoint",
"-",
"specific",
"subdirectories",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/state/filesystem/AbstractFsCheckpointStorage.java#L187-L189 | train | Get the directory for the checkpoint for the given job. | [
30522,
5123,
10763,
4130,
2131,
5403,
3600,
8400,
4305,
2890,
16761,
2100,
29278,
5558,
2497,
1006,
4130,
2918,
5403,
3600,
8400,
15069,
1010,
3105,
3593,
3105,
3593,
1007,
1063,
2709,
2047,
4130,
1006,
2918,
5403,
3600,
8400,
15069,
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-table/flink-table-runtime-blink/src/main/java/org/apache/flink/table/runtime/join/TimeBoundedStreamJoin.java | TimeBoundedStreamJoin.removeExpiredRows | private void removeExpiredRows(
Collector<BaseRow> collector,
long expirationTime,
MapState<Long, List<Tuple2<BaseRow, Boolean>>> rowCache,
ValueState<Long> timerState,
OnTimerContext ctx,
boolean removeLeft) throws Exception {
Iterator<Map.Entry<Long, List<Tuple2<BaseRow, Boolean>>>> iterator = row... | java | private void removeExpiredRows(
Collector<BaseRow> collector,
long expirationTime,
MapState<Long, List<Tuple2<BaseRow, Boolean>>> rowCache,
ValueState<Long> timerState,
OnTimerContext ctx,
boolean removeLeft) throws Exception {
Iterator<Map.Entry<Long, List<Tuple2<BaseRow, Boolean>>>> iterator = row... | [
"private",
"void",
"removeExpiredRows",
"(",
"Collector",
"<",
"BaseRow",
">",
"collector",
",",
"long",
"expirationTime",
",",
"MapState",
"<",
"Long",
",",
"List",
"<",
"Tuple2",
"<",
"BaseRow",
",",
"Boolean",
">",
">",
">",
"rowCache",
",",
"ValueState",... | Remove the expired rows. Register a new timer if the cache still holds valid rows
after the cleaning up.
@param collector the collector to emit results
@param expirationTime the expiration time for this cache
@param rowCache the row cache
@param timerState timer state for the opposite stream
@param ctx the context to ... | [
"Remove",
"the",
"expired",
"rows",
".",
"Register",
"a",
"new",
"timer",
"if",
"the",
"cache",
"still",
"holds",
"valid",
"rows",
"after",
"the",
"cleaning",
"up",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-table/flink-table-runtime-blink/src/main/java/org/apache/flink/table/runtime/join/TimeBoundedStreamJoin.java#L387-L439 | train | Remove expired rows from the cache. | [
30522,
2797,
11675,
6366,
10288,
21649,
10524,
2015,
1006,
10018,
1026,
2918,
10524,
1028,
10018,
1010,
2146,
4654,
16781,
7292,
1010,
7341,
12259,
1026,
2146,
1010,
2862,
1026,
10722,
10814,
2475,
1026,
2918,
10524,
1010,
22017,
20898,
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... |
apache/flink | flink-libraries/flink-cep/src/main/java/org/apache/flink/cep/nfa/sharedbuffer/SharedBuffer.java | SharedBuffer.getEntry | Lockable<SharedBufferNode> getEntry(NodeId nodeId) {
return entryCache.computeIfAbsent(nodeId, id -> {
try {
return entries.get(id);
} catch (Exception ex) {
throw new WrappingRuntimeException(ex);
}
});
} | java | Lockable<SharedBufferNode> getEntry(NodeId nodeId) {
return entryCache.computeIfAbsent(nodeId, id -> {
try {
return entries.get(id);
} catch (Exception ex) {
throw new WrappingRuntimeException(ex);
}
});
} | [
"Lockable",
"<",
"SharedBufferNode",
">",
"getEntry",
"(",
"NodeId",
"nodeId",
")",
"{",
"return",
"entryCache",
".",
"computeIfAbsent",
"(",
"nodeId",
",",
"id",
"->",
"{",
"try",
"{",
"return",
"entries",
".",
"get",
"(",
"id",
")",
";",
"}",
"catch",
... | It always returns node either from state or cache.
@param nodeId id of the node
@return SharedBufferNode | [
"It",
"always",
"returns",
"node",
"either",
"from",
"state",
"or",
"cache",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-libraries/flink-cep/src/main/java/org/apache/flink/cep/nfa/sharedbuffer/SharedBuffer.java#L202-L210 | train | Get the entry for the given node id. | [
30522,
5843,
3085,
1026,
4207,
8569,
12494,
3630,
3207,
1028,
2131,
4765,
2854,
1006,
13045,
3593,
13045,
3593,
1007,
1063,
2709,
4443,
3540,
5403,
1012,
24134,
10128,
7875,
5054,
2102,
1006,
13045,
3593,
1010,
8909,
1011,
1028,
1063,
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-java/src/main/java/org/apache/flink/api/java/operators/Operator.java | Operator.name | public O name(String newName) {
this.name = newName;
@SuppressWarnings("unchecked")
O returnType = (O) this;
return returnType;
} | java | public O name(String newName) {
this.name = newName;
@SuppressWarnings("unchecked")
O returnType = (O) this;
return returnType;
} | [
"public",
"O",
"name",
"(",
"String",
"newName",
")",
"{",
"this",
".",
"name",
"=",
"newName",
";",
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"O",
"returnType",
"=",
"(",
"O",
")",
"this",
";",
"return",
"returnType",
";",
"}"
] | Sets the name of this operator. This overrides the default name, which is either
a generated description of the operation (such as for example "Aggregate(1:SUM, 2:MIN)")
or the name the user-defined function or input/output format executed by the operator.
@param newName The name for this operator.
@return The operato... | [
"Sets",
"the",
"name",
"of",
"this",
"operator",
".",
"This",
"overrides",
"the",
"default",
"name",
"which",
"is",
"either",
"a",
"generated",
"description",
"of",
"the",
"operation",
"(",
"such",
"as",
"for",
"example",
"Aggregate",
"(",
"1",
":",
"SUM",... | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-java/src/main/java/org/apache/flink/api/java/operators/Operator.java#L106-L111 | train | Sets the name of the object. | [
30522,
2270,
1051,
2171,
1006,
5164,
2047,
18442,
1007,
1063,
2023,
1012,
2171,
1027,
2047,
18442,
1025,
1030,
16081,
9028,
5582,
2015,
1006,
1000,
4895,
5403,
18141,
1000,
1007,
1051,
2709,
13874,
1027,
1006,
1051,
1007,
2023,
1025,
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/spark | core/src/main/java/org/apache/spark/util/collection/TimSort.java | TimSort.countRunAndMakeAscending | private int countRunAndMakeAscending(Buffer a, int lo, int hi, Comparator<? super K> c) {
assert lo < hi;
int runHi = lo + 1;
if (runHi == hi)
return 1;
K key0 = s.newKey();
K key1 = s.newKey();
// Find end of run, and reverse range if descending
if (c.compare(s.getKey(a, runHi++, ke... | java | private int countRunAndMakeAscending(Buffer a, int lo, int hi, Comparator<? super K> c) {
assert lo < hi;
int runHi = lo + 1;
if (runHi == hi)
return 1;
K key0 = s.newKey();
K key1 = s.newKey();
// Find end of run, and reverse range if descending
if (c.compare(s.getKey(a, runHi++, ke... | [
"private",
"int",
"countRunAndMakeAscending",
"(",
"Buffer",
"a",
",",
"int",
"lo",
",",
"int",
"hi",
",",
"Comparator",
"<",
"?",
"super",
"K",
">",
"c",
")",
"{",
"assert",
"lo",
"<",
"hi",
";",
"int",
"runHi",
"=",
"lo",
"+",
"1",
";",
"if",
"... | Returns the length of the run beginning at the specified position in
the specified array and reverses the run if it is descending (ensuring
that the run will always be ascending when the method returns).
A run is the longest ascending sequence with:
a[lo] <= a[lo + 1] <= a[lo + 2] <= ...
or the longest descending se... | [
"Returns",
"the",
"length",
"of",
"the",
"run",
"beginning",
"at",
"the",
"specified",
"position",
"in",
"the",
"specified",
"array",
"and",
"reverses",
"the",
"run",
"if",
"it",
"is",
"descending",
"(",
"ensuring",
"that",
"the",
"run",
"will",
"always",
... | 25ee0474f47d9c30d6f553a7892d9549f91071cf | https://github.com/apache/spark/blob/25ee0474f47d9c30d6f553a7892d9549f91071cf/core/src/main/java/org/apache/spark/util/collection/TimSort.java#L260-L280 | train | Count the number of runs in the buffer and make the order of the elements in the buffer ascending. | [
30522,
2797,
20014,
4175,
26605,
4859,
2863,
3489,
3022,
23865,
2075,
1006,
17698,
1037,
1010,
20014,
8840,
1010,
20014,
7632,
1010,
4012,
28689,
4263,
1026,
1029,
3565,
1047,
1028,
1039,
1007,
1063,
20865,
8840,
1026,
7632,
1025,
20014,
24... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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/grouping/WindowsGrouping.java | WindowsGrouping.hasTriggerWindow | public boolean hasTriggerWindow() {
skipEmptyWindow();
Preconditions.checkState(watermark == Long.MIN_VALUE || nextWindow != null,
"next trigger window cannot be null.");
return nextWindow != null && nextWindow.getEnd() <= watermark;
} | java | public boolean hasTriggerWindow() {
skipEmptyWindow();
Preconditions.checkState(watermark == Long.MIN_VALUE || nextWindow != null,
"next trigger window cannot be null.");
return nextWindow != null && nextWindow.getEnd() <= watermark;
} | [
"public",
"boolean",
"hasTriggerWindow",
"(",
")",
"{",
"skipEmptyWindow",
"(",
")",
";",
"Preconditions",
".",
"checkState",
"(",
"watermark",
"==",
"Long",
".",
"MIN_VALUE",
"||",
"nextWindow",
"!=",
"null",
",",
"\"next trigger window cannot be null.\"",
")",
"... | Check if there are windows could be triggered according to the current watermark.
@return true when there are windows to be triggered.
It is designed to be idempotent. | [
"Check",
"if",
"there",
"are",
"windows",
"could",
"be",
"triggered",
"according",
"to",
"the",
"current",
"watermark",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-table/flink-table-runtime-blink/src/main/java/org/apache/flink/table/runtime/window/grouping/WindowsGrouping.java#L125-L130 | train | Returns true if the trigger window is at the end of the window. | [
30522,
2270,
22017,
20898,
2038,
18886,
13327,
11101,
5004,
1006,
1007,
1063,
13558,
6633,
13876,
2100,
11101,
5004,
1006,
1007,
1025,
3653,
8663,
20562,
2015,
1012,
14148,
12259,
1006,
2300,
10665,
1027,
1027,
2146,
1012,
8117,
1035,
3643,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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/AbsSetting.java | AbsSetting.getLong | public Long getLong(String key, String group) {
return getLong(key, group, null);
} | java | public Long getLong(String key, String group) {
return getLong(key, group, null);
} | [
"public",
"Long",
"getLong",
"(",
"String",
"key",
",",
"String",
"group",
")",
"{",
"return",
"getLong",
"(",
"key",
",",
"group",
",",
"null",
")",
";",
"}"
] | 获取long类型属性值
@param key 属性名
@param group 分组名
@return 属性值 | [
"获取long类型属性值"
] | bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-setting/src/main/java/cn/hutool/setting/AbsSetting.java#L200-L202 | train | Retrieves the value of a managed property as a Long. | [
30522,
2270,
2146,
2131,
10052,
1006,
5164,
3145,
1010,
5164,
2177,
1007,
1063,
2709,
2131,
10052,
1006,
3145,
1010,
2177,
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,
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-formats/flink-parquet/src/main/java/org/apache/flink/formats/parquet/avro/ParquetAvroWriters.java | ParquetAvroWriters.forSpecificRecord | public static <T extends SpecificRecordBase> ParquetWriterFactory<T> forSpecificRecord(Class<T> type) {
final String schemaString = SpecificData.get().getSchema(type).toString();
final ParquetBuilder<T> builder = (out) -> createAvroParquetWriter(schemaString, SpecificData.get(), out);
return new ParquetWriterFact... | java | public static <T extends SpecificRecordBase> ParquetWriterFactory<T> forSpecificRecord(Class<T> type) {
final String schemaString = SpecificData.get().getSchema(type).toString();
final ParquetBuilder<T> builder = (out) -> createAvroParquetWriter(schemaString, SpecificData.get(), out);
return new ParquetWriterFact... | [
"public",
"static",
"<",
"T",
"extends",
"SpecificRecordBase",
">",
"ParquetWriterFactory",
"<",
"T",
">",
"forSpecificRecord",
"(",
"Class",
"<",
"T",
">",
"type",
")",
"{",
"final",
"String",
"schemaString",
"=",
"SpecificData",
".",
"get",
"(",
")",
".",
... | Creates a ParquetWriterFactory for an Avro specific type. The Parquet writers will use the
schema of that specific type to build and write the columnar data.
@param type The class of the type to write. | [
"Creates",
"a",
"ParquetWriterFactory",
"for",
"an",
"Avro",
"specific",
"type",
".",
"The",
"Parquet",
"writers",
"will",
"use",
"the",
"schema",
"of",
"that",
"specific",
"type",
"to",
"build",
"and",
"write",
"the",
"columnar",
"data",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-formats/flink-parquet/src/main/java/org/apache/flink/formats/parquet/avro/ParquetAvroWriters.java#L47-L51 | train | Creates a ParquetWriterFactory for a specific record. | [
30522,
2270,
10763,
1026,
1056,
8908,
3563,
2890,
27108,
18939,
11022,
1028,
11968,
12647,
15994,
21450,
1026,
1056,
1028,
2005,
13102,
8586,
18513,
2890,
27108,
2094,
1006,
2465,
1026,
1056,
1028,
2828,
1007,
1063,
2345,
5164,
8040,
28433,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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/compression/Bzip2HuffmanAllocator.java | Bzip2HuffmanAllocator.allocateNodeLengths | private static void allocateNodeLengths(final int[] array) {
int firstNode = array.length - 2;
int nextNode = array.length - 1;
for (int currentDepth = 1, availableNodes = 2; availableNodes > 0; currentDepth++) {
final int lastNode = firstNode;
firstNode = first(array, l... | java | private static void allocateNodeLengths(final int[] array) {
int firstNode = array.length - 2;
int nextNode = array.length - 1;
for (int currentDepth = 1, availableNodes = 2; availableNodes > 0; currentDepth++) {
final int lastNode = firstNode;
firstNode = first(array, l... | [
"private",
"static",
"void",
"allocateNodeLengths",
"(",
"final",
"int",
"[",
"]",
"array",
")",
"{",
"int",
"firstNode",
"=",
"array",
".",
"length",
"-",
"2",
";",
"int",
"nextNode",
"=",
"array",
".",
"length",
"-",
"1",
";",
"for",
"(",
"int",
"c... | A final allocation pass with no code length limit.
@param array The code length array | [
"A",
"final",
"allocation",
"pass",
"with",
"no",
"code",
"length",
"limit",
"."
] | ba06eafa1c1824bd154f1a380019e7ea2edf3c4c | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/codec/src/main/java/io/netty/handler/codec/compression/Bzip2HuffmanAllocator.java#L100-L114 | train | Allocate node lengths. | [
30522,
2797,
10763,
11675,
2035,
24755,
6528,
10244,
7770,
13512,
7898,
1006,
2345,
20014,
1031,
1033,
9140,
1007,
1063,
20014,
2034,
3630,
3207,
1027,
9140,
1012,
3091,
1011,
1016,
1025,
20014,
2279,
3630,
3207,
1027,
9140,
1012,
3091,
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... |
hankcs/HanLP | src/main/java/com/hankcs/hanlp/collection/AhoCorasick/AhoCorasickDoubleArrayTrie.java | AhoCorasickDoubleArrayTrie.save | public void save(ObjectOutputStream out) throws IOException
{
out.writeObject(base);
out.writeObject(check);
out.writeObject(fail);
out.writeObject(output);
out.writeObject(l);
} | java | public void save(ObjectOutputStream out) throws IOException
{
out.writeObject(base);
out.writeObject(check);
out.writeObject(fail);
out.writeObject(output);
out.writeObject(l);
} | [
"public",
"void",
"save",
"(",
"ObjectOutputStream",
"out",
")",
"throws",
"IOException",
"{",
"out",
".",
"writeObject",
"(",
"base",
")",
";",
"out",
".",
"writeObject",
"(",
"check",
")",
";",
"out",
".",
"writeObject",
"(",
"fail",
")",
";",
"out",
... | 持久化
@param out 一个ObjectOutputStream
@throws IOException 可能的IO异常 | [
"持久化"
] | a538d0722ab2e4980a9dcd9ea40324fc3ddba7ce | https://github.com/hankcs/HanLP/blob/a538d0722ab2e4980a9dcd9ea40324fc3ddba7ce/src/main/java/com/hankcs/hanlp/collection/AhoCorasick/AhoCorasickDoubleArrayTrie.java#L213-L220 | train | Saves the result of this exception to the specified output stream. | [
30522,
2270,
11675,
3828,
1006,
4874,
5833,
18780,
21422,
2041,
1007,
11618,
22834,
10288,
24422,
1063,
2041,
1012,
4339,
16429,
20614,
1006,
2918,
1007,
1025,
2041,
1012,
4339,
16429,
20614,
1006,
4638,
1007,
1025,
2041,
1012,
4339,
16429,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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/math/Combination.java | Combination.countAll | public static long countAll(int n) {
long total = 0;
for(int i = 1; i <= n; i++) {
total += count(n, i);
}
return total;
} | java | public static long countAll(int n) {
long total = 0;
for(int i = 1; i <= n; i++) {
total += count(n, i);
}
return total;
} | [
"public",
"static",
"long",
"countAll",
"(",
"int",
"n",
")",
"{",
"long",
"total",
"=",
"0",
";",
"for",
"(",
"int",
"i",
"=",
"1",
";",
"i",
"<=",
"n",
";",
"i",
"++",
")",
"{",
"total",
"+=",
"count",
"(",
"n",
",",
"i",
")",
";",
"}",
... | 计算组合总数,即C(n, 1) + C(n, 2) + C(n, 3)...
@param n 总数
@return 组合数 | [
"计算组合总数,即C",
"(",
"n",
"1",
")",
"+",
"C",
"(",
"n",
"2",
")",
"+",
"C",
"(",
"n",
"3",
")",
"..."
] | bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/math/Combination.java#L53-L59 | train | Count all the records in the table. | [
30522,
2270,
10763,
2146,
4175,
8095,
1006,
20014,
1050,
1007,
1063,
2146,
2561,
1027,
1014,
1025,
2005,
1006,
20014,
1045,
1027,
1015,
1025,
1045,
1026,
1027,
1050,
1025,
1045,
1009,
1009,
1007,
1063,
2561,
1009,
1027,
4175,
1006,
1050,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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-crypto/src/main/java/cn/hutool/crypto/KeyUtil.java | KeyUtil.readX509Certificate | public static Certificate readX509Certificate(InputStream in, char[] password, String alias) {
return readCertificate(X509, in, password, alias);
} | java | public static Certificate readX509Certificate(InputStream in, char[] password, String alias) {
return readCertificate(X509, in, password, alias);
} | [
"public",
"static",
"Certificate",
"readX509Certificate",
"(",
"InputStream",
"in",
",",
"char",
"[",
"]",
"password",
",",
"String",
"alias",
")",
"{",
"return",
"readCertificate",
"(",
"X509",
",",
"in",
",",
"password",
",",
"alias",
")",
";",
"}"
] | 读取X.509 Certification文件<br>
Certification为证书文件<br>
see: http://snowolf.iteye.com/blog/391931
@param in {@link InputStream} 如果想从文件读取.cer文件,使用 {@link FileUtil#getInputStream(java.io.File)} 读取
@param password 密码
@param alias 别名
@return {@link KeyStore}
@since 4.4.1 | [
"读取X",
".",
"509",
"Certification文件<br",
">",
"Certification为证书文件<br",
">",
"see",
":",
"http",
":",
"//",
"snowolf",
".",
"iteye",
".",
"com",
"/",
"blog",
"/",
"391931"
] | bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-crypto/src/main/java/cn/hutool/crypto/KeyUtil.java#L629-L631 | train | Reads an X509 certificate from an input stream. | [
30522,
2270,
10763,
8196,
3191,
2595,
12376,
2683,
17119,
3775,
8873,
16280,
1006,
20407,
25379,
1999,
1010,
25869,
1031,
1033,
20786,
1010,
5164,
14593,
1007,
1063,
2709,
3191,
17119,
3775,
8873,
16280,
1006,
1060,
12376,
2683,
1010,
1999,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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/jobmanager/scheduler/Scheduler.java | Scheduler.shutdown | public void shutdown() {
synchronized (globalLock) {
for (Instance i : allInstances) {
i.removeSlotListener();
i.cancelAndReleaseAllSlots();
}
allInstances.clear();
allInstancesByHost.clear();
instancesWithAvailableResources.clear();
taskQueue.clear();
}
} | java | public void shutdown() {
synchronized (globalLock) {
for (Instance i : allInstances) {
i.removeSlotListener();
i.cancelAndReleaseAllSlots();
}
allInstances.clear();
allInstancesByHost.clear();
instancesWithAvailableResources.clear();
taskQueue.clear();
}
} | [
"public",
"void",
"shutdown",
"(",
")",
"{",
"synchronized",
"(",
"globalLock",
")",
"{",
"for",
"(",
"Instance",
"i",
":",
"allInstances",
")",
"{",
"i",
".",
"removeSlotListener",
"(",
")",
";",
"i",
".",
"cancelAndReleaseAllSlots",
"(",
")",
";",
"}",... | Shuts the scheduler down. After shut down no more tasks can be added to the scheduler. | [
"Shuts",
"the",
"scheduler",
"down",
".",
"After",
"shut",
"down",
"no",
"more",
"tasks",
"can",
"be",
"added",
"to",
"the",
"scheduler",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/jobmanager/scheduler/Scheduler.java#L127-L138 | train | Shutdown all the instances. | [
30522,
2270,
11675,
3844,
7698,
1006,
1007,
1063,
25549,
1006,
3795,
7878,
1007,
1063,
2005,
1006,
6013,
1045,
1024,
2035,
7076,
26897,
2015,
1007,
1063,
1045,
1012,
20362,
10994,
9863,
24454,
1006,
1007,
1025,
1045,
1012,
30524,
5657,
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... |
spring-projects/spring-boot | spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/Sanitizer.java | Sanitizer.sanitize | public Object sanitize(String key, Object value) {
if (value == null) {
return null;
}
for (Pattern pattern : this.keysToSanitize) {
if (pattern.matcher(key).matches()) {
return "******";
}
}
return value;
} | java | public Object sanitize(String key, Object value) {
if (value == null) {
return null;
}
for (Pattern pattern : this.keysToSanitize) {
if (pattern.matcher(key).matches()) {
return "******";
}
}
return value;
} | [
"public",
"Object",
"sanitize",
"(",
"String",
"key",
",",
"Object",
"value",
")",
"{",
"if",
"(",
"value",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"for",
"(",
"Pattern",
"pattern",
":",
"this",
".",
"keysToSanitize",
")",
"{",
"if",
"(",... | Sanitize the given value if necessary.
@param key the key to sanitize
@param value the value
@return the potentially sanitized value | [
"Sanitize",
"the",
"given",
"value",
"if",
"necessary",
"."
] | 0b27f7c70e164b2b1a96477f1d9c1acba56790c1 | https://github.com/spring-projects/spring-boot/blob/0b27f7c70e164b2b1a96477f1d9c1acba56790c1/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/Sanitizer.java#L84-L94 | train | Sanitize the given value. | [
30522,
2270,
4874,
2624,
25090,
4371,
1006,
5164,
3145,
1010,
4874,
3643,
1007,
1063,
2065,
1006,
3643,
1027,
1027,
19701,
1007,
1063,
2709,
19701,
1025,
30524,
1006,
5418,
1012,
2674,
2121,
1006,
3145,
1007,
1012,
3503,
1006,
1007,
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... |
netty/netty | codec-http/src/main/java/io/netty/handler/codec/http/multipart/AbstractDiskHttpData.java | AbstractDiskHttpData.readFrom | private static byte[] readFrom(File src) throws IOException {
long srcsize = src.length();
if (srcsize > Integer.MAX_VALUE) {
throw new IllegalArgumentException(
"File too big to be loaded in memory");
}
FileInputStream inputStream = new FileInputStream(sr... | java | private static byte[] readFrom(File src) throws IOException {
long srcsize = src.length();
if (srcsize > Integer.MAX_VALUE) {
throw new IllegalArgumentException(
"File too big to be loaded in memory");
}
FileInputStream inputStream = new FileInputStream(sr... | [
"private",
"static",
"byte",
"[",
"]",
"readFrom",
"(",
"File",
"src",
")",
"throws",
"IOException",
"{",
"long",
"srcsize",
"=",
"src",
".",
"length",
"(",
")",
";",
"if",
"(",
"srcsize",
">",
"Integer",
".",
"MAX_VALUE",
")",
"{",
"throw",
"new",
"... | Utility function
@return the array of bytes | [
"Utility",
"function"
] | ba06eafa1c1824bd154f1a380019e7ea2edf3c4c | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/codec-http/src/main/java/io/netty/handler/codec/http/multipart/AbstractDiskHttpData.java#L419-L438 | train | Read from a file. | [
30522,
2797,
10763,
24880,
1031,
1033,
3191,
19699,
5358,
1006,
5371,
5034,
2278,
1007,
11618,
22834,
10288,
24422,
1063,
2146,
5034,
6169,
4697,
1027,
5034,
2278,
1012,
3091,
1006,
1007,
1025,
2065,
1006,
5034,
6169,
4697,
1028,
16109,
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... |
netty/netty | handler/src/main/java/io/netty/handler/timeout/ReadTimeoutHandler.java | ReadTimeoutHandler.readTimedOut | protected void readTimedOut(ChannelHandlerContext ctx) throws Exception {
if (!closed) {
ctx.fireExceptionCaught(ReadTimeoutException.INSTANCE);
ctx.close();
closed = true;
}
} | java | protected void readTimedOut(ChannelHandlerContext ctx) throws Exception {
if (!closed) {
ctx.fireExceptionCaught(ReadTimeoutException.INSTANCE);
ctx.close();
closed = true;
}
} | [
"protected",
"void",
"readTimedOut",
"(",
"ChannelHandlerContext",
"ctx",
")",
"throws",
"Exception",
"{",
"if",
"(",
"!",
"closed",
")",
"{",
"ctx",
".",
"fireExceptionCaught",
"(",
"ReadTimeoutException",
".",
"INSTANCE",
")",
";",
"ctx",
".",
"close",
"(",
... | Is called when a read timeout was detected. | [
"Is",
"called",
"when",
"a",
"read",
"timeout",
"was",
"detected",
"."
] | ba06eafa1c1824bd154f1a380019e7ea2edf3c4c | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/handler/src/main/java/io/netty/handler/timeout/ReadTimeoutHandler.java#L96-L102 | train | Called when a read timeout occurs. | [
30522,
5123,
11675,
3191,
7292,
26797,
2102,
1006,
3149,
11774,
3917,
8663,
18209,
14931,
2595,
1007,
11618,
6453,
1063,
2065,
1006,
999,
2701,
1007,
1063,
14931,
2595,
1012,
2543,
10288,
24422,
3540,
18533,
1006,
3191,
7292,
5833,
10288,
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... |
netty/netty | common/src/main/java/io/netty/util/NetUtil.java | NetUtil.toAddressString | public static String toAddressString(InetAddress ip, boolean ipv4Mapped) {
if (ip instanceof Inet4Address) {
return ip.getHostAddress();
}
if (!(ip instanceof Inet6Address)) {
throw new IllegalArgumentException("Unhandled type: " + ip);
}
return toAddress... | java | public static String toAddressString(InetAddress ip, boolean ipv4Mapped) {
if (ip instanceof Inet4Address) {
return ip.getHostAddress();
}
if (!(ip instanceof Inet6Address)) {
throw new IllegalArgumentException("Unhandled type: " + ip);
}
return toAddress... | [
"public",
"static",
"String",
"toAddressString",
"(",
"InetAddress",
"ip",
",",
"boolean",
"ipv4Mapped",
")",
"{",
"if",
"(",
"ip",
"instanceof",
"Inet4Address",
")",
"{",
"return",
"ip",
".",
"getHostAddress",
"(",
")",
";",
"}",
"if",
"(",
"!",
"(",
"i... | Returns the {@link String} representation of an {@link InetAddress}.
<ul>
<li>Inet4Address results are identical to {@link InetAddress#getHostAddress()}</li>
<li>Inet6Address results adhere to
<a href="http://tools.ietf.org/html/rfc5952#section-4">rfc 5952 section 4</a> if
{@code ipv4Mapped} is false. If {@code ipv4Ma... | [
"Returns",
"the",
"{"
] | ba06eafa1c1824bd154f1a380019e7ea2edf3c4c | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/common/src/main/java/io/netty/util/NetUtil.java#L1017-L1026 | train | Returns the string representation of the given IP address. | [
30522,
2270,
10763,
5164,
21344,
16200,
4757,
3367,
4892,
1006,
1999,
12928,
14141,
8303,
12997,
1010,
22017,
20898,
12997,
2615,
2549,
2863,
11469,
1007,
1063,
2065,
1006,
12997,
6013,
11253,
1999,
3388,
2549,
4215,
16200,
4757,
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... |
hankcs/HanLP | src/main/java/com/hankcs/hanlp/algorithm/ahocorasick/trie/Trie.java | Trie.getState | private static State getState(State currentState, Character character)
{
State newCurrentState = currentState.nextState(character); // 先按success跳转
while (newCurrentState == null) // 跳转失败的话,按failure跳转
{
currentState = currentState.failure();
newCurrentState = currentS... | java | private static State getState(State currentState, Character character)
{
State newCurrentState = currentState.nextState(character); // 先按success跳转
while (newCurrentState == null) // 跳转失败的话,按failure跳转
{
currentState = currentState.failure();
newCurrentState = currentS... | [
"private",
"static",
"State",
"getState",
"(",
"State",
"currentState",
",",
"Character",
"character",
")",
"{",
"State",
"newCurrentState",
"=",
"currentState",
".",
"nextState",
"(",
"character",
")",
";",
"// 先按success跳转",
"while",
"(",
"newCurrentState",
"==",... | 跳转到下一个状态
@param currentState 当前状态
@param character 接受字符
@return 跳转结果 | [
"跳转到下一个状态"
] | a538d0722ab2e4980a9dcd9ea40324fc3ddba7ce | https://github.com/hankcs/HanLP/blob/a538d0722ab2e4980a9dcd9ea40324fc3ddba7ce/src/main/java/com/hankcs/hanlp/algorithm/ahocorasick/trie/Trie.java#L208-L217 | train | getState - get the next state | [
30522,
2797,
10763,
2110,
4152,
12259,
1006,
2110,
14731,
12259,
1010,
2839,
2839,
1007,
1063,
2110,
2047,
10841,
14343,
7666,
12259,
1027,
14731,
12259,
1012,
2279,
9153,
2618,
1006,
2839,
1007,
1025,
1013,
1013,
100,
100,
3112,
100,
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... |
hankcs/HanLP | src/main/java/com/hankcs/hanlp/tokenizer/lexical/AbstractLexicalAnalyzer.java | AbstractLexicalAnalyzer.segmentAfterRule | protected void segmentAfterRule(String sentence, String normalized, List<String> wordList)
{
if (!enableRuleBasedSegment)
{
segmenter.segment(sentence, normalized, wordList);
return;
}
int start = 0;
int end = start;
byte preType = typeTable[no... | java | protected void segmentAfterRule(String sentence, String normalized, List<String> wordList)
{
if (!enableRuleBasedSegment)
{
segmenter.segment(sentence, normalized, wordList);
return;
}
int start = 0;
int end = start;
byte preType = typeTable[no... | [
"protected",
"void",
"segmentAfterRule",
"(",
"String",
"sentence",
",",
"String",
"normalized",
",",
"List",
"<",
"String",
">",
"wordList",
")",
"{",
"if",
"(",
"!",
"enableRuleBasedSegment",
")",
"{",
"segmenter",
".",
"segment",
"(",
"sentence",
",",
"no... | 丑陋的规则系统
@param sentence
@param normalized
@param wordList | [
"丑陋的规则系统"
] | a538d0722ab2e4980a9dcd9ea40324fc3ddba7ce | https://github.com/hankcs/HanLP/blob/a538d0722ab2e4980a9dcd9ea40324fc3ddba7ce/src/main/java/com/hankcs/hanlp/tokenizer/lexical/AbstractLexicalAnalyzer.java#L541-L583 | train | segmentAfterRule Method. | [
30522,
5123,
11675,
6903,
10354,
3334,
6820,
2571,
1006,
5164,
6251,
1010,
5164,
3671,
3550,
1010,
2862,
1026,
5164,
1028,
30524,
2203,
1027,
2707,
1025,
24880,
3653,
13874,
1027,
2828,
10880,
1031,
3671,
3550,
1012,
25869,
4017,
1006,
2203... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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/web/client/RestTemplateBuilder.java | RestTemplateBuilder.build | public <T extends RestTemplate> T build(Class<T> restTemplateClass) {
return configure(BeanUtils.instantiateClass(restTemplateClass));
} | java | public <T extends RestTemplate> T build(Class<T> restTemplateClass) {
return configure(BeanUtils.instantiateClass(restTemplateClass));
} | [
"public",
"<",
"T",
"extends",
"RestTemplate",
">",
"T",
"build",
"(",
"Class",
"<",
"T",
">",
"restTemplateClass",
")",
"{",
"return",
"configure",
"(",
"BeanUtils",
".",
"instantiateClass",
"(",
"restTemplateClass",
")",
")",
";",
"}"
] | Build a new {@link RestTemplate} instance of the specified type and configure it
using this builder.
@param <T> the type of rest template
@param restTemplateClass the template type to create
@return a configured {@link RestTemplate} instance.
@see RestTemplateBuilder#build()
@see #configure(RestTemplate) | [
"Build",
"a",
"new",
"{"
] | 0b27f7c70e164b2b1a96477f1d9c1acba56790c1 | https://github.com/spring-projects/spring-boot/blob/0b27f7c70e164b2b1a96477f1d9c1acba56790c1/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/client/RestTemplateBuilder.java#L510-L512 | train | Build a RestTemplate instance from a class. | [
30522,
2270,
1026,
1056,
8908,
2717,
18532,
15725,
1028,
1056,
3857,
1006,
2465,
1026,
1056,
1028,
2717,
18532,
15725,
26266,
1007,
1063,
2709,
9530,
8873,
27390,
2063,
1006,
30524,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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/catalyst/src/main/java/org/apache/spark/sql/util/CaseInsensitiveStringMap.java | CaseInsensitiveStringMap.getDouble | public double getDouble(String key, double defaultValue) {
String value = get(key);
return value == null ? defaultValue : Double.parseDouble(value);
} | java | public double getDouble(String key, double defaultValue) {
String value = get(key);
return value == null ? defaultValue : Double.parseDouble(value);
} | [
"public",
"double",
"getDouble",
"(",
"String",
"key",
",",
"double",
"defaultValue",
")",
"{",
"String",
"value",
"=",
"get",
"(",
"key",
")",
";",
"return",
"value",
"==",
"null",
"?",
"defaultValue",
":",
"Double",
".",
"parseDouble",
"(",
"value",
")... | Returns the double value to which the specified key is mapped,
or defaultValue if there is no mapping for the key. The key match is case-insensitive. | [
"Returns",
"the",
"double",
"value",
"to",
"which",
"the",
"specified",
"key",
"is",
"mapped",
"or",
"defaultValue",
"if",
"there",
"is",
"no",
"mapping",
"for",
"the",
"key",
".",
"The",
"key",
"match",
"is",
"case",
"-",
"insensitive",
"."
] | 25ee0474f47d9c30d6f553a7892d9549f91071cf | https://github.com/apache/spark/blob/25ee0474f47d9c30d6f553a7892d9549f91071cf/sql/catalyst/src/main/java/org/apache/spark/sql/util/CaseInsensitiveStringMap.java#L170-L173 | train | Get a double value from the resource. | [
30522,
2270,
3313,
2131,
26797,
3468,
1006,
5164,
3145,
1010,
3313,
12398,
10175,
5657,
1007,
1063,
5164,
3643,
1027,
2131,
1006,
3145,
1007,
1025,
2709,
3643,
1027,
1027,
19701,
1029,
12398,
10175,
5657,
1024,
3313,
1012,
11968,
6924,
7140... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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/network-shuffle/src/main/java/org/apache/spark/network/shuffle/RetryingBlockFetcher.java | RetryingBlockFetcher.shouldRetry | private synchronized boolean shouldRetry(Throwable e) {
boolean isIOException = e instanceof IOException
|| (e.getCause() != null && e.getCause() instanceof IOException);
boolean hasRemainingRetries = retryCount < maxRetries;
return isIOException && hasRemainingRetries;
} | java | private synchronized boolean shouldRetry(Throwable e) {
boolean isIOException = e instanceof IOException
|| (e.getCause() != null && e.getCause() instanceof IOException);
boolean hasRemainingRetries = retryCount < maxRetries;
return isIOException && hasRemainingRetries;
} | [
"private",
"synchronized",
"boolean",
"shouldRetry",
"(",
"Throwable",
"e",
")",
"{",
"boolean",
"isIOException",
"=",
"e",
"instanceof",
"IOException",
"||",
"(",
"e",
".",
"getCause",
"(",
")",
"!=",
"null",
"&&",
"e",
".",
"getCause",
"(",
")",
"instanc... | Returns true if we should retry due a block fetch failure. We will retry if and only if
the exception was an IOException and we haven't retried 'maxRetries' times already. | [
"Returns",
"true",
"if",
"we",
"should",
"retry",
"due",
"a",
"block",
"fetch",
"failure",
".",
"We",
"will",
"retry",
"if",
"and",
"only",
"if",
"the",
"exception",
"was",
"an",
"IOException",
"and",
"we",
"haven",
"t",
"retried",
"maxRetries",
"times",
... | 25ee0474f47d9c30d6f553a7892d9549f91071cf | https://github.com/apache/spark/blob/25ee0474f47d9c30d6f553a7892d9549f91071cf/common/network-shuffle/src/main/java/org/apache/spark/network/shuffle/RetryingBlockFetcher.java#L177-L182 | train | Returns true if the exception should be retried. | [
30522,
2797,
25549,
22017,
20898,
2323,
13465,
2854,
1006,
5466,
3085,
1041,
1007,
1063,
22017,
20898,
2003,
3695,
10288,
24422,
1027,
1041,
6013,
11253,
22834,
10288,
24422,
1064,
1064,
1006,
1041,
1012,
2131,
3540,
8557,
1006,
1007,
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-optimizer/src/main/java/org/apache/flink/optimizer/dag/BulkIterationNode.java | BulkIterationNode.setNextPartialSolution | public void setNextPartialSolution(OptimizerNode nextPartialSolution, OptimizerNode terminationCriterion) {
// check if the root of the step function has the same parallelism as the iteration
// or if the step function has any operator at all
if (nextPartialSolution.getParallelism() != getParallelism() ||
n... | java | public void setNextPartialSolution(OptimizerNode nextPartialSolution, OptimizerNode terminationCriterion) {
// check if the root of the step function has the same parallelism as the iteration
// or if the step function has any operator at all
if (nextPartialSolution.getParallelism() != getParallelism() ||
n... | [
"public",
"void",
"setNextPartialSolution",
"(",
"OptimizerNode",
"nextPartialSolution",
",",
"OptimizerNode",
"terminationCriterion",
")",
"{",
"// check if the root of the step function has the same parallelism as the iteration",
"// or if the step function has any operator at all",
"if"... | Sets the nextPartialSolution for this BulkIterationNode.
@param nextPartialSolution The nextPartialSolution to set. | [
"Sets",
"the",
"nextPartialSolution",
"for",
"this",
"BulkIterationNode",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-optimizer/src/main/java/org/apache/flink/optimizer/dag/BulkIterationNode.java#L132-L174 | train | Sets the next partial solution. | [
30522,
2270,
11675,
2275,
2638,
18413,
19362,
20925,
19454,
13700,
1006,
23569,
27605,
6290,
3630,
3207,
2279,
19362,
20925,
19454,
13700,
1010,
23569,
27605,
6290,
3630,
3207,
18287,
26775,
21646,
3258,
1007,
1063,
1013,
1013,
4638,
2065,
19... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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/graph/PageRank.java | PageRank.main | public static void main(String[] args) throws Exception {
ParameterTool params = ParameterTool.fromArgs(args);
final int numPages = params.getInt("numPages", PageRankData.getNumberOfPages());
final int maxIterations = params.getInt("iterations", 10);
// set up execution environment
final ExecutionEnvironme... | java | public static void main(String[] args) throws Exception {
ParameterTool params = ParameterTool.fromArgs(args);
final int numPages = params.getInt("numPages", PageRankData.getNumberOfPages());
final int maxIterations = params.getInt("iterations", 10);
// set up execution environment
final ExecutionEnvironme... | [
"public",
"static",
"void",
"main",
"(",
"String",
"[",
"]",
"args",
")",
"throws",
"Exception",
"{",
"ParameterTool",
"params",
"=",
"ParameterTool",
".",
"fromArgs",
"(",
"args",
")",
";",
"final",
"int",
"numPages",
"=",
"params",
".",
"getInt",
"(",
... | ************************************************************************* | [
"*************************************************************************"
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-examples/flink-examples-batch/src/main/java/org/apache/flink/examples/java/graph/PageRank.java#L79-L130 | train | Main method to run the Sequence Engine. | [
30522,
2270,
10763,
11675,
2364,
1006,
5164,
1031,
1033,
12098,
5620,
1007,
11618,
6453,
1063,
16381,
3406,
4747,
11498,
5244,
1027,
16381,
3406,
4747,
1012,
2013,
2906,
5620,
1006,
12098,
5620,
1007,
1025,
2345,
20014,
16371,
8737,
13923,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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/rest/handler/legacy/backpressure/BackPressureStatsTrackerImpl.java | BackPressureStatsTrackerImpl.getOperatorBackPressureStats | public Optional<OperatorBackPressureStats> getOperatorBackPressureStats(ExecutionJobVertex vertex) {
synchronized (lock) {
final OperatorBackPressureStats stats = operatorStatsCache.getIfPresent(vertex);
if (stats == null || backPressureStatsRefreshInterval <= System.currentTimeMillis() - stats.getEndTimestamp(... | java | public Optional<OperatorBackPressureStats> getOperatorBackPressureStats(ExecutionJobVertex vertex) {
synchronized (lock) {
final OperatorBackPressureStats stats = operatorStatsCache.getIfPresent(vertex);
if (stats == null || backPressureStatsRefreshInterval <= System.currentTimeMillis() - stats.getEndTimestamp(... | [
"public",
"Optional",
"<",
"OperatorBackPressureStats",
">",
"getOperatorBackPressureStats",
"(",
"ExecutionJobVertex",
"vertex",
")",
"{",
"synchronized",
"(",
"lock",
")",
"{",
"final",
"OperatorBackPressureStats",
"stats",
"=",
"operatorStatsCache",
".",
"getIfPresent"... | Returns back pressure statistics for a operator. Automatically triggers stack trace sampling
if statistics are not available or outdated.
@param vertex Operator to get the stats for.
@return Back pressure statistics for an operator | [
"Returns",
"back",
"pressure",
"statistics",
"for",
"a",
"operator",
".",
"Automatically",
"triggers",
"stack",
"trace",
"sampling",
"if",
"statistics",
"are",
"not",
"available",
"or",
"outdated",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/rest/handler/legacy/backpressure/BackPressureStatsTrackerImpl.java#L156-L164 | train | Get the back pressure statistics for a given execution job vertex. | [
30522,
2270,
11887,
1026,
6872,
5963,
20110,
14900,
29336,
2015,
1028,
2131,
25918,
8844,
5963,
20110,
14900,
29336,
2015,
1006,
7781,
5558,
2497,
16874,
10288,
19449,
1007,
1063,
25549,
1006,
5843,
1007,
1063,
2345,
6872,
5963,
20110,
14900,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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-haproxy/src/main/java/io/netty/handler/codec/haproxy/HAProxyMessageDecoder.java | HAProxyMessageDecoder.findEndOfHeader | private static int findEndOfHeader(final ByteBuf buffer) {
final int n = buffer.readableBytes();
// per spec, the 15th and 16th bytes contain the address length in bytes
if (n < 16) {
return -1;
}
int offset = buffer.readerIndex() + 14;
// the total header ... | java | private static int findEndOfHeader(final ByteBuf buffer) {
final int n = buffer.readableBytes();
// per spec, the 15th and 16th bytes contain the address length in bytes
if (n < 16) {
return -1;
}
int offset = buffer.readerIndex() + 14;
// the total header ... | [
"private",
"static",
"int",
"findEndOfHeader",
"(",
"final",
"ByteBuf",
"buffer",
")",
"{",
"final",
"int",
"n",
"=",
"buffer",
".",
"readableBytes",
"(",
")",
";",
"// per spec, the 15th and 16th bytes contain the address length in bytes",
"if",
"(",
"n",
"<",
"16"... | Returns the index in the buffer of the end of header if found.
Returns -1 if no end of header was found in the buffer. | [
"Returns",
"the",
"index",
"in",
"the",
"buffer",
"of",
"the",
"end",
"of",
"header",
"if",
"found",
".",
"Returns",
"-",
"1",
"if",
"no",
"end",
"of",
"header",
"was",
"found",
"in",
"the",
"buffer",
"."
] | ba06eafa1c1824bd154f1a380019e7ea2edf3c4c | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/codec-haproxy/src/main/java/io/netty/handler/codec/haproxy/HAProxyMessageDecoder.java#L178-L197 | train | Find the end of the header. | [
30522,
2797,
10763,
20014,
2424,
10497,
11253,
4974,
2121,
1006,
2345,
24880,
8569,
2546,
17698,
1007,
1063,
2345,
20014,
1050,
1027,
17698,
1012,
3191,
3085,
3762,
4570,
1006,
1007,
1025,
1013,
1013,
2566,
28699,
1010,
1996,
6286,
1998,
57... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
apache/flink | flink-runtime/src/main/java/org/apache/flink/runtime/state/DefaultOperatorStateBackend.java | DefaultOperatorStateBackend.getBroadcastState | @SuppressWarnings("unchecked")
@Override
public <K, V> BroadcastState<K, V> getBroadcastState(final MapStateDescriptor<K, V> stateDescriptor) throws StateMigrationException {
Preconditions.checkNotNull(stateDescriptor);
String name = Preconditions.checkNotNull(stateDescriptor.getName());
BackendWritableBroadc... | java | @SuppressWarnings("unchecked")
@Override
public <K, V> BroadcastState<K, V> getBroadcastState(final MapStateDescriptor<K, V> stateDescriptor) throws StateMigrationException {
Preconditions.checkNotNull(stateDescriptor);
String name = Preconditions.checkNotNull(stateDescriptor.getName());
BackendWritableBroadc... | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"@",
"Override",
"public",
"<",
"K",
",",
"V",
">",
"BroadcastState",
"<",
"K",
",",
"V",
">",
"getBroadcastState",
"(",
"final",
"MapStateDescriptor",
"<",
"K",
",",
"V",
">",
"stateDescriptor",
")",
"th... | ------------------------------------------------------------------------------------------- | [
"-------------------------------------------------------------------------------------------"
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/state/DefaultOperatorStateBackend.java#L147-L210 | train | Get the broadcast state for the given state descriptor. | [
30522,
1030,
16081,
9028,
5582,
2015,
1006,
1000,
4895,
5403,
18141,
1000,
1007,
1030,
2058,
15637,
2270,
1026,
1047,
1010,
1058,
1028,
8960,
12259,
1026,
1047,
1010,
1058,
1028,
2131,
12618,
4215,
10526,
9153,
2618,
1006,
2345,
7341,
16238... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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/ExcelUtil.java | ExcelUtil.read07BySax | public static Excel07SaxReader read07BySax(File file, int sheetIndex, RowHandler rowHandler) {
try {
return new Excel07SaxReader(rowHandler).read(file, sheetIndex);
} catch (NoClassDefFoundError e) {
throw new DependencyException(ObjectUtil.defaultIfNull(e.getCause(), e), PoiChecker.NO_POI_ERROR_MSG);
... | java | public static Excel07SaxReader read07BySax(File file, int sheetIndex, RowHandler rowHandler) {
try {
return new Excel07SaxReader(rowHandler).read(file, sheetIndex);
} catch (NoClassDefFoundError e) {
throw new DependencyException(ObjectUtil.defaultIfNull(e.getCause(), e), PoiChecker.NO_POI_ERROR_MSG);
... | [
"public",
"static",
"Excel07SaxReader",
"read07BySax",
"(",
"File",
"file",
",",
"int",
"sheetIndex",
",",
"RowHandler",
"rowHandler",
")",
"{",
"try",
"{",
"return",
"new",
"Excel07SaxReader",
"(",
"rowHandler",
")",
".",
"read",
"(",
"file",
",",
"sheetIndex... | Sax方式读取Excel07
@param file 文件
@param sheetIndex Sheet索引,-1表示全部Sheet, 0表示第一个Sheet
@param rowHandler 行处理器
@return {@link Excel07SaxReader}
@since 3.2.0 | [
"Sax方式读取Excel07"
] | bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-poi/src/main/java/cn/hutool/poi/excel/ExcelUtil.java#L106-L112 | train | Reads an Excel file by Sax. | [
30522,
2270,
10763,
24970,
2692,
2581,
3736,
2595,
16416,
4063,
3191,
2692,
2581,
3762,
3736,
2595,
1006,
5371,
5371,
1010,
20014,
7123,
22254,
10288,
1010,
5216,
11774,
3917,
5216,
11774,
3917,
1007,
1063,
3046,
1063,
2709,
2047,
24970,
26... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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-s3-fs-base/src/main/java/org/apache/flink/fs/s3/common/writer/S3RecoverableFsDataOutputStream.java | S3RecoverableFsDataOutputStream.newStream | public static S3RecoverableFsDataOutputStream newStream(
final RecoverableMultiPartUpload upload,
final FunctionWithException<File, RefCountedFile, IOException> tmpFileCreator,
final long userDefinedMinPartSize) throws IOException {
checkArgument(userDefinedMinPartSize >= S3_MULTIPART_MIN_PART_SIZE);
fin... | java | public static S3RecoverableFsDataOutputStream newStream(
final RecoverableMultiPartUpload upload,
final FunctionWithException<File, RefCountedFile, IOException> tmpFileCreator,
final long userDefinedMinPartSize) throws IOException {
checkArgument(userDefinedMinPartSize >= S3_MULTIPART_MIN_PART_SIZE);
fin... | [
"public",
"static",
"S3RecoverableFsDataOutputStream",
"newStream",
"(",
"final",
"RecoverableMultiPartUpload",
"upload",
",",
"final",
"FunctionWithException",
"<",
"File",
",",
"RefCountedFile",
",",
"IOException",
">",
"tmpFileCreator",
",",
"final",
"long",
"userDefin... | ------------------------------------------------------------------------ | [
"------------------------------------------------------------------------"
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-filesystems/flink-s3-fs-base/src/main/java/org/apache/flink/fs/s3/common/writer/S3RecoverableFsDataOutputStream.java#L229-L244 | train | Creates a new stream for a RecoverableMultiPartUpload. | [
30522,
2270,
10763,
1055,
2509,
2890,
3597,
26061,
3468,
10343,
2850,
28555,
4904,
18780,
21422,
2739,
25379,
1006,
2345,
8980,
3085,
12274,
7096,
11514,
8445,
6279,
11066,
2039,
11066,
1010,
2345,
3853,
24415,
10288,
24422,
1026,
5371,
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... |
looly/hutool | hutool-core/src/main/java/cn/hutool/core/io/IoUtil.java | IoUtil.getWriter | public static OutputStreamWriter getWriter(OutputStream out, Charset charset) {
if (null == out) {
return null;
}
if (null == charset) {
return new OutputStreamWriter(out);
} else {
return new OutputStreamWriter(out, charset);
}
} | java | public static OutputStreamWriter getWriter(OutputStream out, Charset charset) {
if (null == out) {
return null;
}
if (null == charset) {
return new OutputStreamWriter(out);
} else {
return new OutputStreamWriter(out, charset);
}
} | [
"public",
"static",
"OutputStreamWriter",
"getWriter",
"(",
"OutputStream",
"out",
",",
"Charset",
"charset",
")",
"{",
"if",
"(",
"null",
"==",
"out",
")",
"{",
"return",
"null",
";",
"}",
"if",
"(",
"null",
"==",
"charset",
")",
"{",
"return",
"new",
... | 获得一个Writer
@param out 输入流
@param charset 字符集
@return OutputStreamWriter对象 | [
"获得一个Writer"
] | bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/io/IoUtil.java#L374-L384 | train | Gets a OutputStreamWriter for writing a UTF - 8 encoded string to the specified output stream using the specified charset. | [
30522,
2270,
10763,
27852,
25379,
15994,
2131,
15994,
1006,
27852,
25379,
2041,
1010,
25869,
13462,
25869,
13462,
1007,
1063,
2065,
1006,
19701,
1027,
1027,
2041,
1007,
1063,
2709,
19701,
1025,
1065,
2065,
1006,
19701,
1027,
1027,
25869,
1346... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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/base/BigIntSerializer.java | BigIntSerializer.writeBigInteger | public static void writeBigInteger(BigInteger record, DataOutputView target) throws IOException {
// null value support
if (record == null) {
target.writeInt(0);
return;
}
// fast paths for 0, 1, 10
// only reference equality is checked because equals would be too expensive
else if (record == BigInteg... | java | public static void writeBigInteger(BigInteger record, DataOutputView target) throws IOException {
// null value support
if (record == null) {
target.writeInt(0);
return;
}
// fast paths for 0, 1, 10
// only reference equality is checked because equals would be too expensive
else if (record == BigInteg... | [
"public",
"static",
"void",
"writeBigInteger",
"(",
"BigInteger",
"record",
",",
"DataOutputView",
"target",
")",
"throws",
"IOException",
"{",
"// null value support",
"if",
"(",
"record",
"==",
"null",
")",
"{",
"target",
".",
"writeInt",
"(",
"0",
")",
";",... | -------------------------------------------------------------------------------------------- | [
"--------------------------------------------------------------------------------------------"
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-core/src/main/java/org/apache/flink/api/common/typeutils/base/BigIntSerializer.java#L89-L114 | train | Write BigInteger. | [
30522,
2270,
10763,
11675,
4339,
5638,
11528,
2618,
4590,
1006,
2502,
18447,
26320,
2501,
1010,
2951,
5833,
18780,
8584,
4539,
1007,
11618,
22834,
10288,
24422,
1063,
1013,
1013,
19701,
3643,
2490,
2065,
1006,
2501,
1027,
1027,
19701,
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... |
networknt/light-4j | server/src/main/java/com/networknt/server/DefaultConfigLoader.java | DefaultConfigLoader.init | @Override
public void init() {
// if it is necessary to load config files from config server
// Here we expect at least env(dev/sit/uat/prod) and optional config server url
if (lightEnv == null) {
logger.warn("Warning! No light-env has been passed in from command line. Defaulting... | java | @Override
public void init() {
// if it is necessary to load config files from config server
// Here we expect at least env(dev/sit/uat/prod) and optional config server url
if (lightEnv == null) {
logger.warn("Warning! No light-env has been passed in from command line. Defaulting... | [
"@",
"Override",
"public",
"void",
"init",
"(",
")",
"{",
"// if it is necessary to load config files from config server",
"// Here we expect at least env(dev/sit/uat/prod) and optional config server url",
"if",
"(",
"lightEnv",
"==",
"null",
")",
"{",
"logger",
".",
"warn",
... | Load config files from light-config-server instance. This is normally only
used when you run light-4j server as standalone java process. If the server
is dockerized and orchestrated by Kubernetes, the config files and secret
will be mapped to Kubernetes ConfigMap and Secret and passed into the
container.
<p>
Of course,... | [
"Load",
"config",
"files",
"from",
"light",
"-",
"config",
"-",
"server",
"instance",
".",
"This",
"is",
"normally",
"only",
"used",
"when",
"you",
"run",
"light",
"-",
"4j",
"server",
"as",
"standalone",
"java",
"process",
".",
"If",
"the",
"server",
"i... | 2a60257c60663684c8f6dc8b5ea3cf184e534db6 | https://github.com/networknt/light-4j/blob/2a60257c60663684c8f6dc8b5ea3cf184e534db6/server/src/main/java/com/networknt/server/DefaultConfigLoader.java#L58-L118 | train | Initializes the application. | [
30522,
1030,
2058,
15637,
2270,
11675,
1999,
4183,
1006,
1007,
1063,
1013,
1013,
2065,
2009,
2003,
4072,
2000,
7170,
9530,
8873,
2290,
6764,
2013,
9530,
8873,
2290,
8241,
1013,
1013,
2182,
2057,
5987,
2012,
2560,
4372,
2615,
1006,
16475,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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.getTables | public static List<String> getTables(DataSource ds, TableType... types) {
return getTables(ds, null, null, types);
} | java | public static List<String> getTables(DataSource ds, TableType... types) {
return getTables(ds, null, null, types);
} | [
"public",
"static",
"List",
"<",
"String",
">",
"getTables",
"(",
"DataSource",
"ds",
",",
"TableType",
"...",
"types",
")",
"{",
"return",
"getTables",
"(",
"ds",
",",
"null",
",",
"null",
",",
"types",
")",
";",
"}"
] | 获得所有表名
@param ds 数据源
@param types 表类型
@return 表名列表 | [
"获得所有表名"
] | bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-db/src/main/java/cn/hutool/db/meta/MetaUtil.java#L43-L45 | train | Get the list of table names for the given data source. | [
30522,
2270,
10763,
2862,
1026,
5164,
1028,
2131,
10880,
2015,
1006,
2951,
6499,
3126,
3401,
16233,
1010,
13855,
18863,
1012,
1012,
1012,
4127,
1007,
1063,
2709,
2131,
10880,
2015,
1006,
16233,
1010,
19701,
1010,
19701,
1010,
4127,
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... |
apache/flink | flink-filesystems/flink-fs-hadoop-shaded/src/main/java/org/apache/hadoop/conf/Configuration.java | Configuration.getConfResourceAsInputStream | public InputStream getConfResourceAsInputStream(String name) {
try {
URL url= getResource(name);
if (url == null) {
LOG.info(name + " not found");
return null;
} else {
LOG.info("found resource " + name + " at " + url);
}
return url.openStream();
} catch (Exception e) {
return null;
... | java | public InputStream getConfResourceAsInputStream(String name) {
try {
URL url= getResource(name);
if (url == null) {
LOG.info(name + " not found");
return null;
} else {
LOG.info("found resource " + name + " at " + url);
}
return url.openStream();
} catch (Exception e) {
return null;
... | [
"public",
"InputStream",
"getConfResourceAsInputStream",
"(",
"String",
"name",
")",
"{",
"try",
"{",
"URL",
"url",
"=",
"getResource",
"(",
"name",
")",
";",
"if",
"(",
"url",
"==",
"null",
")",
"{",
"LOG",
".",
"info",
"(",
"name",
"+",
"\" not found\"... | Get an input stream attached to the configuration resource with the
given <code>name</code>.
@param name configuration resource name.
@return an input stream attached to the resource. | [
"Get",
"an",
"input",
"stream",
"attached",
"to",
"the",
"configuration",
"resource",
"with",
"the",
"given",
"<code",
">",
"name<",
"/",
"code",
">",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-filesystems/flink-fs-hadoop-shaded/src/main/java/org/apache/hadoop/conf/Configuration.java#L2623-L2638 | train | Get a configuration resource as an input stream. | [
30522,
2270,
20407,
25379,
2131,
8663,
19699,
2229,
8162,
21456,
11493,
18780,
21422,
1006,
5164,
2171,
1007,
1063,
3046,
1063,
24471,
2140,
24471,
2140,
1027,
2131,
6072,
8162,
3401,
1006,
2171,
1007,
1025,
2065,
1006,
24471,
2140,
1027,
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... |
alibaba/canal | client-adapter/elasticsearch/src/main/java/com/alibaba/otter/canal/client/adapter/es/service/ESSyncService.java | ESSyncService.subTableSimpleFieldOperation | private void subTableSimpleFieldOperation(ESSyncConfig config, Dml dml, Map<String, Object> data,
Map<String, Object> old, TableItem tableItem) {
ESMapping mapping = config.getEsMapping();
StringBuilder sql = new StringBuilder(
"SELECT * FROM (" ... | java | private void subTableSimpleFieldOperation(ESSyncConfig config, Dml dml, Map<String, Object> data,
Map<String, Object> old, TableItem tableItem) {
ESMapping mapping = config.getEsMapping();
StringBuilder sql = new StringBuilder(
"SELECT * FROM (" ... | [
"private",
"void",
"subTableSimpleFieldOperation",
"(",
"ESSyncConfig",
"config",
",",
"Dml",
"dml",
",",
"Map",
"<",
"String",
",",
"Object",
">",
"data",
",",
"Map",
"<",
"String",
",",
"Object",
">",
"old",
",",
"TableItem",
"tableItem",
")",
"{",
"ESMa... | 关联子查询, 主表简单字段operation
@param config es配置
@param dml dml信息
@param data 单行dml数据
@param old 单行old数据
@param tableItem 当前表配置 | [
"关联子查询",
"主表简单字段operation"
] | 8f088cddc0755f4350c5aaae95c6e4002d90a40f | https://github.com/alibaba/canal/blob/8f088cddc0755f4350c5aaae95c6e4002d90a40f/client-adapter/elasticsearch/src/main/java/com/alibaba/otter/canal/client/adapter/es/service/ESSyncService.java#L584-L667 | train | Sub table simple field operation. | [
30522,
2797,
11675,
4942,
10880,
5332,
23344,
3790,
25918,
3370,
1006,
9686,
6508,
12273,
8663,
8873,
2290,
9530,
8873,
2290,
1010,
1040,
19968,
1040,
19968,
1010,
4949,
1026,
5164,
1010,
4874,
1028,
2951,
1010,
4949,
1026,
5164,
1010,
4874... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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/util/typeutils/FieldAccessorFactory.java | FieldAccessorFactory.getAccessor | @Internal
public static <T, F> FieldAccessor<T, F> getAccessor(TypeInformation<T> typeInfo, String field, ExecutionConfig config) {
// In case of arrays
if (typeInfo instanceof BasicArrayTypeInfo || typeInfo instanceof PrimitiveArrayTypeInfo) {
try {
return new FieldAccessor.ArrayFieldAccessor<>(Integer.pa... | java | @Internal
public static <T, F> FieldAccessor<T, F> getAccessor(TypeInformation<T> typeInfo, String field, ExecutionConfig config) {
// In case of arrays
if (typeInfo instanceof BasicArrayTypeInfo || typeInfo instanceof PrimitiveArrayTypeInfo) {
try {
return new FieldAccessor.ArrayFieldAccessor<>(Integer.pa... | [
"@",
"Internal",
"public",
"static",
"<",
"T",
",",
"F",
">",
"FieldAccessor",
"<",
"T",
",",
"F",
">",
"getAccessor",
"(",
"TypeInformation",
"<",
"T",
">",
"typeInfo",
",",
"String",
"field",
",",
"ExecutionConfig",
"config",
")",
"{",
"// In case of arr... | Creates a {@link FieldAccessor} for the field that is given by a field expression,
which can be used to get and set the specified field on instances of this type.
@param field The field expression
@param config Configuration object
@param <F> The type of the field to access
@return The created FieldAccessor | [
"Creates",
"a",
"{",
"@link",
"FieldAccessor",
"}",
"for",
"the",
"field",
"that",
"is",
"given",
"by",
"a",
"field",
"expression",
"which",
"can",
"be",
"used",
"to",
"get",
"and",
"set",
"the",
"specified",
"field",
"on",
"instances",
"of",
"this",
"ty... | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-streaming-java/src/main/java/org/apache/flink/streaming/util/typeutils/FieldAccessorFactory.java#L102-L197 | train | Gets the FieldAccessor for the given field. | [
30522,
1030,
4722,
2270,
10763,
1026,
1056,
1010,
1042,
1028,
2492,
6305,
9623,
21748,
1026,
1056,
1010,
1042,
1028,
2131,
6305,
9623,
21748,
1006,
2828,
2378,
14192,
3370,
1026,
1056,
1028,
2828,
2378,
14876,
1010,
5164,
2492,
1010,
7781,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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/internal/PendingWrite.java | PendingWrite.failAndRecycle | public boolean failAndRecycle(Throwable cause) {
ReferenceCountUtil.release(msg);
if (promise != null) {
promise.setFailure(cause);
}
return recycle();
} | java | public boolean failAndRecycle(Throwable cause) {
ReferenceCountUtil.release(msg);
if (promise != null) {
promise.setFailure(cause);
}
return recycle();
} | [
"public",
"boolean",
"failAndRecycle",
"(",
"Throwable",
"cause",
")",
"{",
"ReferenceCountUtil",
".",
"release",
"(",
"msg",
")",
";",
"if",
"(",
"promise",
"!=",
"null",
")",
"{",
"promise",
".",
"setFailure",
"(",
"cause",
")",
";",
"}",
"return",
"re... | Fails the underlying {@link Promise} with the given cause and recycle this instance. | [
"Fails",
"the",
"underlying",
"{"
] | ba06eafa1c1824bd154f1a380019e7ea2edf3c4c | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/common/src/main/java/io/netty/util/internal/PendingWrite.java#L64-L70 | train | Fail the exception and recycle the result set. | [
30522,
2270,
22017,
20898,
8246,
5685,
2890,
23490,
1006,
5466,
3085,
3426,
1007,
1063,
4431,
3597,
16671,
21823,
2140,
1012,
2713,
1006,
5796,
2290,
1007,
1025,
2065,
1006,
4872,
999,
1027,
19701,
1007,
1063,
4872,
1012,
2275,
7011,
4014,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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/diagnostics/AbstractFailureAnalyzer.java | AbstractFailureAnalyzer.getCauseType | @SuppressWarnings("unchecked")
protected Class<? extends T> getCauseType() {
return (Class<? extends T>) ResolvableType
.forClass(AbstractFailureAnalyzer.class, getClass()).resolveGeneric();
} | java | @SuppressWarnings("unchecked")
protected Class<? extends T> getCauseType() {
return (Class<? extends T>) ResolvableType
.forClass(AbstractFailureAnalyzer.class, getClass()).resolveGeneric();
} | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"protected",
"Class",
"<",
"?",
"extends",
"T",
">",
"getCauseType",
"(",
")",
"{",
"return",
"(",
"Class",
"<",
"?",
"extends",
"T",
">",
")",
"ResolvableType",
".",
"forClass",
"(",
"AbstractFailureAnalyz... | Return the cause type being handled by the analyzer. By default the class generic
is used.
@return the cause type | [
"Return",
"the",
"cause",
"type",
"being",
"handled",
"by",
"the",
"analyzer",
".",
"By",
"default",
"the",
"class",
"generic",
"is",
"used",
"."
] | 0b27f7c70e164b2b1a96477f1d9c1acba56790c1 | https://github.com/spring-projects/spring-boot/blob/0b27f7c70e164b2b1a96477f1d9c1acba56790c1/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/diagnostics/AbstractFailureAnalyzer.java#L55-L59 | train | Returns the type of the exception that caused this exception. | [
30522,
1030,
16081,
9028,
5582,
2015,
1006,
1000,
4895,
5403,
18141,
1000,
1007,
5123,
2465,
1026,
1029,
8908,
1056,
1028,
2131,
3540,
8557,
13874,
1006,
1007,
1063,
2709,
1006,
2465,
1026,
1029,
8908,
1056,
1028,
1007,
24501,
4747,
12423,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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/codec/Caesar.java | Caesar.encode | public static String encode(String message, int offset) {
final int len = message.length();
final char[] plain = message.toCharArray();
char c;
for (int i = 0; i < len; i++) {
c = message.charAt(i);
if (false == Character.isLetter(c)) {
continue;
}
plain[i] = encodeChar(c, offset);
}... | java | public static String encode(String message, int offset) {
final int len = message.length();
final char[] plain = message.toCharArray();
char c;
for (int i = 0; i < len; i++) {
c = message.charAt(i);
if (false == Character.isLetter(c)) {
continue;
}
plain[i] = encodeChar(c, offset);
}... | [
"public",
"static",
"String",
"encode",
"(",
"String",
"message",
",",
"int",
"offset",
")",
"{",
"final",
"int",
"len",
"=",
"message",
".",
"length",
"(",
")",
";",
"final",
"char",
"[",
"]",
"plain",
"=",
"message",
".",
"toCharArray",
"(",
")",
"... | 传入明文,加密得到密文
@param message 加密的消息
@param offset 偏移量
@return 加密后的内容 | [
"传入明文,加密得到密文"
] | bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/codec/Caesar.java#L22-L34 | train | Encodes a String with the UTF - 8 encoding. | [
30522,
2270,
10763,
5164,
4372,
16044,
1006,
5164,
4471,
1010,
20014,
16396,
1007,
1063,
2345,
20014,
18798,
1027,
4471,
1012,
3091,
1006,
1007,
1025,
2345,
25869,
1031,
1033,
5810,
1027,
4471,
1012,
2000,
7507,
19848,
9447,
1006,
1007,
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... |
alibaba/canal | client/src/main/java/com/alibaba/otter/canal/client/impl/running/ClientRunningMonitor.java | ClientRunningMonitor.check | public boolean check() {
String path = ZookeeperPathUtils.getDestinationClientRunning(this.destination, clientData.getClientId());
try {
byte[] bytes = zkClient.readData(path);
ClientRunningData eventData = JsonUtils.unmarshalFromByte(bytes, ClientRunningData.class);
... | java | public boolean check() {
String path = ZookeeperPathUtils.getDestinationClientRunning(this.destination, clientData.getClientId());
try {
byte[] bytes = zkClient.readData(path);
ClientRunningData eventData = JsonUtils.unmarshalFromByte(bytes, ClientRunningData.class);
... | [
"public",
"boolean",
"check",
"(",
")",
"{",
"String",
"path",
"=",
"ZookeeperPathUtils",
".",
"getDestinationClientRunning",
"(",
"this",
".",
"destination",
",",
"clientData",
".",
"getClientId",
"(",
")",
")",
";",
"try",
"{",
"byte",
"[",
"]",
"bytes",
... | 检查当前的状态 | [
"检查当前的状态"
] | 8f088cddc0755f4350c5aaae95c6e4002d90a40f | https://github.com/alibaba/canal/blob/8f088cddc0755f4350c5aaae95c6e4002d90a40f/client/src/main/java/com/alibaba/otter/canal/client/impl/running/ClientRunningMonitor.java#L173-L198 | train | check if the canal is running in any node | [
30522,
2270,
22017,
20898,
4638,
1006,
1007,
1063,
5164,
4130,
1027,
9201,
13106,
15069,
21823,
4877,
1012,
2131,
6155,
13770,
3508,
20464,
11638,
15532,
5582,
1006,
2023,
1012,
7688,
1010,
7396,
2850,
2696,
1012,
2131,
20464,
11638,
3593,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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/codec/Caesar.java | Caesar.encodeChar | private static char encodeChar(char c, int offset) {
int position = (table.indexOf(c) + offset) % 52;
return table.charAt(position);
} | java | private static char encodeChar(char c, int offset) {
int position = (table.indexOf(c) + offset) % 52;
return table.charAt(position);
} | [
"private",
"static",
"char",
"encodeChar",
"(",
"char",
"c",
",",
"int",
"offset",
")",
"{",
"int",
"position",
"=",
"(",
"table",
".",
"indexOf",
"(",
"c",
")",
"+",
"offset",
")",
"%",
"52",
";",
"return",
"table",
".",
"charAt",
"(",
"position",
... | 加密轮盘
@param c 被加密字符
@param offset 偏移量
@return 加密后的字符 | [
"加密轮盘"
] | bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/codec/Caesar.java#L64-L68 | train | Encode a char. | [
30522,
2797,
10763,
25869,
4372,
16044,
7507,
2099,
1006,
25869,
1039,
1010,
20014,
16396,
1007,
1063,
20014,
2597,
1027,
1006,
2795,
1012,
5950,
11253,
1006,
1039,
1007,
1009,
16396,
1007,
1003,
4720,
1025,
2709,
2795,
1012,
25869,
4017,
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... |
alibaba/canal | server/src/main/java/com/alibaba/otter/canal/server/embedded/CanalServerWithEmbedded.java | CanalServerWithEmbedded.get | @Override
public Message get(ClientIdentity clientIdentity, int batchSize, Long timeout, TimeUnit unit)
throws CanalServerException {
checkStart(clientIdentity.getDestination());
checkSubscribe(clientIde... | java | @Override
public Message get(ClientIdentity clientIdentity, int batchSize, Long timeout, TimeUnit unit)
throws CanalServerException {
checkStart(clientIdentity.getDestination());
checkSubscribe(clientIde... | [
"@",
"Override",
"public",
"Message",
"get",
"(",
"ClientIdentity",
"clientIdentity",
",",
"int",
"batchSize",
",",
"Long",
"timeout",
",",
"TimeUnit",
"unit",
")",
"throws",
"CanalServerException",
"{",
"checkStart",
"(",
"clientIdentity",
".",
"getDestination",
... | 获取数据,可以指定超时时间.
<pre>
几种case:
a. 如果timeout为null,则采用tryGet方式,即时获取
b. 如果timeout不为null
1. timeout为0,则采用get阻塞方式,获取数据,不设置超时,直到有足够的batchSize数据才返回
2. timeout不为0,则采用get+timeout方式,获取数据,超时还没有batchSize足够的数据,有多少返回多少
注意: meta获取和数据的获取需要保证顺序性,优先拿到meta的,一定也会是优先拿到数据,所以需要加同步. (不能出现先拿到meta,拿到第二批数据,这样就会导致数据顺序性出现问题)
</pre> | [
"获取数据,可以指定超时时间",
"."
] | 8f088cddc0755f4350c5aaae95c6e4002d90a40f | https://github.com/alibaba/canal/blob/8f088cddc0755f4350c5aaae95c6e4002d90a40f/server/src/main/java/com/alibaba/otter/canal/server/embedded/CanalServerWithEmbedded.java#L220-L278 | train | Gets a message from the Canal Instance. | [
30522,
1030,
2058,
15637,
2270,
4471,
2131,
1006,
7396,
5178,
16778,
3723,
7396,
5178,
16778,
3723,
1010,
20014,
14108,
5332,
4371,
1010,
2146,
2051,
5833,
1010,
2051,
19496,
2102,
3131,
1007,
11618,
17263,
2121,
28943,
2595,
24422,
1063,
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... |
alibaba/canal | deployer/src/main/java/com/alibaba/otter/canal/deployer/monitor/remote/DbRemoteConfigLoader.java | DbRemoteConfigLoader.loadRemoteConfig | @Override
public Properties loadRemoteConfig() {
Properties properties = null;
try {
// 加载远程canal配置
ConfigItem configItem = getRemoteCanalConfig();
if (configItem != null) {
if (configItem.getModifiedTime() != currentConfigTimestamp) {
... | java | @Override
public Properties loadRemoteConfig() {
Properties properties = null;
try {
// 加载远程canal配置
ConfigItem configItem = getRemoteCanalConfig();
if (configItem != null) {
if (configItem.getModifiedTime() != currentConfigTimestamp) {
... | [
"@",
"Override",
"public",
"Properties",
"loadRemoteConfig",
"(",
")",
"{",
"Properties",
"properties",
"=",
"null",
";",
"try",
"{",
"// 加载远程canal配置",
"ConfigItem",
"configItem",
"=",
"getRemoteCanalConfig",
"(",
")",
";",
"if",
"(",
"configItem",
"!=",
"null",... | 加载远程 canal.properties文件
@return 远程配置的properties | [
"加载远程",
"canal",
".",
"properties文件"
] | 8f088cddc0755f4350c5aaae95c6e4002d90a40f | https://github.com/alibaba/canal/blob/8f088cddc0755f4350c5aaae95c6e4002d90a40f/deployer/src/main/java/com/alibaba/otter/canal/deployer/monitor/remote/DbRemoteConfigLoader.java#L75-L96 | train | Load remote canal config. | [
30522,
1030,
2058,
15637,
2270,
5144,
7170,
28578,
12184,
8663,
8873,
2290,
1006,
1007,
1063,
5144,
5144,
1027,
19701,
1025,
3046,
1063,
1013,
1013,
1779,
100,
100,
100,
5033,
100,
100,
9530,
8873,
23806,
6633,
9530,
8873,
23806,
6633,
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/codec/Base64.java | Base64.decodeStr | public static String decodeStr(String source, String charset) {
return Base64Decoder.decodeStr(source, charset);
} | java | public static String decodeStr(String source, String charset) {
return Base64Decoder.decodeStr(source, charset);
} | [
"public",
"static",
"String",
"decodeStr",
"(",
"String",
"source",
",",
"String",
"charset",
")",
"{",
"return",
"Base64Decoder",
".",
"decodeStr",
"(",
"source",
",",
"charset",
")",
";",
"}"
] | base64解码
@param source 被解码的base64字符串
@param charset 字符集
@return 被加密后的字符串 | [
"base64解码"
] | bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/codec/Base64.java#L266-L268 | train | Decodes a base64 string. | [
30522,
2270,
10763,
5164,
21933,
6155,
16344,
1006,
5164,
3120,
1010,
5164,
25869,
13462,
1007,
1063,
2709,
2918,
21084,
3207,
16044,
2099,
1012,
21933,
6155,
16344,
1006,
3120,
1010,
25869,
13462,
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... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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/jobmaster/slotpool/SchedulerImpl.java | SchedulerImpl.allocateSlot | @Override
public CompletableFuture<LogicalSlot> allocateSlot(
SlotRequestId slotRequestId,
ScheduledUnit scheduledUnit,
SlotProfile slotProfile,
boolean allowQueuedScheduling,
Time allocationTimeout) {
log.debug("Received slot request [{}] for task: {}", slotRequestId, scheduledUnit.getTaskToExecute());
... | java | @Override
public CompletableFuture<LogicalSlot> allocateSlot(
SlotRequestId slotRequestId,
ScheduledUnit scheduledUnit,
SlotProfile slotProfile,
boolean allowQueuedScheduling,
Time allocationTimeout) {
log.debug("Received slot request [{}] for task: {}", slotRequestId, scheduledUnit.getTaskToExecute());
... | [
"@",
"Override",
"public",
"CompletableFuture",
"<",
"LogicalSlot",
">",
"allocateSlot",
"(",
"SlotRequestId",
"slotRequestId",
",",
"ScheduledUnit",
"scheduledUnit",
",",
"SlotProfile",
"slotProfile",
",",
"boolean",
"allowQueuedScheduling",
",",
"Time",
"allocationTimeo... | --------------------------- | [
"---------------------------"
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/jobmaster/slotpool/SchedulerImpl.java#L107-L137 | train | Allocate a slot. | [
30522,
1030,
2058,
15637,
2270,
4012,
10814,
10880,
11263,
11244,
1026,
11177,
14540,
4140,
1028,
2035,
24755,
4570,
10994,
1006,
10453,
2890,
15500,
3593,
10453,
2890,
15500,
3593,
1010,
5115,
19496,
2102,
5115,
19496,
2102,
1010,
10453,
215... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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/seg/Segment.java | Segment.combineWords | private static void combineWords(Vertex[] wordNet, int start, int end, CoreDictionary.Attribute value)
{
if (start + 1 == end) // 小优化,如果只有一个词,那就不需要合并,直接应用新属性
{
wordNet[start].attribute = value;
}
else
{
StringBuilder sbTerm = new StringBuilder();
... | java | private static void combineWords(Vertex[] wordNet, int start, int end, CoreDictionary.Attribute value)
{
if (start + 1 == end) // 小优化,如果只有一个词,那就不需要合并,直接应用新属性
{
wordNet[start].attribute = value;
}
else
{
StringBuilder sbTerm = new StringBuilder();
... | [
"private",
"static",
"void",
"combineWords",
"(",
"Vertex",
"[",
"]",
"wordNet",
",",
"int",
"start",
",",
"int",
"end",
",",
"CoreDictionary",
".",
"Attribute",
"value",
")",
"{",
"if",
"(",
"start",
"+",
"1",
"==",
"end",
")",
"// 小优化,如果只有一个词,那就不需要合并,直接应... | 将连续的词语合并为一个
@param wordNet 词图
@param start 起始下标(包含)
@param end 结束下标(不包含)
@param value 新的属性 | [
"将连续的词语合并为一个"
] | a538d0722ab2e4980a9dcd9ea40324fc3ddba7ce | https://github.com/hankcs/HanLP/blob/a538d0722ab2e4980a9dcd9ea40324fc3ddba7ce/src/main/java/com/hankcs/hanlp/seg/Segment.java#L331-L349 | train | Combine words. | [
30522,
2797,
10763,
11675,
11506,
22104,
1006,
19449,
1031,
1033,
2773,
7159,
1010,
20014,
2707,
1010,
20014,
2203,
1010,
4563,
29201,
3258,
5649,
1012,
17961,
3643,
1007,
1063,
2065,
1006,
2707,
1009,
1015,
1027,
1027,
2203,
1007,
1013,
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... |
netty/netty | transport-native-epoll/src/main/java/io/netty/channel/epoll/EpollSocketChannelConfig.java | EpollSocketChannelConfig.setIpTransparent | public EpollSocketChannelConfig setIpTransparent(boolean transparent) {
try {
((EpollSocketChannel) channel).socket.setIpTransparent(transparent);
return this;
} catch (IOException e) {
throw new ChannelException(e);
}
} | java | public EpollSocketChannelConfig setIpTransparent(boolean transparent) {
try {
((EpollSocketChannel) channel).socket.setIpTransparent(transparent);
return this;
} catch (IOException e) {
throw new ChannelException(e);
}
} | [
"public",
"EpollSocketChannelConfig",
"setIpTransparent",
"(",
"boolean",
"transparent",
")",
"{",
"try",
"{",
"(",
"(",
"EpollSocketChannel",
")",
"channel",
")",
".",
"socket",
".",
"setIpTransparent",
"(",
"transparent",
")",
";",
"return",
"this",
";",
"}",
... | If {@code true} is used <a href="http://man7.org/linux/man-pages/man7/ip.7.html">IP_TRANSPARENT</a> is enabled,
{@code false} for disable it. Default is disabled. | [
"If",
"{"
] | ba06eafa1c1824bd154f1a380019e7ea2edf3c4c | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/transport-native-epoll/src/main/java/io/netty/channel/epoll/EpollSocketChannelConfig.java#L504-L511 | train | Sets the transparent flag on the socket. | [
30522,
2270,
4958,
14511,
6499,
19869,
10649,
20147,
22499,
2078,
8873,
2290,
2275,
11514,
6494,
3619,
19362,
4765,
1006,
22017,
20898,
13338,
1007,
1063,
3046,
1063,
1006,
1006,
4958,
14511,
6499,
19869,
10649,
20147,
2140,
1007,
3149,
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... |
looly/hutool | hutool-core/src/main/java/cn/hutool/core/text/csv/CsvWriter.java | CsvWriter.doAppendLine | private void doAppendLine(final String... fields) throws IOException {
if (null != fields) {
for (int i = 0; i < fields.length; i++) {
appendField(fields[i]);
}
writer.write(config.lineDelimiter);
newline = true;
}
} | java | private void doAppendLine(final String... fields) throws IOException {
if (null != fields) {
for (int i = 0; i < fields.length; i++) {
appendField(fields[i]);
}
writer.write(config.lineDelimiter);
newline = true;
}
} | [
"private",
"void",
"doAppendLine",
"(",
"final",
"String",
"...",
"fields",
")",
"throws",
"IOException",
"{",
"if",
"(",
"null",
"!=",
"fields",
")",
"{",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"fields",
".",
"length",
";",
"i",
"++",
")... | 追加一行,末尾会自动换行,但是追加前不会换行
@param fields 字段列表 ({@code null} 值会被做为空值追加)
@throws IOException IO异常 | [
"追加一行,末尾会自动换行,但是追加前不会换行"
] | bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/text/csv/CsvWriter.java#L247-L255 | train | Append a line to the output. | [
30522,
2797,
11675,
2079,
29098,
10497,
4179,
1006,
2345,
5164,
1012,
1012,
1012,
4249,
1007,
11618,
22834,
10288,
24422,
1063,
2065,
1006,
19701,
999,
1027,
4249,
1007,
1063,
2005,
1006,
20014,
1045,
1027,
1014,
1025,
1045,
1026,
4249,
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-runtime/src/main/java/org/apache/flink/runtime/state/KeyGroupRange.java | KeyGroupRange.getIntersection | public KeyGroupRange getIntersection(KeyGroupRange other) {
int start = Math.max(startKeyGroup, other.startKeyGroup);
int end = Math.min(endKeyGroup, other.endKeyGroup);
return start <= end ? new KeyGroupRange(start, end) : EMPTY_KEY_GROUP_RANGE;
} | java | public KeyGroupRange getIntersection(KeyGroupRange other) {
int start = Math.max(startKeyGroup, other.startKeyGroup);
int end = Math.min(endKeyGroup, other.endKeyGroup);
return start <= end ? new KeyGroupRange(start, end) : EMPTY_KEY_GROUP_RANGE;
} | [
"public",
"KeyGroupRange",
"getIntersection",
"(",
"KeyGroupRange",
"other",
")",
"{",
"int",
"start",
"=",
"Math",
".",
"max",
"(",
"startKeyGroup",
",",
"other",
".",
"startKeyGroup",
")",
";",
"int",
"end",
"=",
"Math",
".",
"min",
"(",
"endKeyGroup",
"... | Create a range that represent the intersection between this range and the given range.
@param other A KeyGroupRange to intersect.
@return Key-group range that is the intersection between this and the given key-group range. | [
"Create",
"a",
"range",
"that",
"represent",
"the",
"intersection",
"between",
"this",
"range",
"and",
"the",
"given",
"range",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/state/KeyGroupRange.java#L80-L84 | train | Gets the intersection of this range and the given range. | [
30522,
2270,
3145,
17058,
24388,
2063,
2131,
18447,
2545,
18491,
1006,
3145,
17058,
24388,
2063,
2060,
1007,
1063,
20014,
2707,
1027,
8785,
1012,
4098,
1006,
2707,
14839,
17058,
1010,
2060,
1012,
2707,
14839,
17058,
1007,
1025,
20014,
2203,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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/util/SegmentsUtil.java | SegmentsUtil.bitGet | public static boolean bitGet(MemorySegment[] segments, int baseOffset, int index) {
int offset = baseOffset + ((index & BIT_BYTE_POSITION_MASK) >>> 3);
byte current = getByte(segments, offset);
return (current & (1 << (index & BIT_BYTE_INDEX_MASK))) != 0;
} | java | public static boolean bitGet(MemorySegment[] segments, int baseOffset, int index) {
int offset = baseOffset + ((index & BIT_BYTE_POSITION_MASK) >>> 3);
byte current = getByte(segments, offset);
return (current & (1 << (index & BIT_BYTE_INDEX_MASK))) != 0;
} | [
"public",
"static",
"boolean",
"bitGet",
"(",
"MemorySegment",
"[",
"]",
"segments",
",",
"int",
"baseOffset",
",",
"int",
"index",
")",
"{",
"int",
"offset",
"=",
"baseOffset",
"+",
"(",
"(",
"index",
"&",
"BIT_BYTE_POSITION_MASK",
")",
">>>",
"3",
")",
... | read bit from segments.
@param segments target segments.
@param baseOffset bits base offset.
@param index bit index from base offset. | [
"read",
"bit",
"from",
"segments",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-table/flink-table-runtime-blink/src/main/java/org/apache/flink/table/util/SegmentsUtil.java#L522-L526 | train | get bit from segments. | [
30522,
2270,
10763,
22017,
20898,
2978,
18150,
1006,
3638,
3366,
21693,
4765,
1031,
1033,
9214,
1010,
20014,
2918,
27475,
3388,
1010,
20014,
5950,
1007,
1063,
20014,
16396,
1027,
2918,
27475,
3388,
1009,
1006,
1006,
5950,
1004,
2978,
1035,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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.unzip | public static File unzip(String zipFilePath, String outFileDir, Charset charset) throws UtilException {
return unzip(FileUtil.file(zipFilePath), FileUtil.mkdir(outFileDir), charset);
} | java | public static File unzip(String zipFilePath, String outFileDir, Charset charset) throws UtilException {
return unzip(FileUtil.file(zipFilePath), FileUtil.mkdir(outFileDir), charset);
} | [
"public",
"static",
"File",
"unzip",
"(",
"String",
"zipFilePath",
",",
"String",
"outFileDir",
",",
"Charset",
"charset",
")",
"throws",
"UtilException",
"{",
"return",
"unzip",
"(",
"FileUtil",
".",
"file",
"(",
"zipFilePath",
")",
",",
"FileUtil",
".",
"m... | 解压
@param zipFilePath 压缩文件的路径
@param outFileDir 解压到的目录
@param charset 编码
@return 解压的目录
@throws UtilException IO异常 | [
"解压"
] | bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/util/ZipUtil.java#L358-L360 | train | Unzip a file to a file system. | [
30522,
2270,
10763,
5371,
4895,
5831,
2361,
1006,
5164,
14101,
8873,
2571,
15069,
1010,
5164,
2041,
8873,
3709,
4313,
1010,
25869,
13462,
25869,
13462,
1007,
11618,
21183,
9463,
2595,
24422,
1063,
2709,
4895,
5831,
2361,
1006,
5371,
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... |
looly/hutool | hutool-core/src/main/java/cn/hutool/core/io/file/FileCopier.java | FileCopier.create | public static FileCopier create(String srcPath, String destPath) {
return new FileCopier(FileUtil.file(srcPath), FileUtil.file(destPath));
} | java | public static FileCopier create(String srcPath, String destPath) {
return new FileCopier(FileUtil.file(srcPath), FileUtil.file(destPath));
} | [
"public",
"static",
"FileCopier",
"create",
"(",
"String",
"srcPath",
",",
"String",
"destPath",
")",
"{",
"return",
"new",
"FileCopier",
"(",
"FileUtil",
".",
"file",
"(",
"srcPath",
")",
",",
"FileUtil",
".",
"file",
"(",
"destPath",
")",
")",
";",
"}"... | 新建一个文件复制器
@param srcPath 源文件路径(相对ClassPath路径或绝对路径)
@param destPath 目标文件路径(相对ClassPath路径或绝对路径)
@return {@link FileCopier} | [
"新建一个文件复制器"
] | bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/io/file/FileCopier.java#L47-L49 | train | Create a new file copier. | [
30522,
2270,
10763,
5371,
3597,
14756,
2099,
3443,
1006,
5164,
5034,
21906,
8988,
1010,
5164,
4078,
25856,
8988,
1007,
1063,
2709,
2047,
5371,
3597,
14756,
2099,
1006,
5371,
21823,
2140,
1012,
5371,
1006,
5034,
21906,
8988,
1007,
1010,
5371... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
netty/netty | transport-udt/src/main/java/io/netty/channel/udt/nio/NioUdtProvider.java | NioUdtProvider.newConnectorChannelUDT | static SocketChannelUDT newConnectorChannelUDT(final TypeUDT type) {
try {
return SelectorProviderUDT.from(type).openSocketChannel();
} catch (final IOException e) {
throw new ChannelException("failed to open a socket channel", e);
}
} | java | static SocketChannelUDT newConnectorChannelUDT(final TypeUDT type) {
try {
return SelectorProviderUDT.from(type).openSocketChannel();
} catch (final IOException e) {
throw new ChannelException("failed to open a socket channel", e);
}
} | [
"static",
"SocketChannelUDT",
"newConnectorChannelUDT",
"(",
"final",
"TypeUDT",
"type",
")",
"{",
"try",
"{",
"return",
"SelectorProviderUDT",
".",
"from",
"(",
"type",
")",
".",
"openSocketChannel",
"(",
")",
";",
"}",
"catch",
"(",
"final",
"IOException",
"... | Convenience factory for {@link KindUDT#CONNECTOR} channels. | [
"Convenience",
"factory",
"for",
"{"
] | ba06eafa1c1824bd154f1a380019e7ea2edf3c4c | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/transport-udt/src/main/java/io/netty/channel/udt/nio/NioUdtProvider.java#L148-L154 | train | Creates a new connector channel. | [
30522,
10763,
22278,
26058,
6784,
2102,
2047,
8663,
2638,
16761,
26058,
6784,
2102,
1006,
2345,
2828,
6784,
2102,
2828,
1007,
1063,
3046,
1063,
2709,
27000,
21572,
17258,
2121,
6784,
2102,
1012,
2013,
1006,
2828,
1007,
1012,
7480,
7432,
338... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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/runtime/operators/windowing/WindowOperator.java | WindowOperator.clearAllState | private void clearAllState(
W window,
AppendingState<IN, ACC> windowState,
MergingWindowSet<W> mergingWindows) throws Exception {
windowState.clear();
triggerContext.clear();
processContext.window = window;
processContext.clear();
if (mergingWindows != null) {
mergingWindows.retireWindow(window);
... | java | private void clearAllState(
W window,
AppendingState<IN, ACC> windowState,
MergingWindowSet<W> mergingWindows) throws Exception {
windowState.clear();
triggerContext.clear();
processContext.window = window;
processContext.clear();
if (mergingWindows != null) {
mergingWindows.retireWindow(window);
... | [
"private",
"void",
"clearAllState",
"(",
"W",
"window",
",",
"AppendingState",
"<",
"IN",
",",
"ACC",
">",
"windowState",
",",
"MergingWindowSet",
"<",
"W",
">",
"mergingWindows",
")",
"throws",
"Exception",
"{",
"windowState",
".",
"clear",
"(",
")",
";",
... | Drops all state for the given window and calls
{@link Trigger#clear(Window, Trigger.TriggerContext)}.
<p>The caller must ensure that the
correct key is set in the state backend and the triggerContext object. | [
"Drops",
"all",
"state",
"for",
"the",
"given",
"window",
"and",
"calls",
"{",
"@link",
"Trigger#clear",
"(",
"Window",
"Trigger",
".",
"TriggerContext",
")",
"}",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-streaming-java/src/main/java/org/apache/flink/streaming/runtime/operators/windowing/WindowOperator.java#L525-L537 | train | Clear all state of the window. | [
30522,
2797,
11675,
3154,
8095,
9153,
2618,
1006,
1059,
3332,
1010,
10439,
18537,
9153,
2618,
1026,
1999,
1010,
16222,
1028,
3645,
12259,
1010,
16468,
11101,
15568,
3388,
1026,
1059,
1028,
16468,
11101,
15568,
1007,
11618,
6453,
1063,
3645,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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/library/clustering/directed/LocalClusteringCoefficient.java | LocalClusteringCoefficient.runInternal | @Override
public DataSet<Result<K>> runInternal(Graph<K, VV, EV> input)
throws Exception {
// u, v, w, bitmask
DataSet<TriangleListing.Result<K>> triangles = input
.run(new TriangleListing<K, VV, EV>()
.setParallelism(parallelism));
// u, edge count
DataSet<Tuple2<K, LongValue>> triangleVertices = t... | java | @Override
public DataSet<Result<K>> runInternal(Graph<K, VV, EV> input)
throws Exception {
// u, v, w, bitmask
DataSet<TriangleListing.Result<K>> triangles = input
.run(new TriangleListing<K, VV, EV>()
.setParallelism(parallelism));
// u, edge count
DataSet<Tuple2<K, LongValue>> triangleVertices = t... | [
"@",
"Override",
"public",
"DataSet",
"<",
"Result",
"<",
"K",
">",
">",
"runInternal",
"(",
"Graph",
"<",
"K",
",",
"VV",
",",
"EV",
">",
"input",
")",
"throws",
"Exception",
"{",
"// u, v, w, bitmask",
"DataSet",
"<",
"TriangleListing",
".",
"Result",
... | /*
Implementation notes:
The requirement that "K extends CopyableValue<K>" can be removed when
removed from TriangleListing.
CountVertices can be replaced by ".sum(1)" when Flink aggregators use
code generation. | [
"/",
"*",
"Implementation",
"notes",
":"
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-libraries/flink-gelly/src/main/java/org/apache/flink/graph/library/clustering/directed/LocalClusteringCoefficient.java#L112-L147 | train | This method is used to run the Clustering algorithm on the input Graph. | [
30522,
1030,
2058,
15637,
2270,
2951,
13462,
1026,
2765,
1026,
1047,
1028,
1028,
2448,
18447,
11795,
2389,
1006,
10629,
1026,
1047,
1010,
1058,
2615,
1010,
23408,
1028,
7953,
1007,
11618,
6453,
1063,
1013,
1013,
1057,
1010,
1058,
30524,
261... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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/jobmaster/slotpool/SlotPoolImpl.java | SlotPoolImpl.start | public void start(
@Nonnull JobMasterId jobMasterId,
@Nonnull String newJobManagerAddress,
@Nonnull ComponentMainThreadExecutor componentMainThreadExecutor) throws Exception {
this.jobMasterId = jobMasterId;
this.jobManagerAddress = newJobManagerAddress;
this.componentMainThreadExecutor = componentMainThre... | java | public void start(
@Nonnull JobMasterId jobMasterId,
@Nonnull String newJobManagerAddress,
@Nonnull ComponentMainThreadExecutor componentMainThreadExecutor) throws Exception {
this.jobMasterId = jobMasterId;
this.jobManagerAddress = newJobManagerAddress;
this.componentMainThreadExecutor = componentMainThre... | [
"public",
"void",
"start",
"(",
"@",
"Nonnull",
"JobMasterId",
"jobMasterId",
",",
"@",
"Nonnull",
"String",
"newJobManagerAddress",
",",
"@",
"Nonnull",
"ComponentMainThreadExecutor",
"componentMainThreadExecutor",
")",
"throws",
"Exception",
"{",
"this",
".",
"jobMa... | Start the slot pool to accept RPC calls.
@param jobMasterId The necessary leader id for running the job.
@param newJobManagerAddress for the slot requests which are sent to the resource manager
@param componentMainThreadExecutor The main thread executor for the job master's main thread. | [
"Start",
"the",
"slot",
"pool",
"to",
"accept",
"RPC",
"calls",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/jobmaster/slotpool/SlotPoolImpl.java#L173-L187 | train | Start the job manager. | [
30522,
2270,
11675,
2707,
1006,
1030,
2512,
11231,
3363,
3105,
8706,
3593,
3105,
8706,
3593,
1010,
1030,
2512,
11231,
3363,
5164,
2047,
5558,
25526,
5162,
4590,
4215,
16200,
4757,
1010,
1030,
2512,
11231,
3363,
6922,
24238,
2705,
16416,
320... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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-cli/src/main/java/org/springframework/boot/cli/compiler/DependencyCustomizer.java | DependencyCustomizer.ifAnyMissingClasses | public DependencyCustomizer ifAnyMissingClasses(String... classNames) {
return new DependencyCustomizer(this) {
@Override
protected boolean canAdd() {
for (String className : classNames) {
try {
DependencyCustomizer.this.loader.loadClass(className);
}
catch (Exception ex) {
return... | java | public DependencyCustomizer ifAnyMissingClasses(String... classNames) {
return new DependencyCustomizer(this) {
@Override
protected boolean canAdd() {
for (String className : classNames) {
try {
DependencyCustomizer.this.loader.loadClass(className);
}
catch (Exception ex) {
return... | [
"public",
"DependencyCustomizer",
"ifAnyMissingClasses",
"(",
"String",
"...",
"classNames",
")",
"{",
"return",
"new",
"DependencyCustomizer",
"(",
"this",
")",
"{",
"@",
"Override",
"protected",
"boolean",
"canAdd",
"(",
")",
"{",
"for",
"(",
"String",
"classN... | Create a nested {@link DependencyCustomizer} that only applies if any of the
specified class names are not on the class path.
@param classNames the class names to test
@return a nested {@link DependencyCustomizer} | [
"Create",
"a",
"nested",
"{"
] | 0b27f7c70e164b2b1a96477f1d9c1acba56790c1 | https://github.com/spring-projects/spring-boot/blob/0b27f7c70e164b2b1a96477f1d9c1acba56790c1/spring-boot-project/spring-boot-cli/src/main/java/org/springframework/boot/cli/compiler/DependencyCustomizer.java#L91-L106 | train | Creates a dependency customizer that will add classes that are missing from the classpath. | [
30522,
2270,
24394,
7874,
20389,
17629,
2065,
19092,
15630,
7741,
26266,
2229,
1006,
5164,
1012,
1012,
1012,
2465,
18442,
2015,
1007,
1063,
2709,
2047,
24394,
7874,
20389,
17629,
1006,
2023,
1007,
1063,
1030,
2058,
15637,
5123,
22017,
20898,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
SeleniumHQ/selenium | java/client/src/org/openqa/selenium/support/ui/ExpectedConditions.java | ExpectedConditions.elementToBeClickable | public static ExpectedCondition<WebElement> elementToBeClickable(final WebElement element) {
return new ExpectedCondition<WebElement>() {
@Override
public WebElement apply(WebDriver driver) {
WebElement visibleElement = visibilityOf(element).apply(driver);
try {
if (visibleEle... | java | public static ExpectedCondition<WebElement> elementToBeClickable(final WebElement element) {
return new ExpectedCondition<WebElement>() {
@Override
public WebElement apply(WebDriver driver) {
WebElement visibleElement = visibilityOf(element).apply(driver);
try {
if (visibleEle... | [
"public",
"static",
"ExpectedCondition",
"<",
"WebElement",
">",
"elementToBeClickable",
"(",
"final",
"WebElement",
"element",
")",
"{",
"return",
"new",
"ExpectedCondition",
"<",
"WebElement",
">",
"(",
")",
"{",
"@",
"Override",
"public",
"WebElement",
"apply",... | An expectation for checking an element is visible and enabled such that you can click it.
@param element the WebElement
@return the (same) WebElement once it is clickable (visible and enabled) | [
"An",
"expectation",
"for",
"checking",
"an",
"element",
"is",
"visible",
"and",
"enabled",
"such",
"that",
"you",
"can",
"click",
"it",
"."
] | 7af172729f17b20269c8ca4ea6f788db48616535 | https://github.com/SeleniumHQ/selenium/blob/7af172729f17b20269c8ca4ea6f788db48616535/java/client/src/org/openqa/selenium/support/ui/ExpectedConditions.java#L665-L686 | train | An expectation for checking that an element is clickable. | [
30522,
2270,
10763,
3517,
8663,
20562,
1026,
4773,
12260,
3672,
1028,
5783,
3406,
4783,
20464,
6799,
3085,
1006,
2345,
4773,
12260,
3672,
5783,
1007,
1063,
2709,
2047,
3517,
8663,
20562,
1026,
4773,
12260,
3672,
1028,
1006,
1007,
1063,
1030... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
SeleniumHQ/selenium | java/client/src/org/openqa/selenium/support/ui/Quotes.java | Quotes.escape | @SuppressWarnings("JavaDoc")
public static String escape(String toEscape) {
if (toEscape.contains("\"") && toEscape.contains("'")) {
boolean quoteIsLast = false;
if (toEscape.lastIndexOf("\"") == toEscape.length() - 1) {
quoteIsLast = true;
}
String[] substringsWithoutQuotes = toEs... | java | @SuppressWarnings("JavaDoc")
public static String escape(String toEscape) {
if (toEscape.contains("\"") && toEscape.contains("'")) {
boolean quoteIsLast = false;
if (toEscape.lastIndexOf("\"") == toEscape.length() - 1) {
quoteIsLast = true;
}
String[] substringsWithoutQuotes = toEs... | [
"@",
"SuppressWarnings",
"(",
"\"JavaDoc\"",
")",
"public",
"static",
"String",
"escape",
"(",
"String",
"toEscape",
")",
"{",
"if",
"(",
"toEscape",
".",
"contains",
"(",
"\"\\\"\"",
")",
"&&",
"toEscape",
".",
"contains",
"(",
"\"'\"",
")",
")",
"{",
"... | Convert strings with both quotes and ticks into a valid xpath component
For example,
<p>
{@code foo} will be converted to {@code "foo"},
</p>
<p>
{@code f"oo} will be converted to {@code 'f"oo'},
</p>
<p>
{@code foo'"bar} will be converted to {@code concat("foo'", '"', "bar")}
</p>
@param toEscape a text to escape q... | [
"Convert",
"strings",
"with",
"both",
"quotes",
"and",
"ticks",
"into",
"a",
"valid",
"xpath",
"component"
] | 7af172729f17b20269c8ca4ea6f788db48616535 | https://github.com/SeleniumHQ/selenium/blob/7af172729f17b20269c8ca4ea6f788db48616535/java/client/src/org/openqa/selenium/support/ui/Quotes.java#L40-L66 | train | Escape a string into a single quoted string. | [
30522,
1030,
16081,
9028,
5582,
2015,
1006,
1000,
9262,
3527,
2278,
1000,
1007,
2270,
10763,
5164,
4019,
1006,
5164,
10393,
19464,
1007,
1063,
2065,
1006,
10393,
19464,
1012,
3397,
1006,
1000,
1032,
1000,
1000,
1007,
1004,
1004,
10393,
1946... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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/lexer/analyzer/Tokenizer.java | Tokenizer.scanHexDecimal | public Token scanHexDecimal() {
int length = HEX_BEGIN_SYMBOL_LENGTH;
if ('-' == charAt(offset + length)) {
length++;
}
while (isHex(charAt(offset + length))) {
length++;
}
return new Token(Literals.HEX, input.substring(offset, offset + length), of... | java | public Token scanHexDecimal() {
int length = HEX_BEGIN_SYMBOL_LENGTH;
if ('-' == charAt(offset + length)) {
length++;
}
while (isHex(charAt(offset + length))) {
length++;
}
return new Token(Literals.HEX, input.substring(offset, offset + length), of... | [
"public",
"Token",
"scanHexDecimal",
"(",
")",
"{",
"int",
"length",
"=",
"HEX_BEGIN_SYMBOL_LENGTH",
";",
"if",
"(",
"'",
"'",
"==",
"charAt",
"(",
"offset",
"+",
"length",
")",
")",
"{",
"length",
"++",
";",
"}",
"while",
"(",
"isHex",
"(",
"charAt",
... | scan hex decimal.
@return hex decimal token | [
"scan",
"hex",
"decimal",
"."
] | 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/lexer/analyzer/Tokenizer.java#L217-L226 | train | scanHexDecimal returns a Token representing a hex decimal. | [
30522,
2270,
19204,
13594,
5369,
2595,
3207,
6895,
9067,
1006,
1007,
1063,
20014,
3091,
1027,
2002,
2595,
1035,
4088,
1035,
6454,
1035,
3091,
1025,
2065,
1006,
1005,
1011,
1005,
1027,
1027,
25869,
4017,
1006,
16396,
1009,
3091,
1007,
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-table/flink-table-runtime-blink/src/main/java/org/apache/flink/table/runtime/functions/SqlLikeChainChecker.java | SqlLikeChainChecker.checkBegin | private static boolean checkBegin(
BinaryString pattern, MemorySegment[] segments, int start, int len) {
int lenSub = pattern.getSizeInBytes();
return len >= lenSub &&
SegmentsUtil.equals(pattern.getSegments(), 0, segments, start, lenSub);
} | java | private static boolean checkBegin(
BinaryString pattern, MemorySegment[] segments, int start, int len) {
int lenSub = pattern.getSizeInBytes();
return len >= lenSub &&
SegmentsUtil.equals(pattern.getSegments(), 0, segments, start, lenSub);
} | [
"private",
"static",
"boolean",
"checkBegin",
"(",
"BinaryString",
"pattern",
",",
"MemorySegment",
"[",
"]",
"segments",
",",
"int",
"start",
",",
"int",
"len",
")",
"{",
"int",
"lenSub",
"=",
"pattern",
".",
"getSizeInBytes",
"(",
")",
";",
"return",
"le... | Matches the beginning of each string to a pattern. | [
"Matches",
"the",
"beginning",
"of",
"each",
"string",
"to",
"a",
"pattern",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-table/flink-table-runtime-blink/src/main/java/org/apache/flink/table/runtime/functions/SqlLikeChainChecker.java#L140-L145 | train | Check if the beginning of the segment is the same as the beginning of the pattern. | [
30522,
2797,
10763,
22017,
20898,
4638,
4783,
11528,
1006,
12441,
3367,
4892,
5418,
1010,
3638,
3366,
21693,
4765,
1031,
1033,
9214,
1010,
20014,
2707,
1010,
20014,
18798,
1007,
1063,
20014,
10014,
12083,
1027,
5418,
1012,
4152,
4697,
2378,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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/config/entries/DeploymentEntry.java | DeploymentEntry.getCommandLine | public CommandLine getCommandLine(Options commandLineOptions) throws Exception {
final List<String> args = new ArrayList<>();
properties.asMap().forEach((k, v) -> {
// only add supported options
if (commandLineOptions.hasOption(k)) {
final Option o = commandLineOptions.getOption(k);
final String argu... | java | public CommandLine getCommandLine(Options commandLineOptions) throws Exception {
final List<String> args = new ArrayList<>();
properties.asMap().forEach((k, v) -> {
// only add supported options
if (commandLineOptions.hasOption(k)) {
final Option o = commandLineOptions.getOption(k);
final String argu... | [
"public",
"CommandLine",
"getCommandLine",
"(",
"Options",
"commandLineOptions",
")",
"throws",
"Exception",
"{",
"final",
"List",
"<",
"String",
">",
"args",
"=",
"new",
"ArrayList",
"<>",
"(",
")",
";",
"properties",
".",
"asMap",
"(",
")",
".",
"forEach",... | Parses the given command line options from the deployment properties. Ignores properties
that are not defined by options. | [
"Parses",
"the",
"given",
"command",
"line",
"options",
"from",
"the",
"deployment",
"properties",
".",
"Ignores",
"properties",
"that",
"are",
"not",
"defined",
"by",
"options",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-table/flink-sql-client/src/main/java/org/apache/flink/table/client/config/entries/DeploymentEntry.java#L89-L118 | train | Get the command line. | [
30522,
2270,
3094,
4179,
2131,
9006,
2386,
19422,
3170,
1006,
7047,
3094,
4179,
7361,
9285,
1007,
11618,
6453,
1063,
2345,
2862,
1026,
5164,
1028,
12098,
5620,
1027,
2047,
9140,
9863,
1026,
1028,
1006,
1007,
1025,
5144,
1012,
2004,
2863,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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/Schema.java | Schema.field | public Schema field(String fieldName, String fieldType) {
if (tableSchema.containsKey(fieldName)) {
throw new ValidationException("Duplicate field name $fieldName.");
}
LinkedHashMap<String, String> fieldProperties = new LinkedHashMap<>();
fieldProperties.put(SCHEMA_TYPE, fieldType);
tableSchema.put(fiel... | java | public Schema field(String fieldName, String fieldType) {
if (tableSchema.containsKey(fieldName)) {
throw new ValidationException("Duplicate field name $fieldName.");
}
LinkedHashMap<String, String> fieldProperties = new LinkedHashMap<>();
fieldProperties.put(SCHEMA_TYPE, fieldType);
tableSchema.put(fiel... | [
"public",
"Schema",
"field",
"(",
"String",
"fieldName",
",",
"String",
"fieldType",
")",
"{",
"if",
"(",
"tableSchema",
".",
"containsKey",
"(",
"fieldName",
")",
")",
"{",
"throw",
"new",
"ValidationException",
"(",
"\"Duplicate field name $fieldName.\"",
")",
... | Adds a field with the field name and the type string. Required.
This method can be called multiple times. The call order of this method defines
also the order of the fields in a row.
@param fieldName the field name
@param fieldType the type string of the field | [
"Adds",
"a",
"field",
"with",
"the",
"field",
"name",
"and",
"the",
"type",
"string",
".",
"Required",
".",
"This",
"method",
"can",
"be",
"called",
"multiple",
"times",
".",
"The",
"call",
"order",
"of",
"this",
"method",
"defines",
"also",
"the",
"orde... | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-table/flink-table-common/src/main/java/org/apache/flink/table/descriptors/Schema.java#L89-L101 | train | Add a field to the schema. | [
30522,
2270,
8040,
28433,
2492,
1006,
5164,
2492,
18442,
1010,
5164,
2492,
13874,
1007,
1063,
2065,
1006,
7251,
5403,
2863,
1012,
3397,
14839,
1006,
2492,
18442,
1007,
1007,
1063,
5466,
2047,
27354,
10288,
24422,
1006,
1000,
24473,
2492,
21... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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/rpc/RpcEndpoint.java | RpcEndpoint.scheduleRunAsync | protected void scheduleRunAsync(Runnable runnable, long delay, TimeUnit unit) {
rpcServer.scheduleRunAsync(runnable, unit.toMillis(delay));
} | java | protected void scheduleRunAsync(Runnable runnable, long delay, TimeUnit unit) {
rpcServer.scheduleRunAsync(runnable, unit.toMillis(delay));
} | [
"protected",
"void",
"scheduleRunAsync",
"(",
"Runnable",
"runnable",
",",
"long",
"delay",
",",
"TimeUnit",
"unit",
")",
"{",
"rpcServer",
".",
"scheduleRunAsync",
"(",
"runnable",
",",
"unit",
".",
"toMillis",
"(",
"delay",
")",
")",
";",
"}"
] | Execute the runnable in the main thread of the underlying RPC endpoint, with
a delay of the given number of milliseconds.
@param runnable Runnable to be executed
@param delay The delay after which the runnable will be executed | [
"Execute",
"the",
"runnable",
"in",
"the",
"main",
"thread",
"of",
"the",
"underlying",
"RPC",
"endpoint",
"with",
"a",
"delay",
"of",
"the",
"given",
"number",
"of",
"milliseconds",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/rpc/RpcEndpoint.java#L285-L287 | train | Schedule a runnable to be run asynchronously. | [
30522,
5123,
11675,
6134,
26605,
6508,
12273,
1006,
2448,
22966,
2448,
22966,
1010,
2146,
8536,
1010,
2051,
19496,
2102,
3131,
1007,
1063,
1054,
15042,
8043,
6299,
1012,
6134,
26605,
6508,
12273,
1006,
2448,
22966,
1010,
3131,
1012,
3419,
8... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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/traffic/GlobalChannelTrafficCounter.java | GlobalChannelTrafficCounter.start | @Override
public synchronized void start() {
if (monitorActive) {
return;
}
lastTime.set(milliSecondFromNano());
long localCheckInterval = checkInterval.get();
if (localCheckInterval > 0) {
monitorActive = true;
monitor = new MixedTrafficMo... | java | @Override
public synchronized void start() {
if (monitorActive) {
return;
}
lastTime.set(milliSecondFromNano());
long localCheckInterval = checkInterval.get();
if (localCheckInterval > 0) {
monitorActive = true;
monitor = new MixedTrafficMo... | [
"@",
"Override",
"public",
"synchronized",
"void",
"start",
"(",
")",
"{",
"if",
"(",
"monitorActive",
")",
"{",
"return",
";",
"}",
"lastTime",
".",
"set",
"(",
"milliSecondFromNano",
"(",
")",
")",
";",
"long",
"localCheckInterval",
"=",
"checkInterval",
... | Start the monitoring process. | [
"Start",
"the",
"monitoring",
"process",
"."
] | ba06eafa1c1824bd154f1a380019e7ea2edf3c4c | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/handler/src/main/java/io/netty/handler/traffic/GlobalChannelTrafficCounter.java#L89-L102 | train | Start the MixedTrafficMonitoringTask. | [
30522,
1030,
2058,
15637,
2270,
25549,
11675,
2707,
1006,
1007,
1063,
2065,
1006,
8080,
19620,
1007,
1063,
2709,
1025,
1065,
2197,
7292,
1012,
2275,
1006,
4971,
5562,
8663,
20952,
21716,
7229,
2080,
1006,
1007,
1007,
1025,
2146,
2334,
5403,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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/servlet/multipart/MultipartRequestInputStream.java | MultipartRequestInputStream.skipToBoundary | public int skipToBoundary() throws IOException {
int count = 0;
while (true) {
byte b = readByte();
count++;
if (isBoundary(b)) {
break;
}
}
return count;
} | java | public int skipToBoundary() throws IOException {
int count = 0;
while (true) {
byte b = readByte();
count++;
if (isBoundary(b)) {
break;
}
}
return count;
} | [
"public",
"int",
"skipToBoundary",
"(",
")",
"throws",
"IOException",
"{",
"int",
"count",
"=",
"0",
";",
"while",
"(",
"true",
")",
"{",
"byte",
"b",
"=",
"readByte",
"(",
")",
";",
"count",
"++",
";",
"if",
"(",
"isBoundary",
"(",
"b",
")",
")",
... | 跳过边界表示
@return 跳过的字节数 | [
"跳过边界表示"
] | bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-extra/src/main/java/cn/hutool/extra/servlet/multipart/MultipartRequestInputStream.java#L183-L193 | train | Reads a sequence of bytes from the underlying stream until it finds a boundary. | [
30522,
2270,
20014,
13558,
3406,
15494,
5649,
1006,
1007,
11618,
22834,
10288,
24422,
1063,
20014,
4175,
1027,
1014,
1025,
2096,
1006,
2995,
1007,
1063,
24880,
1038,
1027,
3191,
3762,
2618,
1006,
1007,
1025,
4175,
1009,
1009,
1025,
2065,
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... |
netty/netty | handler/src/main/java/io/netty/handler/logging/LoggingHandler.java | LoggingHandler.format | protected String format(ChannelHandlerContext ctx, String eventName, Object firstArg, Object secondArg) {
if (secondArg == null) {
return formatSimple(ctx, eventName, firstArg);
}
String chStr = ctx.channel().toString();
String arg1Str = String.valueOf(firstArg);
Str... | java | protected String format(ChannelHandlerContext ctx, String eventName, Object firstArg, Object secondArg) {
if (secondArg == null) {
return formatSimple(ctx, eventName, firstArg);
}
String chStr = ctx.channel().toString();
String arg1Str = String.valueOf(firstArg);
Str... | [
"protected",
"String",
"format",
"(",
"ChannelHandlerContext",
"ctx",
",",
"String",
"eventName",
",",
"Object",
"firstArg",
",",
"Object",
"secondArg",
")",
"{",
"if",
"(",
"secondArg",
"==",
"null",
")",
"{",
"return",
"formatSimple",
"(",
"ctx",
",",
"eve... | Formats an event and returns the formatted message. This method is currently only used for formatting
{@link ChannelOutboundHandler#connect(ChannelHandlerContext, SocketAddress, SocketAddress, ChannelPromise)}.
@param eventName the name of the event
@param firstArg the first argument of the event
@param secondArg th... | [
"Formats",
"an",
"event",
"and",
"returns",
"the",
"formatted",
"message",
".",
"This",
"method",
"is",
"currently",
"only",
"used",
"for",
"formatting",
"{",
"@link",
"ChannelOutboundHandler#connect",
"(",
"ChannelHandlerContext",
"SocketAddress",
"SocketAddress",
"C... | ba06eafa1c1824bd154f1a380019e7ea2edf3c4c | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/handler/src/main/java/io/netty/handler/logging/LoggingHandler.java#L306-L318 | train | Format a single event. | [
30522,
5123,
5164,
4289,
1006,
3149,
11774,
3917,
8663,
18209,
14931,
2595,
1010,
5164,
2724,
18442,
1010,
4874,
2034,
2906,
2290,
1010,
4874,
2117,
2906,
2290,
1007,
1063,
2065,
1006,
2117,
2906,
2290,
1027,
1027,
19701,
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... |
apache/flink | flink-runtime/src/main/java/org/apache/flink/runtime/operators/hash/CompactingHashTable.java | CompactingHashTable.insertOrReplaceRecord | public void insertOrReplaceRecord(T record) throws IOException {
if (this.closed) {
return;
}
final int searchHashCode = MathUtils.jenkinsHash(this.buildSideComparator.hash(record));
final int posHashCode = searchHashCode % this.numBuckets;
// get the bucket for the given hash code
final MemorySegmen... | java | public void insertOrReplaceRecord(T record) throws IOException {
if (this.closed) {
return;
}
final int searchHashCode = MathUtils.jenkinsHash(this.buildSideComparator.hash(record));
final int posHashCode = searchHashCode % this.numBuckets;
// get the bucket for the given hash code
final MemorySegmen... | [
"public",
"void",
"insertOrReplaceRecord",
"(",
"T",
"record",
")",
"throws",
"IOException",
"{",
"if",
"(",
"this",
".",
"closed",
")",
"{",
"return",
";",
"}",
"final",
"int",
"searchHashCode",
"=",
"MathUtils",
".",
"jenkinsHash",
"(",
"this",
".",
"bui... | Replaces record in hash table if record already present or append record if not.
May trigger expensive compaction.
@param record record to insert or replace
@throws IOException | [
"Replaces",
"record",
"in",
"hash",
"table",
"if",
"record",
"already",
"present",
"or",
"append",
"record",
"if",
"not",
".",
"May",
"trigger",
"expensive",
"compaction",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/operators/hash/CompactingHashTable.java#L349-L426 | train | Insert or replace a record in the InMemoryPartition. | [
30522,
2270,
11675,
19274,
2953,
2890,
24759,
10732,
2890,
27108,
2094,
1006,
1056,
2501,
1007,
11618,
22834,
10288,
24422,
1063,
2065,
1006,
2023,
1012,
2701,
1007,
1063,
2709,
1025,
1065,
2345,
20014,
3945,
14949,
16257,
10244,
1027,
8785,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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.timeWindowAll | public AllWindowedStream<T, TimeWindow> timeWindowAll(Time size, Time slide) {
if (environment.getStreamTimeCharacteristic() == TimeCharacteristic.ProcessingTime) {
return windowAll(SlidingProcessingTimeWindows.of(size, slide));
} else {
return windowAll(SlidingEventTimeWindows.of(size, slide));
}
} | java | public AllWindowedStream<T, TimeWindow> timeWindowAll(Time size, Time slide) {
if (environment.getStreamTimeCharacteristic() == TimeCharacteristic.ProcessingTime) {
return windowAll(SlidingProcessingTimeWindows.of(size, slide));
} else {
return windowAll(SlidingEventTimeWindows.of(size, slide));
}
} | [
"public",
"AllWindowedStream",
"<",
"T",
",",
"TimeWindow",
">",
"timeWindowAll",
"(",
"Time",
"size",
",",
"Time",
"slide",
")",
"{",
"if",
"(",
"environment",
".",
"getStreamTimeCharacteristic",
"(",
")",
"==",
"TimeCharacteristic",
".",
"ProcessingTime",
")",... | Windows this {@code DataStream} into sliding time windows.
<p>This is a shortcut for either {@code .window(SlidingEventTimeWindows.of(size, slide))} or
{@code .window(SlidingProcessingTimeWindows.of(size, slide))} depending on the time characteristic
set using
{@link org.apache.flink.streaming.api.environment.StreamEx... | [
"Windows",
"this",
"{",
"@code",
"DataStream",
"}",
"into",
"sliding",
"time",
"windows",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-streaming-java/src/main/java/org/apache/flink/streaming/api/datastream/DataStream.java#L764-L770 | train | Returns a stream consisting of all time windows of the specified size and slide. | [
30522,
2270,
2035,
11101,
15096,
21422,
1026,
1056,
1010,
2051,
11101,
5004,
1028,
2051,
11101,
21293,
3363,
1006,
2051,
2946,
1010,
2051,
7358,
1007,
1063,
2065,
1006,
4044,
1012,
4152,
25379,
7292,
7507,
22648,
3334,
6553,
1006,
1007,
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... |
netty/netty | codec-http/src/main/java/io/netty/handler/codec/http/cookie/CookieUtil.java | CookieUtil.validCookieAttributeValueOctets | private static BitSet validCookieAttributeValueOctets() {
BitSet bits = new BitSet();
for (int i = 32; i < 127; i++) {
bits.set(i);
}
bits.set(';', false);
return bits;
} | java | private static BitSet validCookieAttributeValueOctets() {
BitSet bits = new BitSet();
for (int i = 32; i < 127; i++) {
bits.set(i);
}
bits.set(';', false);
return bits;
} | [
"private",
"static",
"BitSet",
"validCookieAttributeValueOctets",
"(",
")",
"{",
"BitSet",
"bits",
"=",
"new",
"BitSet",
"(",
")",
";",
"for",
"(",
"int",
"i",
"=",
"32",
";",
"i",
"<",
"127",
";",
"i",
"++",
")",
"{",
"bits",
".",
"set",
"(",
"i",... | path-value = <any CHAR except CTLs or ";"> | [
"path",
"-",
"value",
"=",
"<any",
"CHAR",
"except",
"CTLs",
"or",
";",
">"
] | ba06eafa1c1824bd154f1a380019e7ea2edf3c4c | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/codec-http/src/main/java/io/netty/handler/codec/http/cookie/CookieUtil.java#L70-L77 | train | validCookieAttributeValueOctets This returns a BitSet of valid Cookie Attribute value Octets. | [
30522,
2797,
10763,
9017,
3388,
9398,
3597,
23212,
5243,
4779,
3089,
8569,
2618,
10175,
5657,
10085,
22513,
2015,
1006,
1007,
1063,
9017,
3388,
9017,
1027,
2047,
9017,
3388,
1006,
1007,
1025,
2005,
1006,
20014,
1045,
1027,
3590,
1025,
1045,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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/ReflectUtil.java | ReflectUtil.setFieldValue | public static void setFieldValue(Object obj, String fieldName, Object value) throws UtilException {
Assert.notNull(obj);
Assert.notBlank(fieldName);
setFieldValue(obj, getField(obj.getClass(), fieldName), value);
} | java | public static void setFieldValue(Object obj, String fieldName, Object value) throws UtilException {
Assert.notNull(obj);
Assert.notBlank(fieldName);
setFieldValue(obj, getField(obj.getClass(), fieldName), value);
} | [
"public",
"static",
"void",
"setFieldValue",
"(",
"Object",
"obj",
",",
"String",
"fieldName",
",",
"Object",
"value",
")",
"throws",
"UtilException",
"{",
"Assert",
".",
"notNull",
"(",
"obj",
")",
";",
"Assert",
".",
"notBlank",
"(",
"fieldName",
")",
";... | 设置字段值
@param obj 对象
@param fieldName 字段名
@param value 值,值类型必须与字段类型匹配,不会自动转换对象类型
@throws UtilException 包装IllegalAccessException异常 | [
"设置字段值"
] | bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/util/ReflectUtil.java#L236-L240 | train | Sets the value of the specified field in the specified object to the specified value. | [
30522,
2270,
10763,
11675,
2275,
3790,
10175,
5657,
1006,
4874,
27885,
3501,
1010,
5164,
2492,
18442,
1010,
4874,
3643,
1007,
11618,
21183,
9463,
2595,
24422,
1063,
20865,
1012,
2025,
11231,
3363,
1006,
27885,
3501,
1007,
1025,
20865,
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... |
looly/hutool | hutool-db/src/main/java/cn/hutool/db/sql/Condition.java | Condition.buildValuePartForIN | private void buildValuePartForIN(StringBuilder conditionStrBuilder, List<Object> paramValues) {
conditionStrBuilder.append(" (");
final Object value = this.value;
if (isPlaceHolder()) {
List<?> valuesForIn;
// 占位符对应值列表
if (value instanceof CharSequence) {
valuesForIn = StrUtil.split((CharSeque... | java | private void buildValuePartForIN(StringBuilder conditionStrBuilder, List<Object> paramValues) {
conditionStrBuilder.append(" (");
final Object value = this.value;
if (isPlaceHolder()) {
List<?> valuesForIn;
// 占位符对应值列表
if (value instanceof CharSequence) {
valuesForIn = StrUtil.split((CharSeque... | [
"private",
"void",
"buildValuePartForIN",
"(",
"StringBuilder",
"conditionStrBuilder",
",",
"List",
"<",
"Object",
">",
"paramValues",
")",
"{",
"conditionStrBuilder",
".",
"append",
"(",
"\" (\"",
")",
";",
"final",
"Object",
"value",
"=",
"this",
".",
"value",... | 构建IN语句中的值部分<br>
开头必须加空格,类似:" (?,?,?)" 或者 " (1,2,3,4)"
@param conditionStrBuilder 条件语句构建器
@param paramValues 参数集合,用于参数占位符对应参数回填 | [
"构建IN语句中的值部分<br",
">",
"开头必须加空格,类似:",
"(",
"?",
"?",
"?",
")",
"或者",
"(",
"1",
"2",
"3",
"4",
")"
] | bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-db/src/main/java/cn/hutool/db/sql/Condition.java#L354-L376 | train | Build the value part for IN. | [
30522,
2797,
11675,
3857,
10175,
5657,
19362,
24475,
28741,
1006,
5164,
8569,
23891,
2099,
3785,
16344,
8569,
23891,
2099,
1010,
2862,
1026,
4874,
1028,
11498,
2213,
10175,
15808,
1007,
1063,
3785,
16344,
8569,
23891,
2099,
1012,
10439,
10497... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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/netty/NettyClient.java | NettyClient.connect | ChannelFuture connect(final InetSocketAddress serverSocketAddress) {
checkState(bootstrap != null, "Client has not been initialized yet.");
// --------------------------------------------------------------------
// Child channel pipeline for accepted connections
// ---------------------------------------------... | java | ChannelFuture connect(final InetSocketAddress serverSocketAddress) {
checkState(bootstrap != null, "Client has not been initialized yet.");
// --------------------------------------------------------------------
// Child channel pipeline for accepted connections
// ---------------------------------------------... | [
"ChannelFuture",
"connect",
"(",
"final",
"InetSocketAddress",
"serverSocketAddress",
")",
"{",
"checkState",
"(",
"bootstrap",
"!=",
"null",
",",
"\"Client has not been initialized yet.\"",
")",
";",
"// --------------------------------------------------------------------",
"// ... | ------------------------------------------------------------------------ | [
"------------------------------------------------------------------------"
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/io/network/netty/NettyClient.java#L168-L208 | train | Connects to the given server address. | [
30522,
3149,
11263,
11244,
7532,
1006,
2345,
1999,
8454,
7432,
12928,
14141,
8303,
14903,
7432,
12928,
14141,
8303,
1007,
1063,
14148,
12259,
1006,
6879,
6494,
2361,
999,
1027,
19701,
1010,
1000,
7396,
2038,
2025,
2042,
3988,
3550,
2664,
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... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.