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-java/src/main/java/org/apache/flink/api/java/operators/DistinctOperator.java | DistinctOperator.translateSelectorFunctionDistinct | private static <IN, K> org.apache.flink.api.common.operators.SingleInputOperator<?, IN, ?> translateSelectorFunctionDistinct(
SelectorFunctionKeys<IN, ?> rawKeys,
ReduceFunction<IN> function,
TypeInformation<IN> outputType,
String name,
Operator<IN> input,
int parallelism,
CombineHint hint) {
@Su... | java | private static <IN, K> org.apache.flink.api.common.operators.SingleInputOperator<?, IN, ?> translateSelectorFunctionDistinct(
SelectorFunctionKeys<IN, ?> rawKeys,
ReduceFunction<IN> function,
TypeInformation<IN> outputType,
String name,
Operator<IN> input,
int parallelism,
CombineHint hint) {
@Su... | [
"private",
"static",
"<",
"IN",
",",
"K",
">",
"org",
".",
"apache",
".",
"flink",
".",
"api",
".",
"common",
".",
"operators",
".",
"SingleInputOperator",
"<",
"?",
",",
"IN",
",",
"?",
">",
"translateSelectorFunctionDistinct",
"(",
"SelectorFunctionKeys",
... | -------------------------------------------------------------------------------------------- | [
"--------------------------------------------------------------------------------------------"
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-java/src/main/java/org/apache/flink/api/java/operators/DistinctOperator.java#L128-L149 | train | Translate a single input selector function distinct. | [
30522,
2797,
10763,
1026,
1999,
1010,
1047,
1028,
8917,
1012,
15895,
1012,
13109,
19839,
1012,
17928,
1012,
2691,
1012,
9224,
1012,
2309,
2378,
18780,
25918,
8844,
1026,
1029,
1010,
1999,
1010,
1029,
1028,
16315,
12260,
16761,
11263,
27989,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
looly/hutool | hutool-db/src/main/java/cn/hutool/db/sql/SqlBuilder.java | SqlBuilder.on | public SqlBuilder on(String on) {
if (StrUtil.isNotBlank(on)) {
this.sql.append(" ON ").append(on);
}
return this;
} | java | public SqlBuilder on(String on) {
if (StrUtil.isNotBlank(on)) {
this.sql.append(" ON ").append(on);
}
return this;
} | [
"public",
"SqlBuilder",
"on",
"(",
"String",
"on",
")",
"{",
"if",
"(",
"StrUtil",
".",
"isNotBlank",
"(",
"on",
")",
")",
"{",
"this",
".",
"sql",
".",
"append",
"(",
"\" ON \"",
")",
".",
"append",
"(",
"on",
")",
";",
"}",
"return",
"this",
";... | 配合JOIN的 ON语句,多表关联的条件语句<br>
只支持单一的逻辑运算符(例如多个条件之间)
@param on 条件
@return 自己 | [
"配合JOIN的",
"ON语句,多表关联的条件语句<br",
">",
"只支持单一的逻辑运算符(例如多个条件之间)"
] | bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-db/src/main/java/cn/hutool/db/sql/SqlBuilder.java#L482-L487 | train | Add a ON clause. | [
30522,
2270,
29296,
8569,
23891,
2099,
2006,
1006,
5164,
2006,
1007,
1063,
2065,
1006,
2358,
22134,
4014,
1012,
3475,
4140,
28522,
8950,
1006,
2006,
1007,
1007,
1063,
2023,
1012,
29296,
1012,
10439,
10497,
1006,
1000,
2006,
1000,
1007,
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-java/src/main/java/org/apache/flink/api/java/DataSet.java | DataSet.mapPartition | public <R> MapPartitionOperator<T, R> mapPartition(MapPartitionFunction<T, R> mapPartition) {
if (mapPartition == null) {
throw new NullPointerException("MapPartition function must not be null.");
}
String callLocation = Utils.getCallLocationName();
TypeInformation<R> resultType = TypeExtractor.getMapPartit... | java | public <R> MapPartitionOperator<T, R> mapPartition(MapPartitionFunction<T, R> mapPartition) {
if (mapPartition == null) {
throw new NullPointerException("MapPartition function must not be null.");
}
String callLocation = Utils.getCallLocationName();
TypeInformation<R> resultType = TypeExtractor.getMapPartit... | [
"public",
"<",
"R",
">",
"MapPartitionOperator",
"<",
"T",
",",
"R",
">",
"mapPartition",
"(",
"MapPartitionFunction",
"<",
"T",
",",
"R",
">",
"mapPartition",
")",
"{",
"if",
"(",
"mapPartition",
"==",
"null",
")",
"{",
"throw",
"new",
"NullPointerExcepti... | Applies a Map-style operation to the entire partition of the data.
The function is called once per parallel partition of the data,
and the entire partition is available through the given Iterator.
The number of elements that each instance of the MapPartition function
sees is non deterministic and depends on the paralle... | [
"Applies",
"a",
"Map",
"-",
"style",
"operation",
"to",
"the",
"entire",
"partition",
"of",
"the",
"data",
".",
"The",
"function",
"is",
"called",
"once",
"per",
"parallel",
"partition",
"of",
"the",
"data",
"and",
"the",
"entire",
"partition",
"is",
"avai... | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-java/src/main/java/org/apache/flink/api/java/DataSet.java#L237-L245 | train | Create a new MapPartitionOperator from this operator and a MapPartitionFunction. | [
30522,
2270,
1026,
1054,
1028,
4949,
19362,
3775,
3508,
25918,
8844,
1026,
1056,
1010,
1054,
1028,
4949,
19362,
3775,
3508,
1006,
4949,
19362,
3775,
3508,
11263,
27989,
1026,
1056,
1010,
1054,
1028,
4949,
19362,
3775,
3508,
1007,
1063,
2065... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
apache/flink | flink-runtime/src/main/java/org/apache/flink/runtime/jobmaster/slotpool/SlotPoolImpl.java | SlotPoolImpl.suspend | @Override
public void suspend() {
componentMainThreadExecutor.assertRunningInMainThread();
log.info("Suspending SlotPool.");
// cancel all pending allocations --> we can request these slots
// again after we regained the leadership
Set<AllocationID> allocationIds = pendingRequests.keySetB();
for (Alloc... | java | @Override
public void suspend() {
componentMainThreadExecutor.assertRunningInMainThread();
log.info("Suspending SlotPool.");
// cancel all pending allocations --> we can request these slots
// again after we regained the leadership
Set<AllocationID> allocationIds = pendingRequests.keySetB();
for (Alloc... | [
"@",
"Override",
"public",
"void",
"suspend",
"(",
")",
"{",
"componentMainThreadExecutor",
".",
"assertRunningInMainThread",
"(",
")",
";",
"log",
".",
"info",
"(",
"\"Suspending SlotPool.\"",
")",
";",
"// cancel all pending allocations --> we can request these slots",
... | Suspends this pool, meaning it has lost its authority to accept and distribute slots. | [
"Suspends",
"this",
"pool",
"meaning",
"it",
"has",
"lost",
"its",
"authority",
"to",
"accept",
"and",
"distribute",
"slots",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/jobmaster/slotpool/SlotPoolImpl.java#L192-L214 | train | Suspend the slot pool. | [
30522,
1030,
2058,
15637,
2270,
11675,
28324,
1006,
1007,
1063,
6922,
24238,
2705,
16416,
3207,
2595,
8586,
16161,
2099,
1012,
20865,
15532,
5582,
2378,
24238,
2705,
16416,
2094,
1006,
1007,
1025,
8833,
1012,
18558,
1006,
1000,
28324,
2075,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
apache/flink | flink-runtime/src/main/java/org/apache/flink/runtime/operators/sort/LargeRecordHandler.java | LargeRecordHandler.createSerializer | private TypeSerializer<Object> createSerializer(Object key, int pos) {
if (key == null) {
throw new NullKeyFieldException(pos);
}
try {
TypeInformation<Object> info = TypeExtractor.getForObject(key);
return info.createSerializer(executionConfig);
}
catch (Throwable t) {
throw new RuntimeException(... | java | private TypeSerializer<Object> createSerializer(Object key, int pos) {
if (key == null) {
throw new NullKeyFieldException(pos);
}
try {
TypeInformation<Object> info = TypeExtractor.getForObject(key);
return info.createSerializer(executionConfig);
}
catch (Throwable t) {
throw new RuntimeException(... | [
"private",
"TypeSerializer",
"<",
"Object",
">",
"createSerializer",
"(",
"Object",
"key",
",",
"int",
"pos",
")",
"{",
"if",
"(",
"key",
"==",
"null",
")",
"{",
"throw",
"new",
"NullKeyFieldException",
"(",
"pos",
")",
";",
"}",
"try",
"{",
"TypeInforma... | -------------------------------------------------------------------------------------------- | [
"--------------------------------------------------------------------------------------------"
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/operators/sort/LargeRecordHandler.java#L383-L394 | train | Create a serializer for the given key. | [
30522,
2797,
4127,
11610,
28863,
1026,
4874,
1028,
9005,
11610,
28863,
1006,
4874,
3145,
1010,
20014,
13433,
2015,
1007,
1063,
2065,
1006,
3145,
1027,
1027,
19701,
1007,
1063,
5466,
2047,
19701,
14839,
3790,
10288,
24422,
1006,
13433,
2015,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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/JoinNode.java | JoinNode.computeOperatorSpecificDefaultEstimates | @Override
protected void computeOperatorSpecificDefaultEstimates(DataStatistics statistics) {
long card1 = getFirstPredecessorNode().getEstimatedNumRecords();
long card2 = getSecondPredecessorNode().getEstimatedNumRecords();
this.estimatedNumRecords = (card1 < 0 || card2 < 0) ? -1 : Math.max(card1, card2);
... | java | @Override
protected void computeOperatorSpecificDefaultEstimates(DataStatistics statistics) {
long card1 = getFirstPredecessorNode().getEstimatedNumRecords();
long card2 = getSecondPredecessorNode().getEstimatedNumRecords();
this.estimatedNumRecords = (card1 < 0 || card2 < 0) ? -1 : Math.max(card1, card2);
... | [
"@",
"Override",
"protected",
"void",
"computeOperatorSpecificDefaultEstimates",
"(",
"DataStatistics",
"statistics",
")",
"{",
"long",
"card1",
"=",
"getFirstPredecessorNode",
"(",
")",
".",
"getEstimatedNumRecords",
"(",
")",
";",
"long",
"card2",
"=",
"getSecondPre... | The default estimates build on the principle of inclusion: The smaller input key domain is included in the larger
input key domain. We also assume that every key from the larger input has one join partner in the smaller input.
The result cardinality is hence the larger one. | [
"The",
"default",
"estimates",
"build",
"on",
"the",
"principle",
"of",
"inclusion",
":",
"The",
"smaller",
"input",
"key",
"domain",
"is",
"included",
"in",
"the",
"larger",
"input",
"key",
"domain",
".",
"We",
"also",
"assume",
"that",
"every",
"key",
"f... | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-optimizer/src/main/java/org/apache/flink/optimizer/dag/JoinNode.java#L97-L112 | train | Compute the default estimates for the operator. | [
30522,
1030,
2058,
15637,
5123,
11675,
24134,
25918,
18926,
5051,
6895,
8873,
19797,
12879,
23505,
4355,
21499,
2015,
1006,
2951,
9153,
16774,
6558,
6747,
1007,
1063,
2146,
4003,
2487,
1027,
2131,
8873,
12096,
28139,
3207,
9623,
21748,
3630,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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/DumpHelper.java | DumpHelper.logResult | static void logResult(Map<String, Object> result, DumpConfig config) {
Consumer<String> loggerFunc = getLoggerFuncBasedOnLevel(config.getLogLevel());
if(config.isUseJson()) {
logResultUsingJson(result, loggerFunc);
} else {
int startLevel = -1;
StringBuilder s... | java | static void logResult(Map<String, Object> result, DumpConfig config) {
Consumer<String> loggerFunc = getLoggerFuncBasedOnLevel(config.getLogLevel());
if(config.isUseJson()) {
logResultUsingJson(result, loggerFunc);
} else {
int startLevel = -1;
StringBuilder s... | [
"static",
"void",
"logResult",
"(",
"Map",
"<",
"String",
",",
"Object",
">",
"result",
",",
"DumpConfig",
"config",
")",
"{",
"Consumer",
"<",
"String",
">",
"loggerFunc",
"=",
"getLoggerFuncBasedOnLevel",
"(",
"config",
".",
"getLogLevel",
"(",
")",
")",
... | A help method to log result pojo
@param result the map contains info that needs to be logged | [
"A",
"help",
"method",
"to",
"log",
"result",
"pojo"
] | 2a60257c60663684c8f6dc8b5ea3cf184e534db6 | https://github.com/networknt/light-4j/blob/2a60257c60663684c8f6dc8b5ea3cf184e534db6/dump/src/main/java/com/networknt/dump/DumpHelper.java#L39-L49 | train | Logs the result of a request. | [
30522,
10763,
11675,
8833,
6072,
11314,
1006,
4949,
1026,
5164,
1010,
4874,
1028,
2765,
1010,
15653,
8663,
8873,
2290,
9530,
8873,
2290,
1007,
1063,
7325,
1026,
5164,
1028,
8833,
4590,
11263,
12273,
1027,
2131,
21197,
4590,
11263,
12273,
15... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
netty/netty | buffer/src/main/java/io/netty/buffer/ByteBufUtil.java | ByteBufUtil.hexDump | public static String hexDump(ByteBuf buffer, int fromIndex, int length) {
return HexUtil.hexDump(buffer, fromIndex, length);
} | java | public static String hexDump(ByteBuf buffer, int fromIndex, int length) {
return HexUtil.hexDump(buffer, fromIndex, length);
} | [
"public",
"static",
"String",
"hexDump",
"(",
"ByteBuf",
"buffer",
",",
"int",
"fromIndex",
",",
"int",
"length",
")",
"{",
"return",
"HexUtil",
".",
"hexDump",
"(",
"buffer",
",",
"fromIndex",
",",
"length",
")",
";",
"}"
] | Returns a <a href="http://en.wikipedia.org/wiki/Hex_dump">hex dump</a>
of the specified buffer's sub-region. | [
"Returns",
"a",
"<a",
"href",
"=",
"http",
":",
"//",
"en",
".",
"wikipedia",
".",
"org",
"/",
"wiki",
"/",
"Hex_dump",
">",
"hex",
"dump<",
"/",
"a",
">",
"of",
"the",
"specified",
"buffer",
"s",
"sub",
"-",
"region",
"."
] | ba06eafa1c1824bd154f1a380019e7ea2edf3c4c | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/buffer/src/main/java/io/netty/buffer/ByteBufUtil.java#L121-L123 | train | Hex dump of a byte buffer. | [
30522,
2270,
10763,
5164,
2002,
2595,
8566,
8737,
1006,
24880,
8569,
2546,
17698,
1010,
20014,
2013,
22254,
10288,
1010,
20014,
3091,
1007,
1063,
2709,
2002,
2595,
21823,
2140,
1012,
2002,
2595,
8566,
8737,
1006,
17698,
1010,
2013,
22254,
1... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
apache/flink | flink-streaming-java/src/main/java/org/apache/flink/streaming/api/environment/StreamExecutionEnvironment.java | StreamExecutionEnvironment.generateSequence | public DataStreamSource<Long> generateSequence(long from, long to) {
if (from > to) {
throw new IllegalArgumentException("Start of sequence must not be greater than the end");
}
return addSource(new StatefulSequenceSource(from, to), "Sequence Source");
} | java | public DataStreamSource<Long> generateSequence(long from, long to) {
if (from > to) {
throw new IllegalArgumentException("Start of sequence must not be greater than the end");
}
return addSource(new StatefulSequenceSource(from, to), "Sequence Source");
} | [
"public",
"DataStreamSource",
"<",
"Long",
">",
"generateSequence",
"(",
"long",
"from",
",",
"long",
"to",
")",
"{",
"if",
"(",
"from",
">",
"to",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"Start of sequence must not be greater than the end\"",
... | Creates a new data stream that contains a sequence of numbers. This is a parallel source,
if you manually set the parallelism to {@code 1}
(using {@link org.apache.flink.streaming.api.datastream.SingleOutputStreamOperator#setParallelism(int)})
the generated sequence of elements is in order.
@param from
The number to s... | [
"Creates",
"a",
"new",
"data",
"stream",
"that",
"contains",
"a",
"sequence",
"of",
"numbers",
".",
"This",
"is",
"a",
"parallel",
"source",
"if",
"you",
"manually",
"set",
"the",
"parallelism",
"to",
"{",
"@code",
"1",
"}",
"(",
"using",
"{",
"@link",
... | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-streaming-java/src/main/java/org/apache/flink/streaming/api/environment/StreamExecutionEnvironment.java#L675-L680 | train | Generates a sequence from the given start and end. | [
30522,
2270,
2951,
21422,
6499,
3126,
3401,
1026,
2146,
1028,
19421,
2063,
4226,
5897,
1006,
2146,
2013,
1010,
2146,
2000,
1007,
1063,
30524,
3401,
1006,
2047,
2110,
3993,
3366,
4226,
5897,
6499,
3126,
3401,
1006,
2013,
1010,
2000,
1007,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
apache/flink | flink-libraries/flink-cep/src/main/java/org/apache/flink/cep/nfa/NFA.java | NFA.process | public Collection<Map<String, List<T>>> process(
final SharedBufferAccessor<T> sharedBufferAccessor,
final NFAState nfaState,
final T event,
final long timestamp,
final AfterMatchSkipStrategy afterMatchSkipStrategy,
final TimerService timerService) throws Exception {
try (EventWrapper eventWrapper =... | java | public Collection<Map<String, List<T>>> process(
final SharedBufferAccessor<T> sharedBufferAccessor,
final NFAState nfaState,
final T event,
final long timestamp,
final AfterMatchSkipStrategy afterMatchSkipStrategy,
final TimerService timerService) throws Exception {
try (EventWrapper eventWrapper =... | [
"public",
"Collection",
"<",
"Map",
"<",
"String",
",",
"List",
"<",
"T",
">",
">",
">",
"process",
"(",
"final",
"SharedBufferAccessor",
"<",
"T",
">",
"sharedBufferAccessor",
",",
"final",
"NFAState",
"nfaState",
",",
"final",
"T",
"event",
",",
"final",... | Processes the next input event. If some of the computations reach a final state then the
resulting event sequences are returned. If computations time out and timeout handling is
activated, then the timed out event patterns are returned.
<p>If computations reach a stop state, the path forward is discarded and currently... | [
"Processes",
"the",
"next",
"input",
"event",
".",
"If",
"some",
"of",
"the",
"computations",
"reach",
"a",
"final",
"state",
"then",
"the",
"resulting",
"event",
"sequences",
"are",
"returned",
".",
"If",
"computations",
"time",
"out",
"and",
"timeout",
"ha... | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-libraries/flink-cep/src/main/java/org/apache/flink/cep/nfa/NFA.java#L220-L230 | train | Process an event. | [
30522,
2270,
3074,
1026,
4949,
1026,
5164,
1010,
2862,
1026,
1056,
1028,
1028,
1028,
2832,
1006,
2345,
4207,
8569,
12494,
6305,
9623,
21748,
1026,
1056,
1028,
4207,
8569,
12494,
6305,
9623,
21748,
1010,
2345,
1050,
24333,
3686,
1050,
24333,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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/common/Vertex.java | Vertex.newNumberInstance | public static Vertex newNumberInstance(String realWord)
{
return new Vertex(Predefine.TAG_NUMBER, realWord, new CoreDictionary.Attribute(Nature.m, 1000));
} | java | public static Vertex newNumberInstance(String realWord)
{
return new Vertex(Predefine.TAG_NUMBER, realWord, new CoreDictionary.Attribute(Nature.m, 1000));
} | [
"public",
"static",
"Vertex",
"newNumberInstance",
"(",
"String",
"realWord",
")",
"{",
"return",
"new",
"Vertex",
"(",
"Predefine",
".",
"TAG_NUMBER",
",",
"realWord",
",",
"new",
"CoreDictionary",
".",
"Attribute",
"(",
"Nature",
".",
"m",
",",
"1000",
")"... | 创建一个数词实例
@param realWord 数字对应的真实字串
@return 数词顶点 | [
"创建一个数词实例"
] | a538d0722ab2e4980a9dcd9ea40324fc3ddba7ce | https://github.com/hankcs/HanLP/blob/a538d0722ab2e4980a9dcd9ea40324fc3ddba7ce/src/main/java/com/hankcs/hanlp/seg/common/Vertex.java#L342-L345 | train | Create a number Vertex. | [
30522,
2270,
10763,
19449,
2047,
19172,
5677,
7076,
26897,
1006,
5164,
2613,
18351,
1007,
1063,
2709,
2047,
19449,
1006,
3653,
3207,
23460,
1012,
6415,
1035,
2193,
1010,
2613,
18351,
1010,
2047,
4563,
29201,
3258,
5649,
1012,
17961,
1006,
3... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
looly/hutool | hutool-extra/src/main/java/cn/hutool/extra/ftp/AbstractFtp.java | AbstractFtp.containsIgnoreCase | private static boolean containsIgnoreCase(List<String> names, String nameToFind) {
if (CollUtil.isEmpty(names)) {
return false;
}
if (StrUtil.isEmpty(nameToFind)) {
return false;
}
for (String name : names) {
if (nameToFind.equalsIgnoreCase(name)) {
return true;
}
}
return fals... | java | private static boolean containsIgnoreCase(List<String> names, String nameToFind) {
if (CollUtil.isEmpty(names)) {
return false;
}
if (StrUtil.isEmpty(nameToFind)) {
return false;
}
for (String name : names) {
if (nameToFind.equalsIgnoreCase(name)) {
return true;
}
}
return fals... | [
"private",
"static",
"boolean",
"containsIgnoreCase",
"(",
"List",
"<",
"String",
">",
"names",
",",
"String",
"nameToFind",
")",
"{",
"if",
"(",
"CollUtil",
".",
"isEmpty",
"(",
"names",
")",
")",
"{",
"return",
"false",
";",
"}",
"if",
"(",
"StrUtil",
... | 是否包含指定字符串,忽略大小写
@param names 文件或目录名列表
@param nameToFind 要查找的文件或目录名
@return 是否包含 | [
"是否包含指定字符串,忽略大小写"
] | bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-extra/src/main/java/cn/hutool/extra/ftp/AbstractFtp.java#L160-L173 | train | Checks if the list of strings contains the given name ignoring case. | [
30522,
2797,
10763,
22017,
20898,
3397,
23773,
5686,
18382,
1006,
2862,
1026,
5164,
1028,
3415,
1010,
5164,
2171,
3406,
30524,
1012,
2003,
6633,
13876,
2100,
1006,
3415,
1007,
1007,
1063,
2709,
6270,
1025,
1065,
2065,
1006,
2358,
22134,
401... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
apache/flink | flink-connectors/flink-connector-cassandra/src/main/java/org/apache/flink/streaming/connectors/cassandra/CassandraSink.java | CassandraSink.slotSharingGroup | public CassandraSink<IN> slotSharingGroup(String slotSharingGroup) {
if (useDataStreamSink) {
getSinkTransformation().setSlotSharingGroup(slotSharingGroup);
} else {
getStreamTransformation().setSlotSharingGroup(slotSharingGroup);
}
return this;
} | java | public CassandraSink<IN> slotSharingGroup(String slotSharingGroup) {
if (useDataStreamSink) {
getSinkTransformation().setSlotSharingGroup(slotSharingGroup);
} else {
getStreamTransformation().setSlotSharingGroup(slotSharingGroup);
}
return this;
} | [
"public",
"CassandraSink",
"<",
"IN",
">",
"slotSharingGroup",
"(",
"String",
"slotSharingGroup",
")",
"{",
"if",
"(",
"useDataStreamSink",
")",
"{",
"getSinkTransformation",
"(",
")",
".",
"setSlotSharingGroup",
"(",
"slotSharingGroup",
")",
";",
"}",
"else",
"... | Sets the slot sharing group of this operation. Parallel instances of
operations that are in the same slot sharing group will be co-located in the same
TaskManager slot, if possible.
<p>Operations inherit the slot sharing group of input operations if all input operations
are in the same slot sharing group and no slot s... | [
"Sets",
"the",
"slot",
"sharing",
"group",
"of",
"this",
"operation",
".",
"Parallel",
"instances",
"of",
"operations",
"that",
"are",
"in",
"the",
"same",
"slot",
"sharing",
"group",
"will",
"be",
"co",
"-",
"located",
"in",
"the",
"same",
"TaskManager",
... | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-connectors/flink-connector-cassandra/src/main/java/org/apache/flink/streaming/connectors/cassandra/CassandraSink.java#L185-L192 | train | Sets the slot sharing group for this sink. | [
30522,
2270,
15609,
11493,
2243,
1026,
1999,
1028,
19832,
18428,
3070,
17058,
1006,
5164,
19832,
18428,
3070,
17058,
1007,
1063,
2065,
1006,
2109,
6790,
21422,
11493,
2243,
1007,
1063,
4152,
19839,
6494,
3619,
14192,
3370,
1006,
1007,
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... |
netty/netty | codec-http2/src/main/java/io/netty/handler/codec/http2/DelegatingDecompressorFrameListener.java | DelegatingDecompressorFrameListener.newContentDecompressor | protected EmbeddedChannel newContentDecompressor(final ChannelHandlerContext ctx, CharSequence contentEncoding)
throws Http2Exception {
if (GZIP.contentEqualsIgnoreCase(contentEncoding) || X_GZIP.contentEqualsIgnoreCase(contentEncoding)) {
return new EmbeddedChannel(ctx.channel().id(), c... | java | protected EmbeddedChannel newContentDecompressor(final ChannelHandlerContext ctx, CharSequence contentEncoding)
throws Http2Exception {
if (GZIP.contentEqualsIgnoreCase(contentEncoding) || X_GZIP.contentEqualsIgnoreCase(contentEncoding)) {
return new EmbeddedChannel(ctx.channel().id(), c... | [
"protected",
"EmbeddedChannel",
"newContentDecompressor",
"(",
"final",
"ChannelHandlerContext",
"ctx",
",",
"CharSequence",
"contentEncoding",
")",
"throws",
"Http2Exception",
"{",
"if",
"(",
"GZIP",
".",
"contentEqualsIgnoreCase",
"(",
"contentEncoding",
")",
"||",
"X... | Returns a new {@link EmbeddedChannel} that decodes the HTTP2 message content encoded in the specified
{@code contentEncoding}.
@param contentEncoding the value of the {@code content-encoding} header
@return a new {@link ByteToMessageDecoder} if the specified encoding is supported. {@code null} otherwise
(alternatively... | [
"Returns",
"a",
"new",
"{",
"@link",
"EmbeddedChannel",
"}",
"that",
"decodes",
"the",
"HTTP2",
"message",
"content",
"encoded",
"in",
"the",
"specified",
"{",
"@code",
"contentEncoding",
"}",
"."
] | ba06eafa1c1824bd154f1a380019e7ea2edf3c4c | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/codec-http2/src/main/java/io/netty/handler/codec/http2/DelegatingDecompressorFrameListener.java#L166-L180 | train | Create an EmbeddedChannel based on the content encoding. | [
30522,
5123,
11157,
26058,
2047,
8663,
6528,
2102,
3207,
9006,
20110,
2953,
1006,
2345,
3149,
11774,
3917,
8663,
18209,
14931,
2595,
1010,
25869,
3366,
4226,
5897,
4180,
2368,
3597,
4667,
1007,
11618,
8299,
2475,
10288,
24422,
1063,
2065,
1... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
looly/hutool | hutool-db/src/main/java/cn/hutool/db/SqlConnRunner.java | SqlConnRunner.findBy | public List<Entity> findBy(Connection conn, String tableName, String field, Object value) throws SQLException{
return findAll(conn, Entity.create(tableName).set(field, value));
} | java | public List<Entity> findBy(Connection conn, String tableName, String field, Object value) throws SQLException{
return findAll(conn, Entity.create(tableName).set(field, value));
} | [
"public",
"List",
"<",
"Entity",
">",
"findBy",
"(",
"Connection",
"conn",
",",
"String",
"tableName",
",",
"String",
"field",
",",
"Object",
"value",
")",
"throws",
"SQLException",
"{",
"return",
"findAll",
"(",
"conn",
",",
"Entity",
".",
"create",
"(",
... | 根据某个字段名条件查询数据列表,返回所有字段
@param conn 数据库连接对象
@param tableName 表名
@param field 字段名
@param value 字段值
@return 数据对象列表
@throws SQLException SQL执行异常 | [
"根据某个字段名条件查询数据列表,返回所有字段"
] | bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-db/src/main/java/cn/hutool/db/SqlConnRunner.java#L399-L401 | train | Find by tableName field and value | [
30522,
2270,
2862,
1026,
9178,
1028,
2424,
3762,
1006,
4434,
9530,
2078,
1010,
5164,
2795,
18442,
1010,
5164,
2492,
1010,
4874,
3643,
1007,
11618,
29296,
10288,
24422,
1063,
2709,
2424,
8095,
1006,
9530,
2078,
1010,
9178,
1012,
3443,
1006,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
apache/flink | flink-runtime/src/main/java/org/apache/flink/runtime/instance/Instance.java | Instance.allocateSimpleSlot | public SimpleSlot allocateSimpleSlot() throws InstanceDiedException {
synchronized (instanceLock) {
if (isDead) {
throw new InstanceDiedException(this);
}
Integer nextSlot = availableSlots.poll();
if (nextSlot == null) {
return null;
}
else {
SimpleSlot slot = new SimpleSlot(this, locat... | java | public SimpleSlot allocateSimpleSlot() throws InstanceDiedException {
synchronized (instanceLock) {
if (isDead) {
throw new InstanceDiedException(this);
}
Integer nextSlot = availableSlots.poll();
if (nextSlot == null) {
return null;
}
else {
SimpleSlot slot = new SimpleSlot(this, locat... | [
"public",
"SimpleSlot",
"allocateSimpleSlot",
"(",
")",
"throws",
"InstanceDiedException",
"{",
"synchronized",
"(",
"instanceLock",
")",
"{",
"if",
"(",
"isDead",
")",
"{",
"throw",
"new",
"InstanceDiedException",
"(",
"this",
")",
";",
"}",
"Integer",
"nextSlo... | Allocates a simple slot on this TaskManager instance. This method returns {@code null}, if no slot
is available at the moment.
@return A simple slot that represents a task slot on this TaskManager instance, or null, if the
TaskManager instance has no more slots available.
@throws InstanceDiedException Thrown if the i... | [
"Allocates",
"a",
"simple",
"slot",
"on",
"this",
"TaskManager",
"instance",
".",
"This",
"method",
"returns",
"{",
"@code",
"null",
"}",
"if",
"no",
"slot",
"is",
"available",
"at",
"the",
"moment",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/instance/Instance.java#L220-L236 | train | Allocate a SimpleSlot. | [
30522,
2270,
3722,
14540,
4140,
2035,
24755,
4570,
5714,
21112,
10994,
1006,
1007,
11618,
6013,
10265,
3207,
2595,
24422,
1063,
25549,
1006,
6013,
7878,
1007,
1063,
2065,
1006,
2003,
3207,
4215,
1007,
1063,
5466,
2047,
6013,
10265,
3207,
25... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
apache/flink | flink-runtime/src/main/java/org/apache/flink/runtime/executiongraph/ExecutionGraph.java | ExecutionGraph.updateState | public boolean updateState(TaskExecutionState state) {
assertRunningInJobMasterMainThread();
final Execution attempt = currentExecutions.get(state.getID());
if (attempt != null) {
try {
Map<String, Accumulator<?, ?>> accumulators;
switch (state.getExecutionState()) {
case RUNNING:
return a... | java | public boolean updateState(TaskExecutionState state) {
assertRunningInJobMasterMainThread();
final Execution attempt = currentExecutions.get(state.getID());
if (attempt != null) {
try {
Map<String, Accumulator<?, ?>> accumulators;
switch (state.getExecutionState()) {
case RUNNING:
return a... | [
"public",
"boolean",
"updateState",
"(",
"TaskExecutionState",
"state",
")",
"{",
"assertRunningInJobMasterMainThread",
"(",
")",
";",
"final",
"Execution",
"attempt",
"=",
"currentExecutions",
".",
"get",
"(",
"state",
".",
"getID",
"(",
")",
")",
";",
"if",
... | Updates the state of one of the ExecutionVertex's Execution attempts.
If the new status if "FINISHED", this also updates the accumulators.
@param state The state update.
@return True, if the task update was properly applied, false, if the execution attempt was not found. | [
"Updates",
"the",
"state",
"of",
"one",
"of",
"the",
"ExecutionVertex",
"s",
"Execution",
"attempts",
".",
"If",
"the",
"new",
"status",
"if",
"FINISHED",
"this",
"also",
"updates",
"the",
"accumulators",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/executiongraph/ExecutionGraph.java#L1542-L1590 | train | Update the state of the task. | [
30522,
2270,
22017,
20898,
14409,
12259,
1006,
4708,
10288,
8586,
13700,
9153,
2618,
2110,
1007,
1063,
20865,
15532,
5582,
2378,
5558,
25526,
24268,
24238,
2705,
16416,
2094,
1006,
1007,
1025,
2345,
7781,
3535,
1027,
2783,
10288,
8586,
13700,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
apache/flink | flink-runtime/src/main/java/org/apache/flink/runtime/operators/sort/AbstractMergeIterator.java | AbstractMergeIterator.crossSecond1withNValues | private void crossSecond1withNValues(T2 val1, T1 firstValN,
Iterator<T1> valsN, FlatJoinFunction<T1, T2, O> joinFunction, Collector<O> collector) throws Exception {
T2 copy2 = createCopy(serializer2, val1, this.copy2);
joinFunction.join(firstValN, copy2, collector);
// set copy and join first element
... | java | private void crossSecond1withNValues(T2 val1, T1 firstValN,
Iterator<T1> valsN, FlatJoinFunction<T1, T2, O> joinFunction, Collector<O> collector) throws Exception {
T2 copy2 = createCopy(serializer2, val1, this.copy2);
joinFunction.join(firstValN, copy2, collector);
// set copy and join first element
... | [
"private",
"void",
"crossSecond1withNValues",
"(",
"T2",
"val1",
",",
"T1",
"firstValN",
",",
"Iterator",
"<",
"T1",
">",
"valsN",
",",
"FlatJoinFunction",
"<",
"T1",
",",
"T2",
",",
"O",
">",
"joinFunction",
",",
"Collector",
"<",
"O",
">",
"collector",
... | Crosses a single value from the second side with N values, all sharing a common key.
Effectively realizes a <i>N:1</i> join.
@param val1 The value form the <i>1</i> side.
@param firstValN The first of the values from the <i>N</i> side.
@param valsN Iterator over remaining <i>N</i> side values.
@throws Excepti... | [
"Crosses",
"a",
"single",
"value",
"from",
"the",
"second",
"side",
"with",
"N",
"values",
"all",
"sharing",
"a",
"common",
"key",
".",
"Effectively",
"realizes",
"a",
"<i",
">",
"N",
":",
"1<",
"/",
"i",
">",
"join",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/operators/sort/AbstractMergeIterator.java#L200-L219 | train | Cross second with N values. | [
30522,
2797,
11675,
2892,
3366,
8663,
2094,
2487,
24415,
30524,
1026,
1051,
1028,
10018,
1007,
11618,
6453,
1063,
1056,
2475,
6100,
2475,
1027,
3443,
3597,
7685,
1006,
7642,
17629,
2475,
1010,
11748,
2487,
1010,
2023,
1012,
6100,
2475,
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-http2/src/main/java/io/netty/handler/codec/http2/Http2FrameCodec.java | Http2FrameCodec.userEventTriggered | @Override
public final void userEventTriggered(ChannelHandlerContext ctx, Object evt) throws Exception {
if (evt == Http2ConnectionPrefaceAndSettingsFrameWrittenEvent.INSTANCE) {
// The user event implies that we are on the client.
tryExpandConnectionFlowControlWindow(connection());
... | java | @Override
public final void userEventTriggered(ChannelHandlerContext ctx, Object evt) throws Exception {
if (evt == Http2ConnectionPrefaceAndSettingsFrameWrittenEvent.INSTANCE) {
// The user event implies that we are on the client.
tryExpandConnectionFlowControlWindow(connection());
... | [
"@",
"Override",
"public",
"final",
"void",
"userEventTriggered",
"(",
"ChannelHandlerContext",
"ctx",
",",
"Object",
"evt",
")",
"throws",
"Exception",
"{",
"if",
"(",
"evt",
"==",
"Http2ConnectionPrefaceAndSettingsFrameWrittenEvent",
".",
"INSTANCE",
")",
"{",
"//... | Handles the cleartext HTTP upgrade event. If an upgrade occurred, sends a simple response via
HTTP/2 on stream 1 (the stream specifically reserved for cleartext HTTP upgrade). | [
"Handles",
"the",
"cleartext",
"HTTP",
"upgrade",
"event",
".",
"If",
"an",
"upgrade",
"occurred",
"sends",
"a",
"simple",
"response",
"via",
"HTTP",
"/",
"2",
"on",
"stream",
"1",
"(",
"the",
"stream",
"specifically",
"reserved",
"for",
"cleartext",
"HTTP",... | ba06eafa1c1824bd154f1a380019e7ea2edf3c4c | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/codec-http2/src/main/java/io/netty/handler/codec/http2/Http2FrameCodec.java#L239-L266 | train | Override to handle upgrade events. | [
30522,
1030,
2058,
15637,
2270,
2345,
11675,
5310,
18697,
3372,
18886,
13327,
2098,
1006,
3149,
11774,
3917,
8663,
18209,
14931,
2595,
1010,
4874,
23408,
2102,
1007,
11618,
6453,
1063,
2065,
1006,
23408,
2102,
1027,
30524,
2008,
2057,
2024,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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/dependency/perceptron/transition/trainer/ArcEagerBeamTrainer.java | ArcEagerBeamTrainer.beamSortOneThread | private void beamSortOneThread(ArrayList<Configuration> beam, TreeSet<BeamElement> beamPreserver)
{
for (int b = 0; b < beam.size(); b++)
{
Configuration configuration = beam.get(b);
State currentState = configuration.state;
float prevScore = configuration.score;
... | java | private void beamSortOneThread(ArrayList<Configuration> beam, TreeSet<BeamElement> beamPreserver)
{
for (int b = 0; b < beam.size(); b++)
{
Configuration configuration = beam.get(b);
State currentState = configuration.state;
float prevScore = configuration.score;
... | [
"private",
"void",
"beamSortOneThread",
"(",
"ArrayList",
"<",
"Configuration",
">",
"beam",
",",
"TreeSet",
"<",
"BeamElement",
">",
"beamPreserver",
")",
"{",
"for",
"(",
"int",
"b",
"=",
"0",
";",
"b",
"<",
"beam",
".",
"size",
"(",
")",
";",
"b",
... | 每个beam元素执行所有可能的动作一次
@param beam
@param beamPreserver
@throws Exception | [
"每个beam元素执行所有可能的动作一次"
] | a538d0722ab2e4980a9dcd9ea40324fc3ddba7ce | https://github.com/hankcs/HanLP/blob/a538d0722ab2e4980a9dcd9ea40324fc3ddba7ce/src/main/java/com/hankcs/hanlp/dependency/perceptron/transition/trainer/ArcEagerBeamTrainer.java#L526-L573 | train | Sort one thread of beam. | [
30522,
2797,
11675,
13110,
11589,
5643,
2705,
16416,
2094,
1006,
9140,
9863,
1026,
9563,
1028,
7504,
1010,
3628,
3388,
1026,
7504,
12260,
3672,
1028,
7504,
28994,
2121,
6299,
1007,
1063,
2005,
1006,
20014,
1038,
1027,
1014,
1025,
1038,
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/flink | flink-core/src/main/java/org/apache/flink/util/function/FunctionUtils.java | FunctionUtils.nullFn | @SuppressWarnings("unchecked")
public static <T> Function<T, Void> nullFn() {
return (Function<T, Void>) NULL_FN;
} | java | @SuppressWarnings("unchecked")
public static <T> Function<T, Void> nullFn() {
return (Function<T, Void>) NULL_FN;
} | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"static",
"<",
"T",
">",
"Function",
"<",
"T",
",",
"Void",
">",
"nullFn",
"(",
")",
"{",
"return",
"(",
"Function",
"<",
"T",
",",
"Void",
">",
")",
"NULL_FN",
";",
"}"
] | Function which returns {@code null} (type: Void).
@param <T> input type
@return Function which returns {@code null}. | [
"Function",
"which",
"returns",
"{",
"@code",
"null",
"}",
"(",
"type",
":",
"Void",
")",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-core/src/main/java/org/apache/flink/util/function/FunctionUtils.java#L46-L49 | train | Returns a function that returns null when the function is null. | [
30522,
1030,
16081,
9028,
5582,
2015,
1006,
1000,
4895,
5403,
18141,
1000,
1007,
2270,
10763,
1026,
1056,
1028,
3853,
1026,
1056,
1010,
11675,
1028,
19701,
2546,
2078,
1006,
1007,
1063,
2709,
1006,
3853,
1026,
1056,
1010,
11675,
1028,
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 | dump/src/main/java/com/networknt/dump/CookiesDumper.java | CookiesDumper.dumpCookies | private void dumpCookies(Map<String, Cookie> cookiesMap, String maskKey) {
cookiesMap.forEach((key, cookie) -> {
if(!config.getRequestFilteredCookies().contains(cookie.getName())) {
List<Map<String, String>> cookieInfoList = new ArrayList<>();
//mask cookieValue
... | java | private void dumpCookies(Map<String, Cookie> cookiesMap, String maskKey) {
cookiesMap.forEach((key, cookie) -> {
if(!config.getRequestFilteredCookies().contains(cookie.getName())) {
List<Map<String, String>> cookieInfoList = new ArrayList<>();
//mask cookieValue
... | [
"private",
"void",
"dumpCookies",
"(",
"Map",
"<",
"String",
",",
"Cookie",
">",
"cookiesMap",
",",
"String",
"maskKey",
")",
"{",
"cookiesMap",
".",
"forEach",
"(",
"(",
"key",
",",
"cookie",
")",
"->",
"{",
"if",
"(",
"!",
"config",
".",
"getRequestF... | put cookies info to cookieMap
@param cookiesMap Map of cookies | [
"put",
"cookies",
"info",
"to",
"cookieMap"
] | 2a60257c60663684c8f6dc8b5ea3cf184e534db6 | https://github.com/networknt/light-4j/blob/2a60257c60663684c8f6dc8b5ea3cf184e534db6/dump/src/main/java/com/networknt/dump/CookiesDumper.java#L61-L74 | train | Dump cookies. | [
30522,
2797,
11675,
15653,
3597,
23212,
2229,
1006,
4949,
1026,
5164,
1010,
17387,
1028,
16324,
2863,
2361,
1010,
5164,
7308,
14839,
1007,
1063,
16324,
2863,
2361,
1012,
18921,
6776,
1006,
1006,
3145,
1010,
17387,
1007,
1011,
1028,
1063,
20... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
hankcs/HanLP | src/main/java/com/hankcs/hanlp/model/perceptron/PerceptronClassifier.java | PerceptronClassifier.evaluate | public BinaryClassificationFMeasure evaluate(Instance[] instanceList)
{
int TP = 0, FP = 0, FN = 0;
for (Instance instance : instanceList)
{
int y = model.decode(instance.x);
if (y == 1)
{
if (instance.y == 1)
++TP;
... | java | public BinaryClassificationFMeasure evaluate(Instance[] instanceList)
{
int TP = 0, FP = 0, FN = 0;
for (Instance instance : instanceList)
{
int y = model.decode(instance.x);
if (y == 1)
{
if (instance.y == 1)
++TP;
... | [
"public",
"BinaryClassificationFMeasure",
"evaluate",
"(",
"Instance",
"[",
"]",
"instanceList",
")",
"{",
"int",
"TP",
"=",
"0",
",",
"FP",
"=",
"0",
",",
"FN",
"=",
"0",
";",
"for",
"(",
"Instance",
"instance",
":",
"instanceList",
")",
"{",
"int",
"... | 评估
@param instanceList
@return | [
"评估"
] | a538d0722ab2e4980a9dcd9ea40324fc3ddba7ce | https://github.com/hankcs/HanLP/blob/a538d0722ab2e4980a9dcd9ea40324fc3ddba7ce/src/main/java/com/hankcs/hanlp/model/perceptron/PerceptronClassifier.java#L165-L184 | train | Evaluate the binary classification of the given instance list. | [
30522,
2270,
12441,
26266,
9031,
16715,
5243,
28632,
16157,
1006,
6013,
1031,
1033,
6013,
9863,
1007,
1063,
20014,
1056,
2361,
1027,
1014,
1010,
1042,
2361,
1027,
1014,
1010,
1042,
2078,
1027,
1014,
1025,
2005,
1006,
6013,
6013,
1024,
6013,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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/FileUtil.java | FileUtil.pathEquals | public static boolean pathEquals(File file1, File file2) {
if (isWindows()) {
// Windows环境
try {
if (StrUtil.equalsIgnoreCase(file1.getCanonicalPath(), file2.getCanonicalPath())) {
return true;
}
} catch (Exception e) {
if (StrUtil.equalsIgnoreCase(file1.getAbsolutePath(), file2.getA... | java | public static boolean pathEquals(File file1, File file2) {
if (isWindows()) {
// Windows环境
try {
if (StrUtil.equalsIgnoreCase(file1.getCanonicalPath(), file2.getCanonicalPath())) {
return true;
}
} catch (Exception e) {
if (StrUtil.equalsIgnoreCase(file1.getAbsolutePath(), file2.getA... | [
"public",
"static",
"boolean",
"pathEquals",
"(",
"File",
"file1",
",",
"File",
"file2",
")",
"{",
"if",
"(",
"isWindows",
"(",
")",
")",
"{",
"// Windows环境\r",
"try",
"{",
"if",
"(",
"StrUtil",
".",
"equalsIgnoreCase",
"(",
"file1",
".",
"getCanonicalPath... | 文件路径是否相同<br>
取两个文件的绝对路径比较,在Windows下忽略大小写,在Linux下不忽略。
@param file1 文件1
@param file2 文件2
@return 文件路径是否相同
@since 3.0.9 | [
"文件路径是否相同<br",
">",
"取两个文件的绝对路径比较,在Windows下忽略大小写,在Linux下不忽略。"
] | bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/io/FileUtil.java#L1432-L1457 | train | Checks if two files are equal. | [
30522,
2270,
10763,
22017,
20898,
4130,
2063,
26426,
2015,
1006,
5371,
5371,
2487,
1010,
5371,
5371,
2475,
1007,
1063,
2065,
1006,
2003,
11101,
15568,
1006,
1007,
1007,
1063,
1013,
1013,
3645,
100,
100,
3046,
1063,
2065,
1006,
2358,
22134,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
looly/hutool | hutool-core/src/main/java/cn/hutool/core/lang/Snowflake.java | Snowflake.nextId | public synchronized long nextId() {
long timestamp = genTime();
if (timestamp < lastTimestamp) {
// 如果服务器时间有问题(时钟后退) 报错。
throw new IllegalStateException(StrUtil.format("Clock moved backwards. Refusing to generate id for {}ms", lastTimestamp - timestamp));
}
if (lastTimestamp == timestamp) {
sequ... | java | public synchronized long nextId() {
long timestamp = genTime();
if (timestamp < lastTimestamp) {
// 如果服务器时间有问题(时钟后退) 报错。
throw new IllegalStateException(StrUtil.format("Clock moved backwards. Refusing to generate id for {}ms", lastTimestamp - timestamp));
}
if (lastTimestamp == timestamp) {
sequ... | [
"public",
"synchronized",
"long",
"nextId",
"(",
")",
"{",
"long",
"timestamp",
"=",
"genTime",
"(",
")",
";",
"if",
"(",
"timestamp",
"<",
"lastTimestamp",
")",
"{",
"// 如果服务器时间有问题(时钟后退) 报错。\r",
"throw",
"new",
"IllegalStateException",
"(",
"StrUtil",
".",
"f... | 下一个ID
@return ID | [
"下一个ID"
] | bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/lang/Snowflake.java#L120-L138 | train | Returns the next unique id. | [
30522,
2270,
25549,
2146,
2279,
3593,
1006,
1007,
1063,
2146,
2335,
15464,
2361,
1027,
8991,
7292,
30524,
1013,
1013,
100,
100,
100,
100,
100,
100,
100,
1873,
100,
100,
1006,
100,
100,
100,
100,
1007,
100,
100,
1636,
5466,
2047,
6206,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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.selectAll | public List<String[]> selectAll(){
final List<String[]> result = new ArrayList<>((int)countAll(this.datas.length));
for(int i = 1; i <= this.datas.length; i++) {
result.addAll(select(i));
}
return result;
} | java | public List<String[]> selectAll(){
final List<String[]> result = new ArrayList<>((int)countAll(this.datas.length));
for(int i = 1; i <= this.datas.length; i++) {
result.addAll(select(i));
}
return result;
} | [
"public",
"List",
"<",
"String",
"[",
"]",
">",
"selectAll",
"(",
")",
"{",
"final",
"List",
"<",
"String",
"[",
"]",
">",
"result",
"=",
"new",
"ArrayList",
"<>",
"(",
"(",
"int",
")",
"countAll",
"(",
"this",
".",
"datas",
".",
"length",
")",
"... | 全组合
@return 全排列结果 | [
"全组合"
] | bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/math/Combination.java#L78-L84 | train | Select all the data in the table. | [
30522,
2270,
2862,
1026,
5164,
1031,
1033,
1028,
7276,
8095,
1006,
1007,
1063,
2345,
2862,
1026,
5164,
1031,
1033,
1028,
2765,
1027,
2047,
9140,
9863,
1026,
1028,
1006,
1006,
20014,
1007,
4175,
8095,
1006,
2023,
1012,
2951,
2015,
1012,
30... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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/Lz4FrameEncoder.java | Lz4FrameEncoder.close | public ChannelFuture close(final ChannelPromise promise) {
ChannelHandlerContext ctx = ctx();
EventExecutor executor = ctx.executor();
if (executor.inEventLoop()) {
return finishEncode(ctx, promise);
} else {
executor.execute(new Runnable() {
@Over... | java | public ChannelFuture close(final ChannelPromise promise) {
ChannelHandlerContext ctx = ctx();
EventExecutor executor = ctx.executor();
if (executor.inEventLoop()) {
return finishEncode(ctx, promise);
} else {
executor.execute(new Runnable() {
@Over... | [
"public",
"ChannelFuture",
"close",
"(",
"final",
"ChannelPromise",
"promise",
")",
"{",
"ChannelHandlerContext",
"ctx",
"=",
"ctx",
"(",
")",
";",
"EventExecutor",
"executor",
"=",
"ctx",
".",
"executor",
"(",
")",
";",
"if",
"(",
"executor",
".",
"inEventL... | Close this {@link Lz4FrameEncoder} and so finish the encoding.
The given {@link ChannelFuture} will be notified once the operation
completes and will also be returned. | [
"Close",
"this",
"{"
] | ba06eafa1c1824bd154f1a380019e7ea2edf3c4c | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/codec/src/main/java/io/netty/handler/codec/compression/Lz4FrameEncoder.java#L361-L376 | train | Close the session. | [
30522,
2270,
3149,
11263,
11244,
2485,
1006,
2345,
3149,
21572,
28732,
4872,
1007,
1063,
3149,
11774,
3917,
8663,
18209,
14931,
2595,
1027,
14931,
2595,
1006,
1007,
1025,
2724,
10288,
8586,
16161,
2099,
4654,
8586,
16161,
2099,
1027,
14931,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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/SqlConnRunner.java | SqlConnRunner.insert | public int[] insert(Connection conn, Collection<Entity> records) throws SQLException {
return insert(conn, records.toArray(new Entity[records.size()]));
} | java | public int[] insert(Connection conn, Collection<Entity> records) throws SQLException {
return insert(conn, records.toArray(new Entity[records.size()]));
} | [
"public",
"int",
"[",
"]",
"insert",
"(",
"Connection",
"conn",
",",
"Collection",
"<",
"Entity",
">",
"records",
")",
"throws",
"SQLException",
"{",
"return",
"insert",
"(",
"conn",
",",
"records",
".",
"toArray",
"(",
"new",
"Entity",
"[",
"records",
"... | 批量插入数据<br>
需要注意的是,批量插入每一条数据结构必须一致。批量插入数据时会获取第一条数据的字段结构,之后的数据会按照这个格式插入。<br>
也就是说假如第一条数据只有2个字段,后边数据多于这两个字段的部分将被抛弃。
此方法不会关闭Connection
@param conn 数据库连接
@param records 记录列表,记录KV必须严格一致
@return 插入行数
@throws SQLException SQL执行异常 | [
"批量插入数据<br",
">",
"需要注意的是,批量插入每一条数据结构必须一致。批量插入数据时会获取第一条数据的字段结构,之后的数据会按照这个格式插入。<br",
">",
"也就是说假如第一条数据只有2个字段,后边数据多于这两个字段的部分将被抛弃。",
"此方法不会关闭Connection"
] | bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-db/src/main/java/cn/hutool/db/SqlConnRunner.java#L141-L143 | train | Insert a collection of entities into the database. | [
30522,
2270,
20014,
1031,
1033,
19274,
1006,
4434,
9530,
2078,
1010,
3074,
1026,
9178,
1028,
2636,
1007,
11618,
29296,
10288,
24422,
1063,
2709,
19274,
1006,
9530,
2078,
1010,
2636,
1012,
2000,
2906,
9447,
1006,
2047,
9178,
1031,
2636,
1012... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
apache/flink | flink-table/flink-table-planner/src/main/java/org/apache/calcite/sql/validate/SqlValidatorImpl.java | SqlValidatorImpl.handleScalarSubQuery | private void handleScalarSubQuery(
SqlSelect parentSelect,
SqlSelect selectItem,
List<SqlNode> expandedSelectItems,
Set<String> aliasList,
List<Map.Entry<String, RelDataType>> fieldList) {
// A scalar sub-query only has one output column.
if (1 != selectItem.getSelectList().size()) {
throw newValidatio... | java | private void handleScalarSubQuery(
SqlSelect parentSelect,
SqlSelect selectItem,
List<SqlNode> expandedSelectItems,
Set<String> aliasList,
List<Map.Entry<String, RelDataType>> fieldList) {
// A scalar sub-query only has one output column.
if (1 != selectItem.getSelectList().size()) {
throw newValidatio... | [
"private",
"void",
"handleScalarSubQuery",
"(",
"SqlSelect",
"parentSelect",
",",
"SqlSelect",
"selectItem",
",",
"List",
"<",
"SqlNode",
">",
"expandedSelectItems",
",",
"Set",
"<",
"String",
">",
"aliasList",
",",
"List",
"<",
"Map",
".",
"Entry",
"<",
"Stri... | Processes SubQuery found in Select list. Checks that is actually Scalar
sub-query and makes proper entries in each of the 3 lists used to create
the final rowType entry.
@param parentSelect base SqlSelect item
@param selectItem child SqlSelect from select list
@param expandedSelectItems Select items af... | [
"Processes",
"SubQuery",
"found",
"in",
"Select",
"list",
".",
"Checks",
"that",
"is",
"actually",
"Scalar",
"sub",
"-",
"query",
"and",
"makes",
"proper",
"entries",
"in",
"each",
"of",
"the",
"3",
"lists",
"used",
"to",
"create",
"the",
"final",
"rowType... | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-table/flink-table-planner/src/main/java/org/apache/calcite/sql/validate/SqlValidatorImpl.java#L4129-L4164 | train | Handle a scalar sub - query. | [
30522,
2797,
11675,
16024,
25015,
2869,
12083,
4226,
2854,
1006,
29296,
11246,
22471,
3008,
12260,
6593,
1010,
29296,
11246,
22471,
7276,
4221,
2213,
1010,
2862,
1026,
29296,
3630,
3207,
1028,
4423,
11246,
22471,
4221,
5244,
1010,
2275,
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... |
looly/hutool | hutool-core/src/main/java/cn/hutool/core/bean/BeanUtil.java | BeanUtil.getPropertyDescriptorMap | public static Map<String, PropertyDescriptor> getPropertyDescriptorMap(Class<?> clazz, boolean ignoreCase) throws BeanException {
Map<String, PropertyDescriptor> map = BeanInfoCache.INSTANCE.getPropertyDescriptorMap(clazz, ignoreCase);
if (null == map) {
map = internalGetPropertyDescriptorMap(clazz, ignoreCas... | java | public static Map<String, PropertyDescriptor> getPropertyDescriptorMap(Class<?> clazz, boolean ignoreCase) throws BeanException {
Map<String, PropertyDescriptor> map = BeanInfoCache.INSTANCE.getPropertyDescriptorMap(clazz, ignoreCase);
if (null == map) {
map = internalGetPropertyDescriptorMap(clazz, ignoreCas... | [
"public",
"static",
"Map",
"<",
"String",
",",
"PropertyDescriptor",
">",
"getPropertyDescriptorMap",
"(",
"Class",
"<",
"?",
">",
"clazz",
",",
"boolean",
"ignoreCase",
")",
"throws",
"BeanException",
"{",
"Map",
"<",
"String",
",",
"PropertyDescriptor",
">",
... | 获得字段名和字段描述Map,获得的结果会缓存在 {@link BeanInfoCache}中
@param clazz Bean类
@param ignoreCase 是否忽略大小写
@return 字段名和字段描述Map
@throws BeanException 获取属性异常 | [
"获得字段名和字段描述Map,获得的结果会缓存在",
"{",
"@link",
"BeanInfoCache",
"}",
"中"
] | bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/bean/BeanUtil.java#L192-L199 | train | Returns a map of property descriptors for the given class ignoring case. | [
30522,
2270,
10763,
4949,
1026,
5164,
1010,
3200,
6155,
23235,
2953,
1028,
2131,
21572,
4842,
3723,
6155,
23235,
2953,
2863,
2361,
1006,
2465,
1026,
1029,
1028,
18856,
10936,
2480,
1010,
22017,
20898,
8568,
18382,
1007,
11618,
14068,
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... |
looly/hutool | hutool-poi/src/main/java/cn/hutool/poi/excel/style/StyleUtil.java | StyleUtil.setBorder | public static CellStyle setBorder(CellStyle cellStyle, BorderStyle borderSize, IndexedColors colorIndex) {
cellStyle.setBorderBottom(borderSize);
cellStyle.setBottomBorderColor(colorIndex.index);
cellStyle.setBorderLeft(borderSize);
cellStyle.setLeftBorderColor(colorIndex.index);
cellStyle.setBorderR... | java | public static CellStyle setBorder(CellStyle cellStyle, BorderStyle borderSize, IndexedColors colorIndex) {
cellStyle.setBorderBottom(borderSize);
cellStyle.setBottomBorderColor(colorIndex.index);
cellStyle.setBorderLeft(borderSize);
cellStyle.setLeftBorderColor(colorIndex.index);
cellStyle.setBorderR... | [
"public",
"static",
"CellStyle",
"setBorder",
"(",
"CellStyle",
"cellStyle",
",",
"BorderStyle",
"borderSize",
",",
"IndexedColors",
"colorIndex",
")",
"{",
"cellStyle",
".",
"setBorderBottom",
"(",
"borderSize",
")",
";",
"cellStyle",
".",
"setBottomBorderColor",
"... | 设置cell的四个边框粗细和颜色
@param cellStyle {@link CellStyle}
@param borderSize 边框粗细{@link BorderStyle}枚举
@param colorIndex 颜色的short值
@return {@link CellStyle} | [
"设置cell的四个边框粗细和颜色"
] | bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-poi/src/main/java/cn/hutool/poi/excel/style/StyleUtil.java#L69-L83 | train | Sets the border of the cellStyle. | [
30522,
2270,
10763,
4442,
27983,
2275,
12821,
4063,
1006,
4442,
27983,
4442,
27983,
1010,
6645,
27983,
6645,
4697,
1010,
25331,
18717,
2015,
3609,
22254,
10288,
1007,
1063,
4442,
27983,
1012,
2275,
12821,
4063,
18384,
20389,
1006,
6645,
4697,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
apache/flink | flink-runtime/src/main/java/org/apache/flink/runtime/io/network/partition/consumer/InputGateMetrics.java | InputGateMetrics.refreshAndGetTotal | long refreshAndGetTotal() {
long total = 0;
for (InputChannel channel : inputGate.getInputChannels().values()) {
if (channel instanceof RemoteInputChannel) {
RemoteInputChannel rc = (RemoteInputChannel) channel;
total += rc.unsynchronizedGetNumberOfQueuedBuffers();
}
}
return total;
} | java | long refreshAndGetTotal() {
long total = 0;
for (InputChannel channel : inputGate.getInputChannels().values()) {
if (channel instanceof RemoteInputChannel) {
RemoteInputChannel rc = (RemoteInputChannel) channel;
total += rc.unsynchronizedGetNumberOfQueuedBuffers();
}
}
return total;
} | [
"long",
"refreshAndGetTotal",
"(",
")",
"{",
"long",
"total",
"=",
"0",
";",
"for",
"(",
"InputChannel",
"channel",
":",
"inputGate",
".",
"getInputChannels",
"(",
")",
".",
"values",
"(",
")",
")",
"{",
"if",
"(",
"channel",
"instanceof",
"RemoteInputChan... | Iterates over all input channels and collects the total number of queued buffers in a
best-effort way.
@return total number of queued buffers | [
"Iterates",
"over",
"all",
"input",
"channels",
"and",
"collects",
"the",
"total",
"number",
"of",
"queued",
"buffers",
"in",
"a",
"best",
"-",
"effort",
"way",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/io/network/partition/consumer/InputGateMetrics.java#L51-L63 | train | This method is used to refresh the internal state of the input gate and return the total number of queued buffers in the input gate. | [
30522,
2146,
25416,
21898,
5685,
18150,
3406,
9080,
1006,
1007,
1063,
2146,
2561,
1027,
1014,
1025,
2005,
1006,
7953,
26058,
3149,
1024,
7953,
5867,
1012,
2131,
2378,
18780,
26058,
2015,
1006,
1007,
1012,
5300,
1006,
1007,
1007,
1063,
2065,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
looly/hutool | hutool-core/src/main/java/cn/hutool/core/lang/Validator.java | Validator.isBirthday | public static boolean isBirthday(int year, int month, int day) {
// 验证年
int thisYear = DateUtil.thisYear();
if (year < 1900 || year > thisYear) {
return false;
}
// 验证月
if (month < 1 || month > 12) {
return false;
}
// 验证日
if (day < 1 || day > 31) {
return false;
}
if ((... | java | public static boolean isBirthday(int year, int month, int day) {
// 验证年
int thisYear = DateUtil.thisYear();
if (year < 1900 || year > thisYear) {
return false;
}
// 验证月
if (month < 1 || month > 12) {
return false;
}
// 验证日
if (day < 1 || day > 31) {
return false;
}
if ((... | [
"public",
"static",
"boolean",
"isBirthday",
"(",
"int",
"year",
",",
"int",
"month",
",",
"int",
"day",
")",
"{",
"// 验证年\r",
"int",
"thisYear",
"=",
"DateUtil",
".",
"thisYear",
"(",
")",
";",
"if",
"(",
"year",
"<",
"1900",
"||",
"year",
">",
"thi... | 验证是否为生日
@param year 年,从1900年开始计算
@param month 月,从1开始计数
@param day 日,从1开始计数
@return 是否为生日 | [
"验证是否为生日"
] | bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/lang/Validator.java#L720-L745 | train | Returns true if the given date is a birthday of the specified year month and day. | [
30522,
2270,
10763,
22017,
20898,
2003,
17706,
2705,
10259,
1006,
20014,
2095,
1010,
20014,
3204,
1010,
20014,
2154,
1007,
1063,
1013,
1013,
100,
100,
1840,
20014,
2023,
29100,
1027,
3058,
21823,
2140,
1012,
2023,
29100,
1006,
1007,
1025,
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... |
hankcs/HanLP | src/main/java/com/hankcs/hanlp/mining/cluster/Cluster.java | Cluster.remove_document | void remove_document(Document doc)
{
for (Document<K> document : documents_)
{
if (document.equals(doc))
{
remove_document(doc);
return;
}
}
} | java | void remove_document(Document doc)
{
for (Document<K> document : documents_)
{
if (document.equals(doc))
{
remove_document(doc);
return;
}
}
} | [
"void",
"remove_document",
"(",
"Document",
"doc",
")",
"{",
"for",
"(",
"Document",
"<",
"K",
">",
"document",
":",
"documents_",
")",
"{",
"if",
"(",
"document",
".",
"equals",
"(",
"doc",
")",
")",
"{",
"remove_document",
"(",
"doc",
")",
";",
"re... | Remove a document from this cluster.
@param doc the pointer of a document object | [
"Remove",
"a",
"document",
"from",
"this",
"cluster",
"."
] | a538d0722ab2e4980a9dcd9ea40324fc3ddba7ce | https://github.com/hankcs/HanLP/blob/a538d0722ab2e4980a9dcd9ea40324fc3ddba7ce/src/main/java/com/hankcs/hanlp/mining/cluster/Cluster.java#L140-L150 | train | Remove a document from the list of documents_. | [
30522,
11675,
6366,
1035,
6254,
1006,
6254,
9986,
1007,
1063,
2005,
1006,
6254,
1026,
1047,
1028,
6254,
1024,
5491,
1035,
1007,
1063,
2065,
1006,
6254,
1012,
19635,
1006,
9986,
1007,
1007,
1063,
6366,
1035,
6254,
1006,
9986,
1007,
1025,
2... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
looly/hutool | hutool-core/src/main/java/cn/hutool/core/lang/PatternPool.java | PatternPool.remove | public static Pattern remove(String regex, int flags) {
return POOL.remove(new RegexWithFlag(regex, flags));
} | java | public static Pattern remove(String regex, int flags) {
return POOL.remove(new RegexWithFlag(regex, flags));
} | [
"public",
"static",
"Pattern",
"remove",
"(",
"String",
"regex",
",",
"int",
"flags",
")",
"{",
"return",
"POOL",
".",
"remove",
"(",
"new",
"RegexWithFlag",
"(",
"regex",
",",
"flags",
")",
")",
";",
"}"
] | 移除缓存
@param regex 正则
@param flags 标识
@return 移除的{@link Pattern},可能为{@code null} | [
"移除缓存"
] | bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/lang/PatternPool.java#L100-L102 | train | Returns a new Pattern that matches the given regular expression with the given flags. | [
30522,
2270,
10763,
5418,
6366,
1006,
5164,
19723,
10288,
1010,
20014,
9245,
1007,
1063,
2709,
4770,
1012,
6366,
1006,
2047,
19723,
10288,
24415,
10258,
8490,
1006,
19723,
10288,
1010,
9245,
1007,
1007,
1025,
1065,
102,
0,
0,
0,
0,
0,
0... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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/XmlUtil.java | XmlUtil.write | public static void write(Node node, OutputStream out, String charset, int indent) {
transform(new DOMSource(node), new StreamResult(out), charset, indent);
} | java | public static void write(Node node, OutputStream out, String charset, int indent) {
transform(new DOMSource(node), new StreamResult(out), charset, indent);
} | [
"public",
"static",
"void",
"write",
"(",
"Node",
"node",
",",
"OutputStream",
"out",
",",
"String",
"charset",
",",
"int",
"indent",
")",
"{",
"transform",
"(",
"new",
"DOMSource",
"(",
"node",
")",
",",
"new",
"StreamResult",
"(",
"out",
")",
",",
"c... | 将XML文档写出
@param node {@link Node} XML文档节点或文档本身
@param out 写出的Writer,Writer决定了输出XML的编码
@param charset 编码
@param indent 格式化输出中缩进量,小于1表示不格式化输出
@since 4.0.8 | [
"将XML文档写出"
] | bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/util/XmlUtil.java#L337-L339 | train | Write a DOM node to an output stream. | [
30522,
2270,
10763,
11675,
4339,
1006,
13045,
13045,
1010,
27852,
25379,
2041,
1010,
5164,
25869,
13462,
1010,
20014,
27427,
4765,
1007,
1063,
10938,
1006,
2047,
14383,
6499,
3126,
3401,
1006,
13045,
1007,
1010,
2047,
5460,
6072,
11314,
1006,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
looly/hutool | hutool-core/src/main/java/cn/hutool/core/io/FileUtil.java | FileUtil.writeBytes | public static File writeBytes(byte[] data, File dest, int off, int len, boolean isAppend) throws IORuntimeException {
return FileWriter.create(dest).write(data, off, len, isAppend);
} | java | public static File writeBytes(byte[] data, File dest, int off, int len, boolean isAppend) throws IORuntimeException {
return FileWriter.create(dest).write(data, off, len, isAppend);
} | [
"public",
"static",
"File",
"writeBytes",
"(",
"byte",
"[",
"]",
"data",
",",
"File",
"dest",
",",
"int",
"off",
",",
"int",
"len",
",",
"boolean",
"isAppend",
")",
"throws",
"IORuntimeException",
"{",
"return",
"FileWriter",
".",
"create",
"(",
"dest",
... | 写入数据到文件
@param data 数据
@param dest 目标文件
@param off 数据开始位置
@param len 数据长度
@param isAppend 是否追加模式
@return 目标文件
@throws IORuntimeException IO异常 | [
"写入数据到文件"
] | bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/io/FileUtil.java#L3141-L3143 | train | Write a byte array to a file. | [
30522,
2270,
10763,
5371,
4339,
3762,
4570,
1006,
24880,
1031,
1033,
2951,
1010,
5371,
4078,
2102,
1010,
20014,
2125,
1010,
20014,
18798,
1010,
22017,
20898,
18061,
21512,
4859,
1007,
11618,
22834,
15532,
7292,
10288,
24422,
1063,
2709,
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... |
apache/flink | flink-streaming-java/src/main/java/org/apache/flink/streaming/api/datastream/DataStream.java | DataStream.broadcast | @PublicEvolving
public BroadcastStream<T> broadcast(final MapStateDescriptor<?, ?>... broadcastStateDescriptors) {
Preconditions.checkNotNull(broadcastStateDescriptors);
final DataStream<T> broadcastStream = setConnectionType(new BroadcastPartitioner<>());
return new BroadcastStream<>(environment, broadcastStrea... | java | @PublicEvolving
public BroadcastStream<T> broadcast(final MapStateDescriptor<?, ?>... broadcastStateDescriptors) {
Preconditions.checkNotNull(broadcastStateDescriptors);
final DataStream<T> broadcastStream = setConnectionType(new BroadcastPartitioner<>());
return new BroadcastStream<>(environment, broadcastStrea... | [
"@",
"PublicEvolving",
"public",
"BroadcastStream",
"<",
"T",
">",
"broadcast",
"(",
"final",
"MapStateDescriptor",
"<",
"?",
",",
"?",
">",
"...",
"broadcastStateDescriptors",
")",
"{",
"Preconditions",
".",
"checkNotNull",
"(",
"broadcastStateDescriptors",
")",
... | Sets the partitioning of the {@link DataStream} so that the output elements
are broadcasted to every parallel instance of the next operation. In addition,
it implicitly as many {@link org.apache.flink.api.common.state.BroadcastState broadcast states}
as the specified descriptors which can be used to store the element o... | [
"Sets",
"the",
"partitioning",
"of",
"the",
"{",
"@link",
"DataStream",
"}",
"so",
"that",
"the",
"output",
"elements",
"are",
"broadcasted",
"to",
"every",
"parallel",
"instance",
"of",
"the",
"next",
"operation",
".",
"In",
"addition",
"it",
"implicitly",
... | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-streaming-java/src/main/java/org/apache/flink/streaming/api/datastream/DataStream.java#L426-L431 | train | Creates a new stream that contains the given broadcast state descriptors. | [
30522,
1030,
2270,
6777,
4747,
6455,
2270,
8960,
25379,
1026,
1056,
1028,
3743,
1006,
2345,
7341,
16238,
2229,
23235,
2953,
1026,
1029,
1010,
1029,
1028,
1012,
1012,
1012,
8960,
16238,
2229,
23235,
5668,
1007,
1063,
3653,
8663,
20562,
2015,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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/Bzip2BitWriter.java | Bzip2BitWriter.flush | void flush(ByteBuf out) {
final int bitCount = this.bitCount;
if (bitCount > 0) {
final long bitBuffer = this.bitBuffer;
final int shiftToRight = 64 - bitCount;
if (bitCount <= 8) {
out.writeByte((int) (bitBuffer >>> shiftToRight << 8 - bitCount));
... | java | void flush(ByteBuf out) {
final int bitCount = this.bitCount;
if (bitCount > 0) {
final long bitBuffer = this.bitBuffer;
final int shiftToRight = 64 - bitCount;
if (bitCount <= 8) {
out.writeByte((int) (bitBuffer >>> shiftToRight << 8 - bitCount));
... | [
"void",
"flush",
"(",
"ByteBuf",
"out",
")",
"{",
"final",
"int",
"bitCount",
"=",
"this",
".",
"bitCount",
";",
"if",
"(",
"bitCount",
">",
"0",
")",
"{",
"final",
"long",
"bitBuffer",
"=",
"this",
".",
"bitBuffer",
";",
"final",
"int",
"shiftToRight"... | Writes any remaining bits to the output {@link ByteBuf},
zero padding to a whole byte as required. | [
"Writes",
"any",
"remaining",
"bits",
"to",
"the",
"output",
"{"
] | ba06eafa1c1824bd154f1a380019e7ea2edf3c4c | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/codec/src/main/java/io/netty/handler/codec/compression/Bzip2BitWriter.java#L102-L119 | train | Flushes the buffer to the output. | [
30522,
11675,
13862,
1006,
24880,
8569,
2546,
2041,
1007,
1063,
2345,
20014,
2978,
3597,
16671,
1027,
2023,
1012,
2978,
3597,
16671,
1025,
2065,
1006,
2978,
3597,
16671,
1028,
1014,
1007,
1063,
2345,
2146,
2978,
8569,
12494,
1027,
2023,
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-core/src/main/java/org/apache/flink/util/AbstractCloseableRegistry.java | AbstractCloseableRegistry.registerCloseable | public final void registerCloseable(C closeable) throws IOException {
if (null == closeable) {
return;
}
synchronized (getSynchronizationLock()) {
if (!closed) {
doRegister(closeable, closeableToRef);
return;
}
}
IOUtils.closeQuietly(closeable);
throw new IOException("Cannot register Clo... | java | public final void registerCloseable(C closeable) throws IOException {
if (null == closeable) {
return;
}
synchronized (getSynchronizationLock()) {
if (!closed) {
doRegister(closeable, closeableToRef);
return;
}
}
IOUtils.closeQuietly(closeable);
throw new IOException("Cannot register Clo... | [
"public",
"final",
"void",
"registerCloseable",
"(",
"C",
"closeable",
")",
"throws",
"IOException",
"{",
"if",
"(",
"null",
"==",
"closeable",
")",
"{",
"return",
";",
"}",
"synchronized",
"(",
"getSynchronizationLock",
"(",
")",
")",
"{",
"if",
"(",
"!",... | Registers a {@link Closeable} with the registry. In case the registry is already closed, this method throws an
{@link IllegalStateException} and closes the passed {@link Closeable}.
@param closeable Closeable tor register
@throws IOException exception when the registry was closed before | [
"Registers",
"a",
"{",
"@link",
"Closeable",
"}",
"with",
"the",
"registry",
".",
"In",
"case",
"the",
"registry",
"is",
"already",
"closed",
"this",
"method",
"throws",
"an",
"{",
"@link",
"IllegalStateException",
"}",
"and",
"closes",
"the",
"passed",
"{",... | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-core/src/main/java/org/apache/flink/util/AbstractCloseableRegistry.java#L71-L86 | train | Registers a Closeable with the registry. | [
30522,
2270,
2345,
11675,
4236,
20464,
9232,
3085,
1006,
1039,
2485,
3085,
1007,
11618,
22834,
10288,
24422,
1063,
2065,
1006,
19701,
1027,
1027,
2485,
3085,
1007,
1063,
2709,
1025,
1065,
25549,
1006,
4152,
6038,
2818,
4948,
3989,
7878,
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/checkpoint/hooks/MasterHooks.java | MasterHooks.reset | public static void reset(
final Collection<MasterTriggerRestoreHook<?>> hooks,
final Logger log) throws FlinkException {
for (MasterTriggerRestoreHook<?> hook : hooks) {
final String id = hook.getIdentifier();
try {
hook.reset();
}
catch (Throwable t) {
ExceptionUtils.rethrowIfFatalErrorOrOOM... | java | public static void reset(
final Collection<MasterTriggerRestoreHook<?>> hooks,
final Logger log) throws FlinkException {
for (MasterTriggerRestoreHook<?> hook : hooks) {
final String id = hook.getIdentifier();
try {
hook.reset();
}
catch (Throwable t) {
ExceptionUtils.rethrowIfFatalErrorOrOOM... | [
"public",
"static",
"void",
"reset",
"(",
"final",
"Collection",
"<",
"MasterTriggerRestoreHook",
"<",
"?",
">",
">",
"hooks",
",",
"final",
"Logger",
"log",
")",
"throws",
"FlinkException",
"{",
"for",
"(",
"MasterTriggerRestoreHook",
"<",
"?",
">",
"hook",
... | Resets the master hooks.
@param hooks The hooks to reset
@throws FlinkException Thrown, if the hooks throw an exception. | [
"Resets",
"the",
"master",
"hooks",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/checkpoint/hooks/MasterHooks.java#L61-L75 | train | Resets all the checkpoint master hooks. | [
30522,
2270,
10763,
11675,
25141,
1006,
2345,
3074,
1026,
3040,
18886,
13327,
28533,
5686,
6806,
6559,
1026,
1029,
1028,
1028,
18008,
1010,
2345,
8833,
4590,
8833,
1007,
11618,
13109,
19839,
10288,
24422,
1063,
2005,
1006,
3040,
18886,
13327,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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/minicluster/MiniCluster.java | MiniCluster.createRpcService | protected RpcService createRpcService(
AkkaRpcServiceConfiguration akkaRpcServiceConfig,
boolean remoteEnabled,
String bindAddress) {
final Config akkaConfig;
if (remoteEnabled) {
akkaConfig = AkkaUtils.getAkkaConfig(akkaRpcServiceConfig.getConfiguration(), bindAddress, 0);
} else {
akkaConfig = ... | java | protected RpcService createRpcService(
AkkaRpcServiceConfiguration akkaRpcServiceConfig,
boolean remoteEnabled,
String bindAddress) {
final Config akkaConfig;
if (remoteEnabled) {
akkaConfig = AkkaUtils.getAkkaConfig(akkaRpcServiceConfig.getConfiguration(), bindAddress, 0);
} else {
akkaConfig = ... | [
"protected",
"RpcService",
"createRpcService",
"(",
"AkkaRpcServiceConfiguration",
"akkaRpcServiceConfig",
",",
"boolean",
"remoteEnabled",
",",
"String",
"bindAddress",
")",
"{",
"final",
"Config",
"akkaConfig",
";",
"if",
"(",
"remoteEnabled",
")",
"{",
"akkaConfig",
... | Factory method to instantiate the RPC service.
@param akkaRpcServiceConfig
The default RPC timeout for asynchronous "ask" requests.
@param remoteEnabled
True, if the RPC service should be reachable from other (remote) RPC services.
@param bindAddress
The address to bind the RPC service to. Only relevant when "remoteEn... | [
"Factory",
"method",
"to",
"instantiate",
"the",
"RPC",
"service",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/minicluster/MiniCluster.java#L715-L733 | train | Create a RpcService. | [
30522,
5123,
1054,
15042,
8043,
7903,
2063,
3443,
14536,
6169,
2121,
7903,
2063,
1006,
17712,
6673,
15042,
8043,
7903,
8586,
2239,
8873,
27390,
3370,
17712,
6673,
15042,
8043,
7903,
8586,
2239,
8873,
2290,
1010,
22017,
20898,
6556,
8189,
23... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
netty/netty | buffer/src/main/java/io/netty/buffer/CompositeByteBuf.java | CompositeByteBuf.addComponents | public CompositeByteBuf addComponents(int cIndex, Iterable<ByteBuf> buffers) {
return addComponents(false, cIndex, buffers);
} | java | public CompositeByteBuf addComponents(int cIndex, Iterable<ByteBuf> buffers) {
return addComponents(false, cIndex, buffers);
} | [
"public",
"CompositeByteBuf",
"addComponents",
"(",
"int",
"cIndex",
",",
"Iterable",
"<",
"ByteBuf",
">",
"buffers",
")",
"{",
"return",
"addComponents",
"(",
"false",
",",
"cIndex",
",",
"buffers",
")",
";",
"}"
] | Add the given {@link ByteBuf}s on the specific index
Be aware that this method does not increase the {@code writerIndex} of the {@link CompositeByteBuf}.
If you need to have it increased you need to handle it by your own.
<p>
{@link ByteBuf#release()} ownership of all {@link ByteBuf} objects in {@code buffers} is tran... | [
"Add",
"the",
"given",
"{",
"@link",
"ByteBuf",
"}",
"s",
"on",
"the",
"specific",
"index"
] | ba06eafa1c1824bd154f1a380019e7ea2edf3c4c | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/buffer/src/main/java/io/netty/buffer/CompositeByteBuf.java#L413-L415 | train | Add a sequence of components to this CompositeByteBuf. | [
30522,
2270,
12490,
3762,
2618,
8569,
2546,
5587,
9006,
29513,
7666,
1006,
20014,
25022,
13629,
2595,
1010,
2009,
6906,
3468,
1026,
24880,
8569,
2546,
1028,
17698,
2015,
1007,
1063,
2709,
5587,
9006,
29513,
7666,
1006,
6270,
1010,
25022,
13... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
apache/spark | common/network-yarn/src/main/java/org/apache/spark/network/yarn/YarnShuffleServiceMetrics.java | YarnShuffleServiceMetrics.getMetrics | @Override
public void getMetrics(MetricsCollector collector, boolean all) {
MetricsRecordBuilder metricsRecordBuilder = collector.addRecord("sparkShuffleService");
for (Map.Entry<String, Metric> entry : metricSet.getMetrics().entrySet()) {
collectMetric(metricsRecordBuilder, entry.getKey(), entry.getVa... | java | @Override
public void getMetrics(MetricsCollector collector, boolean all) {
MetricsRecordBuilder metricsRecordBuilder = collector.addRecord("sparkShuffleService");
for (Map.Entry<String, Metric> entry : metricSet.getMetrics().entrySet()) {
collectMetric(metricsRecordBuilder, entry.getKey(), entry.getVa... | [
"@",
"Override",
"public",
"void",
"getMetrics",
"(",
"MetricsCollector",
"collector",
",",
"boolean",
"all",
")",
"{",
"MetricsRecordBuilder",
"metricsRecordBuilder",
"=",
"collector",
".",
"addRecord",
"(",
"\"sparkShuffleService\"",
")",
";",
"for",
"(",
"Map",
... | Get metrics from the source
@param collector to contain the resulting metrics snapshot
@param all if true, return all metrics even if unchanged. | [
"Get",
"metrics",
"from",
"the",
"source"
] | 25ee0474f47d9c30d6f553a7892d9549f91071cf | https://github.com/apache/spark/blob/25ee0474f47d9c30d6f553a7892d9549f91071cf/common/network-yarn/src/main/java/org/apache/spark/network/yarn/YarnShuffleServiceMetrics.java#L47-L54 | train | Get the metrics from the metric set. | [
30522,
1030,
2058,
15637,
2270,
11675,
2131,
12589,
2015,
1006,
12046,
9363,
6216,
16761,
10018,
1010,
22017,
20898,
2035,
1007,
1063,
12046,
21338,
8586,
8551,
8569,
23891,
2099,
12046,
21338,
8586,
8551,
8569,
23891,
2099,
1027,
10018,
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-core/src/main/java/org/apache/flink/configuration/description/Formatter.java | Formatter.format | public String format(Description description) {
for (BlockElement blockElement : description.getBlocks()) {
blockElement.format(this);
}
return finalizeFormatting();
} | java | public String format(Description description) {
for (BlockElement blockElement : description.getBlocks()) {
blockElement.format(this);
}
return finalizeFormatting();
} | [
"public",
"String",
"format",
"(",
"Description",
"description",
")",
"{",
"for",
"(",
"BlockElement",
"blockElement",
":",
"description",
".",
"getBlocks",
"(",
")",
")",
"{",
"blockElement",
".",
"format",
"(",
"this",
")",
";",
"}",
"return",
"finalizeFor... | Formats the description into a String using format specific tags.
@param description description to be formatted
@return string representation of the description | [
"Formats",
"the",
"description",
"into",
"a",
"String",
"using",
"format",
"specific",
"tags",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-core/src/main/java/org/apache/flink/configuration/description/Formatter.java#L36-L41 | train | Format the given description. | [
30522,
2270,
5164,
4289,
1006,
6412,
6412,
1007,
1063,
2005,
1006,
3796,
12260,
3672,
3796,
12260,
3672,
1024,
6412,
1012,
2131,
23467,
2015,
1006,
1007,
1007,
1063,
3796,
12260,
3672,
1012,
4289,
1006,
2023,
1007,
1025,
1065,
2709,
2345,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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/PinyinUtil.java | PinyinUtil.getFirstLetter | public static char getFirstLetter(char ch) {
if (ch >= 'a' && ch <= 'z') {
return ch;
}
if (ch >= 'A' && ch <= 'Z') {
return Character.toLowerCase(ch);
}
final byte[] bys = String.valueOf(ch).getBytes(CharsetUtil.CHARSET_GBK);
if (bys.length == 1) {
return ch;
}
int count = (bys[0] +... | java | public static char getFirstLetter(char ch) {
if (ch >= 'a' && ch <= 'z') {
return ch;
}
if (ch >= 'A' && ch <= 'Z') {
return Character.toLowerCase(ch);
}
final byte[] bys = String.valueOf(ch).getBytes(CharsetUtil.CHARSET_GBK);
if (bys.length == 1) {
return ch;
}
int count = (bys[0] +... | [
"public",
"static",
"char",
"getFirstLetter",
"(",
"char",
"ch",
")",
"{",
"if",
"(",
"ch",
">=",
"'",
"'",
"&&",
"ch",
"<=",
"'",
"'",
")",
"{",
"return",
"ch",
";",
"}",
"if",
"(",
"ch",
">=",
"'",
"'",
"&&",
"ch",
"<=",
"'",
"'",
")",
"{... | 获取拼音首字母<br>
传入汉字,返回拼音首字母<br>
如果传入为字母,返回其小写形式<br>
感谢【帝都】宁静 提供方法
@param ch 汉字
@return 首字母,小写 | [
"获取拼音首字母<br",
">",
"传入汉字,返回拼音首字母<br",
">",
"如果传入为字母,返回其小写形式<br",
">",
"感谢【帝都】宁静",
"提供方法"
] | bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/util/PinyinUtil.java#L83-L145 | train | Returns the first letter of the specified character in the ISO 4217 language. | [
30522,
2270,
10763,
25869,
2131,
8873,
12096,
27901,
2099,
1006,
25869,
10381,
1007,
1063,
2065,
1006,
10381,
1028,
1027,
1005,
1037,
1005,
1004,
1004,
10381,
1026,
1027,
1005,
1062,
1005,
1007,
1063,
2709,
10381,
1025,
1065,
2065,
1006,
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-core/src/main/java/org/apache/flink/core/io/SimpleVersionedSerialization.java | SimpleVersionedSerialization.writeVersionAndSerialize | public static <T> byte[] writeVersionAndSerialize(SimpleVersionedSerializer<T> serializer, T datum) throws IOException {
checkNotNull(serializer, "serializer");
checkNotNull(datum, "datum");
final byte[] data = serializer.serialize(datum);
final byte[] versionAndData = new byte[data.length + 8];
final int v... | java | public static <T> byte[] writeVersionAndSerialize(SimpleVersionedSerializer<T> serializer, T datum) throws IOException {
checkNotNull(serializer, "serializer");
checkNotNull(datum, "datum");
final byte[] data = serializer.serialize(datum);
final byte[] versionAndData = new byte[data.length + 8];
final int v... | [
"public",
"static",
"<",
"T",
">",
"byte",
"[",
"]",
"writeVersionAndSerialize",
"(",
"SimpleVersionedSerializer",
"<",
"T",
">",
"serializer",
",",
"T",
"datum",
")",
"throws",
"IOException",
"{",
"checkNotNull",
"(",
"serializer",
",",
"\"serializer\"",
")",
... | Serializes the version and datum into a byte array. The first four bytes will be occupied by
the version (as returned by {@link SimpleVersionedSerializer#getVersion()}),
written in <i>big-endian</i> encoding. The remaining bytes will be the serialized
datum, as produced by {@link SimpleVersionedSerializer#serialize(Obj... | [
"Serializes",
"the",
"version",
"and",
"datum",
"into",
"a",
"byte",
"array",
".",
"The",
"first",
"four",
"bytes",
"will",
"be",
"occupied",
"by",
"the",
"version",
"(",
"as",
"returned",
"by",
"{",
"@link",
"SimpleVersionedSerializer#getVersion",
"()",
"}",
... | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-core/src/main/java/org/apache/flink/core/io/SimpleVersionedSerialization.java#L108-L131 | train | Write the version and serialize of the given object using the given serializer. | [
30522,
2270,
10763,
1026,
1056,
1028,
24880,
1031,
1033,
4339,
27774,
29560,
11610,
3669,
4371,
1006,
3722,
27774,
2098,
8043,
4818,
17629,
1026,
1056,
1028,
7642,
17629,
1010,
1056,
23755,
2819,
1007,
11618,
22834,
10288,
24422,
1063,
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... |
apache/flink | flink-streaming-java/src/main/java/org/apache/flink/streaming/api/datastream/AllWindowedStream.java | AllWindowedStream.evictor | @PublicEvolving
public AllWindowedStream<T, W> evictor(Evictor<? super T, ? super W> evictor) {
if (windowAssigner instanceof BaseAlignedWindowAssigner) {
throw new UnsupportedOperationException("Cannot use a " + windowAssigner.getClass().getSimpleName() + " with an Evictor.");
}
this.evictor = evictor;
re... | java | @PublicEvolving
public AllWindowedStream<T, W> evictor(Evictor<? super T, ? super W> evictor) {
if (windowAssigner instanceof BaseAlignedWindowAssigner) {
throw new UnsupportedOperationException("Cannot use a " + windowAssigner.getClass().getSimpleName() + " with an Evictor.");
}
this.evictor = evictor;
re... | [
"@",
"PublicEvolving",
"public",
"AllWindowedStream",
"<",
"T",
",",
"W",
">",
"evictor",
"(",
"Evictor",
"<",
"?",
"super",
"T",
",",
"?",
"super",
"W",
">",
"evictor",
")",
"{",
"if",
"(",
"windowAssigner",
"instanceof",
"BaseAlignedWindowAssigner",
")",
... | Sets the {@code Evictor} that should be used to evict elements from a window before emission.
<p>Note: When using an evictor window performance will degrade significantly, since
incremental aggregation of window results cannot be used. | [
"Sets",
"the",
"{",
"@code",
"Evictor",
"}",
"that",
"should",
"be",
"used",
"to",
"evict",
"elements",
"from",
"a",
"window",
"before",
"emission",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-streaming-java/src/main/java/org/apache/flink/streaming/api/datastream/AllWindowedStream.java#L175-L183 | train | Sets the Evictor to use for evicting the stream. | [
30522,
1030,
2270,
6777,
4747,
6455,
2270,
2035,
11101,
15096,
21422,
1026,
1056,
1010,
1059,
1028,
23408,
2594,
4263,
1006,
23408,
2594,
4263,
1026,
1029,
3565,
1056,
1010,
1029,
3565,
1059,
1028,
23408,
2594,
4263,
1007,
1063,
2065,
1006,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
spring-projects/spring-boot | spring-boot-project/spring-boot-tools/spring-boot-loader/src/main/java/org/springframework/boot/loader/jar/Handler.java | Handler.addToRootFileCache | static void addToRootFileCache(File sourceFile, JarFile jarFile) {
Map<File, JarFile> cache = rootFileCache.get();
if (cache == null) {
cache = new ConcurrentHashMap<>();
rootFileCache = new SoftReference<>(cache);
}
cache.put(sourceFile, jarFile);
} | java | static void addToRootFileCache(File sourceFile, JarFile jarFile) {
Map<File, JarFile> cache = rootFileCache.get();
if (cache == null) {
cache = new ConcurrentHashMap<>();
rootFileCache = new SoftReference<>(cache);
}
cache.put(sourceFile, jarFile);
} | [
"static",
"void",
"addToRootFileCache",
"(",
"File",
"sourceFile",
",",
"JarFile",
"jarFile",
")",
"{",
"Map",
"<",
"File",
",",
"JarFile",
">",
"cache",
"=",
"rootFileCache",
".",
"get",
"(",
")",
";",
"if",
"(",
"cache",
"==",
"null",
")",
"{",
"cach... | Add the given {@link JarFile} to the root file cache.
@param sourceFile the source file to add
@param jarFile the jar file. | [
"Add",
"the",
"given",
"{"
] | 0b27f7c70e164b2b1a96477f1d9c1acba56790c1 | https://github.com/spring-projects/spring-boot/blob/0b27f7c70e164b2b1a96477f1d9c1acba56790c1/spring-boot-project/spring-boot-tools/spring-boot-loader/src/main/java/org/springframework/boot/loader/jar/Handler.java#L333-L340 | train | Add a file to the cache of root files. | [
30522,
10763,
11675,
5587,
4263,
17206,
8873,
2571,
3540,
5403,
1006,
5371,
3120,
8873,
2571,
1010,
15723,
8873,
2571,
15723,
8873,
2571,
1007,
1063,
4949,
1026,
5371,
1010,
15723,
8873,
2571,
1028,
17053,
1027,
7117,
8873,
2571,
3540,
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... |
spring-projects/spring-boot | spring-boot-project/spring-boot-devtools/src/main/java/org/springframework/boot/devtools/filewatch/FileSystemWatcher.java | FileSystemWatcher.addSourceFolders | public void addSourceFolders(Iterable<File> folders) {
Assert.notNull(folders, "Folders must not be null");
synchronized (this.monitor) {
for (File folder : folders) {
addSourceFolder(folder);
}
}
} | java | public void addSourceFolders(Iterable<File> folders) {
Assert.notNull(folders, "Folders must not be null");
synchronized (this.monitor) {
for (File folder : folders) {
addSourceFolder(folder);
}
}
} | [
"public",
"void",
"addSourceFolders",
"(",
"Iterable",
"<",
"File",
">",
"folders",
")",
"{",
"Assert",
".",
"notNull",
"(",
"folders",
",",
"\"Folders must not be null\"",
")",
";",
"synchronized",
"(",
"this",
".",
"monitor",
")",
"{",
"for",
"(",
"File",
... | Add source folders to monitor. Cannot be called after the watcher has been
{@link #start() started}.
@param folders the folders to monitor | [
"Add",
"source",
"folders",
"to",
"monitor",
".",
"Cannot",
"be",
"called",
"after",
"the",
"watcher",
"has",
"been",
"{"
] | 0b27f7c70e164b2b1a96477f1d9c1acba56790c1 | https://github.com/spring-projects/spring-boot/blob/0b27f7c70e164b2b1a96477f1d9c1acba56790c1/spring-boot-project/spring-boot-devtools/src/main/java/org/springframework/boot/devtools/filewatch/FileSystemWatcher.java#L112-L119 | train | Adds the source folders to the report. | [
30522,
2270,
11675,
9909,
30524,
3363,
1006,
19622,
2015,
1010,
1000,
19622,
2015,
2442,
2025,
2022,
19701,
1000,
1007,
1025,
25549,
1006,
2023,
1012,
8080,
1007,
1063,
2005,
1006,
5371,
19622,
1024,
19622,
2015,
1007,
1063,
9909,
8162,
340... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
apache/flink | flink-core/src/main/java/org/apache/flink/configuration/description/TextElement.java | TextElement.code | public static TextElement code(String text) {
TextElement element = text(text);
element.textStyles.add(TextStyle.CODE);
return element;
} | java | public static TextElement code(String text) {
TextElement element = text(text);
element.textStyles.add(TextStyle.CODE);
return element;
} | [
"public",
"static",
"TextElement",
"code",
"(",
"String",
"text",
")",
"{",
"TextElement",
"element",
"=",
"text",
"(",
"text",
")",
";",
"element",
".",
"textStyles",
".",
"add",
"(",
"TextStyle",
".",
"CODE",
")",
";",
"return",
"element",
";",
"}"
] | Creates a block of text formatted as code.
@param text a block of text that will be formatted as code
@return block of text formatted as code | [
"Creates",
"a",
"block",
"of",
"text",
"formatted",
"as",
"code",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-core/src/main/java/org/apache/flink/configuration/description/TextElement.java#L64-L68 | train | Create a text element with a code style. | [
30522,
2270,
10763,
3793,
12260,
3672,
3642,
1006,
5164,
3793,
1007,
1063,
3793,
12260,
3672,
5783,
1027,
3793,
1006,
3793,
1007,
1025,
5783,
1012,
6981,
27983,
2015,
1012,
5587,
1006,
6981,
27983,
1012,
3642,
1007,
1025,
2709,
5783,
1025,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
looly/hutool | hutool-system/src/main/java/cn/hutool/system/SystemUtil.java | SystemUtil.dumpSystemInfo | public static void dumpSystemInfo(PrintWriter out) {
out.println("--------------");
out.println(getJvmSpecInfo());
out.println("--------------");
out.println(getJvmInfo());
out.println("--------------");
out.println(getJavaSpecInfo());
out.println("--------------");
out.println(getJavaInfo());
... | java | public static void dumpSystemInfo(PrintWriter out) {
out.println("--------------");
out.println(getJvmSpecInfo());
out.println("--------------");
out.println(getJvmInfo());
out.println("--------------");
out.println(getJavaSpecInfo());
out.println("--------------");
out.println(getJavaInfo());
... | [
"public",
"static",
"void",
"dumpSystemInfo",
"(",
"PrintWriter",
"out",
")",
"{",
"out",
".",
"println",
"(",
"\"--------------\"",
")",
";",
"out",
".",
"println",
"(",
"getJvmSpecInfo",
"(",
")",
")",
";",
"out",
".",
"println",
"(",
"\"--------------\"",... | 将系统信息输出到指定<code>PrintWriter</code>中。
@param out <code>PrintWriter</code>输出流 | [
"将系统信息输出到指定<code",
">",
"PrintWriter<",
"/",
"code",
">",
"中。"
] | bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-system/src/main/java/cn/hutool/system/SystemUtil.java#L439-L460 | train | Dumps the system info. | [
30522,
2270,
10763,
11675,
15653,
6508,
13473,
10020,
14876,
1006,
6140,
15994,
2041,
1007,
1063,
2041,
1012,
6140,
19666,
1006,
1000,
1011,
1011,
1011,
1011,
1011,
1011,
1011,
1011,
1011,
1011,
1011,
1011,
1011,
1011,
1000,
1007,
1025,
204... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
redisson/redisson | redisson/src/main/java/org/redisson/spring/cache/CacheConfig.java | CacheConfig.toJSON | public static String toJSON(Map<String, ? extends CacheConfig> config) throws IOException {
return new CacheConfigSupport().toJSON(config);
} | java | public static String toJSON(Map<String, ? extends CacheConfig> config) throws IOException {
return new CacheConfigSupport().toJSON(config);
} | [
"public",
"static",
"String",
"toJSON",
"(",
"Map",
"<",
"String",
",",
"?",
"extends",
"CacheConfig",
">",
"config",
")",
"throws",
"IOException",
"{",
"return",
"new",
"CacheConfigSupport",
"(",
")",
".",
"toJSON",
"(",
"config",
")",
";",
"}"
] | Convert current configuration to JSON format
@param config object
@return json string
@throws IOException error | [
"Convert",
"current",
"configuration",
"to",
"JSON",
"format"
] | d3acc0249b2d5d658d36d99e2c808ce49332ea44 | https://github.com/redisson/redisson/blob/d3acc0249b2d5d658d36d99e2c808ce49332ea44/redisson/src/main/java/org/redisson/spring/cache/CacheConfig.java#L168-L170 | train | Convert a map of cache config to JSON string. | [
30522,
2270,
10763,
5164,
2000,
22578,
2239,
1006,
4949,
1026,
5164,
1010,
1029,
8908,
17053,
8663,
8873,
2290,
1028,
9530,
8873,
2290,
1007,
11618,
22834,
10288,
24422,
1063,
2709,
2047,
17053,
8663,
8873,
5620,
6279,
6442,
1006,
1007,
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... |
looly/hutool | hutool-core/src/main/java/cn/hutool/core/util/NumberUtil.java | NumberUtil.mul | public static BigDecimal mul(Number v1, Number v2) {
return mul(new Number[] { v1, v2 });
} | java | public static BigDecimal mul(Number v1, Number v2) {
return mul(new Number[] { v1, v2 });
} | [
"public",
"static",
"BigDecimal",
"mul",
"(",
"Number",
"v1",
",",
"Number",
"v2",
")",
"{",
"return",
"mul",
"(",
"new",
"Number",
"[",
"]",
"{",
"v1",
",",
"v2",
"}",
")",
";",
"}"
] | 提供精确的乘法运算<br>
如果传入多个值为null或者空,则返回0
@param v1 被乘数
@param v2 乘数
@return 积 | [
"提供精确的乘法运算<br",
">",
"如果传入多个值为null或者空,则返回0"
] | bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/util/NumberUtil.java#L388-L390 | train | Multiply two numbers. | [
30522,
2270,
10763,
2502,
3207,
6895,
9067,
14163,
2140,
1006,
2193,
1058,
2487,
1010,
2193,
1058,
2475,
1007,
1063,
2709,
14163,
2140,
1006,
2047,
2193,
1031,
1033,
1063,
1058,
2487,
1010,
1058,
2475,
1065,
1007,
1025,
1065,
102,
0,
0,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
netty/netty | handler/src/main/java/io/netty/handler/logging/LoggingHandler.java | LoggingHandler.formatByteBufHolder | private static String formatByteBufHolder(ChannelHandlerContext ctx, String eventName, ByteBufHolder msg) {
String chStr = ctx.channel().toString();
String msgStr = msg.toString();
ByteBuf content = msg.content();
int length = content.readableBytes();
if (length == 0) {
... | java | private static String formatByteBufHolder(ChannelHandlerContext ctx, String eventName, ByteBufHolder msg) {
String chStr = ctx.channel().toString();
String msgStr = msg.toString();
ByteBuf content = msg.content();
int length = content.readableBytes();
if (length == 0) {
... | [
"private",
"static",
"String",
"formatByteBufHolder",
"(",
"ChannelHandlerContext",
"ctx",
",",
"String",
"eventName",
",",
"ByteBufHolder",
"msg",
")",
"{",
"String",
"chStr",
"=",
"ctx",
".",
"channel",
"(",
")",
".",
"toString",
"(",
")",
";",
"String",
"... | Generates the default log message of the specified event whose argument is a {@link ByteBufHolder}. | [
"Generates",
"the",
"default",
"log",
"message",
"of",
"the",
"specified",
"event",
"whose",
"argument",
"is",
"a",
"{"
] | ba06eafa1c1824bd154f1a380019e7ea2edf3c4c | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/handler/src/main/java/io/netty/handler/logging/LoggingHandler.java#L344-L364 | train | Format ByteBuf Holder. | [
30522,
2797,
10763,
5164,
4289,
3762,
2618,
8569,
2546,
14528,
1006,
3149,
11774,
3917,
8663,
18209,
14931,
2595,
1010,
5164,
2724,
18442,
1010,
24880,
8569,
2546,
14528,
5796,
2290,
1007,
1063,
5164,
10381,
3367,
2099,
1027,
14931,
2595,
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... |
hankcs/HanLP | src/main/java/com/hankcs/hanlp/model/perceptron/model/LinearModel.java | LinearModel.load | public void load(String modelFile) throws IOException
{
if (HanLP.Config.DEBUG)
logger.start("加载 %s ... ", modelFile);
ByteArrayStream byteArray = ByteArrayStream.createByteArrayStream(modelFile);
if (!load(byteArray))
{
throw new IOException(String.format("%s... | java | public void load(String modelFile) throws IOException
{
if (HanLP.Config.DEBUG)
logger.start("加载 %s ... ", modelFile);
ByteArrayStream byteArray = ByteArrayStream.createByteArrayStream(modelFile);
if (!load(byteArray))
{
throw new IOException(String.format("%s... | [
"public",
"void",
"load",
"(",
"String",
"modelFile",
")",
"throws",
"IOException",
"{",
"if",
"(",
"HanLP",
".",
"Config",
".",
"DEBUG",
")",
"logger",
".",
"start",
"(",
"\"加载 %s ... \", mo",
"d",
"lFile);",
"",
"",
"ByteArrayStream",
"byteArray",
"=",
"... | 加载模型
@param modelFile
@throws IOException | [
"加载模型"
] | a538d0722ab2e4980a9dcd9ea40324fc3ddba7ce | https://github.com/hankcs/HanLP/blob/a538d0722ab2e4980a9dcd9ea40324fc3ddba7ce/src/main/java/com/hankcs/hanlp/model/perceptron/model/LinearModel.java#L383-L394 | train | Load a single SECTYPE file. | [
30522,
2270,
11675,
7170,
1006,
5164,
2944,
8873,
2571,
1007,
11618,
22834,
10288,
24422,
1063,
2065,
1006,
7658,
14277,
1012,
9530,
8873,
2290,
1012,
2139,
8569,
2290,
1007,
8833,
4590,
1012,
2707,
1006,
1000,
1779,
100,
1003,
1055,
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... |
netty/netty | handler/src/main/java/io/netty/handler/ssl/SslContextBuilder.java | SslContextBuilder.keyManager | public SslContextBuilder keyManager(KeyManagerFactory keyManagerFactory) {
if (forServer) {
checkNotNull(keyManagerFactory, "keyManagerFactory required for servers");
}
keyCertChain = null;
key = null;
keyPassword = null;
this.keyManagerFactory = keyManagerFac... | java | public SslContextBuilder keyManager(KeyManagerFactory keyManagerFactory) {
if (forServer) {
checkNotNull(keyManagerFactory, "keyManagerFactory required for servers");
}
keyCertChain = null;
key = null;
keyPassword = null;
this.keyManagerFactory = keyManagerFac... | [
"public",
"SslContextBuilder",
"keyManager",
"(",
"KeyManagerFactory",
"keyManagerFactory",
")",
"{",
"if",
"(",
"forServer",
")",
"{",
"checkNotNull",
"(",
"keyManagerFactory",
",",
"\"keyManagerFactory required for servers\"",
")",
";",
"}",
"keyCertChain",
"=",
"null... | Identifying manager for this host. {@code keyManagerFactory} may be {@code null} for
client contexts, which disables mutual authentication. Using a {@link KeyManagerFactory}
is only supported for {@link SslProvider#JDK} or {@link SslProvider#OPENSSL} / {@link SslProvider#OPENSSL_REFCNT}
if the used openssl version is 1... | [
"Identifying",
"manager",
"for",
"this",
"host",
".",
"{",
"@code",
"keyManagerFactory",
"}",
"may",
"be",
"{",
"@code",
"null",
"}",
"for",
"client",
"contexts",
"which",
"disables",
"mutual",
"authentication",
".",
"Using",
"a",
"{",
"@link",
"KeyManagerFact... | ba06eafa1c1824bd154f1a380019e7ea2edf3c4c | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/handler/src/main/java/io/netty/handler/ssl/SslContextBuilder.java#L345-L354 | train | Sets the key manager to use for this context. | [
30522,
2270,
7020,
22499,
10111,
18413,
8569,
23891,
2099,
3145,
24805,
4590,
1006,
3145,
24805,
4590,
21450,
3145,
24805,
4590,
21450,
1007,
1063,
2065,
1006,
2005,
8043,
6299,
1007,
1063,
4638,
17048,
11231,
3363,
1006,
3145,
24805,
4590,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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/HttpHeaders.java | HttpHeaders.addHeader | @Deprecated
public static void addHeader(HttpMessage message, String name, Object value) {
message.headers().add(name, value);
} | java | @Deprecated
public static void addHeader(HttpMessage message, String name, Object value) {
message.headers().add(name, value);
} | [
"@",
"Deprecated",
"public",
"static",
"void",
"addHeader",
"(",
"HttpMessage",
"message",
",",
"String",
"name",
",",
"Object",
"value",
")",
"{",
"message",
".",
"headers",
"(",
")",
".",
"add",
"(",
"name",
",",
"value",
")",
";",
"}"
] | @deprecated Use {@link #add(CharSequence, Object)} instead.
@see #addHeader(HttpMessage, CharSequence, Object) | [
"@deprecated",
"Use",
"{",
"@link",
"#add",
"(",
"CharSequence",
"Object",
")",
"}",
"instead",
"."
] | ba06eafa1c1824bd154f1a380019e7ea2edf3c4c | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/codec-http/src/main/java/io/netty/handler/codec/http/HttpHeaders.java#L655-L658 | train | Add a header to the message. | [
30522,
1030,
2139,
28139,
12921,
2270,
10763,
11675,
5587,
4974,
2121,
1006,
8299,
7834,
3736,
3351,
4471,
1010,
5164,
2171,
1010,
4874,
3643,
1007,
1063,
4471,
1012,
20346,
2015,
1006,
1007,
1012,
5587,
1006,
2171,
1010,
3643,
1007,
1025,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
apache/spark | common/unsafe/src/main/java/org/apache/spark/unsafe/types/UTF8String.java | UTF8String.trimLeft | public UTF8String trimLeft(UTF8String trimString) {
if (trimString == null) return null;
// the searching byte position in the source string
int srchIdx = 0;
// the first beginning byte position of a non-matching character
int trimIdx = 0;
while (srchIdx < numBytes) {
UTF8String searchCha... | java | public UTF8String trimLeft(UTF8String trimString) {
if (trimString == null) return null;
// the searching byte position in the source string
int srchIdx = 0;
// the first beginning byte position of a non-matching character
int trimIdx = 0;
while (srchIdx < numBytes) {
UTF8String searchCha... | [
"public",
"UTF8String",
"trimLeft",
"(",
"UTF8String",
"trimString",
")",
"{",
"if",
"(",
"trimString",
"==",
"null",
")",
"return",
"null",
";",
"// the searching byte position in the source string",
"int",
"srchIdx",
"=",
"0",
";",
"// the first beginning byte positio... | Based on the given trim string, trim this string starting from left end
This method searches each character in the source string starting from the left end, removes
the character if it is in the trim string, stops at the first character which is not in the
trim string, returns the new string.
@param trimString the trim... | [
"Based",
"on",
"the",
"given",
"trim",
"string",
"trim",
"this",
"string",
"starting",
"from",
"left",
"end",
"This",
"method",
"searches",
"each",
"character",
"in",
"the",
"source",
"string",
"starting",
"from",
"the",
"left",
"end",
"removes",
"the",
"cha... | 25ee0474f47d9c30d6f553a7892d9549f91071cf | https://github.com/apache/spark/blob/25ee0474f47d9c30d6f553a7892d9549f91071cf/common/unsafe/src/main/java/org/apache/spark/unsafe/types/UTF8String.java#L580-L607 | train | Trims the left part of the source string. | [
30522,
2270,
21183,
2546,
2620,
3367,
4892,
12241,
2571,
6199,
1006,
21183,
2546,
2620,
3367,
4892,
12241,
3367,
4892,
1007,
1063,
2065,
1006,
12241,
3367,
4892,
1027,
1027,
19701,
1007,
2709,
19701,
1025,
1013,
1013,
1996,
6575,
24880,
259... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
looly/hutool | hutool-db/src/main/java/cn/hutool/db/sql/SqlBuilder.java | SqlBuilder.buildCondition | private String buildCondition(LogicalOperator logicalOperator, Condition... conditions) {
if (ArrayUtil.isEmpty(conditions)) {
return StrUtil.EMPTY;
}
if (null == logicalOperator) {
logicalOperator = LogicalOperator.AND;
}
final StringBuilder conditionStrBuilder = new StringBuilder();
boolea... | java | private String buildCondition(LogicalOperator logicalOperator, Condition... conditions) {
if (ArrayUtil.isEmpty(conditions)) {
return StrUtil.EMPTY;
}
if (null == logicalOperator) {
logicalOperator = LogicalOperator.AND;
}
final StringBuilder conditionStrBuilder = new StringBuilder();
boolea... | [
"private",
"String",
"buildCondition",
"(",
"LogicalOperator",
"logicalOperator",
",",
"Condition",
"...",
"conditions",
")",
"{",
"if",
"(",
"ArrayUtil",
".",
"isEmpty",
"(",
"conditions",
")",
")",
"{",
"return",
"StrUtil",
".",
"EMPTY",
";",
"}",
"if",
"(... | 构建组合条件<br>
例如:name = ? AND type IN (?, ?) AND other LIKE ?
@param logicalOperator 逻辑运算符
@param conditions 条件对象
@return 构建后的SQL语句条件部分 | [
"构建组合条件<br",
">",
"例如:name",
"=",
"?",
"AND",
"type",
"IN",
"(",
"?",
"?",
")",
"AND",
"other",
"LIKE",
"?"
] | bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-db/src/main/java/cn/hutool/db/sql/SqlBuilder.java#L587-L611 | train | Build the condition string. | [
30522,
2797,
5164,
3857,
8663,
20562,
1006,
11177,
25918,
8844,
11177,
25918,
8844,
1010,
4650,
1012,
1012,
1012,
3785,
1007,
1063,
2065,
1006,
9140,
21823,
2140,
1012,
2003,
6633,
13876,
2100,
1006,
3785,
1007,
1007,
1063,
2709,
2358,
2213... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
apache/flink | flink-streaming-java/src/main/java/org/apache/flink/streaming/api/datastream/KeyedStream.java | KeyedStream.asQueryableState | @PublicEvolving
public QueryableStateStream<KEY, T> asQueryableState(
String queryableStateName,
ValueStateDescriptor<T> stateDescriptor) {
transform("Queryable state: " + queryableStateName,
getType(),
new QueryableValueStateOperator<>(queryableStateName, stateDescriptor));
stateDescriptor.initial... | java | @PublicEvolving
public QueryableStateStream<KEY, T> asQueryableState(
String queryableStateName,
ValueStateDescriptor<T> stateDescriptor) {
transform("Queryable state: " + queryableStateName,
getType(),
new QueryableValueStateOperator<>(queryableStateName, stateDescriptor));
stateDescriptor.initial... | [
"@",
"PublicEvolving",
"public",
"QueryableStateStream",
"<",
"KEY",
",",
"T",
">",
"asQueryableState",
"(",
"String",
"queryableStateName",
",",
"ValueStateDescriptor",
"<",
"T",
">",
"stateDescriptor",
")",
"{",
"transform",
"(",
"\"Queryable state: \"",
"+",
"que... | Publishes the keyed stream as a queryable ValueState instance.
@param queryableStateName Name under which to the publish the queryable state instance
@param stateDescriptor State descriptor to create state instance from
@return Queryable state instance | [
"Publishes",
"the",
"keyed",
"stream",
"as",
"a",
"queryable",
"ValueState",
"instance",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-streaming-java/src/main/java/org/apache/flink/streaming/api/datastream/KeyedStream.java#L1019-L1034 | train | Returns a new QueryableValueStateStream with the given name and value state descriptor. | [
30522,
1030,
2270,
6777,
4747,
6455,
2270,
23032,
3085,
9153,
22199,
16416,
2213,
1026,
3145,
1010,
1056,
1028,
2004,
4226,
20444,
13510,
12259,
1006,
5164,
23032,
3085,
9153,
6528,
14074,
1010,
5300,
16238,
2229,
23235,
2953,
1026,
1056,
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-system/src/main/java/cn/hutool/system/JavaInfo.java | JavaInfo.getJavaVersionAsInt | private final int getJavaVersionAsInt() {
if (JAVA_VERSION == null) {
return 0;
}
String str = JAVA_VERSION.substring(0, 1);
str = str + JAVA_VERSION.substring(2, 3);
if (JAVA_VERSION.length() >= 5) {
str = str + JAVA_VERSION.substring(4, 5);
} else {
str = str + "0";
}
retur... | java | private final int getJavaVersionAsInt() {
if (JAVA_VERSION == null) {
return 0;
}
String str = JAVA_VERSION.substring(0, 1);
str = str + JAVA_VERSION.substring(2, 3);
if (JAVA_VERSION.length() >= 5) {
str = str + JAVA_VERSION.substring(4, 5);
} else {
str = str + "0";
}
retur... | [
"private",
"final",
"int",
"getJavaVersionAsInt",
"(",
")",
"{",
"if",
"(",
"JAVA_VERSION",
"==",
"null",
")",
"{",
"return",
"0",
";",
"}",
"String",
"str",
"=",
"JAVA_VERSION",
".",
"substring",
"(",
"0",
",",
"1",
")",
";",
"str",
"=",
"str",
"+",... | 取得当前Java impl.的版本的<code>int</code>值。
@return Java版本的<code>int</code>值或<code>0</code> | [
"取得当前Java",
"impl",
".",
"的版本的<code",
">",
"int<",
"/",
"code",
">",
"值。"
] | bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-system/src/main/java/cn/hutool/system/JavaInfo.java#L100-L116 | train | Returns the integer value of the Java version field. | [
30522,
2797,
2345,
20014,
2131,
3900,
3567,
27774,
21369,
3372,
1006,
1007,
1063,
2065,
1006,
9262,
1035,
2544,
1027,
1027,
19701,
1007,
1063,
2709,
1014,
1025,
1065,
5164,
2358,
2099,
1027,
9262,
1035,
2544,
1012,
4942,
3367,
4892,
1006,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
apache/flink | flink-core/src/main/java/org/apache/flink/api/java/typeutils/runtime/PojoSerializer.java | PojoSerializer.getSubclassSerializer | TypeSerializer<?> getSubclassSerializer(Class<?> subclass) {
TypeSerializer<?> result = subclassSerializerCache.get(subclass);
if (result == null) {
result = createSubclassSerializer(subclass);
subclassSerializerCache.put(subclass, result);
}
return result;
} | java | TypeSerializer<?> getSubclassSerializer(Class<?> subclass) {
TypeSerializer<?> result = subclassSerializerCache.get(subclass);
if (result == null) {
result = createSubclassSerializer(subclass);
subclassSerializerCache.put(subclass, result);
}
return result;
} | [
"TypeSerializer",
"<",
"?",
">",
"getSubclassSerializer",
"(",
"Class",
"<",
"?",
">",
"subclass",
")",
"{",
"TypeSerializer",
"<",
"?",
">",
"result",
"=",
"subclassSerializerCache",
".",
"get",
"(",
"subclass",
")",
";",
"if",
"(",
"result",
"==",
"null"... | Fetches cached serializer for a non-registered subclass;
also creates the serializer if it doesn't exist yet.
This method is also exposed to package-private access
for testing purposes. | [
"Fetches",
"cached",
"serializer",
"for",
"a",
"non",
"-",
"registered",
"subclass",
";",
"also",
"creates",
"the",
"serializer",
"if",
"it",
"doesn",
"t",
"exist",
"yet",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-core/src/main/java/org/apache/flink/api/java/typeutils/runtime/PojoSerializer.java#L1061-L1068 | train | Get the subclass serializer for the given class. | [
30522,
4127,
11610,
28863,
1026,
1029,
1028,
4152,
12083,
26266,
8043,
4818,
17629,
1006,
2465,
1026,
1029,
1028,
4942,
26266,
1007,
1063,
4127,
11610,
28863,
1026,
1029,
1028,
2765,
1027,
4942,
26266,
8043,
4818,
17629,
3540,
5403,
1012,
2... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
looly/hutool | hutool-json/src/main/java/cn/hutool/json/JSONUtil.java | JSONUtil.readJSON | public static JSON readJSON(File file, Charset charset) throws IORuntimeException {
return parse(FileReader.create(file, charset).readString());
} | java | public static JSON readJSON(File file, Charset charset) throws IORuntimeException {
return parse(FileReader.create(file, charset).readString());
} | [
"public",
"static",
"JSON",
"readJSON",
"(",
"File",
"file",
",",
"Charset",
"charset",
")",
"throws",
"IORuntimeException",
"{",
"return",
"parse",
"(",
"FileReader",
".",
"create",
"(",
"file",
",",
"charset",
")",
".",
"readString",
"(",
")",
")",
";",
... | 读取JSON
@param file JSON文件
@param charset 编码
@return JSON(包括JSONObject和JSONArray)
@throws IORuntimeException IO异常 | [
"读取JSON"
] | bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-json/src/main/java/cn/hutool/json/JSONUtil.java#L212-L214 | train | Read a JSON file. | [
30522,
2270,
10763,
1046,
3385,
3191,
22578,
2239,
1006,
5371,
5371,
1010,
25869,
13462,
25869,
13462,
1007,
11618,
22834,
15532,
7292,
10288,
24422,
1063,
2709,
11968,
3366,
1006,
5371,
16416,
4063,
1012,
3443,
1006,
5371,
1010,
25869,
13462... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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/mail/MailUtil.java | MailUtil.splitAddress | private static List<String> splitAddress(String addresses){
if(StrUtil.isBlank(addresses)) {
return null;
}
List<String> result;
if(StrUtil.contains(addresses, ',')) {
result = StrUtil.splitTrim(addresses, ',');
}else if(StrUtil.contains(addresses, ';')) {
result = StrUtil.splitTrim(addre... | java | private static List<String> splitAddress(String addresses){
if(StrUtil.isBlank(addresses)) {
return null;
}
List<String> result;
if(StrUtil.contains(addresses, ',')) {
result = StrUtil.splitTrim(addresses, ',');
}else if(StrUtil.contains(addresses, ';')) {
result = StrUtil.splitTrim(addre... | [
"private",
"static",
"List",
"<",
"String",
">",
"splitAddress",
"(",
"String",
"addresses",
")",
"{",
"if",
"(",
"StrUtil",
".",
"isBlank",
"(",
"addresses",
")",
")",
"{",
"return",
"null",
";",
"}",
"List",
"<",
"String",
">",
"result",
";",
"if",
... | 将多个联系人转为列表,分隔符为逗号或者分号
@param addresses 多个联系人,如果为空返回null
@return 联系人列表 | [
"将多个联系人转为列表,分隔符为逗号或者分号"
] | bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-extra/src/main/java/cn/hutool/extra/mail/MailUtil.java#L208-L222 | train | Splits the given address string into a list of addresses. | [
30522,
2797,
10763,
2862,
1026,
5164,
1028,
3975,
4215,
16200,
4757,
1006,
5164,
11596,
1007,
1063,
2065,
1006,
2358,
22134,
4014,
1012,
2003,
28522,
8950,
1006,
11596,
1007,
1007,
1063,
2709,
19701,
1025,
1065,
2862,
1026,
5164,
1028,
2765... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
looly/hutool | hutool-core/src/main/java/cn/hutool/core/util/HexUtil.java | HexUtil.appendHex | public static void appendHex(StringBuilder builder, byte b, boolean toLowerCase) {
final char[] toDigits = toLowerCase ? DIGITS_LOWER : DIGITS_UPPER;
int high = (b & 0xf0) >>> 4;//高位
int low = b & 0x0f;//低位
builder.append(toDigits[high]);
builder.append(toDigits[low]);
} | java | public static void appendHex(StringBuilder builder, byte b, boolean toLowerCase) {
final char[] toDigits = toLowerCase ? DIGITS_LOWER : DIGITS_UPPER;
int high = (b & 0xf0) >>> 4;//高位
int low = b & 0x0f;//低位
builder.append(toDigits[high]);
builder.append(toDigits[low]);
} | [
"public",
"static",
"void",
"appendHex",
"(",
"StringBuilder",
"builder",
",",
"byte",
"b",
",",
"boolean",
"toLowerCase",
")",
"{",
"final",
"char",
"[",
"]",
"toDigits",
"=",
"toLowerCase",
"?",
"DIGITS_LOWER",
":",
"DIGITS_UPPER",
";",
"int",
"high",
"=",... | 将byte值转为16进制并添加到{@link StringBuilder}中
@param builder {@link StringBuilder}
@param b byte
@param toLowerCase 是否使用小写
@since 4.4.1 | [
"将byte值转为16进制并添加到",
"{"
] | bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/util/HexUtil.java#L330-L337 | train | Appends a hex value to a StringBuilder. | [
30522,
2270,
10763,
11675,
10439,
10497,
5369,
2595,
1006,
5164,
8569,
23891,
2099,
12508,
1010,
24880,
1038,
1010,
22017,
20898,
2000,
27663,
18992,
3366,
1007,
1063,
2345,
25869,
1031,
1033,
28681,
8004,
12762,
1027,
2000,
27663,
18992,
336... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
looly/hutool | hutool-core/src/main/java/cn/hutool/core/lang/JarClassLoader.java | JarClassLoader.loadJarToSystemClassLoader | public static URLClassLoader loadJarToSystemClassLoader(File jarFile) {
URLClassLoader urlClassLoader = (URLClassLoader) ClassLoader.getSystemClassLoader();
loadJar(urlClassLoader, jarFile);
return urlClassLoader;
} | java | public static URLClassLoader loadJarToSystemClassLoader(File jarFile) {
URLClassLoader urlClassLoader = (URLClassLoader) ClassLoader.getSystemClassLoader();
loadJar(urlClassLoader, jarFile);
return urlClassLoader;
} | [
"public",
"static",
"URLClassLoader",
"loadJarToSystemClassLoader",
"(",
"File",
"jarFile",
")",
"{",
"URLClassLoader",
"urlClassLoader",
"=",
"(",
"URLClassLoader",
")",
"ClassLoader",
".",
"getSystemClassLoader",
"(",
")",
";",
"loadJar",
"(",
"urlClassLoader",
",",... | 加载Jar文件到System ClassLoader中
@param jarFile 被加载的jar
@return System ClassLoader | [
"加载Jar文件到System",
"ClassLoader中"
] | bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/lang/JarClassLoader.java#L78-L82 | train | Load a jar file to the system class loader. | [
30522,
2270,
10763,
24471,
15472,
27102,
11066,
2121,
7170,
16084,
13122,
27268,
6633,
26266,
11066,
2121,
1006,
5371,
15723,
8873,
2571,
1007,
1063,
24471,
30524,
1006,
24471,
15472,
27102,
11066,
2121,
1010,
15723,
8873,
2571,
1007,
1025,
2... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
apache/flink | flink-table/flink-table-common/src/main/java/org/apache/flink/table/descriptors/Statistics.java | Statistics.columnAvgLength | public Statistics columnAvgLength(String columnName, Double avgLen) {
this.columnStats
.computeIfAbsent(columnName, column -> new HashMap<>())
.put(AVG_LENGTH, String.valueOf(avgLen));
return this;
} | java | public Statistics columnAvgLength(String columnName, Double avgLen) {
this.columnStats
.computeIfAbsent(columnName, column -> new HashMap<>())
.put(AVG_LENGTH, String.valueOf(avgLen));
return this;
} | [
"public",
"Statistics",
"columnAvgLength",
"(",
"String",
"columnName",
",",
"Double",
"avgLen",
")",
"{",
"this",
".",
"columnStats",
".",
"computeIfAbsent",
"(",
"columnName",
",",
"column",
"->",
"new",
"HashMap",
"<>",
"(",
")",
")",
".",
"put",
"(",
"... | Sets the average length statistic for the given column. | [
"Sets",
"the",
"average",
"length",
"statistic",
"for",
"the",
"given",
"column",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-table/flink-table-common/src/main/java/org/apache/flink/table/descriptors/Statistics.java#L111-L116 | train | Sets the avg length statistics for the specified column. | [
30522,
2270,
6747,
5930,
11431,
9354,
3070,
2705,
1006,
5164,
5930,
18442,
1010,
3313,
20704,
9354,
2078,
1007,
1063,
2023,
1012,
7753,
29336,
2015,
1012,
24134,
10128,
7875,
5054,
2102,
1006,
5930,
18442,
1010,
5930,
1011,
1028,
2047,
2332... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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-http2/src/main/java/io/netty/handler/codec/http2/HpackDecoder.java | HpackDecoder.setMaxHeaderTableSize | public void setMaxHeaderTableSize(long maxHeaderTableSize) throws Http2Exception {
if (maxHeaderTableSize < MIN_HEADER_TABLE_SIZE || maxHeaderTableSize > MAX_HEADER_TABLE_SIZE) {
throw connectionError(PROTOCOL_ERROR, "Header Table Size must be >= %d and <= %d but was %d",
MIN_HEA... | java | public void setMaxHeaderTableSize(long maxHeaderTableSize) throws Http2Exception {
if (maxHeaderTableSize < MIN_HEADER_TABLE_SIZE || maxHeaderTableSize > MAX_HEADER_TABLE_SIZE) {
throw connectionError(PROTOCOL_ERROR, "Header Table Size must be >= %d and <= %d but was %d",
MIN_HEA... | [
"public",
"void",
"setMaxHeaderTableSize",
"(",
"long",
"maxHeaderTableSize",
")",
"throws",
"Http2Exception",
"{",
"if",
"(",
"maxHeaderTableSize",
"<",
"MIN_HEADER_TABLE_SIZE",
"||",
"maxHeaderTableSize",
">",
"MAX_HEADER_TABLE_SIZE",
")",
"{",
"throw",
"connectionError... | Set the maximum table size. If this is below the maximum size of the dynamic table used by
the encoder, the beginning of the next header block MUST signal this change. | [
"Set",
"the",
"maximum",
"table",
"size",
".",
"If",
"this",
"is",
"below",
"the",
"maximum",
"size",
"of",
"the",
"dynamic",
"table",
"used",
"by",
"the",
"encoder",
"the",
"beginning",
"of",
"the",
"next",
"header",
"block",
"MUST",
"signal",
"this",
"... | ba06eafa1c1824bd154f1a380019e7ea2edf3c4c | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/codec-http2/src/main/java/io/netty/handler/codec/http2/HpackDecoder.java#L305-L317 | train | Sets the max header table size. | [
30522,
2270,
11675,
2275,
17848,
4974,
8743,
3085,
5332,
4371,
1006,
2146,
4098,
4974,
8743,
3085,
5332,
4371,
1007,
11618,
8299,
2475,
10288,
24422,
1063,
2065,
1006,
4098,
4974,
8743,
3085,
5332,
4371,
1026,
8117,
1035,
20346,
1035,
2795,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
looly/hutool | hutool-db/src/main/java/cn/hutool/db/Db.java | Db.quietRollback | private void quietRollback(Connection conn) {
if (null != conn) {
try {
conn.rollback();
} catch (Exception e) {
StaticLog.error(e);
}
}
} | java | private void quietRollback(Connection conn) {
if (null != conn) {
try {
conn.rollback();
} catch (Exception e) {
StaticLog.error(e);
}
}
} | [
"private",
"void",
"quietRollback",
"(",
"Connection",
"conn",
")",
"{",
"if",
"(",
"null",
"!=",
"conn",
")",
"{",
"try",
"{",
"conn",
".",
"rollback",
"(",
")",
";",
"}",
"catch",
"(",
"Exception",
"e",
")",
"{",
"StaticLog",
".",
"error",
"(",
"... | 静默回滚事务
@param conn Connection | [
"静默回滚事务"
] | bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-db/src/main/java/cn/hutool/db/Db.java#L212-L220 | train | Rollbacks the transaction. | [
30522,
2797,
11675,
4251,
28402,
5963,
1006,
4434,
9530,
2078,
1007,
1063,
2065,
1006,
19701,
999,
1027,
9530,
2078,
1007,
1063,
3046,
1063,
9530,
2078,
1012,
4897,
5963,
1006,
1007,
1025,
1065,
4608,
1006,
6453,
1041,
1007,
1063,
10763,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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/DuplicatingCheckpointOutputStream.java | DuplicatingCheckpointOutputStream.closeAndGetSecondaryHandle | public StreamStateHandle closeAndGetSecondaryHandle() throws IOException {
if (secondaryStreamException == null) {
flushInternalBuffer();
return secondaryOutputStream.closeAndGetHandle();
} else {
throw new IOException("Secondary stream previously failed exceptionally", secondaryStreamException);
}
} | java | public StreamStateHandle closeAndGetSecondaryHandle() throws IOException {
if (secondaryStreamException == null) {
flushInternalBuffer();
return secondaryOutputStream.closeAndGetHandle();
} else {
throw new IOException("Secondary stream previously failed exceptionally", secondaryStreamException);
}
} | [
"public",
"StreamStateHandle",
"closeAndGetSecondaryHandle",
"(",
")",
"throws",
"IOException",
"{",
"if",
"(",
"secondaryStreamException",
"==",
"null",
")",
"{",
"flushInternalBuffer",
"(",
")",
";",
"return",
"secondaryOutputStream",
".",
"closeAndGetHandle",
"(",
... | Returns the state handle from the {@link #secondaryOutputStream}. Also reports suppressed exceptions from earlier
interactions with that stream. | [
"Returns",
"the",
"state",
"handle",
"from",
"the",
"{"
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/state/DuplicatingCheckpointOutputStream.java#L261-L268 | train | Closes the underlying stream and returns the handle of the secondary stream. | [
30522,
2270,
9199,
12259,
11774,
2571,
2485,
5685,
18150,
3366,
8663,
7662,
2100,
11774,
2571,
1006,
1007,
11618,
22834,
10288,
24422,
1063,
2065,
1006,
3905,
21422,
10288,
24422,
1027,
1027,
19701,
1007,
1063,
13862,
18447,
11795,
2389,
8569... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
apache/flink | flink-table/flink-table-runtime-blink/src/main/java/org/apache/flink/table/runtime/rank/TopNBuffer.java | TopNBuffer.removeLast | BaseRow removeLast() {
Map.Entry<BaseRow, Collection<BaseRow>> last = treeMap.lastEntry();
BaseRow lastElement = null;
if (last != null) {
Collection<BaseRow> list = last.getValue();
lastElement = getLastElement(list);
if (lastElement != null) {
if (list.remove(lastElement)) {
currentTopNum -= 1... | java | BaseRow removeLast() {
Map.Entry<BaseRow, Collection<BaseRow>> last = treeMap.lastEntry();
BaseRow lastElement = null;
if (last != null) {
Collection<BaseRow> list = last.getValue();
lastElement = getLastElement(list);
if (lastElement != null) {
if (list.remove(lastElement)) {
currentTopNum -= 1... | [
"BaseRow",
"removeLast",
"(",
")",
"{",
"Map",
".",
"Entry",
"<",
"BaseRow",
",",
"Collection",
"<",
"BaseRow",
">",
">",
"last",
"=",
"treeMap",
".",
"lastEntry",
"(",
")",
";",
"BaseRow",
"lastElement",
"=",
"null",
";",
"if",
"(",
"last",
"!=",
"n... | Removes the last record of the last Entry in the buffer.
@return removed record | [
"Removes",
"the",
"last",
"record",
"of",
"the",
"last",
"Entry",
"in",
"the",
"buffer",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-table/flink-table-runtime-blink/src/main/java/org/apache/flink/table/runtime/rank/TopNBuffer.java#L122-L138 | train | Removes the last element in the tree. | [
30522,
2918,
10524,
6366,
8523,
2102,
1006,
1007,
1063,
4949,
1012,
4443,
1026,
2918,
10524,
1010,
3074,
1026,
2918,
10524,
1028,
1028,
2197,
1027,
3392,
2863,
2361,
1012,
2197,
4765,
2854,
1006,
1007,
1025,
2918,
10524,
2197,
12260,
3672,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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-http2/src/main/java/io/netty/handler/codec/http2/Http2FrameCodec.java | Http2FrameCodec.forEachActiveStream | final void forEachActiveStream(final Http2FrameStreamVisitor streamVisitor) throws Http2Exception {
assert ctx.executor().inEventLoop();
connection().forEachActiveStream(new Http2StreamVisitor() {
@Override
public boolean visit(Http2Stream stream) {
try {
... | java | final void forEachActiveStream(final Http2FrameStreamVisitor streamVisitor) throws Http2Exception {
assert ctx.executor().inEventLoop();
connection().forEachActiveStream(new Http2StreamVisitor() {
@Override
public boolean visit(Http2Stream stream) {
try {
... | [
"final",
"void",
"forEachActiveStream",
"(",
"final",
"Http2FrameStreamVisitor",
"streamVisitor",
")",
"throws",
"Http2Exception",
"{",
"assert",
"ctx",
".",
"executor",
"(",
")",
".",
"inEventLoop",
"(",
")",
";",
"connection",
"(",
")",
".",
"forEachActiveStream... | Iterates over all active HTTP/2 streams.
<p>This method must not be called outside of the event loop. | [
"Iterates",
"over",
"all",
"active",
"HTTP",
"/",
"2",
"streams",
"."
] | ba06eafa1c1824bd154f1a380019e7ea2edf3c4c | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/codec-http2/src/main/java/io/netty/handler/codec/http2/Http2FrameCodec.java#L186-L200 | train | For each active stream visit the given streamVisitor. | [
30522,
2345,
11675,
18921,
6776,
19620,
21422,
1006,
2345,
8299,
2475,
15643,
21422,
11365,
15660,
5460,
11365,
15660,
1007,
11618,
8299,
2475,
10288,
24422,
1063,
20865,
14931,
2595,
1012,
4654,
8586,
16161,
2099,
1006,
1007,
1012,
1999,
186... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
apache/flink | flink-connectors/flink-hadoop-compatibility/src/main/java/org/apache/flink/api/java/hadoop/mapred/HadoopOutputFormatBase.java | HadoopOutputFormatBase.open | @Override
public void open(int taskNumber, int numTasks) throws IOException {
// enforce sequential open() calls
synchronized (OPEN_MUTEX) {
if (Integer.toString(taskNumber + 1).length() > 6) {
throw new IOException("Task id too large.");
}
TaskAttemptID taskAttemptID = TaskAttemptID.forName("attemp... | java | @Override
public void open(int taskNumber, int numTasks) throws IOException {
// enforce sequential open() calls
synchronized (OPEN_MUTEX) {
if (Integer.toString(taskNumber + 1).length() > 6) {
throw new IOException("Task id too large.");
}
TaskAttemptID taskAttemptID = TaskAttemptID.forName("attemp... | [
"@",
"Override",
"public",
"void",
"open",
"(",
"int",
"taskNumber",
",",
"int",
"numTasks",
")",
"throws",
"IOException",
"{",
"// enforce sequential open() calls",
"synchronized",
"(",
"OPEN_MUTEX",
")",
"{",
"if",
"(",
"Integer",
".",
"toString",
"(",
"taskNu... | create the temporary output file for hadoop RecordWriter.
@param taskNumber The number of the parallel instance.
@param numTasks The number of parallel tasks.
@throws java.io.IOException | [
"create",
"the",
"temporary",
"output",
"file",
"for",
"hadoop",
"RecordWriter",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-connectors/flink-hadoop-compatibility/src/main/java/org/apache/flink/api/java/hadoop/mapred/HadoopOutputFormatBase.java#L111-L141 | train | This method is called by the TaskManager to open the job. | [
30522,
1030,
2058,
15637,
2270,
11675,
2330,
1006,
20014,
4708,
19172,
5677,
1010,
20014,
16371,
20492,
19895,
2015,
1007,
11618,
22834,
10288,
24422,
1063,
1013,
1013,
16306,
25582,
2330,
1006,
1007,
4455,
25549,
1006,
2330,
1035,
20101,
259... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
apache/flink | flink-connectors/flink-connector-hive/src/main/java/org/apache/flink/table/catalog/hive/GenericHiveMetastoreCatalogUtil.java | GenericHiveMetastoreCatalogUtil.createHiveDatabase | public static Database createHiveDatabase(String dbName, CatalogDatabase db) {
Map<String, String> props = db.getProperties();
return new Database(
dbName,
db.getDescription().isPresent() ? db.getDescription().get() : null,
null,
props);
} | java | public static Database createHiveDatabase(String dbName, CatalogDatabase db) {
Map<String, String> props = db.getProperties();
return new Database(
dbName,
db.getDescription().isPresent() ? db.getDescription().get() : null,
null,
props);
} | [
"public",
"static",
"Database",
"createHiveDatabase",
"(",
"String",
"dbName",
",",
"CatalogDatabase",
"db",
")",
"{",
"Map",
"<",
"String",
",",
"String",
">",
"props",
"=",
"db",
".",
"getProperties",
"(",
")",
";",
"return",
"new",
"Database",
"(",
"dbN... | Creates a Hive database from CatalogDatabase. | [
"Creates",
"a",
"Hive",
"database",
"from",
"CatalogDatabase",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-connectors/flink-connector-hive/src/main/java/org/apache/flink/table/catalog/hive/GenericHiveMetastoreCatalogUtil.java#L41-L48 | train | Create a Hive Database from a catalog database. | [
30522,
2270,
10763,
7809,
3443,
4048,
28614,
2696,
15058,
1006,
5164,
16962,
18442,
1010,
12105,
2850,
2696,
15058,
16962,
1007,
1063,
4949,
1026,
5164,
1010,
5164,
1028,
24387,
1027,
16962,
1012,
2131,
21572,
4842,
7368,
1006,
1007,
1025,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
looly/hutool | hutool-core/src/main/java/cn/hutool/core/collection/CollUtil.java | CollUtil.newArrayList | public static <T> ArrayList<T> newArrayList(Iterable<T> iterable) {
return (ArrayList<T>) list(false, iterable);
} | java | public static <T> ArrayList<T> newArrayList(Iterable<T> iterable) {
return (ArrayList<T>) list(false, iterable);
} | [
"public",
"static",
"<",
"T",
">",
"ArrayList",
"<",
"T",
">",
"newArrayList",
"(",
"Iterable",
"<",
"T",
">",
"iterable",
")",
"{",
"return",
"(",
"ArrayList",
"<",
"T",
">",
")",
"list",
"(",
"false",
",",
"iterable",
")",
";",
"}"
] | 新建一个ArrayList<br>
提供的参数为null时返回空{@link ArrayList}
@param <T> 集合元素类型
@param iterable {@link Iterable}
@return ArrayList对象
@since 3.1.0 | [
"新建一个ArrayList<br",
">",
"提供的参数为null时返回空",
"{",
"@link",
"ArrayList",
"}"
] | bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/collection/CollUtil.java#L655-L657 | train | Creates an ArrayList from the given iterable. | [
30522,
2270,
10763,
1026,
1056,
1028,
9140,
9863,
1026,
1056,
1028,
2047,
2906,
9447,
9863,
1006,
2009,
6906,
3468,
1026,
1056,
1028,
2009,
6906,
3468,
1007,
1063,
2709,
1006,
9140,
9863,
1026,
1056,
1028,
1007,
2862,
1006,
6270,
1010,
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... |
looly/hutool | hutool-core/src/main/java/cn/hutool/core/date/DateUtil.java | DateUtil.getEndValue | public static int getEndValue(Calendar calendar, int dateField) {
if(Calendar.DAY_OF_WEEK == dateField) {
return (calendar.getFirstDayOfWeek() + 6) % 7;
}
return calendar.getActualMaximum(dateField);
} | java | public static int getEndValue(Calendar calendar, int dateField) {
if(Calendar.DAY_OF_WEEK == dateField) {
return (calendar.getFirstDayOfWeek() + 6) % 7;
}
return calendar.getActualMaximum(dateField);
} | [
"public",
"static",
"int",
"getEndValue",
"(",
"Calendar",
"calendar",
",",
"int",
"dateField",
")",
"{",
"if",
"(",
"Calendar",
".",
"DAY_OF_WEEK",
"==",
"dateField",
")",
"{",
"return",
"(",
"calendar",
".",
"getFirstDayOfWeek",
"(",
")",
"+",
"6",
")",
... | 获取指定日期字段的最大值,例如分钟的最小值是59
@param calendar {@link Calendar}
@param dateField {@link DateField}
@return 字段最大值
@since 4.5.7
@see Calendar#getActualMaximum(int) | [
"获取指定日期字段的最大值,例如分钟的最小值是59"
] | bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/date/DateUtil.java#L1696-L1701 | train | Returns the value of the specified field in the given calendar. | [
30522,
2270,
10763,
20014,
2131,
10497,
10175,
5657,
1006,
8094,
8094,
1010,
20014,
3058,
3790,
1007,
1063,
2065,
1006,
8094,
1012,
2154,
1035,
1997,
1035,
2733,
1027,
1027,
3058,
3790,
1007,
1063,
2709,
1006,
8094,
1012,
2131,
8873,
12096,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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 | utility/src/main/java/com/networknt/utility/StringUtils.java | StringUtils.inputStreamToString | public static String inputStreamToString(InputStream inputStream, Charset charset) throws IOException {
if (inputStream != null && inputStream.available() != -1) {
ByteArrayOutputStream result = new ByteArrayOutputStream();
byte[] buffer = new byte[1024];
int length;
... | java | public static String inputStreamToString(InputStream inputStream, Charset charset) throws IOException {
if (inputStream != null && inputStream.available() != -1) {
ByteArrayOutputStream result = new ByteArrayOutputStream();
byte[] buffer = new byte[1024];
int length;
... | [
"public",
"static",
"String",
"inputStreamToString",
"(",
"InputStream",
"inputStream",
",",
"Charset",
"charset",
")",
"throws",
"IOException",
"{",
"if",
"(",
"inputStream",
"!=",
"null",
"&&",
"inputStream",
".",
"available",
"(",
")",
"!=",
"-",
"1",
")",
... | Convert an InputStream into a String.
Highest performing conversion per: https://stackoverflow.com/a/35446009
@param inputStream The input stream to be converted.
@param charset The decoding charset to use.
@return The string value of the input stream, null otherwise.
@throws IOException If there are any issues in re... | [
"Convert",
"an",
"InputStream",
"into",
"a",
"String",
"."
] | 2a60257c60663684c8f6dc8b5ea3cf184e534db6 | https://github.com/networknt/light-4j/blob/2a60257c60663684c8f6dc8b5ea3cf184e534db6/utility/src/main/java/com/networknt/utility/StringUtils.java#L1265-L1279 | train | This method is used to convert an input stream to a string. | [
30522,
2270,
10763,
5164,
20407,
25379,
13122,
18886,
3070,
1006,
20407,
25379,
20407,
25379,
1010,
25869,
13462,
25869,
13462,
1007,
11618,
22834,
10288,
24422,
1063,
2065,
1006,
20407,
25379,
999,
1027,
19701,
1004,
1004,
20407,
25379,
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/spark | examples/src/main/java/org/apache/spark/examples/sql/hive/JavaSparkHiveExample.java | JavaSparkHiveExample.main | public static void main(String[] args) {
// $example on:spark_hive$
// warehouseLocation points to the default location for managed databases and tables
String warehouseLocation = new File("spark-warehouse").getAbsolutePath();
SparkSession spark = SparkSession
.builder()
.appName("Java Spark... | java | public static void main(String[] args) {
// $example on:spark_hive$
// warehouseLocation points to the default location for managed databases and tables
String warehouseLocation = new File("spark-warehouse").getAbsolutePath();
SparkSession spark = SparkSession
.builder()
.appName("Java Spark... | [
"public",
"static",
"void",
"main",
"(",
"String",
"[",
"]",
"args",
")",
"{",
"// $example on:spark_hive$",
"// warehouseLocation points to the default location for managed databases and tables",
"String",
"warehouseLocation",
"=",
"new",
"File",
"(",
"\"spark-warehouse\"",
... | $example off:spark_hive$ | [
"$example",
"off",
":",
"spark_hive$"
] | 25ee0474f47d9c30d6f553a7892d9549f91071cf | https://github.com/apache/spark/blob/25ee0474f47d9c30d6f553a7892d9549f91071cf/examples/src/main/java/org/apache/spark/examples/sql/hive/JavaSparkHiveExample.java#L57-L128 | train | Example of creating a table and reading data from a file. | [
30522,
2270,
10763,
11675,
2364,
1006,
5164,
1031,
1033,
12098,
5620,
1007,
1063,
1013,
1013,
1002,
2742,
2006,
1024,
12125,
1035,
26736,
1002,
1013,
1013,
9746,
4135,
10719,
2685,
2000,
1996,
12398,
3295,
2005,
3266,
17881,
1998,
7251,
516... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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/SparkLauncher.java | SparkLauncher.launch | public Process launch() throws IOException {
ProcessBuilder pb = createBuilder();
boolean outputToLog = outputStream == null;
boolean errorToLog = !redirectErrorStream && errorStream == null;
String loggerName = getLoggerName();
if (loggerName != null && outputToLog && errorToLog) {
pb.redir... | java | public Process launch() throws IOException {
ProcessBuilder pb = createBuilder();
boolean outputToLog = outputStream == null;
boolean errorToLog = !redirectErrorStream && errorStream == null;
String loggerName = getLoggerName();
if (loggerName != null && outputToLog && errorToLog) {
pb.redir... | [
"public",
"Process",
"launch",
"(",
")",
"throws",
"IOException",
"{",
"ProcessBuilder",
"pb",
"=",
"createBuilder",
"(",
")",
";",
"boolean",
"outputToLog",
"=",
"outputStream",
"==",
"null",
";",
"boolean",
"errorToLog",
"=",
"!",
"redirectErrorStream",
"&&",
... | Launches a sub-process that will start the configured Spark application.
<p>
The {@link #startApplication(SparkAppHandle.Listener...)} method is preferred when launching
Spark, since it provides better control of the child application.
@return A process handle for the Spark app. | [
"Launches",
"a",
"sub",
"-",
"process",
"that",
"will",
"start",
"the",
"configured",
"Spark",
"application",
".",
"<p",
">",
"The",
"{",
"@link",
"#startApplication",
"(",
"SparkAppHandle",
".",
"Listener",
"...",
")",
"}",
"method",
"is",
"preferred",
"whe... | 25ee0474f47d9c30d6f553a7892d9549f91071cf | https://github.com/apache/spark/blob/25ee0474f47d9c30d6f553a7892d9549f91071cf/launcher/src/main/java/org/apache/spark/launcher/SparkLauncher.java#L312-L330 | train | Launch the process. | [
30522,
2270,
2832,
4888,
1006,
1007,
11618,
22834,
10288,
24422,
1063,
2832,
8569,
23891,
2099,
1052,
2497,
1027,
3443,
8569,
23891,
2099,
1006,
1007,
1025,
22017,
20898,
6434,
3406,
21197,
1027,
27852,
25379,
1027,
1027,
19701,
1025,
22017,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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/sampling/PoissonSampler.java | PoissonSampler.sample | @Override
public Iterator<T> sample(final Iterator<T> input) {
if (fraction == 0) {
return emptyIterable;
}
return new SampledIterator<T>() {
T currentElement;
int currentCount = 0;
@Override
public boolean hasNext() {
if (currentCount > 0) {
return true;
} else {
samplingProce... | java | @Override
public Iterator<T> sample(final Iterator<T> input) {
if (fraction == 0) {
return emptyIterable;
}
return new SampledIterator<T>() {
T currentElement;
int currentCount = 0;
@Override
public boolean hasNext() {
if (currentCount > 0) {
return true;
} else {
samplingProce... | [
"@",
"Override",
"public",
"Iterator",
"<",
"T",
">",
"sample",
"(",
"final",
"Iterator",
"<",
"T",
">",
"input",
")",
"{",
"if",
"(",
"fraction",
"==",
"0",
")",
"{",
"return",
"emptyIterable",
";",
"}",
"return",
"new",
"SampledIterator",
"<",
"T",
... | Sample the input elements, for each input element, generate its count following a poisson
distribution.
@param input Elements to be sampled.
@return The sampled result which is lazy computed upon input elements. | [
"Sample",
"the",
"input",
"elements",
"for",
"each",
"input",
"element",
"generate",
"its",
"count",
"following",
"a",
"poisson",
"distribution",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-java/src/main/java/org/apache/flink/api/java/sampling/PoissonSampler.java#L85-L162 | train | Samples an iterator of elements from the input. | [
30522,
1030,
2058,
15637,
2270,
2009,
6906,
4263,
1026,
1056,
1028,
7099,
1006,
2345,
2009,
6906,
4263,
1026,
1056,
1028,
7953,
1007,
1063,
2065,
1006,
12884,
1027,
1027,
1014,
1007,
1063,
2709,
4064,
21646,
3085,
1025,
1065,
2709,
2047,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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/Proxy.java | Proxy.setSslProxy | public Proxy setSslProxy(String sslProxy) {
verifyProxyTypeCompatibility(ProxyType.MANUAL);
this.proxyType = ProxyType.MANUAL;
this.sslProxy = sslProxy;
return this;
} | java | public Proxy setSslProxy(String sslProxy) {
verifyProxyTypeCompatibility(ProxyType.MANUAL);
this.proxyType = ProxyType.MANUAL;
this.sslProxy = sslProxy;
return this;
} | [
"public",
"Proxy",
"setSslProxy",
"(",
"String",
"sslProxy",
")",
"{",
"verifyProxyTypeCompatibility",
"(",
"ProxyType",
".",
"MANUAL",
")",
";",
"this",
".",
"proxyType",
"=",
"ProxyType",
".",
"MANUAL",
";",
"this",
".",
"sslProxy",
"=",
"sslProxy",
";",
"... | Specify which proxy to use for SSL connections.
@param sslProxy the proxy host, expected format is <code>hostname.com:1234</code>
@return reference to self | [
"Specify",
"which",
"proxy",
"to",
"use",
"for",
"SSL",
"connections",
"."
] | 7af172729f17b20269c8ca4ea6f788db48616535 | https://github.com/SeleniumHQ/selenium/blob/7af172729f17b20269c8ca4ea6f788db48616535/java/client/src/org/openqa/selenium/Proxy.java#L283-L288 | train | Sets the SSL proxy. | [
30522,
2270,
24540,
4520,
14540,
21572,
18037,
1006,
5164,
7020,
14277,
3217,
18037,
1007,
1063,
20410,
21572,
18037,
13874,
9006,
24952,
8553,
1006,
24540,
13874,
1012,
6410,
1007,
1025,
2023,
1012,
24540,
13874,
1027,
24540,
13874,
1012,
64... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
SeleniumHQ/selenium | java/client/src/org/openqa/selenium/support/ui/Select.java | Select.selectByVisibleText | @Override
public void selectByVisibleText(String text) {
// try to find the option via XPATH ...
List<WebElement> options =
element.findElements(By.xpath(".//option[normalize-space(.) = " + Quotes.escape(text) + "]"));
for (WebElement option : options) {
setSelected(option, true);
if (!... | java | @Override
public void selectByVisibleText(String text) {
// try to find the option via XPATH ...
List<WebElement> options =
element.findElements(By.xpath(".//option[normalize-space(.) = " + Quotes.escape(text) + "]"));
for (WebElement option : options) {
setSelected(option, true);
if (!... | [
"@",
"Override",
"public",
"void",
"selectByVisibleText",
"(",
"String",
"text",
")",
"{",
"// try to find the option via XPATH ...",
"List",
"<",
"WebElement",
">",
"options",
"=",
"element",
".",
"findElements",
"(",
"By",
".",
"xpath",
"(",
"\".//option[normalize... | Select all options that display text matching the argument. That is, when given "Bar" this
would select an option like:
<option value="foo">Bar</option>
@param text The visible text to match against
@throws NoSuchElementException If no matching option elements are found | [
"Select",
"all",
"options",
"that",
"display",
"text",
"matching",
"the",
"argument",
".",
"That",
"is",
"when",
"given",
"Bar",
"this",
"would",
"select",
"an",
"option",
"like",
":"
] | 7af172729f17b20269c8ca4ea6f788db48616535 | https://github.com/SeleniumHQ/selenium/blob/7af172729f17b20269c8ca4ea6f788db48616535/java/client/src/org/openqa/selenium/support/ui/Select.java#L110-L150 | train | Override the method to select the option with the specified text. | [
30522,
1030,
2058,
15637,
2270,
11675,
7276,
3762,
11365,
7028,
18209,
1006,
5164,
3793,
1007,
1063,
1013,
1013,
3046,
2000,
2424,
1996,
5724,
3081,
26726,
8988,
1012,
1012,
1012,
2862,
1026,
4773,
12260,
3672,
1028,
7047,
1027,
5783,
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/spark | sql/hive-thriftserver/src/main/java/org/apache/hive/service/cli/thrift/ThriftHttpServlet.java | ThriftHttpServlet.getHttpOnlyCookieHeader | private static String getHttpOnlyCookieHeader(Cookie cookie) {
NewCookie newCookie = new NewCookie(cookie.getName(), cookie.getValue(),
cookie.getPath(), cookie.getDomain(), cookie.getVersion(),
cookie.getComment(), cookie.getMaxAge(), cookie.getSecure());
return newCookie + "; HttpOnly";
} | java | private static String getHttpOnlyCookieHeader(Cookie cookie) {
NewCookie newCookie = new NewCookie(cookie.getName(), cookie.getValue(),
cookie.getPath(), cookie.getDomain(), cookie.getVersion(),
cookie.getComment(), cookie.getMaxAge(), cookie.getSecure());
return newCookie + "; HttpOnly";
} | [
"private",
"static",
"String",
"getHttpOnlyCookieHeader",
"(",
"Cookie",
"cookie",
")",
"{",
"NewCookie",
"newCookie",
"=",
"new",
"NewCookie",
"(",
"cookie",
".",
"getName",
"(",
")",
",",
"cookie",
".",
"getValue",
"(",
")",
",",
"cookie",
".",
"getPath",
... | Generate httponly cookie from HS2 cookie
@param cookie HS2 generated cookie
@return The httponly cookie | [
"Generate",
"httponly",
"cookie",
"from",
"HS2",
"cookie"
] | 25ee0474f47d9c30d6f553a7892d9549f91071cf | https://github.com/apache/spark/blob/25ee0474f47d9c30d6f553a7892d9549f91071cf/sql/hive-thriftserver/src/main/java/org/apache/hive/service/cli/thrift/ThriftHttpServlet.java#L303-L308 | train | Get the HttpOnly cookie header | [
30522,
2797,
10763,
5164,
2131,
11039,
25856,
2239,
2135,
3597,
23212,
11106,
13775,
2121,
1006,
17387,
17387,
1007,
1063,
2047,
3597,
23212,
2063,
2047,
3597,
23212,
2063,
1027,
2047,
2047,
3597,
23212,
2063,
1006,
17387,
1012,
2131,
18442,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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-json/src/main/java/cn/hutool/json/JSONConverter.java | JSONConverter.toList | protected static <T> List<T> toList(JSONArray jsonArray, Class<T> elementType) {
return Convert.toList(elementType, jsonArray);
} | java | protected static <T> List<T> toList(JSONArray jsonArray, Class<T> elementType) {
return Convert.toList(elementType, jsonArray);
} | [
"protected",
"static",
"<",
"T",
">",
"List",
"<",
"T",
">",
"toList",
"(",
"JSONArray",
"jsonArray",
",",
"Class",
"<",
"T",
">",
"elementType",
")",
"{",
"return",
"Convert",
".",
"toList",
"(",
"elementType",
",",
"jsonArray",
")",
";",
"}"
] | 将JSONArray转换为指定类型的对量列表
@param <T> 元素类型
@param jsonArray JSONArray
@param elementType 对象元素类型
@return 对象列表 | [
"将JSONArray转换为指定类型的对量列表"
] | bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-json/src/main/java/cn/hutool/json/JSONConverter.java#L50-L52 | train | Converts a JSONArray to a List of the given type. | [
30522,
5123,
10763,
1026,
1056,
1028,
2862,
1026,
1056,
1028,
2000,
9863,
1006,
1046,
3385,
2906,
9447,
1046,
3385,
2906,
9447,
1010,
2465,
1026,
1056,
1028,
5783,
13874,
1007,
1063,
2709,
10463,
1012,
2000,
9863,
1006,
5783,
13874,
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-runtime/src/main/java/org/apache/flink/runtime/zookeeper/ZooKeeperUtilityFactory.java | ZooKeeperUtilityFactory.createZooKeeperStateHandleStore | public <T extends Serializable> ZooKeeperStateHandleStore<T> createZooKeeperStateHandleStore(
String zkStateHandleStorePath,
RetrievableStateStorageHelper<T> stateStorageHelper) throws Exception {
return ZooKeeperUtils.createZooKeeperStateHandleStore(
facade,
zkStateHandleStorePath,
stateStorageHelper... | java | public <T extends Serializable> ZooKeeperStateHandleStore<T> createZooKeeperStateHandleStore(
String zkStateHandleStorePath,
RetrievableStateStorageHelper<T> stateStorageHelper) throws Exception {
return ZooKeeperUtils.createZooKeeperStateHandleStore(
facade,
zkStateHandleStorePath,
stateStorageHelper... | [
"public",
"<",
"T",
"extends",
"Serializable",
">",
"ZooKeeperStateHandleStore",
"<",
"T",
">",
"createZooKeeperStateHandleStore",
"(",
"String",
"zkStateHandleStorePath",
",",
"RetrievableStateStorageHelper",
"<",
"T",
">",
"stateStorageHelper",
")",
"throws",
"Exception... | Creates a {@link ZooKeeperStateHandleStore} instance with the provided arguments.
@param zkStateHandleStorePath specifying the path in ZooKeeper to store the state handles to
@param stateStorageHelper storing the actual state data
@param <T> Type of the state to be stored
@return a ZooKeeperStateHandleStore instance
@... | [
"Creates",
"a",
"{",
"@link",
"ZooKeeperStateHandleStore",
"}",
"instance",
"with",
"the",
"provided",
"arguments",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/zookeeper/ZooKeeperUtilityFactory.java#L79-L87 | train | Create a ZooKeeperStateHandleStore. | [
30522,
2270,
1026,
1056,
8908,
7642,
21335,
3468,
1028,
9201,
24764,
12259,
11774,
4244,
19277,
1026,
1056,
1028,
3443,
23221,
24764,
12259,
11774,
4244,
19277,
1006,
5164,
1062,
5705,
12259,
11774,
4244,
19277,
15069,
1010,
2128,
18886,
1333... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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/NumberUtil.java | NumberUtil.mul | public static BigDecimal mul(String v1, String v2) {
return mul(new BigDecimal(v1), new BigDecimal(v2));
} | java | public static BigDecimal mul(String v1, String v2) {
return mul(new BigDecimal(v1), new BigDecimal(v2));
} | [
"public",
"static",
"BigDecimal",
"mul",
"(",
"String",
"v1",
",",
"String",
"v2",
")",
"{",
"return",
"mul",
"(",
"new",
"BigDecimal",
"(",
"v1",
")",
",",
"new",
"BigDecimal",
"(",
"v2",
")",
")",
";",
"}"
] | 提供精确的乘法运算
@param v1 被乘数
@param v2 乘数
@return 积
@since 3.0.8 | [
"提供精确的乘法运算"
] | bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/util/NumberUtil.java#L424-L426 | train | Multiply two numbers. | [
30522,
2270,
10763,
2502,
3207,
6895,
9067,
14163,
2140,
1006,
5164,
1058,
2487,
1010,
5164,
1058,
2475,
1007,
1063,
2709,
14163,
2140,
1006,
2047,
2502,
3207,
6895,
9067,
1006,
1058,
2487,
1007,
1010,
2047,
2502,
3207,
6895,
9067,
1006,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
apache/flink | flink-streaming-java/src/main/java/org/apache/flink/streaming/runtime/tasks/StreamTask.java | StreamTask.createStateBackend | private StateBackend createStateBackend() throws Exception {
final StateBackend fromApplication = configuration.getStateBackend(getUserCodeClassLoader());
return StateBackendLoader.fromApplicationOrConfigOrDefault(
fromApplication,
getEnvironment().getTaskManagerInfo().getConfiguration(),
getUserCodeCl... | java | private StateBackend createStateBackend() throws Exception {
final StateBackend fromApplication = configuration.getStateBackend(getUserCodeClassLoader());
return StateBackendLoader.fromApplicationOrConfigOrDefault(
fromApplication,
getEnvironment().getTaskManagerInfo().getConfiguration(),
getUserCodeCl... | [
"private",
"StateBackend",
"createStateBackend",
"(",
")",
"throws",
"Exception",
"{",
"final",
"StateBackend",
"fromApplication",
"=",
"configuration",
".",
"getStateBackend",
"(",
"getUserCodeClassLoader",
"(",
")",
")",
";",
"return",
"StateBackendLoader",
".",
"fr... | ------------------------------------------------------------------------ | [
"------------------------------------------------------------------------"
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-streaming-java/src/main/java/org/apache/flink/streaming/runtime/tasks/StreamTask.java#L813-L821 | train | Create the state backend. | [
30522,
2797,
2110,
5963,
10497,
9005,
12259,
5963,
10497,
1006,
1007,
11618,
6453,
1063,
2345,
2110,
5963,
10497,
2013,
29098,
19341,
3508,
1027,
9563,
1012,
4152,
12259,
5963,
30524,
10230,
22287,
5162,
4590,
2378,
14876,
1006,
1007,
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/lang/ConsistentHash.java | ConsistentHash.remove | public void remove(T node) {
for (int i = 0; i < numberOfReplicas; i++) {
circle.remove(hashFunc.hash(node.toString() + i));
}
} | java | public void remove(T node) {
for (int i = 0; i < numberOfReplicas; i++) {
circle.remove(hashFunc.hash(node.toString() + i));
}
} | [
"public",
"void",
"remove",
"(",
"T",
"node",
")",
"{",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"numberOfReplicas",
";",
"i",
"++",
")",
"{",
"circle",
".",
"remove",
"(",
"hashFunc",
".",
"hash",
"(",
"node",
".",
"toString",
"(",
")",
... | 移除节点的同时移除相应的虚拟节点
@param node 节点对象 | [
"移除节点的同时移除相应的虚拟节点"
] | bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/lang/ConsistentHash.java#L78-L82 | train | Remove a node from the cluster. | [
30522,
2270,
11675,
6366,
1006,
1056,
13045,
1007,
1063,
2005,
1006,
20014,
1045,
1027,
1014,
1025,
1045,
1026,
2193,
11253,
2890,
24759,
5555,
2015,
1025,
1045,
1009,
1009,
1007,
1063,
4418,
1012,
6366,
1006,
23325,
11263,
12273,
1012,
233... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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-streaming/src/main/java/org/apache/flink/streaming/examples/statemachine/event/Event.java | Event.formatAddress | public static String formatAddress(int address) {
int b1 = (address >>> 24) & 0xff;
int b2 = (address >>> 16) & 0xff;
int b3 = (address >>> 8) & 0xff;
int b4 = address & 0xff;
return "" + b1 + '.' + b2 + '.' + b3 + '.' + b4;
} | java | public static String formatAddress(int address) {
int b1 = (address >>> 24) & 0xff;
int b2 = (address >>> 16) & 0xff;
int b3 = (address >>> 8) & 0xff;
int b4 = address & 0xff;
return "" + b1 + '.' + b2 + '.' + b3 + '.' + b4;
} | [
"public",
"static",
"String",
"formatAddress",
"(",
"int",
"address",
")",
"{",
"int",
"b1",
"=",
"(",
"address",
">>>",
"24",
")",
"&",
"0xff",
";",
"int",
"b2",
"=",
"(",
"address",
">>>",
"16",
")",
"&",
"0xff",
";",
"int",
"b3",
"=",
"(",
"ad... | Util method to create a string representation of a 32 bit integer representing
an IPv4 address.
@param address The address, MSB first.
@return The IP address string. | [
"Util",
"method",
"to",
"create",
"a",
"string",
"representation",
"of",
"a",
"32",
"bit",
"integer",
"representing",
"an",
"IPv4",
"address",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-examples/flink-examples-streaming/src/main/java/org/apache/flink/streaming/examples/statemachine/event/Event.java#L96-L103 | train | Format an address into a string | [
30522,
2270,
10763,
5164,
4289,
4215,
16200,
4757,
1006,
20014,
4769,
1007,
1063,
20014,
29491,
1027,
1006,
4769,
1028,
1028,
1028,
2484,
1007,
1004,
1014,
2595,
4246,
1025,
20014,
1038,
2475,
1027,
1006,
4769,
1028,
1028,
1028,
2385,
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-extra/src/main/java/cn/hutool/extra/template/engine/velocity/VelocityUtil.java | VelocityUtil.toFile | public static void toFile(Template template, VelocityContext context, String destPath) {
PrintWriter writer = null;
try {
writer = FileUtil.getPrintWriter(destPath, Velocity.getProperty(Velocity.INPUT_ENCODING).toString(), false);
merge(template, context, writer);
} catch (IORuntimeException e) {
t... | java | public static void toFile(Template template, VelocityContext context, String destPath) {
PrintWriter writer = null;
try {
writer = FileUtil.getPrintWriter(destPath, Velocity.getProperty(Velocity.INPUT_ENCODING).toString(), false);
merge(template, context, writer);
} catch (IORuntimeException e) {
t... | [
"public",
"static",
"void",
"toFile",
"(",
"Template",
"template",
",",
"VelocityContext",
"context",
",",
"String",
"destPath",
")",
"{",
"PrintWriter",
"writer",
"=",
"null",
";",
"try",
"{",
"writer",
"=",
"FileUtil",
".",
"getPrintWriter",
"(",
"destPath",... | 生成文件
@param template 模板
@param context 模板上下文
@param destPath 目标路径(绝对) | [
"生成文件"
] | bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-extra/src/main/java/cn/hutool/extra/template/engine/velocity/VelocityUtil.java#L165-L175 | train | Write the contents of the given Velocity template to the given destination path. | [
30522,
2270,
10763,
11675,
2000,
8873,
2571,
1006,
23561,
23561,
1010,
10146,
8663,
18209,
6123,
1010,
5164,
4078,
25856,
8988,
1007,
1063,
6140,
15994,
3213,
1027,
19701,
1025,
3046,
1063,
3213,
1027,
5371,
21823,
2140,
1012,
2131,
16550,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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/embedded/undertow/UndertowCompressionConfigurer.java | UndertowCompressionConfigurer.configureCompression | public static HttpHandler configureCompression(Compression compression,
HttpHandler httpHandler) {
if (compression == null || !compression.getEnabled()) {
return httpHandler;
}
ContentEncodingRepository repository = new ContentEncodingRepository();
repository.addEncodingHandler("gzip", new GzipEncodingPro... | java | public static HttpHandler configureCompression(Compression compression,
HttpHandler httpHandler) {
if (compression == null || !compression.getEnabled()) {
return httpHandler;
}
ContentEncodingRepository repository = new ContentEncodingRepository();
repository.addEncodingHandler("gzip", new GzipEncodingPro... | [
"public",
"static",
"HttpHandler",
"configureCompression",
"(",
"Compression",
"compression",
",",
"HttpHandler",
"httpHandler",
")",
"{",
"if",
"(",
"compression",
"==",
"null",
"||",
"!",
"compression",
".",
"getEnabled",
"(",
")",
")",
"{",
"return",
"httpHan... | Optionally wrap the given {@link HttpHandler} for HTTP compression support.
@param compression the HTTP compression configuration
@param httpHandler the HTTP handler to wrap
@return the wrapped HTTP handler if compression is enabled, or the handler itself | [
"Optionally",
"wrap",
"the",
"given",
"{"
] | 0b27f7c70e164b2b1a96477f1d9c1acba56790c1 | https://github.com/spring-projects/spring-boot/blob/0b27f7c70e164b2b1a96477f1d9c1acba56790c1/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/embedded/undertow/UndertowCompressionConfigurer.java#L55-L64 | train | Configure the compression. | [
30522,
2270,
10763,
8299,
11774,
3917,
9530,
8873,
27390,
8586,
25377,
8303,
3258,
1006,
13379,
13379,
1010,
8299,
11774,
3917,
8299,
11774,
3917,
1007,
1063,
2065,
1006,
13379,
1027,
1027,
19701,
1064,
1064,
999,
13379,
1012,
2131,
8189,
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... |
hankcs/HanLP | src/main/java/com/hankcs/hanlp/corpus/io/IOUtil.java | IOUtil.readBytesFromOtherInputStream | public static int readBytesFromOtherInputStream(InputStream is, byte[] targetArray) throws IOException
{
assert targetArray != null;
if (targetArray.length == 0) return 0;
int len;
int off = 0;
while (off < targetArray.length && (len = is.read(targetArray, off, targetArray.le... | java | public static int readBytesFromOtherInputStream(InputStream is, byte[] targetArray) throws IOException
{
assert targetArray != null;
if (targetArray.length == 0) return 0;
int len;
int off = 0;
while (off < targetArray.length && (len = is.read(targetArray, off, targetArray.le... | [
"public",
"static",
"int",
"readBytesFromOtherInputStream",
"(",
"InputStream",
"is",
",",
"byte",
"[",
"]",
"targetArray",
")",
"throws",
"IOException",
"{",
"assert",
"targetArray",
"!=",
"null",
";",
"if",
"(",
"targetArray",
".",
"length",
"==",
"0",
")",
... | 从InputStream读取指定长度的字节出来
@param is 流
@param targetArray output
@return 实际读取了多少字节,返回0表示遇到了文件尾部
@throws IOException | [
"从InputStream读取指定长度的字节出来"
] | a538d0722ab2e4980a9dcd9ea40324fc3ddba7ce | https://github.com/hankcs/HanLP/blob/a538d0722ab2e4980a9dcd9ea40324fc3ddba7ce/src/main/java/com/hankcs/hanlp/corpus/io/IOUtil.java#L292-L303 | train | Read bytes from other input stream. | [
30522,
2270,
10763,
20014,
3191,
3762,
4570,
19699,
19506,
12399,
2378,
18780,
21422,
1006,
20407,
25379,
2003,
1010,
24880,
1031,
1033,
4539,
2906,
9447,
1007,
11618,
22834,
10288,
24422,
1063,
20865,
4539,
2906,
9447,
999,
1027,
19701,
1025... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
looly/hutool | hutool-core/src/main/java/cn/hutool/core/util/ReUtil.java | ReUtil.findAll | public static List<String> findAll(String regex, CharSequence content, int group) {
return findAll(regex, content, group, new ArrayList<String>());
} | java | public static List<String> findAll(String regex, CharSequence content, int group) {
return findAll(regex, content, group, new ArrayList<String>());
} | [
"public",
"static",
"List",
"<",
"String",
">",
"findAll",
"(",
"String",
"regex",
",",
"CharSequence",
"content",
",",
"int",
"group",
")",
"{",
"return",
"findAll",
"(",
"regex",
",",
"content",
",",
"group",
",",
"new",
"ArrayList",
"<",
"String",
">"... | 取得内容中匹配的所有结果
@param regex 正则
@param content 被查找的内容
@param group 正则的分组
@return 结果列表
@since 3.0.6 | [
"取得内容中匹配的所有结果"
] | bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/util/ReUtil.java#L388-L390 | train | Finds all matches of the given regex in the given content and group. | [
30522,
2270,
10763,
2862,
1026,
5164,
1028,
2424,
8095,
1006,
5164,
19723,
10288,
1010,
25869,
3366,
4226,
5897,
4180,
1010,
20014,
2177,
1007,
1063,
2709,
2424,
8095,
1006,
19723,
10288,
1010,
4180,
1010,
2177,
1010,
2047,
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/flink | flink-runtime/src/main/java/org/apache/flink/runtime/checkpoint/CheckpointCoordinator.java | CheckpointCoordinator.receiveDeclineMessage | public void receiveDeclineMessage(DeclineCheckpoint message) {
if (shutdown || message == null) {
return;
}
if (!job.equals(message.getJob())) {
throw new IllegalArgumentException("Received DeclineCheckpoint message for job " +
message.getJob() + " while this coordinator handles job " + job);
}
fin... | java | public void receiveDeclineMessage(DeclineCheckpoint message) {
if (shutdown || message == null) {
return;
}
if (!job.equals(message.getJob())) {
throw new IllegalArgumentException("Received DeclineCheckpoint message for job " +
message.getJob() + " while this coordinator handles job " + job);
}
fin... | [
"public",
"void",
"receiveDeclineMessage",
"(",
"DeclineCheckpoint",
"message",
")",
"{",
"if",
"(",
"shutdown",
"||",
"message",
"==",
"null",
")",
"{",
"return",
";",
"}",
"if",
"(",
"!",
"job",
".",
"equals",
"(",
"message",
".",
"getJob",
"(",
")",
... | Receives a {@link DeclineCheckpoint} message for a pending checkpoint.
@param message Checkpoint decline from the task manager | [
"Receives",
"a",
"{",
"@link",
"DeclineCheckpoint",
"}",
"message",
"for",
"a",
"pending",
"checkpoint",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/checkpoint/CheckpointCoordinator.java#L723-L767 | train | This method is called when a DeclineCheckpoint message is received from the coordinator. | [
30522,
2270,
11675,
2363,
8586,
4179,
7834,
3736,
3351,
1006,
6689,
5403,
3600,
8400,
4471,
1007,
1063,
2065,
1006,
3844,
7698,
1064,
1064,
4471,
1027,
1027,
19701,
1007,
1063,
2709,
1025,
1065,
2065,
1006,
999,
3105,
1012,
19635,
1006,
4... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
looly/hutool | hutool-core/src/main/java/cn/hutool/core/lang/Assert.java | Assert.notContain | public static String notContain(String textToSearch, String substring) throws IllegalArgumentException {
return notContain(textToSearch, substring, "[Assertion failed] - this String argument must not contain the substring [{}]", substring);
} | java | public static String notContain(String textToSearch, String substring) throws IllegalArgumentException {
return notContain(textToSearch, substring, "[Assertion failed] - this String argument must not contain the substring [{}]", substring);
} | [
"public",
"static",
"String",
"notContain",
"(",
"String",
"textToSearch",
",",
"String",
"substring",
")",
"throws",
"IllegalArgumentException",
"{",
"return",
"notContain",
"(",
"textToSearch",
",",
"substring",
",",
"\"[Assertion failed] - this String argument must not c... | 断言给定字符串是否不被另一个字符串包含(既是否为子串)
<pre class="code">
Assert.doesNotContain(name, "rod", "Name must not contain 'rod'");
</pre>
@param textToSearch 被搜索的字符串
@param substring 被检查的子串
@return 被检查的子串
@throws IllegalArgumentException 非子串抛出异常 | [
"断言给定字符串是否不被另一个字符串包含(既是否为子串)"
] | bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/lang/Assert.java#L261-L263 | train | Assert that the textToSearch does not contain the substring | [
30522,
2270,
10763,
5164,
2025,
8663,
18249,
1006,
5164,
3793,
22282,
2906,
2818,
1010,
5164,
4942,
3367,
4892,
1007,
11618,
6206,
2906,
22850,
15781,
2595,
24422,
1063,
2709,
2025,
8663,
18249,
1006,
3793,
22282,
2906,
2818,
1010,
4942,
33... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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/ResourceSpec.java | ResourceSpec.lessThanOrEqual | public boolean lessThanOrEqual(@Nonnull ResourceSpec other) {
int cmp1 = Double.compare(this.cpuCores, other.cpuCores);
int cmp2 = Integer.compare(this.heapMemoryInMB, other.heapMemoryInMB);
int cmp3 = Integer.compare(this.directMemoryInMB, other.directMemoryInMB);
int cmp4 = Integer.compare(this.nativeMemoryIn... | java | public boolean lessThanOrEqual(@Nonnull ResourceSpec other) {
int cmp1 = Double.compare(this.cpuCores, other.cpuCores);
int cmp2 = Integer.compare(this.heapMemoryInMB, other.heapMemoryInMB);
int cmp3 = Integer.compare(this.directMemoryInMB, other.directMemoryInMB);
int cmp4 = Integer.compare(this.nativeMemoryIn... | [
"public",
"boolean",
"lessThanOrEqual",
"(",
"@",
"Nonnull",
"ResourceSpec",
"other",
")",
"{",
"int",
"cmp1",
"=",
"Double",
".",
"compare",
"(",
"this",
".",
"cpuCores",
",",
"other",
".",
"cpuCores",
")",
";",
"int",
"cmp2",
"=",
"Integer",
".",
"comp... | Checks the current resource less than or equal with the other resource by comparing
all the fields in the resource.
@param other The resource to compare
@return True if current resource is less than or equal with the other resource, otherwise return false. | [
"Checks",
"the",
"current",
"resource",
"less",
"than",
"or",
"equal",
"with",
"the",
"other",
"resource",
"by",
"comparing",
"all",
"the",
"fields",
"in",
"the",
"resource",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-core/src/main/java/org/apache/flink/api/common/operators/ResourceSpec.java#L184-L201 | train | Checks if this resource spec is less than or equal to the other resource spec. | [
30522,
2270,
22017,
20898,
2625,
21604,
5686,
26426,
1006,
1030,
2512,
11231,
3363,
4219,
5051,
2278,
2060,
1007,
1063,
20014,
4642,
2361,
2487,
1027,
3313,
1012,
12826,
1006,
2023,
1012,
17368,
17345,
2015,
1010,
2060,
1012,
17368,
17345,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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/ArrayUtil.java | ArrayUtil.removeNull | public static <T> T[] removeNull(T[] array) {
return filter(array, new Editor<T>() {
@Override
public T edit(T t) {
// 返回null便不加入集合
return t;
}
});
} | java | public static <T> T[] removeNull(T[] array) {
return filter(array, new Editor<T>() {
@Override
public T edit(T t) {
// 返回null便不加入集合
return t;
}
});
} | [
"public",
"static",
"<",
"T",
">",
"T",
"[",
"]",
"removeNull",
"(",
"T",
"[",
"]",
"array",
")",
"{",
"return",
"filter",
"(",
"array",
",",
"new",
"Editor",
"<",
"T",
">",
"(",
")",
"{",
"@",
"Override",
"public",
"T",
"edit",
"(",
"T",
"t",
... | 去除{@code null} 元素
@param array 数组
@return 处理后的数组
@since 3.2.2 | [
"去除",
"{",
"@code",
"null",
"}",
"元素"
] | bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/util/ArrayUtil.java#L781-L789 | train | Removes null elements from an array. | [
30522,
2270,
10763,
1026,
1056,
1028,
1056,
1031,
1033,
6366,
11231,
3363,
1006,
1056,
1031,
1033,
9140,
1007,
1063,
2709,
11307,
1006,
9140,
1010,
2047,
3559,
1026,
1056,
1028,
1006,
1007,
1063,
1030,
2058,
15637,
2270,
1056,
10086,
1006,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
apache/flink | flink-core/src/main/java/org/apache/flink/api/java/typeutils/TypeExtractor.java | TypeExtractor.getBinaryOperatorReturnType | @SuppressWarnings("unchecked")
@PublicEvolving
public static <IN1, IN2, OUT> TypeInformation<OUT> getBinaryOperatorReturnType(
Function function,
Class<?> baseClass,
int input1TypeArgumentIndex,
int input2TypeArgumentIndex,
int outputTypeArgumentIndex,
int[] lambdaOutputTypeArgumentIndices,
TypeInformat... | java | @SuppressWarnings("unchecked")
@PublicEvolving
public static <IN1, IN2, OUT> TypeInformation<OUT> getBinaryOperatorReturnType(
Function function,
Class<?> baseClass,
int input1TypeArgumentIndex,
int input2TypeArgumentIndex,
int outputTypeArgumentIndex,
int[] lambdaOutputTypeArgumentIndices,
TypeInformat... | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"@",
"PublicEvolving",
"public",
"static",
"<",
"IN1",
",",
"IN2",
",",
"OUT",
">",
"TypeInformation",
"<",
"OUT",
">",
"getBinaryOperatorReturnType",
"(",
"Function",
"function",
",",
"Class",
"<",
"?",
">",... | Returns the binary operator's return type.
<p>This method can extract a type in 4 different ways:
<p>1. By using the generics of the base class like MyFunction<X, Y, Z, IN, OUT>.
This is what outputTypeArgumentIndex (in this example "4") is good for.
<p>2. By using input type inference SubMyFunction<T, String, Strin... | [
"Returns",
"the",
"binary",
"operator",
"s",
"return",
"type",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-core/src/main/java/org/apache/flink/api/java/typeutils/TypeExtractor.java#L646-L723 | train | Gets the binary operator return type. | [
30522,
1030,
16081,
9028,
5582,
2015,
1006,
1000,
4895,
5403,
18141,
1000,
1007,
1030,
2270,
6777,
4747,
6455,
2270,
10763,
1026,
1999,
2487,
1010,
1999,
2475,
1010,
2041,
1028,
2828,
2378,
14192,
3370,
1026,
2041,
1028,
2131,
21114,
2854,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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/dartsclone/DartMap.java | DartMap.commonPrefixSearch | public ArrayList<Pair<String, V>> commonPrefixSearch(String key, int offset, int maxResults)
{
byte[] keyBytes = key.getBytes(utf8);
List<Pair<Integer, Integer>> pairList = commonPrefixSearch(keyBytes, offset, maxResults);
ArrayList<Pair<String, V>> resultList = new ArrayList<Pair<String, V>... | java | public ArrayList<Pair<String, V>> commonPrefixSearch(String key, int offset, int maxResults)
{
byte[] keyBytes = key.getBytes(utf8);
List<Pair<Integer, Integer>> pairList = commonPrefixSearch(keyBytes, offset, maxResults);
ArrayList<Pair<String, V>> resultList = new ArrayList<Pair<String, V>... | [
"public",
"ArrayList",
"<",
"Pair",
"<",
"String",
",",
"V",
">",
">",
"commonPrefixSearch",
"(",
"String",
"key",
",",
"int",
"offset",
",",
"int",
"maxResults",
")",
"{",
"byte",
"[",
"]",
"keyBytes",
"=",
"key",
".",
"getBytes",
"(",
"utf8",
")",
... | 前缀查询
@param key
@param offset
@param maxResults
@return | [
"前缀查询"
] | a538d0722ab2e4980a9dcd9ea40324fc3ddba7ce | https://github.com/hankcs/HanLP/blob/a538d0722ab2e4980a9dcd9ea40324fc3ddba7ce/src/main/java/com/hankcs/hanlp/collection/dartsclone/DartMap.java#L140-L150 | train | Common prefix search. | [
30522,
2270,
9140,
9863,
1026,
3940,
1026,
5164,
1010,
1058,
1028,
1028,
2691,
28139,
8873,
2595,
17310,
11140,
1006,
5164,
3145,
1010,
20014,
16396,
1010,
20014,
4098,
6072,
11314,
2015,
1007,
1063,
24880,
1031,
1033,
3145,
3762,
4570,
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... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.