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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
spring-projects/spring-boot | spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/properties/source/ConfigurationPropertyName.java | ConfigurationPropertyName.getElement | public String getElement(int elementIndex, Form form) {
CharSequence element = this.elements.get(elementIndex);
ElementType type = this.elements.getType(elementIndex);
if (type.isIndexed()) {
return element.toString();
}
if (form == Form.ORIGINAL) {
if (type != ElementType.NON_UNIFORM) {
return element.toString();
}
return convertToOriginalForm(element).toString();
}
if (form == Form.DASHED) {
if (type == ElementType.UNIFORM || type == ElementType.DASHED) {
return element.toString();
}
return convertToDashedElement(element).toString();
}
CharSequence uniformElement = this.uniformElements[elementIndex];
if (uniformElement == null) {
uniformElement = (type != ElementType.UNIFORM)
? convertToUniformElement(element) : element;
this.uniformElements[elementIndex] = uniformElement.toString();
}
return uniformElement.toString();
} | java | public String getElement(int elementIndex, Form form) {
CharSequence element = this.elements.get(elementIndex);
ElementType type = this.elements.getType(elementIndex);
if (type.isIndexed()) {
return element.toString();
}
if (form == Form.ORIGINAL) {
if (type != ElementType.NON_UNIFORM) {
return element.toString();
}
return convertToOriginalForm(element).toString();
}
if (form == Form.DASHED) {
if (type == ElementType.UNIFORM || type == ElementType.DASHED) {
return element.toString();
}
return convertToDashedElement(element).toString();
}
CharSequence uniformElement = this.uniformElements[elementIndex];
if (uniformElement == null) {
uniformElement = (type != ElementType.UNIFORM)
? convertToUniformElement(element) : element;
this.uniformElements[elementIndex] = uniformElement.toString();
}
return uniformElement.toString();
} | [
"public",
"String",
"getElement",
"(",
"int",
"elementIndex",
",",
"Form",
"form",
")",
"{",
"CharSequence",
"element",
"=",
"this",
".",
"elements",
".",
"get",
"(",
"elementIndex",
")",
";",
"ElementType",
"type",
"=",
"this",
".",
"elements",
".",
"getT... | Return an element in the name in the given form.
@param elementIndex the element index
@param form the form to return
@return the last element | [
"Return",
"an",
"element",
"in",
"the",
"name",
"in",
"the",
"given",
"form",
"."
] | 0b27f7c70e164b2b1a96477f1d9c1acba56790c1 | https://github.com/spring-projects/spring-boot/blob/0b27f7c70e164b2b1a96477f1d9c1acba56790c1/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/properties/source/ConfigurationPropertyName.java#L125-L150 | train | Returns the element at the given index in the given form. | [
30522,
2270,
5164,
2131,
12260,
3672,
1006,
20014,
5783,
22254,
10288,
1010,
2433,
2433,
1007,
1063,
25869,
3366,
4226,
5897,
5783,
1027,
2023,
1012,
3787,
1012,
2131,
1006,
5783,
22254,
10288,
1007,
1025,
5783,
13874,
2828,
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/spark | common/unsafe/src/main/java/org/apache/spark/unsafe/types/UTF8String.java | UTF8String.indexOf | public int indexOf(UTF8String v, int start) {
if (v.numBytes() == 0) {
return 0;
}
// locate to the start position.
int i = 0; // position in byte
int c = 0; // position in character
while (i < numBytes && c < start) {
i += numBytesForFirstByte(getByte(i));
c += 1;
}
do {
if (i + v.numBytes > numBytes) {
return -1;
}
if (ByteArrayMethods.arrayEquals(base, offset + i, v.base, v.offset, v.numBytes)) {
return c;
}
i += numBytesForFirstByte(getByte(i));
c += 1;
} while (i < numBytes);
return -1;
} | java | public int indexOf(UTF8String v, int start) {
if (v.numBytes() == 0) {
return 0;
}
// locate to the start position.
int i = 0; // position in byte
int c = 0; // position in character
while (i < numBytes && c < start) {
i += numBytesForFirstByte(getByte(i));
c += 1;
}
do {
if (i + v.numBytes > numBytes) {
return -1;
}
if (ByteArrayMethods.arrayEquals(base, offset + i, v.base, v.offset, v.numBytes)) {
return c;
}
i += numBytesForFirstByte(getByte(i));
c += 1;
} while (i < numBytes);
return -1;
} | [
"public",
"int",
"indexOf",
"(",
"UTF8String",
"v",
",",
"int",
"start",
")",
"{",
"if",
"(",
"v",
".",
"numBytes",
"(",
")",
"==",
"0",
")",
"{",
"return",
"0",
";",
"}",
"// locate to the start position.",
"int",
"i",
"=",
"0",
";",
"// position in b... | Returns the position of the first occurrence of substr in
current string from the specified position (0-based index).
@param v the string to be searched
@param start the start position of the current string for searching
@return the position of the first occurrence of substr, if not found, -1 returned. | [
"Returns",
"the",
"position",
"of",
"the",
"first",
"occurrence",
"of",
"substr",
"in",
"current",
"string",
"from",
"the",
"specified",
"position",
"(",
"0",
"-",
"based",
"index",
")",
"."
] | 25ee0474f47d9c30d6f553a7892d9549f91071cf | https://github.com/apache/spark/blob/25ee0474f47d9c30d6f553a7892d9549f91071cf/common/unsafe/src/main/java/org/apache/spark/unsafe/types/UTF8String.java#L710-L735 | train | Gets the index of the first occurrence of v in this string. | [
30522,
2270,
20014,
5950,
11253,
1006,
21183,
2546,
2620,
3367,
4892,
1058,
1010,
20014,
2707,
1007,
1063,
2065,
1006,
1058,
1012,
15903,
17250,
2015,
1006,
1007,
1027,
1027,
1014,
1007,
1063,
2709,
1014,
1025,
1065,
1013,
1013,
12453,
2000... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
looly/hutool | hutool-db/src/main/java/cn/hutool/db/sql/Condition.java | Condition.unwrapQuote | private static String unwrapQuote(String value) {
if (null == value) {
return null;
}
value = value.trim();
int from = 0;
int to = value.length();
char startChar = value.charAt(0);
char endChar = value.charAt(to - 1);
if (startChar == endChar) {
if ('\'' == startChar || '"' == startChar) {
from = 1;
to = to - 1;
}
}
if (from == 0 && to == value.length()) {
// 并不包含,返回原值
return value;
}
return value.substring(from, to);
} | java | private static String unwrapQuote(String value) {
if (null == value) {
return null;
}
value = value.trim();
int from = 0;
int to = value.length();
char startChar = value.charAt(0);
char endChar = value.charAt(to - 1);
if (startChar == endChar) {
if ('\'' == startChar || '"' == startChar) {
from = 1;
to = to - 1;
}
}
if (from == 0 && to == value.length()) {
// 并不包含,返回原值
return value;
}
return value.substring(from, to);
} | [
"private",
"static",
"String",
"unwrapQuote",
"(",
"String",
"value",
")",
"{",
"if",
"(",
"null",
"==",
"value",
")",
"{",
"return",
"null",
";",
"}",
"value",
"=",
"value",
".",
"trim",
"(",
")",
";",
"int",
"from",
"=",
"0",
";",
"int",
"to",
... | 去掉包围在字符串两端的单引号或双引号
@param value 值
@return 去掉引号后的值 | [
"去掉包围在字符串两端的单引号或双引号"
] | bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-db/src/main/java/cn/hutool/db/sql/Condition.java#L469-L491 | train | Unwrap the quote character in the value. | [
30522,
2797,
10763,
5164,
4895,
13088,
9331,
28940,
12184,
1006,
5164,
3643,
1007,
1063,
2065,
1006,
19701,
1027,
1027,
3643,
1007,
1063,
2709,
19701,
1025,
1065,
3643,
1027,
3643,
1012,
12241,
1006,
1007,
1025,
20014,
2013,
1027,
1014,
102... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
looly/hutool | hutool-cron/src/main/java/cn/hutool/cron/TaskTable.java | TaskTable.executeTaskIfMatchInternal | protected void executeTaskIfMatchInternal(long millis) {
for (int i = 0; i < size; i++) {
if (patterns.get(i).match(timezone, millis, this.scheduler.matchSecond)) {
this.scheduler.taskExecutorManager.spawnExecutor(tasks.get(i));
}
}
} | java | protected void executeTaskIfMatchInternal(long millis) {
for (int i = 0; i < size; i++) {
if (patterns.get(i).match(timezone, millis, this.scheduler.matchSecond)) {
this.scheduler.taskExecutorManager.spawnExecutor(tasks.get(i));
}
}
} | [
"protected",
"void",
"executeTaskIfMatchInternal",
"(",
"long",
"millis",
")",
"{",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"size",
";",
"i",
"++",
")",
"{",
"if",
"(",
"patterns",
".",
"get",
"(",
"i",
")",
".",
"match",
"(",
"timezone",
... | 如果时间匹配则执行相应的Task,无锁
@param millis 时间毫秒
@since 3.1.1 | [
"如果时间匹配则执行相应的Task,无锁"
] | bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-cron/src/main/java/cn/hutool/cron/TaskTable.java#L216-L222 | train | Execute the tasks if the given millis matches the pattern. | [
30522,
5123,
11675,
15389,
10230,
3211,
16715,
4017,
17231,
16451,
2389,
1006,
2146,
4971,
2483,
1007,
1063,
2005,
1006,
20014,
1045,
1027,
1014,
1025,
1045,
1026,
2946,
1025,
1045,
1009,
1009,
1007,
1063,
2065,
1006,
7060,
1012,
2131,
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... |
hankcs/HanLP | src/main/java/com/hankcs/hanlp/dependency/nnparser/NeuralNetworkParser.java | NeuralNetworkParser.get_cluster_from_dependency | void get_cluster_from_dependency(final Dependency data,
List<Integer> cluster4,
List<Integer> cluster6,
List<Integer> cluster)
{
if (use_cluster)
{
int L = data.forms.size();
for (int i = 0; i < L; ++i)
{
int form = data.forms.get(i);
cluster4.add(i == 0 ?
cluster4_types_alphabet.idOf(SpecialOption.ROOT) : form_to_cluster4.get(form));
cluster6.add(i == 0 ?
cluster6_types_alphabet.idOf(SpecialOption.ROOT) : form_to_cluster6.get(form));
cluster.add(i == 0 ?
cluster_types_alphabet.idOf(SpecialOption.ROOT) : form_to_cluster.get(form));
}
}
} | java | void get_cluster_from_dependency(final Dependency data,
List<Integer> cluster4,
List<Integer> cluster6,
List<Integer> cluster)
{
if (use_cluster)
{
int L = data.forms.size();
for (int i = 0; i < L; ++i)
{
int form = data.forms.get(i);
cluster4.add(i == 0 ?
cluster4_types_alphabet.idOf(SpecialOption.ROOT) : form_to_cluster4.get(form));
cluster6.add(i == 0 ?
cluster6_types_alphabet.idOf(SpecialOption.ROOT) : form_to_cluster6.get(form));
cluster.add(i == 0 ?
cluster_types_alphabet.idOf(SpecialOption.ROOT) : form_to_cluster.get(form));
}
}
} | [
"void",
"get_cluster_from_dependency",
"(",
"final",
"Dependency",
"data",
",",
"List",
"<",
"Integer",
">",
"cluster4",
",",
"List",
"<",
"Integer",
">",
"cluster6",
",",
"List",
"<",
"Integer",
">",
"cluster",
")",
"{",
"if",
"(",
"use_cluster",
")",
"{"... | 获取词聚类特征
@param data 输入数据
@param cluster4
@param cluster6
@param cluster | [
"获取词聚类特征"
] | a538d0722ab2e4980a9dcd9ea40324fc3ddba7ce | https://github.com/hankcs/HanLP/blob/a538d0722ab2e4980a9dcd9ea40324fc3ddba7ce/src/main/java/com/hankcs/hanlp/dependency/nnparser/NeuralNetworkParser.java#L477-L496 | train | get_cluster_from_dependency This method is called to get the cluster from a dependency. | [
30522,
11675,
2131,
1035,
9324,
1035,
2013,
1035,
24394,
1006,
2345,
24394,
2951,
1010,
2862,
1026,
16109,
1028,
9324,
2549,
1010,
2862,
1026,
16109,
1028,
9324,
2575,
1010,
2862,
1026,
16109,
1028,
9324,
1007,
1063,
2065,
1006,
2224,
1035,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
apache/flink | flink-optimizer/src/main/java/org/apache/flink/optimizer/dataproperties/RequestedGlobalProperties.java | RequestedGlobalProperties.reset | public void reset() {
this.partitioning = PartitioningProperty.RANDOM_PARTITIONED;
this.ordering = null;
this.partitioningFields = null;
this.dataDistribution = null;
this.customPartitioner = null;
} | java | public void reset() {
this.partitioning = PartitioningProperty.RANDOM_PARTITIONED;
this.ordering = null;
this.partitioningFields = null;
this.dataDistribution = null;
this.customPartitioner = null;
} | [
"public",
"void",
"reset",
"(",
")",
"{",
"this",
".",
"partitioning",
"=",
"PartitioningProperty",
".",
"RANDOM_PARTITIONED",
";",
"this",
".",
"ordering",
"=",
"null",
";",
"this",
".",
"partitioningFields",
"=",
"null",
";",
"this",
".",
"dataDistribution",... | This method resets the properties to a state where no properties are given. | [
"This",
"method",
"resets",
"the",
"properties",
"to",
"a",
"state",
"where",
"no",
"properties",
"are",
"given",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-optimizer/src/main/java/org/apache/flink/optimizer/dataproperties/RequestedGlobalProperties.java#L220-L226 | train | Resets the partitioning properties to the default values. | [
30522,
2270,
11675,
25141,
1006,
1007,
1063,
2023,
1012,
13571,
2075,
1027,
13571,
2075,
21572,
4842,
3723,
1012,
6721,
1035,
13571,
2098,
1025,
2023,
1012,
13063,
1027,
19701,
1025,
2023,
1012,
13571,
2075,
15155,
1027,
19701,
1025,
2023,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
apache/flink | flink-streaming-java/src/main/java/org/apache/flink/streaming/api/datastream/DataStreamUtils.java | DataStreamUtils.collect | public static <OUT> Iterator<OUT> collect(DataStream<OUT> stream) throws IOException {
TypeSerializer<OUT> serializer = stream.getType().createSerializer(
stream.getExecutionEnvironment().getConfig());
SocketStreamIterator<OUT> iter = new SocketStreamIterator<OUT>(serializer);
//Find out what IP of us should be given to CollectSink, that it will be able to connect to
StreamExecutionEnvironment env = stream.getExecutionEnvironment();
InetAddress clientAddress;
if (env instanceof RemoteStreamEnvironment) {
String host = ((RemoteStreamEnvironment) env).getHost();
int port = ((RemoteStreamEnvironment) env).getPort();
try {
clientAddress = ConnectionUtils.findConnectingAddress(new InetSocketAddress(host, port), 2000, 400);
}
catch (Exception e) {
throw new IOException("Could not determine an suitable network address to " +
"receive back data from the streaming program.", e);
}
} else if (env instanceof LocalStreamEnvironment) {
clientAddress = InetAddress.getLoopbackAddress();
} else {
try {
clientAddress = InetAddress.getLocalHost();
} catch (UnknownHostException e) {
throw new IOException("Could not determine this machines own local address to " +
"receive back data from the streaming program.", e);
}
}
DataStreamSink<OUT> sink = stream.addSink(new CollectSink<OUT>(clientAddress, iter.getPort(), serializer));
sink.setParallelism(1); // It would not work if multiple instances would connect to the same port
(new CallExecute(env, iter)).start();
return iter;
} | java | public static <OUT> Iterator<OUT> collect(DataStream<OUT> stream) throws IOException {
TypeSerializer<OUT> serializer = stream.getType().createSerializer(
stream.getExecutionEnvironment().getConfig());
SocketStreamIterator<OUT> iter = new SocketStreamIterator<OUT>(serializer);
//Find out what IP of us should be given to CollectSink, that it will be able to connect to
StreamExecutionEnvironment env = stream.getExecutionEnvironment();
InetAddress clientAddress;
if (env instanceof RemoteStreamEnvironment) {
String host = ((RemoteStreamEnvironment) env).getHost();
int port = ((RemoteStreamEnvironment) env).getPort();
try {
clientAddress = ConnectionUtils.findConnectingAddress(new InetSocketAddress(host, port), 2000, 400);
}
catch (Exception e) {
throw new IOException("Could not determine an suitable network address to " +
"receive back data from the streaming program.", e);
}
} else if (env instanceof LocalStreamEnvironment) {
clientAddress = InetAddress.getLoopbackAddress();
} else {
try {
clientAddress = InetAddress.getLocalHost();
} catch (UnknownHostException e) {
throw new IOException("Could not determine this machines own local address to " +
"receive back data from the streaming program.", e);
}
}
DataStreamSink<OUT> sink = stream.addSink(new CollectSink<OUT>(clientAddress, iter.getPort(), serializer));
sink.setParallelism(1); // It would not work if multiple instances would connect to the same port
(new CallExecute(env, iter)).start();
return iter;
} | [
"public",
"static",
"<",
"OUT",
">",
"Iterator",
"<",
"OUT",
">",
"collect",
"(",
"DataStream",
"<",
"OUT",
">",
"stream",
")",
"throws",
"IOException",
"{",
"TypeSerializer",
"<",
"OUT",
">",
"serializer",
"=",
"stream",
".",
"getType",
"(",
")",
".",
... | Returns an iterator to iterate over the elements of the DataStream.
@return The iterator | [
"Returns",
"an",
"iterator",
"to",
"iterate",
"over",
"the",
"elements",
"of",
"the",
"DataStream",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-streaming-java/src/main/java/org/apache/flink/streaming/api/datastream/DataStreamUtils.java#L50-L88 | train | Collect data from a data stream. | [
30522,
2270,
10763,
1026,
2041,
1028,
2009,
6906,
4263,
1026,
2041,
1028,
8145,
1006,
2951,
21422,
1026,
2041,
1028,
5460,
1007,
11618,
22834,
10288,
24422,
1063,
4127,
11610,
28863,
1026,
2041,
1028,
7642,
17629,
1027,
5460,
1012,
2131,
13... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
looly/hutool | hutool-extra/src/main/java/cn/hutool/extra/mail/MailUtil.java | MailUtil.sendText | public static void sendText(Collection<String> tos, String subject, String content, File... files) {
send(tos, subject, content, false, files);
} | java | public static void sendText(Collection<String> tos, String subject, String content, File... files) {
send(tos, subject, content, false, files);
} | [
"public",
"static",
"void",
"sendText",
"(",
"Collection",
"<",
"String",
">",
"tos",
",",
"String",
"subject",
",",
"String",
"content",
",",
"File",
"...",
"files",
")",
"{",
"send",
"(",
"tos",
",",
"subject",
",",
"content",
",",
"false",
",",
"fil... | 使用配置文件中设置的账户发送文本邮件,发送给多人
@param tos 收件人列表
@param subject 标题
@param content 正文
@param files 附件列表 | [
"使用配置文件中设置的账户发送文本邮件,发送给多人"
] | bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-extra/src/main/java/cn/hutool/extra/mail/MailUtil.java#L85-L87 | train | Send text to a collection of strings. | [
30522,
2270,
10763,
11675,
4604,
18209,
1006,
3074,
1026,
5164,
1028,
2000,
2015,
1010,
5164,
3395,
1010,
5164,
4180,
1010,
5371,
1012,
1012,
1012,
6764,
1007,
1063,
4604,
1006,
2000,
2015,
1010,
3395,
1010,
4180,
1010,
6270,
1010,
6764,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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.addSink | public static <IN> CassandraSinkBuilder<IN> addSink(DataStream<IN> input) {
TypeInformation<IN> typeInfo = input.getType();
if (typeInfo instanceof TupleTypeInfo) {
DataStream<Tuple> tupleInput = (DataStream<Tuple>) input;
return (CassandraSinkBuilder<IN>) new CassandraTupleSinkBuilder<>(tupleInput, tupleInput.getType(), tupleInput.getType().createSerializer(tupleInput.getExecutionEnvironment().getConfig()));
}
if (typeInfo instanceof RowTypeInfo) {
DataStream<Row> rowInput = (DataStream<Row>) input;
return (CassandraSinkBuilder<IN>) new CassandraRowSinkBuilder(rowInput, rowInput.getType(), rowInput.getType().createSerializer(rowInput.getExecutionEnvironment().getConfig()));
}
if (typeInfo instanceof PojoTypeInfo) {
return new CassandraPojoSinkBuilder<>(input, input.getType(), input.getType().createSerializer(input.getExecutionEnvironment().getConfig()));
}
if (typeInfo instanceof CaseClassTypeInfo) {
DataStream<Product> productInput = (DataStream<Product>) input;
return (CassandraSinkBuilder<IN>) new CassandraScalaProductSinkBuilder<>(productInput, productInput.getType(), productInput.getType().createSerializer(input.getExecutionEnvironment().getConfig()));
}
throw new IllegalArgumentException("No support for the type of the given DataStream: " + input.getType());
} | java | public static <IN> CassandraSinkBuilder<IN> addSink(DataStream<IN> input) {
TypeInformation<IN> typeInfo = input.getType();
if (typeInfo instanceof TupleTypeInfo) {
DataStream<Tuple> tupleInput = (DataStream<Tuple>) input;
return (CassandraSinkBuilder<IN>) new CassandraTupleSinkBuilder<>(tupleInput, tupleInput.getType(), tupleInput.getType().createSerializer(tupleInput.getExecutionEnvironment().getConfig()));
}
if (typeInfo instanceof RowTypeInfo) {
DataStream<Row> rowInput = (DataStream<Row>) input;
return (CassandraSinkBuilder<IN>) new CassandraRowSinkBuilder(rowInput, rowInput.getType(), rowInput.getType().createSerializer(rowInput.getExecutionEnvironment().getConfig()));
}
if (typeInfo instanceof PojoTypeInfo) {
return new CassandraPojoSinkBuilder<>(input, input.getType(), input.getType().createSerializer(input.getExecutionEnvironment().getConfig()));
}
if (typeInfo instanceof CaseClassTypeInfo) {
DataStream<Product> productInput = (DataStream<Product>) input;
return (CassandraSinkBuilder<IN>) new CassandraScalaProductSinkBuilder<>(productInput, productInput.getType(), productInput.getType().createSerializer(input.getExecutionEnvironment().getConfig()));
}
throw new IllegalArgumentException("No support for the type of the given DataStream: " + input.getType());
} | [
"public",
"static",
"<",
"IN",
">",
"CassandraSinkBuilder",
"<",
"IN",
">",
"addSink",
"(",
"DataStream",
"<",
"IN",
">",
"input",
")",
"{",
"TypeInformation",
"<",
"IN",
">",
"typeInfo",
"=",
"input",
".",
"getType",
"(",
")",
";",
"if",
"(",
"typeInf... | Writes a DataStream into a Cassandra database.
@param input input DataStream
@param <IN> input type
@return CassandraSinkBuilder, to further configure the sink | [
"Writes",
"a",
"DataStream",
"into",
"a",
"Cassandra",
"database",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-connectors/flink-connector-cassandra/src/main/java/org/apache/flink/streaming/connectors/cassandra/CassandraSink.java#L212-L230 | train | Add a sink to the Cassandra cluster. | [
30522,
2270,
10763,
1026,
1999,
1028,
30524,
1063,
2828,
2378,
14192,
3370,
1026,
1999,
1028,
2828,
2378,
14876,
1027,
7953,
1012,
2131,
13874,
1006,
1007,
1025,
2065,
1006,
2828,
2378,
14876,
6013,
11253,
10722,
10814,
13874,
2378,
14876,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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.addListener | public void addListener(FileChangeListener fileChangeListener) {
Assert.notNull(fileChangeListener, "FileChangeListener must not be null");
synchronized (this.monitor) {
checkNotStarted();
this.listeners.add(fileChangeListener);
}
} | java | public void addListener(FileChangeListener fileChangeListener) {
Assert.notNull(fileChangeListener, "FileChangeListener must not be null");
synchronized (this.monitor) {
checkNotStarted();
this.listeners.add(fileChangeListener);
}
} | [
"public",
"void",
"addListener",
"(",
"FileChangeListener",
"fileChangeListener",
")",
"{",
"Assert",
".",
"notNull",
"(",
"fileChangeListener",
",",
"\"FileChangeListener must not be null\"",
")",
";",
"synchronized",
"(",
"this",
".",
"monitor",
")",
"{",
"checkNotS... | Add listener for file change events. Cannot be called after the watcher has been
{@link #start() started}.
@param fileChangeListener the listener to add | [
"Add",
"listener",
"for",
"file",
"change",
"events",
".",
"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#L99-L105 | train | Add a FileChangeListener to the list of listeners. | [
30522,
2270,
11675,
5587,
9863,
24454,
1006,
5371,
22305,
29282,
6528,
2121,
5371,
22305,
29282,
6528,
2121,
1007,
1063,
20865,
1012,
2025,
11231,
3363,
1006,
5371,
22305,
29282,
6528,
2121,
1010,
1000,
5371,
22305,
29282,
6528,
2121,
2442,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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-http/src/main/java/cn/hutool/http/HttpRequest.java | HttpRequest.form | public HttpRequest form(String name, Resource resource) {
if (null != resource) {
if (false == isKeepAlive()) {
keepAlive(true);
}
if (null == this.fileForm) {
fileForm = new HashMap<>();
}
// 文件对象
this.fileForm.put(name, resource);
}
return this;
} | java | public HttpRequest form(String name, Resource resource) {
if (null != resource) {
if (false == isKeepAlive()) {
keepAlive(true);
}
if (null == this.fileForm) {
fileForm = new HashMap<>();
}
// 文件对象
this.fileForm.put(name, resource);
}
return this;
} | [
"public",
"HttpRequest",
"form",
"(",
"String",
"name",
",",
"Resource",
"resource",
")",
"{",
"if",
"(",
"null",
"!=",
"resource",
")",
"{",
"if",
"(",
"false",
"==",
"isKeepAlive",
"(",
")",
")",
"{",
"keepAlive",
"(",
"true",
")",
";",
"}",
"if",
... | 文件表单项<br>
一旦有文件加入,表单变为multipart/form-data
@param name 名
@param resource 数据源,文件可以使用{@link FileResource}包装使用
@return this
@since 4.0.9 | [
"文件表单项<br",
">",
"一旦有文件加入,表单变为multipart",
"/",
"form",
"-",
"data"
] | bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-http/src/main/java/cn/hutool/http/HttpRequest.java#L561-L574 | train | Adds a file form to the request. | [
30522,
2270,
8299,
2890,
15500,
2433,
1006,
5164,
2171,
1010,
7692,
7692,
1007,
1063,
2065,
1006,
19701,
999,
1027,
7692,
1007,
1063,
2065,
1006,
6270,
1027,
1027,
2003,
20553,
12952,
3512,
1006,
1007,
1007,
1063,
2562,
11475,
3726,
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-db/src/main/java/cn/hutool/db/sql/SqlBuilder.java | SqlBuilder.insert | public SqlBuilder insert(Entity entity, DialectName dialectName) {
// 验证
validateEntity(entity);
if (null != wrapper) {
// 包装表名
// entity = wrapper.wrap(entity);
entity.setTableName(wrapper.wrap(entity.getTableName()));
}
final boolean isOracle = ObjectUtil.equal(dialectName, DialectName.ORACLE);// 对Oracle的特殊处理
final StringBuilder fieldsPart = new StringBuilder();
final StringBuilder placeHolder = new StringBuilder();
boolean isFirst = true;
String field;
Object value;
for (Entry<String, Object> entry : entity.entrySet()) {
field = entry.getKey();
value = entry.getValue();
if (StrUtil.isNotBlank(field) /* && null != value */) {
if (isFirst) {
isFirst = false;
} else {
// 非第一个参数,追加逗号
fieldsPart.append(", ");
placeHolder.append(", ");
}
this.fields.add(field);
fieldsPart.append((null != wrapper) ? wrapper.wrap(field) : field);
if (isOracle && value instanceof String && StrUtil.endWithIgnoreCase((String) value, ".nextval")) {
// Oracle的特殊自增键,通过字段名.nextval获得下一个值
placeHolder.append(value);
} else {
placeHolder.append("?");
this.paramValues.add(value);
}
}
}
sql.append("INSERT INTO ")//
.append(entity.getTableName()).append(" (").append(fieldsPart).append(") VALUES (")//
.append(placeHolder.toString()).append(")");
return this;
} | java | public SqlBuilder insert(Entity entity, DialectName dialectName) {
// 验证
validateEntity(entity);
if (null != wrapper) {
// 包装表名
// entity = wrapper.wrap(entity);
entity.setTableName(wrapper.wrap(entity.getTableName()));
}
final boolean isOracle = ObjectUtil.equal(dialectName, DialectName.ORACLE);// 对Oracle的特殊处理
final StringBuilder fieldsPart = new StringBuilder();
final StringBuilder placeHolder = new StringBuilder();
boolean isFirst = true;
String field;
Object value;
for (Entry<String, Object> entry : entity.entrySet()) {
field = entry.getKey();
value = entry.getValue();
if (StrUtil.isNotBlank(field) /* && null != value */) {
if (isFirst) {
isFirst = false;
} else {
// 非第一个参数,追加逗号
fieldsPart.append(", ");
placeHolder.append(", ");
}
this.fields.add(field);
fieldsPart.append((null != wrapper) ? wrapper.wrap(field) : field);
if (isOracle && value instanceof String && StrUtil.endWithIgnoreCase((String) value, ".nextval")) {
// Oracle的特殊自增键,通过字段名.nextval获得下一个值
placeHolder.append(value);
} else {
placeHolder.append("?");
this.paramValues.add(value);
}
}
}
sql.append("INSERT INTO ")//
.append(entity.getTableName()).append(" (").append(fieldsPart).append(") VALUES (")//
.append(placeHolder.toString()).append(")");
return this;
} | [
"public",
"SqlBuilder",
"insert",
"(",
"Entity",
"entity",
",",
"DialectName",
"dialectName",
")",
"{",
"// 验证\r",
"validateEntity",
"(",
"entity",
")",
";",
"if",
"(",
"null",
"!=",
"wrapper",
")",
"{",
"// 包装表名\r",
"// entity = wrapper.wrap(entity);\r",
"entity"... | 插入<br>
插入会忽略空的字段名及其对应值,但是对于有字段名对应值为{@code null}的情况不忽略
@param entity 实体
@param dialectName 方言名
@return 自己 | [
"插入<br",
">",
"插入会忽略空的字段名及其对应值,但是对于有字段名对应值为",
"{",
"@code",
"null",
"}",
"的情况不忽略"
] | bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-db/src/main/java/cn/hutool/db/sql/SqlBuilder.java#L106-L151 | train | Create a INSERT statement from an entity. | [
30522,
2270,
29296,
8569,
23891,
2099,
19274,
1006,
9178,
9178,
1010,
9329,
18442,
9329,
18442,
1007,
1063,
1013,
1013,
100,
100,
9398,
3686,
4765,
3012,
1006,
9178,
1007,
1025,
2065,
1006,
19701,
999,
1027,
10236,
4842,
1007,
1063,
1013,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
looly/hutool | hutool-core/src/main/java/cn/hutool/core/codec/Base32.java | Base32.decodeStr | public static String decodeStr(String source, String charset) {
return StrUtil.str(decode(source), charset);
} | java | public static String decodeStr(String source, String charset) {
return StrUtil.str(decode(source), charset);
} | [
"public",
"static",
"String",
"decodeStr",
"(",
"String",
"source",
",",
"String",
"charset",
")",
"{",
"return",
"StrUtil",
".",
"str",
"(",
"decode",
"(",
"source",
")",
",",
"charset",
")",
";",
"}"
] | base32解码
@param source 被解码的base32字符串
@param charset 字符集
@return 被加密后的字符串 | [
"base32解码"
] | bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/codec/Base32.java#L173-L175 | train | Decodes a base64 string into a string. | [
30522,
2270,
10763,
5164,
21933,
6155,
16344,
1006,
5164,
3120,
1010,
5164,
25869,
13462,
1007,
1063,
2709,
2358,
22134,
4014,
1012,
2358,
2099,
1006,
21933,
3207,
1006,
3120,
1007,
1010,
25869,
13462,
1007,
1025,
1065,
102,
0,
0,
0,
0,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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-orc/src/main/java/org/apache/flink/orc/OrcRowInputFormat.java | OrcRowInputFormat.computeProjectionMask | private boolean[] computeProjectionMask() {
// mask with all fields of the schema
boolean[] projectionMask = new boolean[schema.getMaximumId() + 1];
// for each selected field
for (int inIdx : selectedFields) {
// set all nested fields of a selected field to true
TypeDescription fieldSchema = schema.getChildren().get(inIdx);
for (int i = fieldSchema.getId(); i <= fieldSchema.getMaximumId(); i++) {
projectionMask[i] = true;
}
}
return projectionMask;
} | java | private boolean[] computeProjectionMask() {
// mask with all fields of the schema
boolean[] projectionMask = new boolean[schema.getMaximumId() + 1];
// for each selected field
for (int inIdx : selectedFields) {
// set all nested fields of a selected field to true
TypeDescription fieldSchema = schema.getChildren().get(inIdx);
for (int i = fieldSchema.getId(); i <= fieldSchema.getMaximumId(); i++) {
projectionMask[i] = true;
}
}
return projectionMask;
} | [
"private",
"boolean",
"[",
"]",
"computeProjectionMask",
"(",
")",
"{",
"// mask with all fields of the schema",
"boolean",
"[",
"]",
"projectionMask",
"=",
"new",
"boolean",
"[",
"schema",
".",
"getMaximumId",
"(",
")",
"+",
"1",
"]",
";",
"// for each selected f... | Computes the ORC projection mask of the fields to include from the selected fields.rowOrcInputFormat.nextRecord(null).
@return The ORC projection mask. | [
"Computes",
"the",
"ORC",
"projection",
"mask",
"of",
"the",
"fields",
"to",
"include",
"from",
"the",
"selected",
"fields",
".",
"rowOrcInputFormat",
".",
"nextRecord",
"(",
"null",
")",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-connectors/flink-orc/src/main/java/org/apache/flink/orc/OrcRowInputFormat.java#L194-L206 | train | Compute the projection mask. | [
30522,
2797,
22017,
20898,
1031,
1033,
24134,
21572,
20614,
3258,
9335,
2243,
1006,
1007,
1063,
1013,
1013,
7308,
2007,
2035,
4249,
1997,
1996,
8040,
28433,
22017,
20898,
1031,
1033,
13996,
9335,
2243,
1027,
2047,
22017,
20898,
1031,
8040,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
spring-projects/spring-boot | spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/AutoConfigurationPackages.java | AutoConfigurationPackages.get | public static List<String> get(BeanFactory beanFactory) {
try {
return beanFactory.getBean(BEAN, BasePackages.class).get();
}
catch (NoSuchBeanDefinitionException ex) {
throw new IllegalStateException(
"Unable to retrieve @EnableAutoConfiguration base packages");
}
} | java | public static List<String> get(BeanFactory beanFactory) {
try {
return beanFactory.getBean(BEAN, BasePackages.class).get();
}
catch (NoSuchBeanDefinitionException ex) {
throw new IllegalStateException(
"Unable to retrieve @EnableAutoConfiguration base packages");
}
} | [
"public",
"static",
"List",
"<",
"String",
">",
"get",
"(",
"BeanFactory",
"beanFactory",
")",
"{",
"try",
"{",
"return",
"beanFactory",
".",
"getBean",
"(",
"BEAN",
",",
"BasePackages",
".",
"class",
")",
".",
"get",
"(",
")",
";",
"}",
"catch",
"(",
... | Return the auto-configuration base packages for the given bean factory.
@param beanFactory the source bean factory
@return a list of auto-configuration packages
@throws IllegalStateException if auto-configuration is not enabled | [
"Return",
"the",
"auto",
"-",
"configuration",
"base",
"packages",
"for",
"the",
"given",
"bean",
"factory",
"."
] | 0b27f7c70e164b2b1a96477f1d9c1acba56790c1 | https://github.com/spring-projects/spring-boot/blob/0b27f7c70e164b2b1a96477f1d9c1acba56790c1/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/AutoConfigurationPackages.java#L71-L79 | train | Get the base packages from the bean factory. | [
30522,
2270,
10763,
2862,
1026,
5164,
1028,
2131,
1006,
14068,
21450,
14068,
21450,
1007,
1063,
3046,
1063,
2709,
14068,
21450,
1012,
2131,
4783,
2319,
1006,
14068,
1010,
2918,
23947,
13923,
1012,
2465,
1007,
1012,
2131,
1006,
1007,
1025,
1... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
looly/hutool | hutool-core/src/main/java/cn/hutool/core/io/FileUtil.java | FileUtil.load | @Deprecated
public static <T> T load(ReaderHandler<T> readerHandler, String path, String charset) throws IORuntimeException {
return FileReader.create(file(path), CharsetUtil.charset(charset)).read(readerHandler);
} | java | @Deprecated
public static <T> T load(ReaderHandler<T> readerHandler, String path, String charset) throws IORuntimeException {
return FileReader.create(file(path), CharsetUtil.charset(charset)).read(readerHandler);
} | [
"@",
"Deprecated",
"public",
"static",
"<",
"T",
">",
"T",
"load",
"(",
"ReaderHandler",
"<",
"T",
">",
"readerHandler",
",",
"String",
"path",
",",
"String",
"charset",
")",
"throws",
"IORuntimeException",
"{",
"return",
"FileReader",
".",
"create",
"(",
... | 按照给定的readerHandler读取文件中的数据
@param <T> 集合类型
@param readerHandler Reader处理类
@param path 文件的绝对路径
@param charset 字符集
@return 从文件中load出的数据
@throws IORuntimeException IO异常
@deprecated 使用FileUtil#load(String, String, ReaderHandler) 代替 | [
"按照给定的readerHandler读取文件中的数据"
] | bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/io/FileUtil.java#L2471-L2474 | train | Load a file from a file path using the specified reader handler and charset. | [
30522,
1030,
2139,
28139,
12921,
2270,
10763,
1026,
1056,
1028,
1056,
7170,
30524,
1007,
1007,
1012,
3191,
1006,
8068,
11774,
3917,
1007,
1025,
1065,
102,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/comparator/ComparatorChain.java | ComparatorChain.addComparator | public ComparatorChain<E> addComparator(final Comparator<E> comparator, final boolean reverse) {
checkLocked();
chain.add(comparator);
if (reverse == true) {
orderingBits.set(chain.size() - 1);
}
return this;
} | java | public ComparatorChain<E> addComparator(final Comparator<E> comparator, final boolean reverse) {
checkLocked();
chain.add(comparator);
if (reverse == true) {
orderingBits.set(chain.size() - 1);
}
return this;
} | [
"public",
"ComparatorChain",
"<",
"E",
">",
"addComparator",
"(",
"final",
"Comparator",
"<",
"E",
">",
"comparator",
",",
"final",
"boolean",
"reverse",
")",
"{",
"checkLocked",
"(",
")",
";",
"chain",
".",
"add",
"(",
"comparator",
")",
";",
"if",
"(",... | 在链的尾部添加比较器,使用给定排序方式
@param comparator {@link Comparator} 比较器
@param reverse 是否反序,true表示正序,false反序
@return this | [
"在链的尾部添加比较器,使用给定排序方式"
] | bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/comparator/ComparatorChain.java#L101-L109 | train | Adds a new Comparator to the chain. | [
30522,
2270,
4012,
28689,
4263,
24925,
2078,
1026,
1041,
1028,
5587,
9006,
28689,
4263,
1006,
2345,
4012,
28689,
4263,
1026,
1041,
1028,
4012,
28689,
4263,
1010,
2345,
22017,
20898,
7901,
1007,
1063,
4638,
7878,
2098,
1006,
1007,
1025,
4677... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/UnilateralSortMerger.java | UnilateralSortMerger.setResultIteratorException | protected final void setResultIteratorException(IOException ioex) {
synchronized (this.iteratorLock) {
if (this.iteratorException == null) {
this.iteratorException = ioex;
this.iteratorLock.notifyAll();
}
}
} | java | protected final void setResultIteratorException(IOException ioex) {
synchronized (this.iteratorLock) {
if (this.iteratorException == null) {
this.iteratorException = ioex;
this.iteratorLock.notifyAll();
}
}
} | [
"protected",
"final",
"void",
"setResultIteratorException",
"(",
"IOException",
"ioex",
")",
"{",
"synchronized",
"(",
"this",
".",
"iteratorLock",
")",
"{",
"if",
"(",
"this",
".",
"iteratorException",
"==",
"null",
")",
"{",
"this",
".",
"iteratorException",
... | Reports an exception to all threads that are waiting for the result iterator.
@param ioex The exception to be reported to the threads that wait for the result iterator. | [
"Reports",
"an",
"exception",
"to",
"all",
"threads",
"that",
"are",
"waiting",
"for",
"the",
"result",
"iterator",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/operators/sort/UnilateralSortMerger.java#L680-L687 | train | Sets the result iterator exception. | [
30522,
5123,
2345,
11675,
2275,
6072,
11314,
21646,
8844,
10288,
24422,
1006,
22834,
10288,
24422,
22834,
10288,
1007,
1063,
25549,
1006,
2023,
1012,
2009,
6906,
4263,
7878,
1007,
1063,
2065,
1006,
2023,
1012,
2009,
6906,
19277,
2595,
24422,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
apache/spark | sql/core/src/main/java/org/apache/spark/sql/vectorized/ColumnarBatch.java | ColumnarBatch.rowIterator | public Iterator<InternalRow> rowIterator() {
final int maxRows = numRows;
final MutableColumnarRow row = new MutableColumnarRow(columns);
return new Iterator<InternalRow>() {
int rowId = 0;
@Override
public boolean hasNext() {
return rowId < maxRows;
}
@Override
public InternalRow next() {
if (rowId >= maxRows) {
throw new NoSuchElementException();
}
row.rowId = rowId++;
return row;
}
@Override
public void remove() {
throw new UnsupportedOperationException();
}
};
} | java | public Iterator<InternalRow> rowIterator() {
final int maxRows = numRows;
final MutableColumnarRow row = new MutableColumnarRow(columns);
return new Iterator<InternalRow>() {
int rowId = 0;
@Override
public boolean hasNext() {
return rowId < maxRows;
}
@Override
public InternalRow next() {
if (rowId >= maxRows) {
throw new NoSuchElementException();
}
row.rowId = rowId++;
return row;
}
@Override
public void remove() {
throw new UnsupportedOperationException();
}
};
} | [
"public",
"Iterator",
"<",
"InternalRow",
">",
"rowIterator",
"(",
")",
"{",
"final",
"int",
"maxRows",
"=",
"numRows",
";",
"final",
"MutableColumnarRow",
"row",
"=",
"new",
"MutableColumnarRow",
"(",
"columns",
")",
";",
"return",
"new",
"Iterator",
"<",
"... | Returns an iterator over the rows in this batch. | [
"Returns",
"an",
"iterator",
"over",
"the",
"rows",
"in",
"this",
"batch",
"."
] | 25ee0474f47d9c30d6f553a7892d9549f91071cf | https://github.com/apache/spark/blob/25ee0474f47d9c30d6f553a7892d9549f91071cf/sql/core/src/main/java/org/apache/spark/sql/vectorized/ColumnarBatch.java#L51-L76 | train | Returns an iterator over the rows of this table. | [
30522,
2270,
2009,
6906,
4263,
1026,
4722,
10524,
1028,
5216,
21646,
8844,
1006,
1007,
1063,
2345,
20014,
4098,
10524,
2015,
1027,
16371,
2213,
10524,
2015,
1025,
2345,
14163,
10880,
25778,
2819,
11802,
10524,
5216,
1027,
2047,
14163,
10880,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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.validateNotEmptyAndEqual | public static void validateNotEmptyAndEqual(Object t1, Object t2, String errorMsg) throws ValidateException {
validateNotEmpty(t1, errorMsg);
validateEqual(t1, t2, errorMsg);
} | java | public static void validateNotEmptyAndEqual(Object t1, Object t2, String errorMsg) throws ValidateException {
validateNotEmpty(t1, errorMsg);
validateEqual(t1, t2, errorMsg);
} | [
"public",
"static",
"void",
"validateNotEmptyAndEqual",
"(",
"Object",
"t1",
",",
"Object",
"t2",
",",
"String",
"errorMsg",
")",
"throws",
"ValidateException",
"{",
"validateNotEmpty",
"(",
"t1",
",",
"errorMsg",
")",
";",
"validateEqual",
"(",
"t1",
",",
"t2... | 验证是否非空且与指定值相等<br>
当数据为空时抛出验证异常<br>
当两值不等时抛出异常
@param t1 对象1
@param t2 对象2
@param errorMsg 错误信息
@throws ValidateException 验证异常 | [
"验证是否非空且与指定值相等<br",
">",
"当数据为空时抛出验证异常<br",
">",
"当两值不等时抛出异常"
] | bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/lang/Validator.java#L279-L282 | train | Validate that two objects are not null and not equal. | [
30522,
2270,
10763,
11675,
9398,
3686,
22074,
27718,
7054,
3207,
26426,
1006,
4874,
1056,
2487,
1010,
4874,
1056,
2475,
1010,
5164,
7561,
5244,
2290,
1007,
11618,
9398,
3686,
10288,
24422,
1063,
9398,
3686,
22074,
27718,
2100,
1006,
1056,
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-core/src/main/java/org/apache/flink/configuration/ConfigOption.java | ConfigOption.withDescription | public ConfigOption<T> withDescription(final String description) {
return withDescription(Description.builder().text(description).build());
} | java | public ConfigOption<T> withDescription(final String description) {
return withDescription(Description.builder().text(description).build());
} | [
"public",
"ConfigOption",
"<",
"T",
">",
"withDescription",
"(",
"final",
"String",
"description",
")",
"{",
"return",
"withDescription",
"(",
"Description",
".",
"builder",
"(",
")",
".",
"text",
"(",
"description",
")",
".",
"build",
"(",
")",
")",
";",
... | Creates a new config option, using this option's key and default value, and
adding the given description. The given description is used when generation the configuration documention.
@param description The description for this option.
@return A new config option, with given description. | [
"Creates",
"a",
"new",
"config",
"option",
"using",
"this",
"option",
"s",
"key",
"and",
"default",
"value",
"and",
"adding",
"the",
"given",
"description",
".",
"The",
"given",
"description",
"is",
"used",
"when",
"generation",
"the",
"configuration",
"docume... | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-core/src/main/java/org/apache/flink/configuration/ConfigOption.java#L157-L159 | train | Sets the description of the option. | [
30522,
2270,
9530,
8873,
3995,
16790,
1026,
1056,
1028,
2007,
6155,
23235,
3258,
1006,
2345,
5164,
6412,
1007,
1063,
2709,
2007,
6155,
23235,
3258,
1006,
6412,
1012,
12508,
1006,
1007,
1012,
3793,
1006,
6412,
1007,
1012,
3857,
1006,
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... |
hankcs/HanLP | src/main/java/com/hankcs/hanlp/collection/trie/datrie/MutableDoubleArrayTrieInteger.java | MutableDoubleArrayTrieInteger.solveConflict | private void solveConflict(int parent, int newChild)
{
// 找出parent的所有子节点
TreeSet<Integer> children = new TreeSet<Integer>();
children.add(newChild);
final int charsetSize = this.charMap.getCharsetSize();
for (int c = 0; c < charsetSize; ++c)
{
int next = getBase(parent) + c;
if (next >= getBaseArraySize())
{
break;
}
if (getCheck(next) == parent)
{
children.add(c);
}
}
// 移动旧子节点到新的位置
int newBase = searchFreeBase(children);
children.remove(newChild);
for (Integer c : children)
{
int child = newBase + c;
deleteFreeLink(child);
setCheck(child, parent);
int childBase = getBase(getBase(parent) + c);
setBase(child, childBase);
if (!isLeafValue(childBase))
{
for (int d = 0; d < charsetSize; ++d)
{
int to = childBase + d;
if (to >= getBaseArraySize())
{
break;
}
if (getCheck(to) == getBase(parent) + c)
{
setCheck(to, child);
}
}
}
addFreeLink(getBase(parent) + c);
}
// 更新新base值
setBase(parent, newBase);
} | java | private void solveConflict(int parent, int newChild)
{
// 找出parent的所有子节点
TreeSet<Integer> children = new TreeSet<Integer>();
children.add(newChild);
final int charsetSize = this.charMap.getCharsetSize();
for (int c = 0; c < charsetSize; ++c)
{
int next = getBase(parent) + c;
if (next >= getBaseArraySize())
{
break;
}
if (getCheck(next) == parent)
{
children.add(c);
}
}
// 移动旧子节点到新的位置
int newBase = searchFreeBase(children);
children.remove(newChild);
for (Integer c : children)
{
int child = newBase + c;
deleteFreeLink(child);
setCheck(child, parent);
int childBase = getBase(getBase(parent) + c);
setBase(child, childBase);
if (!isLeafValue(childBase))
{
for (int d = 0; d < charsetSize; ++d)
{
int to = childBase + d;
if (to >= getBaseArraySize())
{
break;
}
if (getCheck(to) == getBase(parent) + c)
{
setCheck(to, child);
}
}
}
addFreeLink(getBase(parent) + c);
}
// 更新新base值
setBase(parent, newBase);
} | [
"private",
"void",
"solveConflict",
"(",
"int",
"parent",
",",
"int",
"newChild",
")",
"{",
"// 找出parent的所有子节点",
"TreeSet",
"<",
"Integer",
">",
"children",
"=",
"new",
"TreeSet",
"<",
"Integer",
">",
"(",
")",
";",
"children",
".",
"add",
"(",
"newChild",... | 解决冲突
@param parent 父节点
@param newChild 子节点的char值 | [
"解决冲突"
] | a538d0722ab2e4980a9dcd9ea40324fc3ddba7ce | https://github.com/hankcs/HanLP/blob/a538d0722ab2e4980a9dcd9ea40324fc3ddba7ce/src/main/java/com/hankcs/hanlp/collection/trie/datrie/MutableDoubleArrayTrieInteger.java#L355-L404 | train | Solve conflict. | [
30522,
2797,
11675,
9611,
8663,
29301,
1006,
20014,
6687,
1010,
20014,
2047,
19339,
1007,
1063,
1013,
1013,
100,
1774,
6687,
1916,
100,
1873,
1816,
100,
100,
3628,
3388,
1026,
16109,
1028,
2336,
1027,
2047,
3628,
3388,
1026,
16109,
1028,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
SeleniumHQ/selenium | java/client/src/org/openqa/selenium/interactions/Actions.java | Actions.keyDown | public Actions keyDown(WebElement target, CharSequence key) {
if (isBuildingActions()) {
action.addAction(new KeyDownAction(jsonKeyboard, jsonMouse, (Locatable) target, asKeys(key)));
}
return focusInTicks(target)
.addKeyAction(key, codepoint -> tick(defaultKeyboard.createKeyDown(codepoint)));
} | java | public Actions keyDown(WebElement target, CharSequence key) {
if (isBuildingActions()) {
action.addAction(new KeyDownAction(jsonKeyboard, jsonMouse, (Locatable) target, asKeys(key)));
}
return focusInTicks(target)
.addKeyAction(key, codepoint -> tick(defaultKeyboard.createKeyDown(codepoint)));
} | [
"public",
"Actions",
"keyDown",
"(",
"WebElement",
"target",
",",
"CharSequence",
"key",
")",
"{",
"if",
"(",
"isBuildingActions",
"(",
")",
")",
"{",
"action",
".",
"addAction",
"(",
"new",
"KeyDownAction",
"(",
"jsonKeyboard",
",",
"jsonMouse",
",",
"(",
... | Performs a modifier key press after focusing on an element. Equivalent to:
<i>Actions.click(element).sendKeys(theKey);</i>
@see #keyDown(CharSequence)
@param key Either {@link Keys#SHIFT}, {@link Keys#ALT} or {@link Keys#CONTROL}. If the
provided key is none of those, {@link IllegalArgumentException} is thrown.
@param target WebElement to perform the action
@return A self reference. | [
"Performs",
"a",
"modifier",
"key",
"press",
"after",
"focusing",
"on",
"an",
"element",
".",
"Equivalent",
"to",
":",
"<i",
">",
"Actions",
".",
"click",
"(",
"element",
")",
".",
"sendKeys",
"(",
"theKey",
")",
";",
"<",
"/",
"i",
">",
"@see",
"#ke... | 7af172729f17b20269c8ca4ea6f788db48616535 | https://github.com/SeleniumHQ/selenium/blob/7af172729f17b20269c8ca4ea6f788db48616535/java/client/src/org/openqa/selenium/interactions/Actions.java#L104-L110 | train | KeyDown action. | [
30522,
2270,
4506,
3145,
7698,
1006,
4773,
12260,
3672,
4539,
1010,
25869,
3366,
4226,
5897,
3145,
1007,
1063,
2065,
1006,
2003,
25820,
18908,
8496,
1006,
1007,
1007,
1063,
2895,
1012,
5587,
18908,
3258,
1006,
2047,
3145,
7698,
18908,
3258,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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 | registry/src/main/java/com/networknt/registry/URLImpl.java | URLImpl.toFullStr | @Override
public String toFullStr() {
StringBuilder builder = new StringBuilder();
builder.append(getUri()).append("?");
for (Map.Entry<String, String> entry : parameters.entrySet()) {
String name = entry.getKey();
String value = entry.getValue();
builder.append(name).append("=").append(value).append("&");
}
return builder.toString();
} | java | @Override
public String toFullStr() {
StringBuilder builder = new StringBuilder();
builder.append(getUri()).append("?");
for (Map.Entry<String, String> entry : parameters.entrySet()) {
String name = entry.getKey();
String value = entry.getValue();
builder.append(name).append("=").append(value).append("&");
}
return builder.toString();
} | [
"@",
"Override",
"public",
"String",
"toFullStr",
"(",
")",
"{",
"StringBuilder",
"builder",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"builder",
".",
"append",
"(",
"getUri",
"(",
")",
")",
".",
"append",
"(",
"\"?\"",
")",
";",
"for",
"(",
"Map",
... | TODO there is a trailing &, use string join instead StringBuilder. | [
"TODO",
"there",
"is",
"a",
"trailing",
"&",
"use",
"string",
"join",
"instead",
"StringBuilder",
"."
] | 2a60257c60663684c8f6dc8b5ea3cf184e534db6 | https://github.com/networknt/light-4j/blob/2a60257c60663684c8f6dc8b5ea3cf184e534db6/registry/src/main/java/com/networknt/registry/URLImpl.java#L379-L392 | train | Returns a string representation of the request. | [
30522,
1030,
2058,
15637,
2270,
5164,
2000,
3993,
4877,
16344,
1006,
1007,
1063,
5164,
8569,
23891,
2099,
12508,
1027,
2047,
5164,
8569,
23891,
2099,
1006,
1007,
1025,
12508,
1012,
10439,
10497,
1006,
2131,
9496,
1006,
1007,
1007,
1012,
104... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/jobgraph/JobVertex.java | JobVertex.setSlotSharingGroup | public void setSlotSharingGroup(SlotSharingGroup grp) {
if (this.slotSharingGroup != null) {
this.slotSharingGroup.removeVertexFromGroup(id);
}
this.slotSharingGroup = grp;
if (grp != null) {
grp.addVertexToGroup(id);
}
} | java | public void setSlotSharingGroup(SlotSharingGroup grp) {
if (this.slotSharingGroup != null) {
this.slotSharingGroup.removeVertexFromGroup(id);
}
this.slotSharingGroup = grp;
if (grp != null) {
grp.addVertexToGroup(id);
}
} | [
"public",
"void",
"setSlotSharingGroup",
"(",
"SlotSharingGroup",
"grp",
")",
"{",
"if",
"(",
"this",
".",
"slotSharingGroup",
"!=",
"null",
")",
"{",
"this",
".",
"slotSharingGroup",
".",
"removeVertexFromGroup",
"(",
"id",
")",
";",
"}",
"this",
".",
"slot... | Associates this vertex with a slot sharing group for scheduling. Different vertices in the same
slot sharing group can run one subtask each in the same slot.
@param grp The slot sharing group to associate the vertex with. | [
"Associates",
"this",
"vertex",
"with",
"a",
"slot",
"sharing",
"group",
"for",
"scheduling",
".",
"Different",
"vertices",
"in",
"the",
"same",
"slot",
"sharing",
"group",
"can",
"run",
"one",
"subtask",
"each",
"in",
"the",
"same",
"slot",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/jobgraph/JobVertex.java#L366-L375 | train | Sets the slot sharing group. | [
30522,
2270,
11675,
4520,
10994,
7377,
4892,
17058,
1006,
19832,
18428,
3070,
17058,
24665,
2361,
1007,
1063,
2065,
1006,
2023,
1012,
19832,
18428,
3070,
17058,
999,
1027,
19701,
1007,
1063,
2023,
1012,
19832,
18428,
3070,
17058,
1012,
6366,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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 | client/src/main/java/org/apache/hc/core5/util/copied/ByteArrayBuffer.java | ByteArrayBuffer.toByteArray | public byte[] toByteArray() {
final byte[] b = new byte[this.len];
if (this.len > 0) {
System.arraycopy(this.array, 0, b, 0, this.len);
}
return b;
} | java | public byte[] toByteArray() {
final byte[] b = new byte[this.len];
if (this.len > 0) {
System.arraycopy(this.array, 0, b, 0, this.len);
}
return b;
} | [
"public",
"byte",
"[",
"]",
"toByteArray",
"(",
")",
"{",
"final",
"byte",
"[",
"]",
"b",
"=",
"new",
"byte",
"[",
"this",
".",
"len",
"]",
";",
"if",
"(",
"this",
".",
"len",
">",
"0",
")",
"{",
"System",
".",
"arraycopy",
"(",
"this",
".",
... | Converts the content of this buffer to an array of bytes.
@return byte array | [
"Converts",
"the",
"content",
"of",
"this",
"buffer",
"to",
"an",
"array",
"of",
"bytes",
"."
] | 2a60257c60663684c8f6dc8b5ea3cf184e534db6 | https://github.com/networknt/light-4j/blob/2a60257c60663684c8f6dc8b5ea3cf184e534db6/client/src/main/java/org/apache/hc/core5/util/copied/ByteArrayBuffer.java#L178-L184 | train | Get the array as a byte array. | [
30522,
2270,
24880,
1031,
1033,
11291,
27058,
11335,
2100,
1006,
1007,
1063,
2345,
24880,
1031,
1033,
1038,
1027,
2047,
24880,
1031,
2023,
1012,
18798,
1033,
1025,
2065,
1006,
2023,
1012,
18798,
1028,
1014,
1007,
1063,
2291,
1012,
9140,
359... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
netty/netty | transport-native-kqueue/src/main/java/io/netty/channel/kqueue/KQueueEventArray.java | KQueueEventArray.realloc | void realloc(boolean throwIfFail) {
// Double the capacity while it is "sufficiently small", and otherwise increase by 50%.
int newLength = capacity <= 65536 ? capacity << 1 : capacity + capacity >> 1;
try {
ByteBuffer buffer = Buffer.allocateDirectWithNativeOrder(calculateBufferCapacity(newLength));
// Copy over the old content of the memory and reset the position as we always act on the buffer as if
// the position was never increased.
memory.position(0).limit(size);
buffer.put(memory);
buffer.position(0);
Buffer.free(memory);
memory = buffer;
memoryAddress = Buffer.memoryAddress(buffer);
} catch (OutOfMemoryError e) {
if (throwIfFail) {
OutOfMemoryError error = new OutOfMemoryError(
"unable to allocate " + newLength + " new bytes! Existing capacity is: " + capacity);
error.initCause(e);
throw error;
}
}
} | java | void realloc(boolean throwIfFail) {
// Double the capacity while it is "sufficiently small", and otherwise increase by 50%.
int newLength = capacity <= 65536 ? capacity << 1 : capacity + capacity >> 1;
try {
ByteBuffer buffer = Buffer.allocateDirectWithNativeOrder(calculateBufferCapacity(newLength));
// Copy over the old content of the memory and reset the position as we always act on the buffer as if
// the position was never increased.
memory.position(0).limit(size);
buffer.put(memory);
buffer.position(0);
Buffer.free(memory);
memory = buffer;
memoryAddress = Buffer.memoryAddress(buffer);
} catch (OutOfMemoryError e) {
if (throwIfFail) {
OutOfMemoryError error = new OutOfMemoryError(
"unable to allocate " + newLength + " new bytes! Existing capacity is: " + capacity);
error.initCause(e);
throw error;
}
}
} | [
"void",
"realloc",
"(",
"boolean",
"throwIfFail",
")",
"{",
"// Double the capacity while it is \"sufficiently small\", and otherwise increase by 50%.",
"int",
"newLength",
"=",
"capacity",
"<=",
"65536",
"?",
"capacity",
"<<",
"1",
":",
"capacity",
"+",
"capacity",
">>",... | Increase the storage of this {@link KQueueEventArray}. | [
"Increase",
"the",
"storage",
"of",
"this",
"{"
] | ba06eafa1c1824bd154f1a380019e7ea2edf3c4c | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/transport-native-kqueue/src/main/java/io/netty/channel/kqueue/KQueueEventArray.java#L94-L117 | train | Realloc the buffer. | [
30522,
11675,
2613,
4135,
2278,
1006,
22017,
20898,
5466,
13355,
12502,
1007,
1063,
1013,
1013,
3313,
1996,
3977,
2096,
2009,
2003,
1000,
12949,
2235,
1000,
1010,
1998,
4728,
3623,
2011,
2753,
1003,
1012,
20014,
2047,
7770,
13512,
2232,
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... |
hankcs/HanLP | src/main/java/com/hankcs/hanlp/corpus/dictionary/TMDictionaryMaker.java | TMDictionaryMaker.addPair | public void addPair(String first, String second)
{
Map<String, Integer> firstMatrix = transferMatrix.get(first);
if (firstMatrix == null)
{
firstMatrix = new TreeMap<String, Integer>();
transferMatrix.put(first, firstMatrix);
}
Integer frequency = firstMatrix.get(second);
if (frequency == null) frequency = 0;
firstMatrix.put(second, frequency + 1);
} | java | public void addPair(String first, String second)
{
Map<String, Integer> firstMatrix = transferMatrix.get(first);
if (firstMatrix == null)
{
firstMatrix = new TreeMap<String, Integer>();
transferMatrix.put(first, firstMatrix);
}
Integer frequency = firstMatrix.get(second);
if (frequency == null) frequency = 0;
firstMatrix.put(second, frequency + 1);
} | [
"public",
"void",
"addPair",
"(",
"String",
"first",
",",
"String",
"second",
")",
"{",
"Map",
"<",
"String",
",",
"Integer",
">",
"firstMatrix",
"=",
"transferMatrix",
".",
"get",
"(",
"first",
")",
";",
"if",
"(",
"firstMatrix",
"==",
"null",
")",
"{... | 添加一个转移例子,会在内部完成统计
@param first
@param second | [
"添加一个转移例子,会在内部完成统计"
] | a538d0722ab2e4980a9dcd9ea40324fc3ddba7ce | https://github.com/hankcs/HanLP/blob/a538d0722ab2e4980a9dcd9ea40324fc3ddba7ce/src/main/java/com/hankcs/hanlp/corpus/dictionary/TMDictionaryMaker.java#L43-L54 | train | Add a pair of a single class to the sequence. | [
30522,
2270,
11675,
5587,
4502,
4313,
1006,
5164,
2034,
1010,
5164,
2117,
1007,
1063,
4949,
1026,
5164,
1010,
16109,
1028,
2034,
18900,
17682,
1027,
4651,
18900,
17682,
1012,
2131,
1006,
2034,
1007,
1025,
2065,
1006,
2034,
18900,
17682,
102... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
apache/flink | flink-runtime/src/main/java/org/apache/flink/runtime/taskmanager/Task.java | Task.executeAsyncCallRunnable | private void executeAsyncCallRunnable(Runnable runnable, String callName, boolean blocking) {
// make sure the executor is initialized. lock against concurrent calls to this function
synchronized (this) {
if (executionState != ExecutionState.RUNNING) {
return;
}
// get ourselves a reference on the stack that cannot be concurrently modified
BlockingCallMonitoringThreadPool executor = this.asyncCallDispatcher;
if (executor == null) {
// first time use, initialize
checkState(userCodeClassLoader != null, "userCodeClassLoader must not be null");
// Under normal execution, we expect that one thread will suffice, this is why we
// keep the core threads to 1. In the case of a synchronous savepoint, we will block
// the checkpointing thread, so we need an additional thread to execute the
// notifyCheckpointComplete() callback. Finally, we aggressively purge (potentially)
// idle thread so that we do not risk to have many idle thread on machines with multiple
// tasks on them. Either way, only one of them can execute at a time due to the
// checkpoint lock.
executor = new BlockingCallMonitoringThreadPool(
new DispatcherThreadFactory(
TASK_THREADS_GROUP,
"Async calls on " + taskNameWithSubtask,
userCodeClassLoader));
this.asyncCallDispatcher = executor;
// double-check for execution state, and make sure we clean up after ourselves
// if we created the dispatcher while the task was concurrently canceled
if (executionState != ExecutionState.RUNNING) {
executor.shutdown();
asyncCallDispatcher = null;
return;
}
}
LOG.debug("Invoking async call {} on task {}", callName, taskNameWithSubtask);
try {
executor.submit(runnable, blocking);
}
catch (RejectedExecutionException e) {
// may be that we are concurrently finished or canceled.
// if not, report that something is fishy
if (executionState == ExecutionState.RUNNING) {
throw new RuntimeException("Async call with a " + (blocking ? "" : "non-") + "blocking call was rejected, even though the task is running.", e);
}
}
}
} | java | private void executeAsyncCallRunnable(Runnable runnable, String callName, boolean blocking) {
// make sure the executor is initialized. lock against concurrent calls to this function
synchronized (this) {
if (executionState != ExecutionState.RUNNING) {
return;
}
// get ourselves a reference on the stack that cannot be concurrently modified
BlockingCallMonitoringThreadPool executor = this.asyncCallDispatcher;
if (executor == null) {
// first time use, initialize
checkState(userCodeClassLoader != null, "userCodeClassLoader must not be null");
// Under normal execution, we expect that one thread will suffice, this is why we
// keep the core threads to 1. In the case of a synchronous savepoint, we will block
// the checkpointing thread, so we need an additional thread to execute the
// notifyCheckpointComplete() callback. Finally, we aggressively purge (potentially)
// idle thread so that we do not risk to have many idle thread on machines with multiple
// tasks on them. Either way, only one of them can execute at a time due to the
// checkpoint lock.
executor = new BlockingCallMonitoringThreadPool(
new DispatcherThreadFactory(
TASK_THREADS_GROUP,
"Async calls on " + taskNameWithSubtask,
userCodeClassLoader));
this.asyncCallDispatcher = executor;
// double-check for execution state, and make sure we clean up after ourselves
// if we created the dispatcher while the task was concurrently canceled
if (executionState != ExecutionState.RUNNING) {
executor.shutdown();
asyncCallDispatcher = null;
return;
}
}
LOG.debug("Invoking async call {} on task {}", callName, taskNameWithSubtask);
try {
executor.submit(runnable, blocking);
}
catch (RejectedExecutionException e) {
// may be that we are concurrently finished or canceled.
// if not, report that something is fishy
if (executionState == ExecutionState.RUNNING) {
throw new RuntimeException("Async call with a " + (blocking ? "" : "non-") + "blocking call was rejected, even though the task is running.", e);
}
}
}
} | [
"private",
"void",
"executeAsyncCallRunnable",
"(",
"Runnable",
"runnable",
",",
"String",
"callName",
",",
"boolean",
"blocking",
")",
"{",
"// make sure the executor is initialized. lock against concurrent calls to this function",
"synchronized",
"(",
"this",
")",
"{",
"if"... | Utility method to dispatch an asynchronous call on the invokable.
@param runnable The async call runnable.
@param callName The name of the call, for logging purposes. | [
"Utility",
"method",
"to",
"dispatch",
"an",
"asynchronous",
"call",
"on",
"the",
"invokable",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/taskmanager/Task.java#L1319-L1369 | train | Execute an async call runnable. | [
30522,
2797,
11675,
15389,
3022,
6038,
16665,
3363,
15532,
22966,
1006,
2448,
22966,
2448,
22966,
1010,
5164,
2655,
18442,
1010,
22017,
20898,
10851,
1007,
1063,
1013,
1013,
2191,
2469,
1996,
4654,
8586,
16161,
2099,
2003,
3988,
3550,
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/types/StringValue.java | StringValue.setValue | public void setValue(CharSequence value, int offset, int len) {
checkNotNull(value);
if (offset < 0 || len < 0 || offset > value.length() - len) {
throw new IndexOutOfBoundsException("offset: " + offset + " len: " + len + " value.len: " + len);
}
ensureSize(len);
this.len = len;
for (int i = 0; i < len; i++) {
this.value[i] = value.charAt(offset + i);
}
this.hashCode = 0;
} | java | public void setValue(CharSequence value, int offset, int len) {
checkNotNull(value);
if (offset < 0 || len < 0 || offset > value.length() - len) {
throw new IndexOutOfBoundsException("offset: " + offset + " len: " + len + " value.len: " + len);
}
ensureSize(len);
this.len = len;
for (int i = 0; i < len; i++) {
this.value[i] = value.charAt(offset + i);
}
this.hashCode = 0;
} | [
"public",
"void",
"setValue",
"(",
"CharSequence",
"value",
",",
"int",
"offset",
",",
"int",
"len",
")",
"{",
"checkNotNull",
"(",
"value",
")",
";",
"if",
"(",
"offset",
"<",
"0",
"||",
"len",
"<",
"0",
"||",
"offset",
">",
"value",
".",
"length",
... | Sets the value of the StringValue to a substring of the given string.
@param value The new string value.
@param offset The position to start the substring.
@param len The length of the substring. | [
"Sets",
"the",
"value",
"of",
"the",
"StringValue",
"to",
"a",
"substring",
"of",
"the",
"given",
"string",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-core/src/main/java/org/apache/flink/types/StringValue.java#L184-L196 | train | Sets the value of this object to the specified char sequence. | [
30522,
2270,
11675,
2275,
10175,
5657,
1006,
25869,
3366,
4226,
5897,
3643,
1010,
20014,
16396,
1010,
20014,
18798,
1007,
1063,
4638,
17048,
11231,
3363,
1006,
3643,
1007,
1025,
2065,
1006,
16396,
1026,
1014,
1064,
1064,
18798,
1026,
1014,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
spring-projects/spring-boot | spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/properties/source/ConfigurationPropertyName.java | ConfigurationPropertyName.getLastElement | public String getLastElement(Form form) {
int size = getNumberOfElements();
return (size != 0) ? getElement(size - 1, form) : EMPTY_STRING;
} | java | public String getLastElement(Form form) {
int size = getNumberOfElements();
return (size != 0) ? getElement(size - 1, form) : EMPTY_STRING;
} | [
"public",
"String",
"getLastElement",
"(",
"Form",
"form",
")",
"{",
"int",
"size",
"=",
"getNumberOfElements",
"(",
")",
";",
"return",
"(",
"size",
"!=",
"0",
")",
"?",
"getElement",
"(",
"size",
"-",
"1",
",",
"form",
")",
":",
"EMPTY_STRING",
";",
... | Return the last element in the name in the given form.
@param form the form to return
@return the last element | [
"Return",
"the",
"last",
"element",
"in",
"the",
"name",
"in",
"the",
"given",
"form",
"."
] | 0b27f7c70e164b2b1a96477f1d9c1acba56790c1 | https://github.com/spring-projects/spring-boot/blob/0b27f7c70e164b2b1a96477f1d9c1acba56790c1/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/properties/source/ConfigurationPropertyName.java#L114-L117 | train | Gets the last element in the list. | [
30522,
2270,
5164,
2131,
8523,
9834,
13665,
1006,
2433,
2433,
1007,
1063,
20014,
2946,
1027,
2131,
19172,
5677,
11253,
12260,
8163,
1006,
1007,
1025,
2709,
1006,
2946,
999,
1027,
1014,
1007,
1029,
2131,
12260,
3672,
1006,
2946,
1011,
1015,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/LaunchedURLClassLoader.java | LaunchedURLClassLoader.definePackageIfNecessary | private void definePackageIfNecessary(String className) {
int lastDot = className.lastIndexOf('.');
if (lastDot >= 0) {
String packageName = className.substring(0, lastDot);
if (getPackage(packageName) == null) {
try {
definePackage(className, packageName);
}
catch (IllegalArgumentException ex) {
// Tolerate race condition due to being parallel capable
if (getPackage(packageName) == null) {
// This should never happen as the IllegalArgumentException
// indicates that the package has already been defined and,
// therefore, getPackage(name) should not have returned null.
throw new AssertionError(
"Package " + packageName + " has already been defined "
+ "but it could not be found");
}
}
}
}
} | java | private void definePackageIfNecessary(String className) {
int lastDot = className.lastIndexOf('.');
if (lastDot >= 0) {
String packageName = className.substring(0, lastDot);
if (getPackage(packageName) == null) {
try {
definePackage(className, packageName);
}
catch (IllegalArgumentException ex) {
// Tolerate race condition due to being parallel capable
if (getPackage(packageName) == null) {
// This should never happen as the IllegalArgumentException
// indicates that the package has already been defined and,
// therefore, getPackage(name) should not have returned null.
throw new AssertionError(
"Package " + packageName + " has already been defined "
+ "but it could not be found");
}
}
}
}
} | [
"private",
"void",
"definePackageIfNecessary",
"(",
"String",
"className",
")",
"{",
"int",
"lastDot",
"=",
"className",
".",
"lastIndexOf",
"(",
"'",
"'",
")",
";",
"if",
"(",
"lastDot",
">=",
"0",
")",
"{",
"String",
"packageName",
"=",
"className",
".",... | Define a package before a {@code findClass} call is made. This is necessary to
ensure that the appropriate manifest for nested JARs is associated with the
package.
@param className the class name being found | [
"Define",
"a",
"package",
"before",
"a",
"{"
] | 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/LaunchedURLClassLoader.java#L106-L127 | train | Define the package if it doesn t already exist. | [
30522,
2797,
11675,
9375,
23947,
4270,
10128,
2638,
9623,
10286,
2100,
1006,
5164,
2465,
18442,
1007,
1063,
20014,
2197,
27364,
1027,
2465,
18442,
1012,
2197,
22254,
10288,
11253,
1006,
1005,
1012,
1005,
1007,
1025,
2065,
1006,
2197,
27364,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/DataStreamSink.java | DataStreamSink.setResources | private DataStreamSink<T> setResources(ResourceSpec minResources, ResourceSpec preferredResources) {
Preconditions.checkNotNull(minResources, "The min resources must be not null.");
Preconditions.checkNotNull(preferredResources, "The preferred resources must be not null.");
Preconditions.checkArgument(minResources.isValid() && preferredResources.isValid() && minResources.lessThanOrEqual(preferredResources),
"The values in resources must be not less than 0 and the preferred resources must be greater than the min resources.");
transformation.setResources(minResources, preferredResources);
return this;
} | java | private DataStreamSink<T> setResources(ResourceSpec minResources, ResourceSpec preferredResources) {
Preconditions.checkNotNull(minResources, "The min resources must be not null.");
Preconditions.checkNotNull(preferredResources, "The preferred resources must be not null.");
Preconditions.checkArgument(minResources.isValid() && preferredResources.isValid() && minResources.lessThanOrEqual(preferredResources),
"The values in resources must be not less than 0 and the preferred resources must be greater than the min resources.");
transformation.setResources(minResources, preferredResources);
return this;
} | [
"private",
"DataStreamSink",
"<",
"T",
">",
"setResources",
"(",
"ResourceSpec",
"minResources",
",",
"ResourceSpec",
"preferredResources",
")",
"{",
"Preconditions",
".",
"checkNotNull",
"(",
"minResources",
",",
"\"The min resources must be not null.\"",
")",
";",
"Pr... | Sets the minimum and preferred resources for this sink, and the lower and upper resource limits will
be considered in resource resize feature for future plan.
@param minResources The minimum resources for this sink.
@param preferredResources The preferred resources for this sink
@return The sink with set minimum and preferred resources. | [
"Sets",
"the",
"minimum",
"and",
"preferred",
"resources",
"for",
"this",
"sink",
"and",
"the",
"lower",
"and",
"upper",
"resource",
"limits",
"will",
"be",
"considered",
"in",
"resource",
"resize",
"feature",
"for",
"future",
"plan",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-streaming-java/src/main/java/org/apache/flink/streaming/api/datastream/DataStreamSink.java#L129-L138 | train | Sets the resources for the sink. | [
30522,
2797,
2951,
21422,
11493,
2243,
1026,
1056,
1028,
2275,
6072,
8162,
9623,
1006,
4219,
5051,
2278,
8117,
6072,
8162,
9623,
1010,
4219,
5051,
2278,
6871,
6072,
8162,
9623,
1007,
1063,
3653,
8663,
20562,
2015,
1012,
4638,
17048,
11231,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
apache/flink | flink-runtime/src/main/java/org/apache/flink/runtime/executiongraph/ExecutionVertex.java | ExecutionVertex.createDeploymentDescriptor | TaskDeploymentDescriptor createDeploymentDescriptor(
ExecutionAttemptID executionId,
LogicalSlot targetSlot,
@Nullable JobManagerTaskRestore taskRestore,
int attemptNumber) throws ExecutionGraphException {
// Produced intermediate results
List<ResultPartitionDeploymentDescriptor> producedPartitions = new ArrayList<>(resultPartitions.size());
// Consumed intermediate results
List<InputGateDeploymentDescriptor> consumedPartitions = new ArrayList<>(inputEdges.length);
boolean lazyScheduling = getExecutionGraph().getScheduleMode().allowLazyDeployment();
for (IntermediateResultPartition partition : resultPartitions.values()) {
List<List<ExecutionEdge>> consumers = partition.getConsumers();
if (consumers.isEmpty()) {
//TODO this case only exists for test, currently there has to be exactly one consumer in real jobs!
producedPartitions.add(ResultPartitionDeploymentDescriptor.from(
partition,
KeyGroupRangeAssignment.UPPER_BOUND_MAX_PARALLELISM,
lazyScheduling));
} else {
Preconditions.checkState(1 == consumers.size(),
"Only one consumer supported in the current implementation! Found: " + consumers.size());
List<ExecutionEdge> consumer = consumers.get(0);
ExecutionJobVertex vertex = consumer.get(0).getTarget().getJobVertex();
int maxParallelism = vertex.getMaxParallelism();
producedPartitions.add(ResultPartitionDeploymentDescriptor.from(partition, maxParallelism, lazyScheduling));
}
}
final InputChannelDeploymentDescriptor[] icddArray = new InputChannelDeploymentDescriptor[0];
for (ExecutionEdge[] edges : inputEdges) {
List<InputChannelDeploymentDescriptor> partitions = InputChannelDeploymentDescriptor.fromEdges(
Arrays.asList(edges),
lazyScheduling);
// If the produced partition has multiple consumers registered, we
// need to request the one matching our sub task index.
// TODO Refactor after removing the consumers from the intermediate result partitions
int numConsumerEdges = edges[0].getSource().getConsumers().get(0).size();
int queueToRequest = subTaskIndex % numConsumerEdges;
IntermediateResult consumedIntermediateResult = edges[0].getSource().getIntermediateResult();
final IntermediateDataSetID resultId = consumedIntermediateResult.getId();
final ResultPartitionType partitionType = consumedIntermediateResult.getResultType();
consumedPartitions.add(new InputGateDeploymentDescriptor(resultId, partitionType, queueToRequest, partitions.toArray(icddArray)));
}
final Either<SerializedValue<JobInformation>, PermanentBlobKey> jobInformationOrBlobKey = getExecutionGraph().getJobInformationOrBlobKey();
final TaskDeploymentDescriptor.MaybeOffloaded<JobInformation> serializedJobInformation;
if (jobInformationOrBlobKey.isLeft()) {
serializedJobInformation = new TaskDeploymentDescriptor.NonOffloaded<>(jobInformationOrBlobKey.left());
} else {
serializedJobInformation = new TaskDeploymentDescriptor.Offloaded<>(jobInformationOrBlobKey.right());
}
final Either<SerializedValue<TaskInformation>, PermanentBlobKey> taskInformationOrBlobKey;
try {
taskInformationOrBlobKey = jobVertex.getTaskInformationOrBlobKey();
} catch (IOException e) {
throw new ExecutionGraphException(
"Could not create a serialized JobVertexInformation for " +
jobVertex.getJobVertexId(), e);
}
final TaskDeploymentDescriptor.MaybeOffloaded<TaskInformation> serializedTaskInformation;
if (taskInformationOrBlobKey.isLeft()) {
serializedTaskInformation = new TaskDeploymentDescriptor.NonOffloaded<>(taskInformationOrBlobKey.left());
} else {
serializedTaskInformation = new TaskDeploymentDescriptor.Offloaded<>(taskInformationOrBlobKey.right());
}
return new TaskDeploymentDescriptor(
getJobId(),
serializedJobInformation,
serializedTaskInformation,
executionId,
targetSlot.getAllocationId(),
subTaskIndex,
attemptNumber,
targetSlot.getPhysicalSlotNumber(),
taskRestore,
producedPartitions,
consumedPartitions);
} | java | TaskDeploymentDescriptor createDeploymentDescriptor(
ExecutionAttemptID executionId,
LogicalSlot targetSlot,
@Nullable JobManagerTaskRestore taskRestore,
int attemptNumber) throws ExecutionGraphException {
// Produced intermediate results
List<ResultPartitionDeploymentDescriptor> producedPartitions = new ArrayList<>(resultPartitions.size());
// Consumed intermediate results
List<InputGateDeploymentDescriptor> consumedPartitions = new ArrayList<>(inputEdges.length);
boolean lazyScheduling = getExecutionGraph().getScheduleMode().allowLazyDeployment();
for (IntermediateResultPartition partition : resultPartitions.values()) {
List<List<ExecutionEdge>> consumers = partition.getConsumers();
if (consumers.isEmpty()) {
//TODO this case only exists for test, currently there has to be exactly one consumer in real jobs!
producedPartitions.add(ResultPartitionDeploymentDescriptor.from(
partition,
KeyGroupRangeAssignment.UPPER_BOUND_MAX_PARALLELISM,
lazyScheduling));
} else {
Preconditions.checkState(1 == consumers.size(),
"Only one consumer supported in the current implementation! Found: " + consumers.size());
List<ExecutionEdge> consumer = consumers.get(0);
ExecutionJobVertex vertex = consumer.get(0).getTarget().getJobVertex();
int maxParallelism = vertex.getMaxParallelism();
producedPartitions.add(ResultPartitionDeploymentDescriptor.from(partition, maxParallelism, lazyScheduling));
}
}
final InputChannelDeploymentDescriptor[] icddArray = new InputChannelDeploymentDescriptor[0];
for (ExecutionEdge[] edges : inputEdges) {
List<InputChannelDeploymentDescriptor> partitions = InputChannelDeploymentDescriptor.fromEdges(
Arrays.asList(edges),
lazyScheduling);
// If the produced partition has multiple consumers registered, we
// need to request the one matching our sub task index.
// TODO Refactor after removing the consumers from the intermediate result partitions
int numConsumerEdges = edges[0].getSource().getConsumers().get(0).size();
int queueToRequest = subTaskIndex % numConsumerEdges;
IntermediateResult consumedIntermediateResult = edges[0].getSource().getIntermediateResult();
final IntermediateDataSetID resultId = consumedIntermediateResult.getId();
final ResultPartitionType partitionType = consumedIntermediateResult.getResultType();
consumedPartitions.add(new InputGateDeploymentDescriptor(resultId, partitionType, queueToRequest, partitions.toArray(icddArray)));
}
final Either<SerializedValue<JobInformation>, PermanentBlobKey> jobInformationOrBlobKey = getExecutionGraph().getJobInformationOrBlobKey();
final TaskDeploymentDescriptor.MaybeOffloaded<JobInformation> serializedJobInformation;
if (jobInformationOrBlobKey.isLeft()) {
serializedJobInformation = new TaskDeploymentDescriptor.NonOffloaded<>(jobInformationOrBlobKey.left());
} else {
serializedJobInformation = new TaskDeploymentDescriptor.Offloaded<>(jobInformationOrBlobKey.right());
}
final Either<SerializedValue<TaskInformation>, PermanentBlobKey> taskInformationOrBlobKey;
try {
taskInformationOrBlobKey = jobVertex.getTaskInformationOrBlobKey();
} catch (IOException e) {
throw new ExecutionGraphException(
"Could not create a serialized JobVertexInformation for " +
jobVertex.getJobVertexId(), e);
}
final TaskDeploymentDescriptor.MaybeOffloaded<TaskInformation> serializedTaskInformation;
if (taskInformationOrBlobKey.isLeft()) {
serializedTaskInformation = new TaskDeploymentDescriptor.NonOffloaded<>(taskInformationOrBlobKey.left());
} else {
serializedTaskInformation = new TaskDeploymentDescriptor.Offloaded<>(taskInformationOrBlobKey.right());
}
return new TaskDeploymentDescriptor(
getJobId(),
serializedJobInformation,
serializedTaskInformation,
executionId,
targetSlot.getAllocationId(),
subTaskIndex,
attemptNumber,
targetSlot.getPhysicalSlotNumber(),
taskRestore,
producedPartitions,
consumedPartitions);
} | [
"TaskDeploymentDescriptor",
"createDeploymentDescriptor",
"(",
"ExecutionAttemptID",
"executionId",
",",
"LogicalSlot",
"targetSlot",
",",
"@",
"Nullable",
"JobManagerTaskRestore",
"taskRestore",
",",
"int",
"attemptNumber",
")",
"throws",
"ExecutionGraphException",
"{",
"// ... | Creates a task deployment descriptor to deploy a subtask to the given target slot.
TODO: This should actually be in the EXECUTION | [
"Creates",
"a",
"task",
"deployment",
"descriptor",
"to",
"deploy",
"a",
"subtask",
"to",
"the",
"given",
"target",
"slot",
".",
"TODO",
":",
"This",
"should",
"actually",
"be",
"in",
"the",
"EXECUTION"
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/executiongraph/ExecutionVertex.java#L825-L921 | train | Create a deployment descriptor for the given task. | [
30522,
4708,
3207,
24759,
6977,
3672,
6155,
23235,
2953,
2580,
13699,
4135,
25219,
3372,
6155,
23235,
2953,
1006,
7781,
19321,
6633,
13876,
3593,
7781,
3593,
1010,
11177,
14540,
4140,
7889,
10994,
1010,
1030,
19701,
3085,
3105,
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... |
apache/incubator-shardingsphere | sharding-jdbc/sharding-jdbc-core/src/main/java/org/apache/shardingsphere/shardingjdbc/api/yaml/YamlShardingDataSourceFactory.java | YamlShardingDataSourceFactory.createDataSource | public static DataSource createDataSource(final Map<String, DataSource> dataSourceMap, final File yamlFile) throws SQLException, IOException {
YamlRootShardingConfiguration config = YamlEngine.unmarshal(yamlFile, YamlRootShardingConfiguration.class);
return ShardingDataSourceFactory.createDataSource(dataSourceMap, new ShardingRuleConfigurationYamlSwapper().swap(config.getShardingRule()), config.getProps());
} | java | public static DataSource createDataSource(final Map<String, DataSource> dataSourceMap, final File yamlFile) throws SQLException, IOException {
YamlRootShardingConfiguration config = YamlEngine.unmarshal(yamlFile, YamlRootShardingConfiguration.class);
return ShardingDataSourceFactory.createDataSource(dataSourceMap, new ShardingRuleConfigurationYamlSwapper().swap(config.getShardingRule()), config.getProps());
} | [
"public",
"static",
"DataSource",
"createDataSource",
"(",
"final",
"Map",
"<",
"String",
",",
"DataSource",
">",
"dataSourceMap",
",",
"final",
"File",
"yamlFile",
")",
"throws",
"SQLException",
",",
"IOException",
"{",
"YamlRootShardingConfiguration",
"config",
"=... | Create sharding data source.
@param dataSourceMap data source map
@param yamlFile YAML file for rule configuration of databases and tables sharding without data sources
@return sharding data source
@throws SQLException SQL exception
@throws IOException IO exception | [
"Create",
"sharding",
"data",
"source",
"."
] | f88fd29fc345dfb31fdce12e9e96cbfa0fd2402d | https://github.com/apache/incubator-shardingsphere/blob/f88fd29fc345dfb31fdce12e9e96cbfa0fd2402d/sharding-jdbc/sharding-jdbc-core/src/main/java/org/apache/shardingsphere/shardingjdbc/api/yaml/YamlShardingDataSourceFactory.java#L76-L79 | train | Create DataSource from yaml file. | [
30522,
2270,
10763,
2951,
6499,
3126,
3401,
2580,
6790,
6499,
3126,
3401,
1006,
2345,
4949,
1026,
5164,
1010,
2951,
6499,
3126,
3401,
1028,
2951,
6499,
3126,
3401,
2863,
2361,
1010,
2345,
5371,
8038,
19968,
8873,
2571,
1007,
11618,
29296,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
netty/netty | common/src/main/java/io/netty/util/AsciiString.java | AsciiString.contains | public static boolean contains(CharSequence a, CharSequence b) {
return contains(a, b, DefaultCharEqualityComparator.INSTANCE);
} | java | public static boolean contains(CharSequence a, CharSequence b) {
return contains(a, b, DefaultCharEqualityComparator.INSTANCE);
} | [
"public",
"static",
"boolean",
"contains",
"(",
"CharSequence",
"a",
",",
"CharSequence",
"b",
")",
"{",
"return",
"contains",
"(",
"a",
",",
"b",
",",
"DefaultCharEqualityComparator",
".",
"INSTANCE",
")",
";",
"}"
] | Determine if {@code a} contains {@code b} in a case sensitive manner. | [
"Determine",
"if",
"{"
] | ba06eafa1c1824bd154f1a380019e7ea2edf3c4c | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/common/src/main/java/io/netty/util/AsciiString.java#L1425-L1427 | train | Returns true if the two CharSequences are contained in the source. | [
30522,
2270,
10763,
22017,
20898,
3397,
1006,
25869,
3366,
4226,
5897,
1037,
1010,
25869,
3366,
4226,
5897,
1038,
1007,
1063,
2709,
3397,
1006,
1037,
1010,
1038,
1010,
12398,
7507,
2890,
26426,
3012,
9006,
28689,
4263,
1012,
6013,
1007,
102... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
spring-projects/spring-boot | spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/main/java/org/springframework/boot/maven/SpringApplicationAdminClient.java | SpringApplicationAdminClient.connect | public static JMXConnector connect(int port) throws IOException {
String url = "service:jmx:rmi:///jndi/rmi://127.0.0.1:" + port + "/jmxrmi";
JMXServiceURL serviceUrl = new JMXServiceURL(url);
return JMXConnectorFactory.connect(serviceUrl, null);
} | java | public static JMXConnector connect(int port) throws IOException {
String url = "service:jmx:rmi:///jndi/rmi://127.0.0.1:" + port + "/jmxrmi";
JMXServiceURL serviceUrl = new JMXServiceURL(url);
return JMXConnectorFactory.connect(serviceUrl, null);
} | [
"public",
"static",
"JMXConnector",
"connect",
"(",
"int",
"port",
")",
"throws",
"IOException",
"{",
"String",
"url",
"=",
"\"service:jmx:rmi:///jndi/rmi://127.0.0.1:\"",
"+",
"port",
"+",
"\"/jmxrmi\"",
";",
"JMXServiceURL",
"serviceUrl",
"=",
"new",
"JMXServiceURL"... | Create a connector for an {@link javax.management.MBeanServer} exposed on the
current machine and the current port. Security should be disabled.
@param port the port on which the mbean server is exposed
@return a connection
@throws IOException if the connection to that server failed | [
"Create",
"a",
"connector",
"for",
"an",
"{"
] | 0b27f7c70e164b2b1a96477f1d9c1acba56790c1 | https://github.com/spring-projects/spring-boot/blob/0b27f7c70e164b2b1a96477f1d9c1acba56790c1/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/main/java/org/springframework/boot/maven/SpringApplicationAdminClient.java#L116-L120 | train | Connect to the specified port. | [
30522,
2270,
10763,
1046,
22984,
8663,
2638,
16761,
7532,
1006,
20014,
3417,
1007,
11618,
22834,
10288,
24422,
1063,
5164,
24471,
2140,
1027,
1000,
2326,
1024,
1046,
22984,
1024,
28549,
2072,
1024,
1013,
1013,
1013,
1046,
16089,
1013,
28549,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/builder/CompareToBuilder.java | CompareToBuilder.reflectionCompare | public static int reflectionCompare(
final Object lhs,
final Object rhs,
final boolean compareTransients,
final Class<?> reflectUpToClass,
final String... excludeFields) {
if (lhs == rhs) {
return 0;
}
if (lhs == null || rhs == null) {
throw new NullPointerException();
}
Class<?> lhsClazz = lhs.getClass();
if (!lhsClazz.isInstance(rhs)) {
throw new ClassCastException();
}
final CompareToBuilder compareToBuilder = new CompareToBuilder();
reflectionAppend(lhs, rhs, lhsClazz, compareToBuilder, compareTransients, excludeFields);
while (lhsClazz.getSuperclass() != null && lhsClazz != reflectUpToClass) {
lhsClazz = lhsClazz.getSuperclass();
reflectionAppend(lhs, rhs, lhsClazz, compareToBuilder, compareTransients, excludeFields);
}
return compareToBuilder.toComparison();
} | java | public static int reflectionCompare(
final Object lhs,
final Object rhs,
final boolean compareTransients,
final Class<?> reflectUpToClass,
final String... excludeFields) {
if (lhs == rhs) {
return 0;
}
if (lhs == null || rhs == null) {
throw new NullPointerException();
}
Class<?> lhsClazz = lhs.getClass();
if (!lhsClazz.isInstance(rhs)) {
throw new ClassCastException();
}
final CompareToBuilder compareToBuilder = new CompareToBuilder();
reflectionAppend(lhs, rhs, lhsClazz, compareToBuilder, compareTransients, excludeFields);
while (lhsClazz.getSuperclass() != null && lhsClazz != reflectUpToClass) {
lhsClazz = lhsClazz.getSuperclass();
reflectionAppend(lhs, rhs, lhsClazz, compareToBuilder, compareTransients, excludeFields);
}
return compareToBuilder.toComparison();
} | [
"public",
"static",
"int",
"reflectionCompare",
"(",
"final",
"Object",
"lhs",
",",
"final",
"Object",
"rhs",
",",
"final",
"boolean",
"compareTransients",
",",
"final",
"Class",
"<",
"?",
">",
"reflectUpToClass",
",",
"final",
"String",
"...",
"excludeFields",
... | <p>Compares two <code>Object</code>s via reflection.</p>
<p>Fields can be private, thus <code>AccessibleObject.setAccessible</code>
is used to bypass normal access control checks. This will fail under a
security manager unless the appropriate permissions are set.</p>
<ul>
<li>Static fields will not be compared</li>
<li>If the <code>compareTransients</code> is <code>true</code>,
compares transient members. Otherwise ignores them, as they
are likely derived fields.</li>
<li>Compares superclass fields up to and including <code>reflectUpToClass</code>.
If <code>reflectUpToClass</code> is <code>null</code>, compares all superclass fields.</li>
</ul>
<p>If both <code>lhs</code> and <code>rhs</code> are <code>null</code>,
they are considered equal.</p>
@param lhs left-hand object
@param rhs right-hand object
@param compareTransients whether to compare transient fields
@param reflectUpToClass last superclass for which fields are compared
@param excludeFields fields to exclude
@return a negative integer, zero, or a positive integer as <code>lhs</code>
is less than, equal to, or greater than <code>rhs</code>
@throws NullPointerException if either <code>lhs</code> or <code>rhs</code>
(but not both) is <code>null</code>
@throws ClassCastException if <code>rhs</code> is not assignment-compatible
with <code>lhs</code>
@since 2.2 (2.0 as <code>reflectionCompare(Object, Object, boolean, Class)</code>) | [
"<p",
">",
"Compares",
"two",
"<code",
">",
"Object<",
"/",
"code",
">",
"s",
"via",
"reflection",
".",
"<",
"/",
"p",
">"
] | bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/builder/CompareToBuilder.java#L222-L246 | train | Compare two objects using reflection. | [
30522,
2270,
10763,
20014,
9185,
9006,
19362,
2063,
1006,
2345,
4874,
1048,
7898,
1010,
2345,
4874,
1054,
7898,
1010,
2345,
22017,
20898,
12826,
6494,
3619,
11638,
2015,
1010,
2345,
2465,
1026,
1029,
1028,
8339,
29441,
10085,
27102,
1010,
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/utility/TextUtility.java | TextUtility.isDBCCase | public static boolean isDBCCase(String str)
{
if (str != null)
{
str += " ";
for (int i = 0; i < str.length(); i++)
{
String s = str.substring(i, i + 1);
int length = 0;
try
{
length = s.getBytes("GBK").length;
}
catch (UnsupportedEncodingException e)
{
e.printStackTrace();
length = s.getBytes().length;
}
if (length != 1)
return false;
}
return true;
}
return false;
} | java | public static boolean isDBCCase(String str)
{
if (str != null)
{
str += " ";
for (int i = 0; i < str.length(); i++)
{
String s = str.substring(i, i + 1);
int length = 0;
try
{
length = s.getBytes("GBK").length;
}
catch (UnsupportedEncodingException e)
{
e.printStackTrace();
length = s.getBytes().length;
}
if (length != 1)
return false;
}
return true;
}
return false;
} | [
"public",
"static",
"boolean",
"isDBCCase",
"(",
"String",
"str",
")",
"{",
"if",
"(",
"str",
"!=",
"null",
")",
"{",
"str",
"+=",
"\" \"",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"str",
".",
"length",
"(",
")",
";",
"i",
"++",
... | 判断该字符串是否是半角字符
@param str
@return | [
"判断该字符串是否是半角字符"
] | a538d0722ab2e4980a9dcd9ea40324fc3ddba7ce | https://github.com/hankcs/HanLP/blob/a538d0722ab2e4980a9dcd9ea40324fc3ddba7ce/src/main/java/com/hankcs/hanlp/utility/TextUtility.java#L437-L463 | train | isDBCCase This method is used to check if the string is a DB Case. | [
30522,
2270,
10763,
22017,
20898,
2003,
18939,
16665,
3366,
1006,
5164,
2358,
2099,
1007,
1063,
2065,
1006,
2358,
2099,
999,
1027,
19701,
1007,
1063,
2358,
2099,
1009,
1027,
1000,
1000,
1025,
2005,
1006,
20014,
1045,
1027,
1014,
1025,
1045,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
hankcs/HanLP | src/main/java/com/hankcs/hanlp/dependency/perceptron/accessories/CoNLLReader.java | CoNLLReader.createIndices | public static IndexMaps createIndices(String conllPath, boolean labeled, boolean lowercased, String clusterFile) throws IOException
{
HashMap<String, Integer> wordMap = new HashMap<String, Integer>();
HashMap<Integer, Integer> labels = new HashMap<Integer, Integer>();
HashMap<String, Integer> clusterMap = new HashMap<String, Integer>();
HashMap<Integer, Integer> cluster4Map = new HashMap<Integer, Integer>();
HashMap<Integer, Integer> cluster6Map = new HashMap<Integer, Integer>();
String rootString = "ROOT";
wordMap.put("ROOT", 0);
labels.put(0, 0);
// 所有label的id必须从零开始并且连续
BufferedReader reader = new BufferedReader(new FileReader(conllPath));
String line;
while ((line = reader.readLine()) != null)
{
String[] args = line.trim().split("\t");
if (args.length > 7)
{
String label = args[7];
int head = Integer.parseInt(args[6]);
if (head == 0)
rootString = label;
if (!labeled)
label = "~";
else if (label.equals("_"))
label = "-";
if (!wordMap.containsKey(label))
{
labels.put(wordMap.size(), labels.size());
wordMap.put(label, wordMap.size());
}
}
}
reader = new BufferedReader(new FileReader(conllPath));
while ((line = reader.readLine()) != null)
{
String[] cells = line.trim().split("\t");
if (cells.length > 7)
{
String pos = cells[3];
if (!wordMap.containsKey(pos))
{
wordMap.put(pos, wordMap.size());
}
}
}
if (clusterFile.length() > 0)
{
reader = new BufferedReader(new FileReader(clusterFile));
while ((line = reader.readLine()) != null)
{
String[] cells = line.trim().split("\t");
if (cells.length > 2)
{
String cluster = cells[0];
String word = cells[1];
String prefix4 = cluster.substring(0, Math.min(4, cluster.length()));
String prefix6 = cluster.substring(0, Math.min(6, cluster.length()));
int clusterId = wordMap.size();
if (!wordMap.containsKey(cluster))
{
clusterMap.put(word, wordMap.size());
wordMap.put(cluster, wordMap.size());
}
else
{
clusterId = wordMap.get(cluster);
clusterMap.put(word, clusterId);
}
int pref4Id = wordMap.size();
if (!wordMap.containsKey(prefix4))
{
wordMap.put(prefix4, wordMap.size());
}
else
{
pref4Id = wordMap.get(prefix4);
}
int pref6Id = wordMap.size();
if (!wordMap.containsKey(prefix6))
{
wordMap.put(prefix6, wordMap.size());
}
else
{
pref6Id = wordMap.get(prefix6);
}
cluster4Map.put(clusterId, pref4Id);
cluster6Map.put(clusterId, pref6Id);
}
}
}
reader = new BufferedReader(new FileReader(conllPath));
while ((line = reader.readLine()) != null)
{
String[] cells = line.trim().split("\t");
if (cells.length > 7)
{
String word = cells[1];
if (lowercased)
word = word.toLowerCase();
if (!wordMap.containsKey(word))
{
wordMap.put(word, wordMap.size());
}
}
}
return new IndexMaps(wordMap, labels, rootString, cluster4Map, cluster6Map, clusterMap);
} | java | public static IndexMaps createIndices(String conllPath, boolean labeled, boolean lowercased, String clusterFile) throws IOException
{
HashMap<String, Integer> wordMap = new HashMap<String, Integer>();
HashMap<Integer, Integer> labels = new HashMap<Integer, Integer>();
HashMap<String, Integer> clusterMap = new HashMap<String, Integer>();
HashMap<Integer, Integer> cluster4Map = new HashMap<Integer, Integer>();
HashMap<Integer, Integer> cluster6Map = new HashMap<Integer, Integer>();
String rootString = "ROOT";
wordMap.put("ROOT", 0);
labels.put(0, 0);
// 所有label的id必须从零开始并且连续
BufferedReader reader = new BufferedReader(new FileReader(conllPath));
String line;
while ((line = reader.readLine()) != null)
{
String[] args = line.trim().split("\t");
if (args.length > 7)
{
String label = args[7];
int head = Integer.parseInt(args[6]);
if (head == 0)
rootString = label;
if (!labeled)
label = "~";
else if (label.equals("_"))
label = "-";
if (!wordMap.containsKey(label))
{
labels.put(wordMap.size(), labels.size());
wordMap.put(label, wordMap.size());
}
}
}
reader = new BufferedReader(new FileReader(conllPath));
while ((line = reader.readLine()) != null)
{
String[] cells = line.trim().split("\t");
if (cells.length > 7)
{
String pos = cells[3];
if (!wordMap.containsKey(pos))
{
wordMap.put(pos, wordMap.size());
}
}
}
if (clusterFile.length() > 0)
{
reader = new BufferedReader(new FileReader(clusterFile));
while ((line = reader.readLine()) != null)
{
String[] cells = line.trim().split("\t");
if (cells.length > 2)
{
String cluster = cells[0];
String word = cells[1];
String prefix4 = cluster.substring(0, Math.min(4, cluster.length()));
String prefix6 = cluster.substring(0, Math.min(6, cluster.length()));
int clusterId = wordMap.size();
if (!wordMap.containsKey(cluster))
{
clusterMap.put(word, wordMap.size());
wordMap.put(cluster, wordMap.size());
}
else
{
clusterId = wordMap.get(cluster);
clusterMap.put(word, clusterId);
}
int pref4Id = wordMap.size();
if (!wordMap.containsKey(prefix4))
{
wordMap.put(prefix4, wordMap.size());
}
else
{
pref4Id = wordMap.get(prefix4);
}
int pref6Id = wordMap.size();
if (!wordMap.containsKey(prefix6))
{
wordMap.put(prefix6, wordMap.size());
}
else
{
pref6Id = wordMap.get(prefix6);
}
cluster4Map.put(clusterId, pref4Id);
cluster6Map.put(clusterId, pref6Id);
}
}
}
reader = new BufferedReader(new FileReader(conllPath));
while ((line = reader.readLine()) != null)
{
String[] cells = line.trim().split("\t");
if (cells.length > 7)
{
String word = cells[1];
if (lowercased)
word = word.toLowerCase();
if (!wordMap.containsKey(word))
{
wordMap.put(word, wordMap.size());
}
}
}
return new IndexMaps(wordMap, labels, rootString, cluster4Map, cluster6Map, clusterMap);
} | [
"public",
"static",
"IndexMaps",
"createIndices",
"(",
"String",
"conllPath",
",",
"boolean",
"labeled",
",",
"boolean",
"lowercased",
",",
"String",
"clusterFile",
")",
"throws",
"IOException",
"{",
"HashMap",
"<",
"String",
",",
"Integer",
">",
"wordMap",
"=",... | 读取CoNLL文件,创建索引
@param conllPath
@param labeled
@param lowercased
@param clusterFile
@return
@throws Exception | [
"读取CoNLL文件,创建索引"
] | a538d0722ab2e4980a9dcd9ea40324fc3ddba7ce | https://github.com/hankcs/HanLP/blob/a538d0722ab2e4980a9dcd9ea40324fc3ddba7ce/src/main/java/com/hankcs/hanlp/dependency/perceptron/accessories/CoNLLReader.java#L48-L169 | train | Create the IndexMaps object from the specified conllPath. | [
30522,
2270,
10763,
5950,
2863,
4523,
3443,
22254,
23522,
1006,
5164,
9530,
3363,
15069,
1010,
22017,
20898,
12599,
1010,
22017,
20898,
2896,
28969,
1010,
5164,
9324,
8873,
2571,
30524,
2863,
2361,
1027,
2047,
23325,
2863,
2361,
1026,
5164,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
looly/hutool | hutool-core/src/main/java/cn/hutool/core/codec/BCD.java | BCD.bcdToStr | public static String bcdToStr(byte[] bytes) {
char temp[] = new char[bytes.length * 2], val;
for (int i = 0; i < bytes.length; i++) {
val = (char) (((bytes[i] & 0xf0) >> 4) & 0x0f);
temp[i * 2] = (char) (val > 9 ? val + 'A' - 10 : val + '0');
val = (char) (bytes[i] & 0x0f);
temp[i * 2 + 1] = (char) (val > 9 ? val + 'A' - 10 : val + '0');
}
return new String(temp);
} | java | public static String bcdToStr(byte[] bytes) {
char temp[] = new char[bytes.length * 2], val;
for (int i = 0; i < bytes.length; i++) {
val = (char) (((bytes[i] & 0xf0) >> 4) & 0x0f);
temp[i * 2] = (char) (val > 9 ? val + 'A' - 10 : val + '0');
val = (char) (bytes[i] & 0x0f);
temp[i * 2 + 1] = (char) (val > 9 ? val + 'A' - 10 : val + '0');
}
return new String(temp);
} | [
"public",
"static",
"String",
"bcdToStr",
"(",
"byte",
"[",
"]",
"bytes",
")",
"{",
"char",
"temp",
"[",
"]",
"=",
"new",
"char",
"[",
"bytes",
".",
"length",
"*",
"2",
"]",
",",
"val",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"b... | BCD转ASCII字符串
@param bytes BCD byte数组
@return ASCII字符串 | [
"BCD转ASCII字符串"
] | bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/codec/BCD.java#L84-L95 | train | Converts a byte array to a UTF - 8 string. | [
30522,
2270,
10763,
5164,
4647,
11927,
14122,
2099,
1006,
24880,
1031,
1033,
27507,
1007,
1063,
25869,
8915,
8737,
1031,
1033,
1027,
2047,
25869,
1031,
27507,
1012,
3091,
1008,
1016,
1033,
1010,
11748,
1025,
2005,
1006,
20014,
1045,
1027,
1... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
apache/flink | flink-streaming-java/src/main/java/org/apache/flink/streaming/api/operators/AbstractUdfStreamOperator.java | AbstractUdfStreamOperator.setOutputType | @Override
public void setOutputType(TypeInformation<OUT> outTypeInfo, ExecutionConfig executionConfig) {
StreamingFunctionUtils.setOutputType(userFunction, outTypeInfo, executionConfig);
} | java | @Override
public void setOutputType(TypeInformation<OUT> outTypeInfo, ExecutionConfig executionConfig) {
StreamingFunctionUtils.setOutputType(userFunction, outTypeInfo, executionConfig);
} | [
"@",
"Override",
"public",
"void",
"setOutputType",
"(",
"TypeInformation",
"<",
"OUT",
">",
"outTypeInfo",
",",
"ExecutionConfig",
"executionConfig",
")",
"{",
"StreamingFunctionUtils",
".",
"setOutputType",
"(",
"userFunction",
",",
"outTypeInfo",
",",
"executionCon... | ------------------------------------------------------------------------ | [
"------------------------------------------------------------------------"
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-streaming-java/src/main/java/org/apache/flink/streaming/api/operators/AbstractUdfStreamOperator.java#L138-L141 | train | Sets the output type of the user function. | [
30522,
1030,
2058,
15637,
2270,
11675,
2275,
5833,
18780,
13874,
1006,
2828,
2378,
14192,
3370,
1026,
2041,
1028,
2041,
13874,
2378,
14876,
1010,
7781,
8663,
8873,
2290,
7781,
8663,
8873,
2290,
1007,
1063,
11058,
11263,
27989,
21823,
4877,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/ThriftCLIServiceClient.java | ThriftCLIServiceClient.executeStatement | @Override
public OperationHandle executeStatement(SessionHandle sessionHandle, String statement,
Map<String, String> confOverlay)
throws HiveSQLException {
return executeStatementInternal(sessionHandle, statement, confOverlay, false);
} | java | @Override
public OperationHandle executeStatement(SessionHandle sessionHandle, String statement,
Map<String, String> confOverlay)
throws HiveSQLException {
return executeStatementInternal(sessionHandle, statement, confOverlay, false);
} | [
"@",
"Override",
"public",
"OperationHandle",
"executeStatement",
"(",
"SessionHandle",
"sessionHandle",
",",
"String",
"statement",
",",
"Map",
"<",
"String",
",",
"String",
">",
"confOverlay",
")",
"throws",
"HiveSQLException",
"{",
"return",
"executeStatementIntern... | /* (non-Javadoc)
@see org.apache.hive.service.cli.ICLIService#executeStatement(org.apache.hive.service.cli.SessionHandle, java.lang.String, java.util.Map) | [
"/",
"*",
"(",
"non",
"-",
"Javadoc",
")"
] | 25ee0474f47d9c30d6f553a7892d9549f91071cf | https://github.com/apache/spark/blob/25ee0474f47d9c30d6f553a7892d9549f91071cf/sql/hive-thriftserver/src/main/java/org/apache/hive/service/cli/thrift/ThriftCLIServiceClient.java#L114-L119 | train | Execute a SQL statement. | [
30522,
1030,
2058,
15637,
2270,
3169,
11774,
2571,
15389,
9153,
18532,
4765,
1006,
5219,
11774,
2571,
5219,
11774,
2571,
1010,
5164,
4861,
1010,
4949,
1026,
5164,
1010,
5164,
1028,
9530,
14876,
6299,
8485,
1007,
11618,
26736,
2015,
4160,
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-yarn/src/main/java/org/apache/flink/yarn/YarnTaskExecutorRunner.java | YarnTaskExecutorRunner.run | private static void run(String[] args) {
try {
LOG.debug("All environment variables: {}", ENV);
final String currDir = ENV.get(Environment.PWD.key());
LOG.info("Current working Directory: {}", currDir);
final Configuration configuration = GlobalConfiguration.loadConfiguration(currDir);
//TODO provide path.
FileSystem.initialize(configuration, PluginUtils.createPluginManagerFromRootFolder(Optional.empty()));
setupConfigurationAndInstallSecurityContext(configuration, currDir, ENV);
final String containerId = ENV.get(YarnResourceManager.ENV_FLINK_CONTAINER_ID);
Preconditions.checkArgument(containerId != null,
"ContainerId variable %s not set", YarnResourceManager.ENV_FLINK_CONTAINER_ID);
SecurityUtils.getInstalledContext().runSecured((Callable<Void>) () -> {
TaskManagerRunner.runTaskManager(configuration, new ResourceID(containerId));
return null;
});
}
catch (Throwable t) {
final Throwable strippedThrowable = ExceptionUtils.stripException(t, UndeclaredThrowableException.class);
// make sure that everything whatever ends up in the log
LOG.error("YARN TaskManager initialization failed.", strippedThrowable);
System.exit(INIT_ERROR_EXIT_CODE);
}
} | java | private static void run(String[] args) {
try {
LOG.debug("All environment variables: {}", ENV);
final String currDir = ENV.get(Environment.PWD.key());
LOG.info("Current working Directory: {}", currDir);
final Configuration configuration = GlobalConfiguration.loadConfiguration(currDir);
//TODO provide path.
FileSystem.initialize(configuration, PluginUtils.createPluginManagerFromRootFolder(Optional.empty()));
setupConfigurationAndInstallSecurityContext(configuration, currDir, ENV);
final String containerId = ENV.get(YarnResourceManager.ENV_FLINK_CONTAINER_ID);
Preconditions.checkArgument(containerId != null,
"ContainerId variable %s not set", YarnResourceManager.ENV_FLINK_CONTAINER_ID);
SecurityUtils.getInstalledContext().runSecured((Callable<Void>) () -> {
TaskManagerRunner.runTaskManager(configuration, new ResourceID(containerId));
return null;
});
}
catch (Throwable t) {
final Throwable strippedThrowable = ExceptionUtils.stripException(t, UndeclaredThrowableException.class);
// make sure that everything whatever ends up in the log
LOG.error("YARN TaskManager initialization failed.", strippedThrowable);
System.exit(INIT_ERROR_EXIT_CODE);
}
} | [
"private",
"static",
"void",
"run",
"(",
"String",
"[",
"]",
"args",
")",
"{",
"try",
"{",
"LOG",
".",
"debug",
"(",
"\"All environment variables: {}\"",
",",
"ENV",
")",
";",
"final",
"String",
"currDir",
"=",
"ENV",
".",
"get",
"(",
"Environment",
".",... | The instance entry point for the YARN task executor. Obtains user group information and calls
the main work method {@link TaskManagerRunner#runTaskManager(Configuration, ResourceID)} as a
privileged action.
@param args The command line arguments. | [
"The",
"instance",
"entry",
"point",
"for",
"the",
"YARN",
"task",
"executor",
".",
"Obtains",
"user",
"group",
"information",
"and",
"calls",
"the",
"main",
"work",
"method",
"{",
"@link",
"TaskManagerRunner#runTaskManager",
"(",
"Configuration",
"ResourceID",
")... | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-yarn/src/main/java/org/apache/flink/yarn/YarnTaskExecutorRunner.java#L89-L118 | train | Run the YARN TaskManager. | [
30522,
2797,
10763,
11675,
2448,
1006,
5164,
1031,
1033,
12098,
5620,
1007,
1063,
3046,
1063,
8833,
1012,
2139,
8569,
2290,
1006,
1000,
2035,
4044,
10857,
1024,
1063,
1065,
1000,
1010,
4372,
2615,
1007,
1025,
2345,
5164,
12731,
12171,
4305,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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.partitionByRange | public PartitionOperator<T> partitionByRange(int... fields) {
return new PartitionOperator<>(this, PartitionMethod.RANGE, new Keys.ExpressionKeys<>(fields, getType()), Utils.getCallLocationName());
} | java | public PartitionOperator<T> partitionByRange(int... fields) {
return new PartitionOperator<>(this, PartitionMethod.RANGE, new Keys.ExpressionKeys<>(fields, getType()), Utils.getCallLocationName());
} | [
"public",
"PartitionOperator",
"<",
"T",
">",
"partitionByRange",
"(",
"int",
"...",
"fields",
")",
"{",
"return",
"new",
"PartitionOperator",
"<>",
"(",
"this",
",",
"PartitionMethod",
".",
"RANGE",
",",
"new",
"Keys",
".",
"ExpressionKeys",
"<>",
"(",
"fie... | Range-partitions a DataSet on the specified key fields.
<p><b>Important:</b>This operation requires an extra pass over the DataSet to compute the range boundaries and
shuffles the whole DataSet over the network. This can take significant amount of time.
@param fields The field indexes on which the DataSet is range-partitioned.
@return The partitioned DataSet. | [
"Range",
"-",
"partitions",
"a",
"DataSet",
"on",
"the",
"specified",
"key",
"fields",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-java/src/main/java/org/apache/flink/api/java/DataSet.java#L1297-L1299 | train | Partitions this DataSet on the specified fields using a Range - based partitioning algorithm. | [
30522,
2270,
13571,
25918,
8844,
1026,
1056,
1028,
13571,
3762,
24388,
2063,
1006,
20014,
1012,
1012,
1012,
4249,
1007,
1063,
2709,
2047,
13571,
25918,
8844,
1026,
1028,
1006,
2023,
1010,
13571,
11368,
6806,
2094,
1012,
2846,
1010,
2047,
63... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
alibaba/canal | dbsync/src/main/java/com/taobao/tddl/dbsync/binlog/LogBuffer.java | LogBuffer.getBeInt32 | public final int getBeInt32() {
if (position + 3 >= origin + limit) throw new IllegalArgumentException("limit excceed: "
+ (position - origin + 3));
byte[] buf = buffer;
return ((buf[position++]) << 24) | ((0xff & buf[position++]) << 16) | ((0xff & buf[position++]) << 8)
| (0xff & buf[position++]);
} | java | public final int getBeInt32() {
if (position + 3 >= origin + limit) throw new IllegalArgumentException("limit excceed: "
+ (position - origin + 3));
byte[] buf = buffer;
return ((buf[position++]) << 24) | ((0xff & buf[position++]) << 16) | ((0xff & buf[position++]) << 8)
| (0xff & buf[position++]);
} | [
"public",
"final",
"int",
"getBeInt32",
"(",
")",
"{",
"if",
"(",
"position",
"+",
"3",
">=",
"origin",
"+",
"limit",
")",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"limit excceed: \"",
"+",
"(",
"position",
"-",
"origin",
"+",
"3",
")",
")",
";... | Return next 32-bit signed int from buffer. (big-endian)
@see mysql-5.6.10/include/myisampack.h - mi_sint4korr | [
"Return",
"next",
"32",
"-",
"bit",
"signed",
"int",
"from",
"buffer",
".",
"(",
"big",
"-",
"endian",
")"
] | 8f088cddc0755f4350c5aaae95c6e4002d90a40f | https://github.com/alibaba/canal/blob/8f088cddc0755f4350c5aaae95c6e4002d90a40f/dbsync/src/main/java/com/taobao/tddl/dbsync/binlog/LogBuffer.java#L515-L522 | train | Gets a signed int from the buffer as an int32. | [
30522,
2270,
2345,
20014,
2131,
19205,
3372,
16703,
1006,
1007,
1063,
2065,
1006,
2597,
1009,
1017,
1028,
1027,
4761,
1009,
5787,
1007,
5466,
2047,
6206,
2906,
22850,
15781,
2595,
24422,
1006,
1000,
5787,
4654,
9468,
13089,
1024,
1000,
1009... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/URLUtil.java | URLUtil.getDecodedPath | public static String getDecodedPath(URL url) {
if (null == url) {
return null;
}
String path = null;
try {
// URL对象的getPath方法对于包含中文或空格的问题
path = URLUtil.toURI(url).getPath();
} catch (UtilException e) {
// ignore
}
return (null != path) ? path : url.getPath();
} | java | public static String getDecodedPath(URL url) {
if (null == url) {
return null;
}
String path = null;
try {
// URL对象的getPath方法对于包含中文或空格的问题
path = URLUtil.toURI(url).getPath();
} catch (UtilException e) {
// ignore
}
return (null != path) ? path : url.getPath();
} | [
"public",
"static",
"String",
"getDecodedPath",
"(",
"URL",
"url",
")",
"{",
"if",
"(",
"null",
"==",
"url",
")",
"{",
"return",
"null",
";",
"}",
"String",
"path",
"=",
"null",
";",
"try",
"{",
"// URL对象的getPath方法对于包含中文或空格的问题\r",
"path",
"=",
"URLUtil",
... | 从URL对象中获取不被编码的路径Path<br>
对于本地路径,URL对象的getPath方法对于包含中文或空格时会被编码,导致本读路径读取错误。<br>
此方法将URL转为URI后获取路径用于解决路径被编码的问题
@param url {@link URL}
@return 路径
@since 3.0.8 | [
"从URL对象中获取不被编码的路径Path<br",
">",
"对于本地路径,URL对象的getPath方法对于包含中文或空格时会被编码,导致本读路径读取错误。<br",
">",
"此方法将URL转为URI后获取路径用于解决路径被编码的问题"
] | bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/util/URLUtil.java#L410-L423 | train | Gets the decoded path from the given URL. | [
30522,
2270,
10763,
5164,
2131,
3207,
16044,
18927,
8988,
1006,
24471,
2140,
24471,
2140,
1007,
1063,
2065,
1006,
19701,
30524,
24471,
2140,
100,
100,
1916,
2131,
15069,
1863,
1901,
100,
100,
100,
100,
1746,
1861,
100,
1930,
100,
1916,
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... |
hankcs/HanLP | src/main/java/com/hankcs/hanlp/collection/MDAG/MDAG.java | MDAG.isAcceptNode | private static boolean isAcceptNode(Object nodeObj)
{
if (nodeObj != null)
{
Class nodeObjClass = nodeObj.getClass();
if (nodeObjClass.equals(MDAGNode.class))
return ((MDAGNode) nodeObj).isAcceptNode();
else if (nodeObjClass.equals(SimpleMDAGNode.class))
return ((SimpleMDAGNode) nodeObj).isAcceptNode();
}
throw new IllegalArgumentException("Argument is not an MDAGNode or SimpleMDAGNode");
} | java | private static boolean isAcceptNode(Object nodeObj)
{
if (nodeObj != null)
{
Class nodeObjClass = nodeObj.getClass();
if (nodeObjClass.equals(MDAGNode.class))
return ((MDAGNode) nodeObj).isAcceptNode();
else if (nodeObjClass.equals(SimpleMDAGNode.class))
return ((SimpleMDAGNode) nodeObj).isAcceptNode();
}
throw new IllegalArgumentException("Argument is not an MDAGNode or SimpleMDAGNode");
} | [
"private",
"static",
"boolean",
"isAcceptNode",
"(",
"Object",
"nodeObj",
")",
"{",
"if",
"(",
"nodeObj",
"!=",
"null",
")",
"{",
"Class",
"nodeObjClass",
"=",
"nodeObj",
".",
"getClass",
"(",
")",
";",
"if",
"(",
"nodeObjClass",
".",
"equals",
"(",
"MDA... | Determines if a child node object is accepting.
@param nodeObj an Object
@return if {@code nodeObj} is either an MDAGNode or a SimplifiedMDAGNode,
true if the node is accepting, false otherwise
throws IllegalArgumentException if {@code nodeObj} is not an MDAGNode or SimplifiedMDAGNode | [
"Determines",
"if",
"a",
"child",
"node",
"object",
"is",
"accepting",
"."
] | a538d0722ab2e4980a9dcd9ea40324fc3ddba7ce | https://github.com/hankcs/HanLP/blob/a538d0722ab2e4980a9dcd9ea40324fc3ddba7ce/src/main/java/com/hankcs/hanlp/collection/MDAG/MDAG.java#L1054-L1068 | train | isAcceptNode This method checks if the nodeObj is an instance of the appropriate class. | [
30522,
2797,
10763,
22017,
20898,
18061,
9468,
23606,
3630,
3207,
1006,
4874,
13045,
16429,
3501,
1007,
1063,
2065,
1006,
13045,
16429,
3501,
999,
1027,
19701,
1007,
1063,
2465,
13045,
16429,
3501,
26266,
1027,
13045,
16429,
3501,
1012,
2131,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/CLIService.java | CLIService.openSessionWithImpersonation | @Override
public SessionHandle openSessionWithImpersonation(String username, String password, Map<String, String> configuration,
String delegationToken) throws HiveSQLException {
SessionHandle sessionHandle = sessionManager.openSession(SERVER_VERSION, username, password, null, configuration,
true, delegationToken);
LOG.debug(sessionHandle + ": openSession()");
return sessionHandle;
} | java | @Override
public SessionHandle openSessionWithImpersonation(String username, String password, Map<String, String> configuration,
String delegationToken) throws HiveSQLException {
SessionHandle sessionHandle = sessionManager.openSession(SERVER_VERSION, username, password, null, configuration,
true, delegationToken);
LOG.debug(sessionHandle + ": openSession()");
return sessionHandle;
} | [
"@",
"Override",
"public",
"SessionHandle",
"openSessionWithImpersonation",
"(",
"String",
"username",
",",
"String",
"password",
",",
"Map",
"<",
"String",
",",
"String",
">",
"configuration",
",",
"String",
"delegationToken",
")",
"throws",
"HiveSQLException",
"{"... | /* (non-Javadoc)
@see org.apache.hive.service.cli.ICLIService#openSession(java.lang.String, java.lang.String, java.util.Map) | [
"/",
"*",
"(",
"non",
"-",
"Javadoc",
")"
] | 25ee0474f47d9c30d6f553a7892d9549f91071cf | https://github.com/apache/spark/blob/25ee0474f47d9c30d6f553a7892d9549f91071cf/sql/hive-thriftserver/src/main/java/org/apache/hive/service/cli/CLIService.java#L222-L229 | train | Create a new session with an impersonation. | [
30522,
1030,
2058,
15637,
2270,
5219,
11774,
2571,
7480,
7971,
3258,
24415,
5714,
27576,
3370,
1006,
5164,
5310,
18442,
1010,
5164,
20786,
1010,
4949,
1026,
5164,
1010,
5164,
1028,
9563,
1010,
5164,
10656,
18715,
2368,
1007,
11618,
26736,
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-core/src/main/java/org/apache/flink/api/common/operators/CompilerHints.java | CompilerHints.addUniqueField | public void addUniqueField(int field) {
if (this.uniqueFields == null) {
this.uniqueFields = new HashSet<FieldSet>();
}
this.uniqueFields.add(new FieldSet(field));
} | java | public void addUniqueField(int field) {
if (this.uniqueFields == null) {
this.uniqueFields = new HashSet<FieldSet>();
}
this.uniqueFields.add(new FieldSet(field));
} | [
"public",
"void",
"addUniqueField",
"(",
"int",
"field",
")",
"{",
"if",
"(",
"this",
".",
"uniqueFields",
"==",
"null",
")",
"{",
"this",
".",
"uniqueFields",
"=",
"new",
"HashSet",
"<",
"FieldSet",
">",
"(",
")",
";",
"}",
"this",
".",
"uniqueFields"... | Adds a field as having only unique values.
@param field The field with unique values. | [
"Adds",
"a",
"field",
"as",
"having",
"only",
"unique",
"values",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-core/src/main/java/org/apache/flink/api/common/operators/CompilerHints.java#L131-L136 | train | Adds a unique field to the entity. | [
30522,
2270,
11675,
5587,
19496,
4226,
3790,
1006,
20014,
2492,
1007,
1063,
2065,
1006,
2023,
1012,
4310,
15155,
1027,
1027,
19701,
1007,
1063,
2023,
1012,
4310,
15155,
1027,
2047,
23325,
13462,
1026,
4249,
3388,
1028,
1006,
1007,
1025,
106... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
looly/hutool | hutool-setting/src/main/java/cn/hutool/setting/AbsSetting.java | AbsSetting.getDouble | public Double getDouble(String key, String group, Double defaultValue) {
return Convert.toDouble(getByGroup(key, group), defaultValue);
} | java | public Double getDouble(String key, String group, Double defaultValue) {
return Convert.toDouble(getByGroup(key, group), defaultValue);
} | [
"public",
"Double",
"getDouble",
"(",
"String",
"key",
",",
"String",
"group",
",",
"Double",
"defaultValue",
")",
"{",
"return",
"Convert",
".",
"toDouble",
"(",
"getByGroup",
"(",
"key",
",",
"group",
")",
",",
"defaultValue",
")",
";",
"}"
] | 获取double类型属性值
@param key 属性名
@param group 分组名
@param defaultValue 默认值
@return 属性值 | [
"获取double类型属性值"
] | bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-setting/src/main/java/cn/hutool/setting/AbsSetting.java#L252-L254 | train | Get a Double value from the database by key and group. | [
30522,
2270,
3313,
2131,
26797,
3468,
1006,
5164,
3145,
1010,
5164,
2177,
1010,
3313,
12398,
10175,
30524,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/img/ImgUtil.java | ImgUtil.write | public static void write(Image image, String imageType, OutputStream out) throws IORuntimeException {
write(image, imageType, getImageOutputStream(out));
} | java | public static void write(Image image, String imageType, OutputStream out) throws IORuntimeException {
write(image, imageType, getImageOutputStream(out));
} | [
"public",
"static",
"void",
"write",
"(",
"Image",
"image",
",",
"String",
"imageType",
",",
"OutputStream",
"out",
")",
"throws",
"IORuntimeException",
"{",
"write",
"(",
"image",
",",
"imageType",
",",
"getImageOutputStream",
"(",
"out",
")",
")",
";",
"}"... | 写出图像
@param image {@link Image}
@param imageType 图片类型(图片扩展名)
@param out 写出到的目标流
@throws IORuntimeException IO异常
@since 3.1.2 | [
"写出图像"
] | bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/img/ImgUtil.java#L1402-L1404 | train | Writes an image to an OutputStream. | [
30522,
2270,
10763,
11675,
4339,
1006,
3746,
3746,
1010,
5164,
3746,
13874,
1010,
27852,
25379,
2041,
1007,
11618,
22834,
15532,
7292,
10288,
24422,
1063,
4339,
1006,
3746,
1010,
3746,
13874,
1010,
2131,
9581,
3351,
5833,
18780,
21422,
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/spark | sql/hive-thriftserver/src/main/java/org/apache/hive/service/cli/EmbeddedCLIServiceClient.java | EmbeddedCLIServiceClient.getTables | @Override
public OperationHandle getTables(SessionHandle sessionHandle, String catalogName,
String schemaName, String tableName, List<String> tableTypes) throws HiveSQLException {
return cliService.getTables(sessionHandle, catalogName, schemaName, tableName, tableTypes);
} | java | @Override
public OperationHandle getTables(SessionHandle sessionHandle, String catalogName,
String schemaName, String tableName, List<String> tableTypes) throws HiveSQLException {
return cliService.getTables(sessionHandle, catalogName, schemaName, tableName, tableTypes);
} | [
"@",
"Override",
"public",
"OperationHandle",
"getTables",
"(",
"SessionHandle",
"sessionHandle",
",",
"String",
"catalogName",
",",
"String",
"schemaName",
",",
"String",
"tableName",
",",
"List",
"<",
"String",
">",
"tableTypes",
")",
"throws",
"HiveSQLException",... | /* (non-Javadoc)
@see org.apache.hive.service.cli.CLIServiceClient#getTables(org.apache.hive.service.cli.SessionHandle, java.lang.String, java.lang.String, java.lang.String, java.util.List) | [
"/",
"*",
"(",
"non",
"-",
"Javadoc",
")"
] | 25ee0474f47d9c30d6f553a7892d9549f91071cf | https://github.com/apache/spark/blob/25ee0474f47d9c30d6f553a7892d9549f91071cf/sql/hive-thriftserver/src/main/java/org/apache/hive/service/cli/EmbeddedCLIServiceClient.java#L119-L123 | train | Get the tables for the sequence number. | [
30522,
1030,
2058,
15637,
2270,
3169,
11774,
2571,
2131,
10880,
2015,
1006,
5219,
11774,
2571,
5219,
11774,
2571,
1010,
5164,
12105,
18442,
1010,
5164,
8040,
28433,
18442,
1010,
5164,
2795,
18442,
1010,
2862,
1026,
5164,
1028,
13855,
18863,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/jetty/JettyServletWebServerFactory.java | JettyServletWebServerFactory.configureWebAppContext | protected final void configureWebAppContext(WebAppContext context,
ServletContextInitializer... initializers) {
Assert.notNull(context, "Context must not be null");
context.setTempDirectory(getTempDirectory());
if (this.resourceLoader != null) {
context.setClassLoader(this.resourceLoader.getClassLoader());
}
String contextPath = getContextPath();
context.setContextPath(StringUtils.hasLength(contextPath) ? contextPath : "/");
context.setDisplayName(getDisplayName());
configureDocumentRoot(context);
if (isRegisterDefaultServlet()) {
addDefaultServlet(context);
}
if (shouldRegisterJspServlet()) {
addJspServlet(context);
context.addBean(new JasperInitializer(context), true);
}
addLocaleMappings(context);
ServletContextInitializer[] initializersToUse = mergeInitializers(initializers);
Configuration[] configurations = getWebAppContextConfigurations(context,
initializersToUse);
context.setConfigurations(configurations);
context.setThrowUnavailableOnStartupException(true);
configureSession(context);
postProcessWebAppContext(context);
} | java | protected final void configureWebAppContext(WebAppContext context,
ServletContextInitializer... initializers) {
Assert.notNull(context, "Context must not be null");
context.setTempDirectory(getTempDirectory());
if (this.resourceLoader != null) {
context.setClassLoader(this.resourceLoader.getClassLoader());
}
String contextPath = getContextPath();
context.setContextPath(StringUtils.hasLength(contextPath) ? contextPath : "/");
context.setDisplayName(getDisplayName());
configureDocumentRoot(context);
if (isRegisterDefaultServlet()) {
addDefaultServlet(context);
}
if (shouldRegisterJspServlet()) {
addJspServlet(context);
context.addBean(new JasperInitializer(context), true);
}
addLocaleMappings(context);
ServletContextInitializer[] initializersToUse = mergeInitializers(initializers);
Configuration[] configurations = getWebAppContextConfigurations(context,
initializersToUse);
context.setConfigurations(configurations);
context.setThrowUnavailableOnStartupException(true);
configureSession(context);
postProcessWebAppContext(context);
} | [
"protected",
"final",
"void",
"configureWebAppContext",
"(",
"WebAppContext",
"context",
",",
"ServletContextInitializer",
"...",
"initializers",
")",
"{",
"Assert",
".",
"notNull",
"(",
"context",
",",
"\"Context must not be null\"",
")",
";",
"context",
".",
"setTem... | Configure the given Jetty {@link WebAppContext} for use.
@param context the context to configure
@param initializers the set of initializers to apply | [
"Configure",
"the",
"given",
"Jetty",
"{"
] | 0b27f7c70e164b2b1a96477f1d9c1acba56790c1 | https://github.com/spring-projects/spring-boot/blob/0b27f7c70e164b2b1a96477f1d9c1acba56790c1/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/embedded/jetty/JettyServletWebServerFactory.java#L203-L229 | train | Configures the given webapp context. | [
30522,
5123,
2345,
11675,
9530,
8873,
27390,
7974,
15878,
29098,
8663,
18209,
1006,
4773,
29098,
8663,
18209,
6123,
1010,
14262,
2615,
7485,
8663,
18209,
5498,
20925,
17629,
1012,
1012,
1012,
3988,
17629,
2015,
1007,
1063,
20865,
1012,
2025,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/IterUtil.java | IterUtil.toMap | public static <K, V> Map<K, V> toMap(Iterator<K> keys, Iterator<V> values) {
return toMap(keys, values, false);
} | java | public static <K, V> Map<K, V> toMap(Iterator<K> keys, Iterator<V> values) {
return toMap(keys, values, false);
} | [
"public",
"static",
"<",
"K",
",",
"V",
">",
"Map",
"<",
"K",
",",
"V",
">",
"toMap",
"(",
"Iterator",
"<",
"K",
">",
"keys",
",",
"Iterator",
"<",
"V",
">",
"values",
")",
"{",
"return",
"toMap",
"(",
"keys",
",",
"values",
",",
"false",
")",
... | 将键列表和值列表转换为Map<br>
以键为准,值与键位置需对应。如果键元素数多于值元素,多余部分值用null代替。<br>
如果值多于键,忽略多余的值。
@param <K> 键类型
@param <V> 值类型
@param keys 键列表
@param values 值列表
@return 标题内容Map
@since 3.1.0 | [
"将键列表和值列表转换为Map<br",
">",
"以键为准,值与键位置需对应。如果键元素数多于值元素,多余部分值用null代替。<br",
">",
"如果值多于键,忽略多余的值。"
] | bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/collection/IterUtil.java#L404-L406 | train | Creates a map from the given iterator. | [
30522,
2270,
10763,
1026,
1047,
30524,
1026,
1047,
1010,
1058,
1028,
3419,
9331,
1006,
2009,
6906,
4263,
1026,
1047,
1028,
6309,
1010,
2009,
6906,
4263,
1026,
1058,
1028,
5300,
1007,
1063,
2709,
3419,
9331,
1006,
6309,
1010,
5300,
1010,
6... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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.getWriter | public static BufferedWriter getWriter(File file, String charsetName, boolean isAppend) throws IORuntimeException {
return getWriter(file, Charset.forName(charsetName), isAppend);
} | java | public static BufferedWriter getWriter(File file, String charsetName, boolean isAppend) throws IORuntimeException {
return getWriter(file, Charset.forName(charsetName), isAppend);
} | [
"public",
"static",
"BufferedWriter",
"getWriter",
"(",
"File",
"file",
",",
"String",
"charsetName",
",",
"boolean",
"isAppend",
")",
"throws",
"IORuntimeException",
"{",
"return",
"getWriter",
"(",
"file",
",",
"Charset",
".",
"forName",
"(",
"charsetName",
")... | 获得一个带缓存的写入对象
@param file 输出文件
@param charsetName 字符集
@param isAppend 是否追加
@return BufferedReader对象
@throws IORuntimeException IO异常 | [
"获得一个带缓存的写入对象"
] | bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/io/FileUtil.java#L2611-L2613 | train | Get a BufferedWriter for a file with the specified charset. | [
30522,
2270,
10763,
17698,
2098,
15994,
2131,
15994,
1006,
5371,
5371,
1010,
5164,
25869,
13462,
18442,
1010,
22017,
20898,
18061,
21512,
4859,
1007,
11618,
22834,
15532,
7292,
10288,
24422,
1063,
2709,
2131,
15994,
1006,
5371,
1010,
25869,
1... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
looly/hutool | hutool-core/src/main/java/cn/hutool/core/io/IoUtil.java | IoUtil.copy | public static long copy(ReadableByteChannel in, WritableByteChannel out, int bufferSize, StreamProgress streamProgress) throws IORuntimeException {
Assert.notNull(in, "InputStream is null !");
Assert.notNull(out, "OutputStream is null !");
ByteBuffer byteBuffer = ByteBuffer.allocate(bufferSize <= 0 ? DEFAULT_BUFFER_SIZE : bufferSize);
long size = 0;
if (null != streamProgress) {
streamProgress.start();
}
try {
while (in.read(byteBuffer) != EOF) {
byteBuffer.flip();// 写转读
size += out.write(byteBuffer);
byteBuffer.clear();
if (null != streamProgress) {
streamProgress.progress(size);
}
}
} catch (IOException e) {
throw new IORuntimeException(e);
}
if (null != streamProgress) {
streamProgress.finish();
}
return size;
} | java | public static long copy(ReadableByteChannel in, WritableByteChannel out, int bufferSize, StreamProgress streamProgress) throws IORuntimeException {
Assert.notNull(in, "InputStream is null !");
Assert.notNull(out, "OutputStream is null !");
ByteBuffer byteBuffer = ByteBuffer.allocate(bufferSize <= 0 ? DEFAULT_BUFFER_SIZE : bufferSize);
long size = 0;
if (null != streamProgress) {
streamProgress.start();
}
try {
while (in.read(byteBuffer) != EOF) {
byteBuffer.flip();// 写转读
size += out.write(byteBuffer);
byteBuffer.clear();
if (null != streamProgress) {
streamProgress.progress(size);
}
}
} catch (IOException e) {
throw new IORuntimeException(e);
}
if (null != streamProgress) {
streamProgress.finish();
}
return size;
} | [
"public",
"static",
"long",
"copy",
"(",
"ReadableByteChannel",
"in",
",",
"WritableByteChannel",
"out",
",",
"int",
"bufferSize",
",",
"StreamProgress",
"streamProgress",
")",
"throws",
"IORuntimeException",
"{",
"Assert",
".",
"notNull",
"(",
"in",
",",
"\"Input... | 拷贝流,使用NIO,不会关闭流
@param in {@link ReadableByteChannel}
@param out {@link WritableByteChannel}
@param bufferSize 缓冲大小,如果小于等于0,使用默认
@param streamProgress {@link StreamProgress}进度处理器
@return 拷贝的字节数
@throws IORuntimeException IO异常 | [
"拷贝流,使用NIO,不会关闭流"
] | bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/io/IoUtil.java#L264-L290 | train | Copies the contents of the specified input channel to the specified output channel using the specified buffer size and stream progress. | [
30522,
2270,
10763,
2146,
6100,
1006,
3191,
3085,
3762,
15007,
20147,
2140,
1999,
1010,
25697,
3085,
3762,
15007,
20147,
2140,
2041,
1010,
20014,
17698,
5332,
4371,
1010,
5460,
21572,
17603,
4757,
5460,
21572,
17603,
4757,
1007,
11618,
22834,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
looly/hutool | hutool-core/src/main/java/cn/hutool/core/util/ZipUtil.java | ZipUtil.zip | public static File zip(String srcPath, String zipPath, Charset charset, boolean withSrcDir) throws UtilException {
final File srcFile = FileUtil.file(srcPath);
final File zipFile = FileUtil.file(zipPath);
zip(zipFile, charset, withSrcDir, srcFile);
return zipFile;
} | java | public static File zip(String srcPath, String zipPath, Charset charset, boolean withSrcDir) throws UtilException {
final File srcFile = FileUtil.file(srcPath);
final File zipFile = FileUtil.file(zipPath);
zip(zipFile, charset, withSrcDir, srcFile);
return zipFile;
} | [
"public",
"static",
"File",
"zip",
"(",
"String",
"srcPath",
",",
"String",
"zipPath",
",",
"Charset",
"charset",
",",
"boolean",
"withSrcDir",
")",
"throws",
"UtilException",
"{",
"final",
"File",
"srcFile",
"=",
"FileUtil",
".",
"file",
"(",
"srcPath",
")"... | 对文件或文件目录进行压缩<br>
@param srcPath 要压缩的源文件路径。如果压缩一个文件,则为该文件的全路径;如果压缩一个目录,则为该目录的顶层目录路径
@param zipPath 压缩文件保存的路径,包括文件名。注意:zipPath不能是srcPath路径下的子文件夹
@param charset 编码
@param withSrcDir 是否包含被打包目录
@return 压缩文件
@throws UtilException IO异常 | [
"对文件或文件目录进行压缩<br",
">"
] | bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/util/ZipUtil.java#L125-L130 | train | Creates a zip file from the given source and zip path. | [
30522,
2270,
10763,
5371,
14101,
1006,
5164,
5034,
21906,
8988,
1010,
30524,
5371,
21823,
2140,
1012,
5371,
1006,
5034,
21906,
8988,
1007,
1025,
2345,
5371,
14101,
8873,
2571,
1027,
5371,
21823,
2140,
1012,
5371,
1006,
14101,
15069,
1007,
1... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
apache/flink | flink-runtime/src/main/java/org/apache/flink/runtime/clusterframework/BootstrapTools.java | BootstrapTools.startActorSystem | public static ActorSystem startActorSystem(
Configuration configuration,
String actorSystemName,
String listeningAddress,
String portRangeDefinition,
Logger logger,
@Nonnull ActorSystemExecutorConfiguration actorSystemExecutorConfiguration) throws Exception {
// parse port range definition and create port iterator
Iterator<Integer> portsIterator;
try {
portsIterator = NetUtils.getPortRangeFromString(portRangeDefinition);
} catch (Exception e) {
throw new IllegalArgumentException("Invalid port range definition: " + portRangeDefinition);
}
while (portsIterator.hasNext()) {
final int port = portsIterator.next();
try {
return startActorSystem(
configuration,
actorSystemName,
listeningAddress,
port,
logger,
actorSystemExecutorConfiguration);
}
catch (Exception e) {
// we can continue to try if this contains a netty channel exception
Throwable cause = e.getCause();
if (!(cause instanceof org.jboss.netty.channel.ChannelException ||
cause instanceof java.net.BindException)) {
throw e;
} // else fall through the loop and try the next port
}
}
// if we come here, we have exhausted the port range
throw new BindException("Could not start actor system on any port in port range "
+ portRangeDefinition);
} | java | public static ActorSystem startActorSystem(
Configuration configuration,
String actorSystemName,
String listeningAddress,
String portRangeDefinition,
Logger logger,
@Nonnull ActorSystemExecutorConfiguration actorSystemExecutorConfiguration) throws Exception {
// parse port range definition and create port iterator
Iterator<Integer> portsIterator;
try {
portsIterator = NetUtils.getPortRangeFromString(portRangeDefinition);
} catch (Exception e) {
throw new IllegalArgumentException("Invalid port range definition: " + portRangeDefinition);
}
while (portsIterator.hasNext()) {
final int port = portsIterator.next();
try {
return startActorSystem(
configuration,
actorSystemName,
listeningAddress,
port,
logger,
actorSystemExecutorConfiguration);
}
catch (Exception e) {
// we can continue to try if this contains a netty channel exception
Throwable cause = e.getCause();
if (!(cause instanceof org.jboss.netty.channel.ChannelException ||
cause instanceof java.net.BindException)) {
throw e;
} // else fall through the loop and try the next port
}
}
// if we come here, we have exhausted the port range
throw new BindException("Could not start actor system on any port in port range "
+ portRangeDefinition);
} | [
"public",
"static",
"ActorSystem",
"startActorSystem",
"(",
"Configuration",
"configuration",
",",
"String",
"actorSystemName",
",",
"String",
"listeningAddress",
",",
"String",
"portRangeDefinition",
",",
"Logger",
"logger",
",",
"@",
"Nonnull",
"ActorSystemExecutorConfi... | Starts an ActorSystem with the given configuration listening at the address/ports.
@param configuration The Flink configuration
@param actorSystemName Name of the started {@link ActorSystem}
@param listeningAddress The address to listen at.
@param portRangeDefinition The port range to choose a port from.
@param logger The logger to output log information.
@param actorSystemExecutorConfiguration configuration for the ActorSystem's underlying executor
@return The ActorSystem which has been started
@throws Exception Thrown when actor system cannot be started in specified port range | [
"Starts",
"an",
"ActorSystem",
"with",
"the",
"given",
"configuration",
"listening",
"at",
"the",
"address",
"/",
"ports",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/clusterframework/BootstrapTools.java#L133-L174 | train | Start an actor system on the given port range. | [
30522,
2270,
10763,
5889,
27268,
6633,
2707,
18908,
5668,
27268,
6633,
1006,
9563,
9563,
1010,
5164,
5889,
27268,
6633,
18442,
1010,
5164,
5962,
4215,
16200,
4757,
1010,
5164,
3417,
24388,
14728,
16294,
22753,
1010,
8833,
4590,
8833,
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... |
looly/hutool | hutool-core/src/main/java/cn/hutool/core/util/NumberUtil.java | NumberUtil.generateBySet | public static Integer[] generateBySet(int begin, int end, int size) {
if (begin > end) {
int temp = begin;
begin = end;
end = temp;
}
// 加入逻辑判断,确保begin<end并且size不能大于该表示范围
if ((end - begin) < size) {
throw new UtilException("Size is larger than range between begin and end!");
}
Random ran = new Random();
Set<Integer> set = new HashSet<Integer>();
while (set.size() < size) {
set.add(begin + ran.nextInt(end - begin));
}
Integer[] ranArr = set.toArray(new Integer[size]);
return ranArr;
} | java | public static Integer[] generateBySet(int begin, int end, int size) {
if (begin > end) {
int temp = begin;
begin = end;
end = temp;
}
// 加入逻辑判断,确保begin<end并且size不能大于该表示范围
if ((end - begin) < size) {
throw new UtilException("Size is larger than range between begin and end!");
}
Random ran = new Random();
Set<Integer> set = new HashSet<Integer>();
while (set.size() < size) {
set.add(begin + ran.nextInt(end - begin));
}
Integer[] ranArr = set.toArray(new Integer[size]);
return ranArr;
} | [
"public",
"static",
"Integer",
"[",
"]",
"generateBySet",
"(",
"int",
"begin",
",",
"int",
"end",
",",
"int",
"size",
")",
"{",
"if",
"(",
"begin",
">",
"end",
")",
"{",
"int",
"temp",
"=",
"begin",
";",
"begin",
"=",
"end",
";",
"end",
"=",
"tem... | 生成不重复随机数 根据给定的最小数字和最大数字,以及随机数的个数,产生指定的不重复的数组
@param begin 最小数字(包含该数)
@param end 最大数字(不包含该数)
@param size 指定产生随机数的个数
@return 随机int数组 | [
"生成不重复随机数",
"根据给定的最小数字和最大数字,以及随机数的个数,产生指定的不重复的数组"
] | bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/util/NumberUtil.java#L1264-L1283 | train | Generates a random number of integers from the specified range of integers. | [
30522,
2270,
10763,
16109,
1031,
1033,
9699,
3762,
13462,
1006,
20014,
4088,
1010,
20014,
2203,
1010,
20014,
2946,
1007,
1063,
2065,
1006,
4088,
1028,
2203,
1007,
1063,
20014,
8915,
8737,
1027,
4088,
1025,
4088,
1027,
2203,
1025,
2203,
1027... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
apache/flink | flink-table/flink-sql-client/src/main/java/org/apache/flink/table/client/gateway/local/result/ChangelogCollectStreamResult.java | ChangelogCollectStreamResult.processRecord | @Override
protected void processRecord(Tuple2<Boolean, Row> change) {
synchronized (resultLock) {
// wait if the buffer is full
if (changeRecordBuffer.size() >= CHANGE_RECORD_BUFFER_SIZE) {
try {
resultLock.wait();
} catch (InterruptedException e) {
// ignore
}
} else {
changeRecordBuffer.add(change);
}
}
} | java | @Override
protected void processRecord(Tuple2<Boolean, Row> change) {
synchronized (resultLock) {
// wait if the buffer is full
if (changeRecordBuffer.size() >= CHANGE_RECORD_BUFFER_SIZE) {
try {
resultLock.wait();
} catch (InterruptedException e) {
// ignore
}
} else {
changeRecordBuffer.add(change);
}
}
} | [
"@",
"Override",
"protected",
"void",
"processRecord",
"(",
"Tuple2",
"<",
"Boolean",
",",
"Row",
">",
"change",
")",
"{",
"synchronized",
"(",
"resultLock",
")",
"{",
"// wait if the buffer is full",
"if",
"(",
"changeRecordBuffer",
".",
"size",
"(",
")",
">=... | -------------------------------------------------------------------------------------------- | [
"--------------------------------------------------------------------------------------------"
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-table/flink-sql-client/src/main/java/org/apache/flink/table/client/gateway/local/result/ChangelogCollectStreamResult.java#L84-L98 | train | Process a record. | [
30522,
1030,
2058,
15637,
5123,
11675,
2832,
2890,
27108,
2094,
1006,
10722,
10814,
2475,
1026,
22017,
20898,
1010,
5216,
1028,
2689,
1007,
1063,
25549,
1006,
2765,
7878,
1007,
1063,
1013,
1013,
3524,
2065,
1996,
17698,
2003,
2440,
2065,
10... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
netty/netty | codec-http/src/main/java/io/netty/handler/codec/http/HttpResponseStatus.java | HttpResponseStatus.valueOf | public static HttpResponseStatus valueOf(int code) {
HttpResponseStatus status = valueOf0(code);
return status != null ? status : new HttpResponseStatus(code);
} | java | public static HttpResponseStatus valueOf(int code) {
HttpResponseStatus status = valueOf0(code);
return status != null ? status : new HttpResponseStatus(code);
} | [
"public",
"static",
"HttpResponseStatus",
"valueOf",
"(",
"int",
"code",
")",
"{",
"HttpResponseStatus",
"status",
"=",
"valueOf0",
"(",
"code",
")",
";",
"return",
"status",
"!=",
"null",
"?",
"status",
":",
"new",
"HttpResponseStatus",
"(",
"code",
")",
";... | Returns the {@link HttpResponseStatus} represented by the specified code.
If the specified code is a standard HTTP status code, a cached instance
will be returned. Otherwise, a new instance will be returned. | [
"Returns",
"the",
"{"
] | ba06eafa1c1824bd154f1a380019e7ea2edf3c4c | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/codec-http/src/main/java/io/netty/handler/codec/http/HttpResponseStatus.java#L333-L336 | train | Gets a new instance of the class with the specified HTTP status code. | [
30522,
2270,
10763,
8299,
6072,
26029,
8583,
29336,
2271,
3643,
11253,
1006,
20014,
3642,
1007,
1063,
8299,
6072,
26029,
8583,
29336,
2271,
3570,
1027,
3643,
11253,
2692,
1006,
3642,
1007,
1025,
2709,
3570,
999,
1027,
19701,
1029,
3570,
102... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
apache/flink | flink-java/src/main/java/org/apache/flink/api/java/io/SplitDataProperties.java | SplitDataProperties.getAllFlatKeys | private int[] getAllFlatKeys(String[] fieldExpressions) {
int[] allKeys = null;
for (String keyExp : fieldExpressions) {
Keys.ExpressionKeys<T> ek = new Keys.ExpressionKeys<>(keyExp, this.type);
int[] flatKeys = ek.computeLogicalKeyPositions();
if (allKeys == null) {
allKeys = flatKeys;
} else {
// check for duplicates
for (int key1 : flatKeys) {
for (int key2 : allKeys) {
if (key1 == key2) {
throw new InvalidProgramException("Duplicate fields in field expression " + keyExp);
}
}
}
// append flat keys
int oldLength = allKeys.length;
int newLength = oldLength + flatKeys.length;
allKeys = Arrays.copyOf(allKeys, newLength);
System.arraycopy(flatKeys, 0, allKeys, oldLength, flatKeys.length);
}
}
return allKeys;
} | java | private int[] getAllFlatKeys(String[] fieldExpressions) {
int[] allKeys = null;
for (String keyExp : fieldExpressions) {
Keys.ExpressionKeys<T> ek = new Keys.ExpressionKeys<>(keyExp, this.type);
int[] flatKeys = ek.computeLogicalKeyPositions();
if (allKeys == null) {
allKeys = flatKeys;
} else {
// check for duplicates
for (int key1 : flatKeys) {
for (int key2 : allKeys) {
if (key1 == key2) {
throw new InvalidProgramException("Duplicate fields in field expression " + keyExp);
}
}
}
// append flat keys
int oldLength = allKeys.length;
int newLength = oldLength + flatKeys.length;
allKeys = Arrays.copyOf(allKeys, newLength);
System.arraycopy(flatKeys, 0, allKeys, oldLength, flatKeys.length);
}
}
return allKeys;
} | [
"private",
"int",
"[",
"]",
"getAllFlatKeys",
"(",
"String",
"[",
"]",
"fieldExpressions",
")",
"{",
"int",
"[",
"]",
"allKeys",
"=",
"null",
";",
"for",
"(",
"String",
"keyExp",
":",
"fieldExpressions",
")",
"{",
"Keys",
".",
"ExpressionKeys",
"<",
"T",... | ///////////////////// FLAT FIELD EXTRACTION METHODS | [
"/////////////////////",
"FLAT",
"FIELD",
"EXTRACTION",
"METHODS"
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-java/src/main/java/org/apache/flink/api/java/io/SplitDataProperties.java#L370-L398 | train | Get all the flat keys of the given field expressions. | [
30522,
2797,
20014,
1031,
1033,
2131,
8095,
10258,
4017,
14839,
2015,
1006,
5164,
1031,
1033,
2492,
10288,
20110,
8496,
1007,
1063,
20014,
1031,
1033,
2035,
14839,
2015,
1027,
19701,
1025,
2005,
1006,
5164,
3145,
10288,
2361,
1024,
2492,
10... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
looly/hutool | hutool-core/src/main/java/cn/hutool/core/util/ObjectUtil.java | ObjectUtil.isValidIfNumber | public static boolean isValidIfNumber(Object obj) {
if (obj != null && obj instanceof Number) {
if (obj instanceof Double) {
if (((Double) obj).isInfinite() || ((Double) obj).isNaN()) {
return false;
}
} else if (obj instanceof Float) {
if (((Float) obj).isInfinite() || ((Float) obj).isNaN()) {
return false;
}
}
}
return true;
} | java | public static boolean isValidIfNumber(Object obj) {
if (obj != null && obj instanceof Number) {
if (obj instanceof Double) {
if (((Double) obj).isInfinite() || ((Double) obj).isNaN()) {
return false;
}
} else if (obj instanceof Float) {
if (((Float) obj).isInfinite() || ((Float) obj).isNaN()) {
return false;
}
}
}
return true;
} | [
"public",
"static",
"boolean",
"isValidIfNumber",
"(",
"Object",
"obj",
")",
"{",
"if",
"(",
"obj",
"!=",
"null",
"&&",
"obj",
"instanceof",
"Number",
")",
"{",
"if",
"(",
"obj",
"instanceof",
"Double",
")",
"{",
"if",
"(",
"(",
"(",
"Double",
")",
"... | 检查是否为有效的数字<br>
检查Double和Float是否为无限大,或者Not a Number<br>
非数字类型和Null将返回true
@param obj 被检查类型
@return 检查结果,非数字类型和Null将返回true | [
"检查是否为有效的数字<br",
">",
"检查Double和Float是否为无限大,或者Not",
"a",
"Number<br",
">",
"非数字类型和Null将返回true"
] | bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/util/ObjectUtil.java#L412-L425 | train | Checks if the given object is a Number. | [
30522,
2270,
10763,
22017,
20898,
2003,
10175,
28173,
2546,
19172,
5677,
1006,
4874,
27885,
3501,
1007,
1063,
2065,
1006,
27885,
3501,
999,
1027,
19701,
1004,
1004,
27885,
3501,
6013,
11253,
2193,
1007,
1063,
2065,
1006,
27885,
3501,
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... |
apache/flink | flink-java/src/main/java/org/apache/flink/api/java/DataSet.java | DataSet.partitionCustom | public <K extends Comparable<K>> PartitionOperator<T> partitionCustom(Partitioner<K> partitioner, KeySelector<T, K> keyExtractor) {
final TypeInformation<K> keyType = TypeExtractor.getKeySelectorTypes(keyExtractor, getType());
return new PartitionOperator<>(this, new Keys.SelectorFunctionKeys<>(keyExtractor, getType(), keyType), clean(partitioner), Utils.getCallLocationName());
} | java | public <K extends Comparable<K>> PartitionOperator<T> partitionCustom(Partitioner<K> partitioner, KeySelector<T, K> keyExtractor) {
final TypeInformation<K> keyType = TypeExtractor.getKeySelectorTypes(keyExtractor, getType());
return new PartitionOperator<>(this, new Keys.SelectorFunctionKeys<>(keyExtractor, getType(), keyType), clean(partitioner), Utils.getCallLocationName());
} | [
"public",
"<",
"K",
"extends",
"Comparable",
"<",
"K",
">",
">",
"PartitionOperator",
"<",
"T",
">",
"partitionCustom",
"(",
"Partitioner",
"<",
"K",
">",
"partitioner",
",",
"KeySelector",
"<",
"T",
",",
"K",
">",
"keyExtractor",
")",
"{",
"final",
"Typ... | Partitions a DataSet on the key returned by the selector, using a custom partitioner.
This method takes the key selector to get the key to partition on, and a partitioner that
accepts the key type.
<p>Note: This method works only on single field keys, i.e. the selector cannot return tuples
of fields.
@param partitioner The partitioner to assign partitions to keys.
@param keyExtractor The KeyExtractor with which the DataSet is partitioned.
@return The partitioned DataSet.
@see KeySelector | [
"Partitions",
"a",
"DataSet",
"on",
"the",
"key",
"returned",
"by",
"the",
"selector",
"using",
"a",
"custom",
"partitioner",
".",
"This",
"method",
"takes",
"the",
"key",
"selector",
"to",
"get",
"the",
"key",
"to",
"partition",
"on",
"and",
"a",
"partiti... | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-java/src/main/java/org/apache/flink/api/java/DataSet.java#L1372-L1375 | train | Partition a DataSet using a custom KeySelector. | [
30522,
2270,
1026,
1047,
8908,
12435,
1026,
1047,
1028,
1028,
13571,
25918,
8844,
1026,
1056,
1028,
13571,
7874,
20389,
1006,
13571,
2121,
1026,
1047,
1028,
13571,
2121,
1010,
6309,
12260,
16761,
1026,
1056,
1010,
1047,
1028,
3145,
10288,
6... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/dependency/CoNll/PosTagCompiler.java | PosTagCompiler.compile | public static String compile(String tag, String name)
{
if (tag.startsWith("m")) return Predefine.TAG_NUMBER;
else if (tag.startsWith("nr")) return Predefine.TAG_PEOPLE;
else if (tag.startsWith("ns")) return Predefine.TAG_PLACE;
else if (tag.startsWith("nt")) return Predefine.TAG_GROUP;
else if (tag.startsWith("t")) return Predefine.TAG_TIME;
else if (tag.equals("x")) return Predefine.TAG_CLUSTER;
else if (tag.equals("nx")) return Predefine.TAG_PROPER;
else if (tag.equals("xx")) return Predefine.TAG_OTHER;
// switch (tag)
// {
// case "m":
// case "mq":
// return Predefine.TAG_NUMBER;
// case "nr":
// case "nr1":
// case "nr2":
// case "nrf":
// case "nrj":
// return Predefine.TAG_PEOPLE;
// case "ns":
// case "nsf":
// return Predefine.TAG_PLACE;
// case "nt":
// return Predefine.TAG_TIME;
// case "x":
// return Predefine.TAG_CLUSTER;
// case "nx":
// return Predefine.TAG_PROPER;
// }
return name;
} | java | public static String compile(String tag, String name)
{
if (tag.startsWith("m")) return Predefine.TAG_NUMBER;
else if (tag.startsWith("nr")) return Predefine.TAG_PEOPLE;
else if (tag.startsWith("ns")) return Predefine.TAG_PLACE;
else if (tag.startsWith("nt")) return Predefine.TAG_GROUP;
else if (tag.startsWith("t")) return Predefine.TAG_TIME;
else if (tag.equals("x")) return Predefine.TAG_CLUSTER;
else if (tag.equals("nx")) return Predefine.TAG_PROPER;
else if (tag.equals("xx")) return Predefine.TAG_OTHER;
// switch (tag)
// {
// case "m":
// case "mq":
// return Predefine.TAG_NUMBER;
// case "nr":
// case "nr1":
// case "nr2":
// case "nrf":
// case "nrj":
// return Predefine.TAG_PEOPLE;
// case "ns":
// case "nsf":
// return Predefine.TAG_PLACE;
// case "nt":
// return Predefine.TAG_TIME;
// case "x":
// return Predefine.TAG_CLUSTER;
// case "nx":
// return Predefine.TAG_PROPER;
// }
return name;
} | [
"public",
"static",
"String",
"compile",
"(",
"String",
"tag",
",",
"String",
"name",
")",
"{",
"if",
"(",
"tag",
".",
"startsWith",
"(",
"\"m\"",
")",
")",
"return",
"Predefine",
".",
"TAG_NUMBER",
";",
"else",
"if",
"(",
"tag",
".",
"startsWith",
"("... | 编译,比如将词性为数词的转为##数##
@param tag 标签
@param name 原词
@return 编译后的等效词 | [
"编译,比如将词性为数词的转为##数##"
] | a538d0722ab2e4980a9dcd9ea40324fc3ddba7ce | https://github.com/hankcs/HanLP/blob/a538d0722ab2e4980a9dcd9ea40324fc3ddba7ce/src/main/java/com/hankcs/hanlp/corpus/dependency/CoNll/PosTagCompiler.java#L28-L62 | train | Compiles a tag into a code specification. | [
30522,
2270,
10763,
5164,
4012,
22090,
1006,
5164,
6415,
1010,
5164,
2171,
1007,
1063,
2065,
1006,
6415,
1012,
4627,
24415,
1006,
1000,
1049,
1000,
1007,
1007,
2709,
3653,
3207,
23460,
1012,
6415,
1035,
2193,
1025,
2842,
2065,
1006,
6415,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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.getAny | public static <T> T[] getAny(Object array, int... indexes) {
if(null == array) {
return null;
}
final T[] result = newArray(array.getClass().getComponentType(), indexes.length);
for (int i : indexes) {
result[i] = get(array, i);
}
return result;
} | java | public static <T> T[] getAny(Object array, int... indexes) {
if(null == array) {
return null;
}
final T[] result = newArray(array.getClass().getComponentType(), indexes.length);
for (int i : indexes) {
result[i] = get(array, i);
}
return result;
} | [
"public",
"static",
"<",
"T",
">",
"T",
"[",
"]",
"getAny",
"(",
"Object",
"array",
",",
"int",
"...",
"indexes",
")",
"{",
"if",
"(",
"null",
"==",
"array",
")",
"{",
"return",
"null",
";",
"}",
"final",
"T",
"[",
"]",
"result",
"=",
"newArray",... | 获取数组中指定多个下标元素值,组成新数组
@param <T> 数组元素类型
@param array 数组
@param indexes 下标列表
@return 结果 | [
"获取数组中指定多个下标元素值,组成新数组"
] | bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/util/ArrayUtil.java#L1834-L1844 | train | Gets any value in the array with the specified indexes. | [
30522,
2270,
10763,
1026,
1056,
1028,
1056,
1031,
1033,
2131,
19092,
1006,
4874,
9140,
1010,
20014,
1012,
1012,
1012,
5950,
2229,
1007,
1063,
2065,
1006,
19701,
1027,
1027,
9140,
1007,
1063,
2709,
19701,
1025,
1065,
2345,
1056,
1031,
1033,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
spring-projects/spring-boot | spring-boot-project/spring-boot-tools/spring-boot-configuration-processor/src/json-shade/java/org/springframework/boot/configurationprocessor/json/JSONStringer.java | JSONStringer.value | public JSONStringer value(boolean value) throws JSONException {
if (this.stack.isEmpty()) {
throw new JSONException("Nesting problem");
}
beforeValue();
this.out.append(value);
return this;
} | java | public JSONStringer value(boolean value) throws JSONException {
if (this.stack.isEmpty()) {
throw new JSONException("Nesting problem");
}
beforeValue();
this.out.append(value);
return this;
} | [
"public",
"JSONStringer",
"value",
"(",
"boolean",
"value",
")",
"throws",
"JSONException",
"{",
"if",
"(",
"this",
".",
"stack",
".",
"isEmpty",
"(",
")",
")",
"{",
"throw",
"new",
"JSONException",
"(",
"\"Nesting problem\"",
")",
";",
"}",
"beforeValue",
... | Encodes {@code value} to this stringer.
@param value the value to encode
@return this stringer.
@throws JSONException if processing of json failed | [
"Encodes",
"{"
] | 0b27f7c70e164b2b1a96477f1d9c1acba56790c1 | https://github.com/spring-projects/spring-boot/blob/0b27f7c70e164b2b1a96477f1d9c1acba56790c1/spring-boot-project/spring-boot-tools/spring-boot-configuration-processor/src/json-shade/java/org/springframework/boot/configurationprocessor/json/JSONStringer.java#L275-L282 | train | Write a boolean value. | [
30522,
2270,
1046,
23345,
18886,
11392,
3643,
1006,
22017,
20898,
3643,
1007,
11618,
1046,
3385,
10288,
24422,
1063,
2065,
1006,
2023,
1012,
9991,
1012,
2003,
6633,
13876,
2100,
1006,
1007,
1007,
1063,
5466,
30524,
1007,
1025,
2709,
2023,
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-core/src/main/java/org/apache/flink/core/memory/MemorySegment.java | MemorySegment.putCharLittleEndian | public final void putCharLittleEndian(int index, char value) {
if (LITTLE_ENDIAN) {
putChar(index, value);
} else {
putChar(index, Character.reverseBytes(value));
}
} | java | public final void putCharLittleEndian(int index, char value) {
if (LITTLE_ENDIAN) {
putChar(index, value);
} else {
putChar(index, Character.reverseBytes(value));
}
} | [
"public",
"final",
"void",
"putCharLittleEndian",
"(",
"int",
"index",
",",
"char",
"value",
")",
"{",
"if",
"(",
"LITTLE_ENDIAN",
")",
"{",
"putChar",
"(",
"index",
",",
"value",
")",
";",
"}",
"else",
"{",
"putChar",
"(",
"index",
",",
"Character",
"... | Writes the given character (16 bit, 2 bytes) to the given position in little-endian
byte order. This method's speed depends on the system's native byte order, and it
is possibly slower than {@link #putChar(int, char)}. For most cases (such as
transient storage in memory or serialization for I/O and network),
it suffices to know that the byte order in which the value is written is the same as the
one in which it is read, and {@link #putChar(int, char)} is the preferable choice.
@param index The position at which the value will be written.
@param value The char value to be written.
@throws IndexOutOfBoundsException Thrown, if the index is negative, or larger than the segment size minus 2. | [
"Writes",
"the",
"given",
"character",
"(",
"16",
"bit",
"2",
"bytes",
")",
"to",
"the",
"given",
"position",
"in",
"little",
"-",
"endian",
"byte",
"order",
".",
"This",
"method",
"s",
"speed",
"depends",
"on",
"the",
"system",
"s",
"native",
"byte",
... | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-core/src/main/java/org/apache/flink/core/memory/MemorySegment.java#L515-L521 | train | Puts a char value into the buffer at the given index in little - endian order. | [
30522,
2270,
2345,
11675,
2404,
7507,
12190,
12474,
24129,
11692,
1006,
20014,
5950,
1010,
25869,
3643,
1007,
1063,
2065,
1006,
2210,
1035,
2203,
2937,
1007,
1063,
2404,
7507,
2099,
1006,
5950,
1010,
3643,
1007,
1025,
1065,
2842,
1063,
2404... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/ApplicationProtocolNegotiationHandler.java | ApplicationProtocolNegotiationHandler.handshakeFailure | protected void handshakeFailure(ChannelHandlerContext ctx, Throwable cause) throws Exception {
logger.warn("{} TLS handshake failed:", ctx.channel(), cause);
ctx.close();
} | java | protected void handshakeFailure(ChannelHandlerContext ctx, Throwable cause) throws Exception {
logger.warn("{} TLS handshake failed:", ctx.channel(), cause);
ctx.close();
} | [
"protected",
"void",
"handshakeFailure",
"(",
"ChannelHandlerContext",
"ctx",
",",
"Throwable",
"cause",
")",
"throws",
"Exception",
"{",
"logger",
".",
"warn",
"(",
"\"{} TLS handshake failed:\"",
",",
"ctx",
".",
"channel",
"(",
")",
",",
"cause",
")",
";",
... | Invoked on failed initial SSL/TLS handshake. | [
"Invoked",
"on",
"failed",
"initial",
"SSL",
"/",
"TLS",
"handshake",
"."
] | ba06eafa1c1824bd154f1a380019e7ea2edf3c4c | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/handler/src/main/java/io/netty/handler/ssl/ApplicationProtocolNegotiationHandler.java#L114-L117 | train | Called when the TLS handshake fails. | [
30522,
5123,
11675,
2398,
20459,
12879,
12502,
5397,
1006,
3149,
11774,
3917,
8663,
18209,
14931,
2595,
1010,
5466,
3085,
3426,
1007,
11618,
6453,
1063,
8833,
4590,
1012,
11582,
1006,
1000,
1063,
1065,
1056,
4877,
2398,
20459,
2063,
3478,
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... |
netty/netty | codec-http2/src/main/java/io/netty/handler/codec/http2/HttpConversionUtil.java | HttpConversionUtil.toFullHttpResponse | public static FullHttpResponse toFullHttpResponse(int streamId, Http2Headers http2Headers, ByteBufAllocator alloc,
boolean validateHttpHeaders)
throws Http2Exception {
HttpResponseStatus status = parseStatus(http2Headers.status());
// HTTP/2 does not define a way to carry the version or reason phrase that is included in an
// HTTP/1.1 status line.
FullHttpResponse msg = new DefaultFullHttpResponse(HttpVersion.HTTP_1_1, status, alloc.buffer(),
validateHttpHeaders);
try {
addHttp2ToHttpHeaders(streamId, http2Headers, msg, false);
} catch (Http2Exception e) {
msg.release();
throw e;
} catch (Throwable t) {
msg.release();
throw streamError(streamId, PROTOCOL_ERROR, t, "HTTP/2 to HTTP/1.x headers conversion error");
}
return msg;
} | java | public static FullHttpResponse toFullHttpResponse(int streamId, Http2Headers http2Headers, ByteBufAllocator alloc,
boolean validateHttpHeaders)
throws Http2Exception {
HttpResponseStatus status = parseStatus(http2Headers.status());
// HTTP/2 does not define a way to carry the version or reason phrase that is included in an
// HTTP/1.1 status line.
FullHttpResponse msg = new DefaultFullHttpResponse(HttpVersion.HTTP_1_1, status, alloc.buffer(),
validateHttpHeaders);
try {
addHttp2ToHttpHeaders(streamId, http2Headers, msg, false);
} catch (Http2Exception e) {
msg.release();
throw e;
} catch (Throwable t) {
msg.release();
throw streamError(streamId, PROTOCOL_ERROR, t, "HTTP/2 to HTTP/1.x headers conversion error");
}
return msg;
} | [
"public",
"static",
"FullHttpResponse",
"toFullHttpResponse",
"(",
"int",
"streamId",
",",
"Http2Headers",
"http2Headers",
",",
"ByteBufAllocator",
"alloc",
",",
"boolean",
"validateHttpHeaders",
")",
"throws",
"Http2Exception",
"{",
"HttpResponseStatus",
"status",
"=",
... | Create a new object to contain the response data
@param streamId The stream associated with the response
@param http2Headers The initial set of HTTP/2 headers to create the response with
@param alloc The {@link ByteBufAllocator} to use to generate the content of the message
@param validateHttpHeaders <ul>
<li>{@code true} to validate HTTP headers in the http-codec</li>
<li>{@code false} not to validate HTTP headers in the http-codec</li>
</ul>
@return A new response object which represents headers/data
@throws Http2Exception see {@link #addHttp2ToHttpHeaders(int, Http2Headers, FullHttpMessage, boolean)} | [
"Create",
"a",
"new",
"object",
"to",
"contain",
"the",
"response",
"data"
] | ba06eafa1c1824bd154f1a380019e7ea2edf3c4c | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/codec-http2/src/main/java/io/netty/handler/codec/http2/HttpConversionUtil.java#L213-L231 | train | Converts a Http2 headers object to a FullHttpResponse object. | [
30522,
2270,
10763,
2440,
11039,
25856,
6072,
26029,
3366,
2000,
3993,
2140,
11039,
25856,
6072,
26029,
3366,
1006,
20014,
5460,
3593,
1010,
8299,
2475,
4974,
2545,
8299,
2475,
4974,
2545,
1010,
24880,
8569,
13976,
24755,
4263,
2035,
10085,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/img/ImgUtil.java | ImgUtil.flip | public static void flip(Image image, File outFile) throws IORuntimeException {
write(flip(image), outFile);
} | java | public static void flip(Image image, File outFile) throws IORuntimeException {
write(flip(image), outFile);
} | [
"public",
"static",
"void",
"flip",
"(",
"Image",
"image",
",",
"File",
"outFile",
")",
"throws",
"IORuntimeException",
"{",
"write",
"(",
"flip",
"(",
"image",
")",
",",
"outFile",
")",
";",
"}"
] | 水平翻转图像
@param image 图像
@param outFile 输出文件
@throws IORuntimeException IO异常
@since 3.2.2 | [
"水平翻转图像"
] | bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/img/ImgUtil.java#L1082-L1084 | train | Flips the image and writes the result to a file. | [
30522,
2270,
10763,
11675,
11238,
1006,
3746,
3746,
1010,
5371,
2041,
8873,
2571,
1007,
11618,
22834,
15532,
7292,
10288,
24422,
1063,
4339,
1006,
11238,
1006,
3746,
1007,
1010,
2041,
8873,
2571,
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... |
alibaba/canal | client-adapter/elasticsearch/src/main/java/com/alibaba/otter/canal/client/adapter/es/support/ESSyncUtil.java | ESSyncUtil.pkConditionSql | public static String pkConditionSql(ESMapping mapping, Map<String, Object> data) {
Set<ColumnItem> idColumns = new LinkedHashSet<>();
SchemaItem schemaItem = mapping.getSchemaItem();
TableItem mainTable = schemaItem.getMainTable();
for (ColumnItem idColumnItem : schemaItem.getIdFieldItem(mapping).getColumnItems()) {
if ((mainTable.getAlias() == null && idColumnItem.getOwner() == null)
|| (mainTable.getAlias() != null && mainTable.getAlias().equals(idColumnItem.getOwner()))) {
idColumns.add(idColumnItem);
}
}
if (idColumns.isEmpty()) {
throw new RuntimeException("Not found primary key field in main table");
}
// 拼接condition
StringBuilder condition = new StringBuilder(" ");
for (ColumnItem idColumn : idColumns) {
Object idVal = data.get(idColumn.getColumnName());
if (mainTable.getAlias() != null) condition.append(mainTable.getAlias()).append(".");
condition.append(idColumn.getColumnName()).append("=");
if (idVal instanceof String) {
condition.append("'").append(idVal).append("' AND ");
} else {
condition.append(idVal).append(" AND ");
}
}
if (condition.toString().endsWith("AND ")) {
int len2 = condition.length();
condition.delete(len2 - 4, len2);
}
return condition.toString();
} | java | public static String pkConditionSql(ESMapping mapping, Map<String, Object> data) {
Set<ColumnItem> idColumns = new LinkedHashSet<>();
SchemaItem schemaItem = mapping.getSchemaItem();
TableItem mainTable = schemaItem.getMainTable();
for (ColumnItem idColumnItem : schemaItem.getIdFieldItem(mapping).getColumnItems()) {
if ((mainTable.getAlias() == null && idColumnItem.getOwner() == null)
|| (mainTable.getAlias() != null && mainTable.getAlias().equals(idColumnItem.getOwner()))) {
idColumns.add(idColumnItem);
}
}
if (idColumns.isEmpty()) {
throw new RuntimeException("Not found primary key field in main table");
}
// 拼接condition
StringBuilder condition = new StringBuilder(" ");
for (ColumnItem idColumn : idColumns) {
Object idVal = data.get(idColumn.getColumnName());
if (mainTable.getAlias() != null) condition.append(mainTable.getAlias()).append(".");
condition.append(idColumn.getColumnName()).append("=");
if (idVal instanceof String) {
condition.append("'").append(idVal).append("' AND ");
} else {
condition.append(idVal).append(" AND ");
}
}
if (condition.toString().endsWith("AND ")) {
int len2 = condition.length();
condition.delete(len2 - 4, len2);
}
return condition.toString();
} | [
"public",
"static",
"String",
"pkConditionSql",
"(",
"ESMapping",
"mapping",
",",
"Map",
"<",
"String",
",",
"Object",
">",
"data",
")",
"{",
"Set",
"<",
"ColumnItem",
">",
"idColumns",
"=",
"new",
"LinkedHashSet",
"<>",
"(",
")",
";",
"SchemaItem",
"schem... | 拼接主键条件
@param mapping
@param data
@return | [
"拼接主键条件"
] | 8f088cddc0755f4350c5aaae95c6e4002d90a40f | https://github.com/alibaba/canal/blob/8f088cddc0755f4350c5aaae95c6e4002d90a40f/client-adapter/elasticsearch/src/main/java/com/alibaba/otter/canal/client/adapter/es/support/ESSyncUtil.java#L258-L293 | train | Sql - Condition for PK | [
30522,
2270,
10763,
5164,
1052,
2243,
8663,
20562,
2015,
4160,
2140,
1006,
9686,
2863,
14853,
12375,
1010,
4949,
1026,
5164,
1010,
4874,
1028,
2951,
1007,
1063,
2275,
1026,
5930,
4221,
2213,
1028,
8909,
25778,
2819,
3619,
1027,
2047,
5799,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/ExecutionVertex.java | ExecutionVertex.isInputConsumable | boolean isInputConsumable(int inputNumber) {
return Arrays.stream(inputEdges[inputNumber]).map(ExecutionEdge::getSource).anyMatch(
IntermediateResultPartition::isConsumable);
} | java | boolean isInputConsumable(int inputNumber) {
return Arrays.stream(inputEdges[inputNumber]).map(ExecutionEdge::getSource).anyMatch(
IntermediateResultPartition::isConsumable);
} | [
"boolean",
"isInputConsumable",
"(",
"int",
"inputNumber",
")",
"{",
"return",
"Arrays",
".",
"stream",
"(",
"inputEdges",
"[",
"inputNumber",
"]",
")",
".",
"map",
"(",
"ExecutionEdge",
"::",
"getSource",
")",
".",
"anyMatch",
"(",
"IntermediateResultPartition"... | Get whether an input of the vertex is consumable.
An input is consumable when when any partition in it is consumable.
Note that a BLOCKING result partition is only consumable when all partitions in the result are FINISHED.
@return whether the input is consumable | [
"Get",
"whether",
"an",
"input",
"of",
"the",
"vertex",
"is",
"consumable",
".",
"An",
"input",
"is",
"consumable",
"when",
"when",
"any",
"partition",
"in",
"it",
"is",
"consumable",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/executiongraph/ExecutionVertex.java#L785-L788 | train | Checks if the input edge is consuming. | [
30522,
22017,
20898,
2003,
2378,
18780,
8663,
17421,
3085,
1006,
20014,
7953,
19172,
5677,
1007,
1063,
2709,
27448,
1012,
5460,
1006,
7953,
24225,
2015,
1031,
7953,
19172,
5677,
1033,
1007,
1012,
4949,
1006,
7781,
24225,
1024,
1024,
4152,
8... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
apache/flink | flink-scala-shell/src/main/java/org/apache/flink/api/java/JarHelper.java | JarHelper.jarDir | private void jarDir(File dirOrFile2jar, JarOutputStream jos, String path)
throws IOException {
if (mVerbose) {
System.out.println("checking " + dirOrFile2jar);
}
if (dirOrFile2jar.isDirectory()) {
String[] dirList = dirOrFile2jar.list();
String subPath = (path == null) ? "" : (path + dirOrFile2jar.getName() + SEP);
if (path != null) {
JarEntry je = new JarEntry(subPath);
je.setTime(dirOrFile2jar.lastModified());
jos.putNextEntry(je);
jos.flush();
jos.closeEntry();
}
for (int i = 0; i < dirList.length; i++) {
File f = new File(dirOrFile2jar, dirList[i]);
jarDir(f, jos, subPath);
}
} else if (dirOrFile2jar.exists()) {
if (dirOrFile2jar.getCanonicalPath().equals(mDestJarName)) {
if (mVerbose) {
System.out.println("skipping " + dirOrFile2jar.getPath());
}
return;
}
if (mVerbose) {
System.out.println("adding " + dirOrFile2jar.getPath());
}
FileInputStream fis = new FileInputStream(dirOrFile2jar);
try {
JarEntry entry = new JarEntry(path + dirOrFile2jar.getName());
entry.setTime(dirOrFile2jar.lastModified());
jos.putNextEntry(entry);
while ((mByteCount = fis.read(mBuffer)) != -1) {
jos.write(mBuffer, 0, mByteCount);
if (mVerbose) {
System.out.println("wrote " + mByteCount + " bytes");
}
}
jos.flush();
jos.closeEntry();
} catch (IOException ioe) {
throw ioe;
} finally {
fis.close();
}
}
} | java | private void jarDir(File dirOrFile2jar, JarOutputStream jos, String path)
throws IOException {
if (mVerbose) {
System.out.println("checking " + dirOrFile2jar);
}
if (dirOrFile2jar.isDirectory()) {
String[] dirList = dirOrFile2jar.list();
String subPath = (path == null) ? "" : (path + dirOrFile2jar.getName() + SEP);
if (path != null) {
JarEntry je = new JarEntry(subPath);
je.setTime(dirOrFile2jar.lastModified());
jos.putNextEntry(je);
jos.flush();
jos.closeEntry();
}
for (int i = 0; i < dirList.length; i++) {
File f = new File(dirOrFile2jar, dirList[i]);
jarDir(f, jos, subPath);
}
} else if (dirOrFile2jar.exists()) {
if (dirOrFile2jar.getCanonicalPath().equals(mDestJarName)) {
if (mVerbose) {
System.out.println("skipping " + dirOrFile2jar.getPath());
}
return;
}
if (mVerbose) {
System.out.println("adding " + dirOrFile2jar.getPath());
}
FileInputStream fis = new FileInputStream(dirOrFile2jar);
try {
JarEntry entry = new JarEntry(path + dirOrFile2jar.getName());
entry.setTime(dirOrFile2jar.lastModified());
jos.putNextEntry(entry);
while ((mByteCount = fis.read(mBuffer)) != -1) {
jos.write(mBuffer, 0, mByteCount);
if (mVerbose) {
System.out.println("wrote " + mByteCount + " bytes");
}
}
jos.flush();
jos.closeEntry();
} catch (IOException ioe) {
throw ioe;
} finally {
fis.close();
}
}
} | [
"private",
"void",
"jarDir",
"(",
"File",
"dirOrFile2jar",
",",
"JarOutputStream",
"jos",
",",
"String",
"path",
")",
"throws",
"IOException",
"{",
"if",
"(",
"mVerbose",
")",
"{",
"System",
".",
"out",
".",
"println",
"(",
"\"checking \"",
"+",
"dirOrFile2j... | Recursively jars up the given path under the given directory. | [
"Recursively",
"jars",
"up",
"the",
"given",
"path",
"under",
"the",
"given",
"directory",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-scala-shell/src/main/java/org/apache/flink/api/java/JarHelper.java#L154-L203 | train | This method is used to write a directory to a jar file. | [
30522,
2797,
11675,
15723,
4305,
2099,
1006,
5371,
16101,
16347,
9463,
2475,
16084,
1010,
15723,
5833,
18780,
21422,
8183,
2015,
1010,
5164,
4130,
1007,
11618,
22834,
10288,
24422,
1063,
2065,
1006,
19842,
2121,
15853,
2063,
1007,
1063,
2291,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
looly/hutool | hutool-core/src/main/java/cn/hutool/core/util/TypeUtil.java | TypeUtil.getActualType | public static Type getActualType(Type actualType, Class<?> typeDefineClass, Type typeVariable) {
Type[] types = getActualTypes(actualType, typeDefineClass, typeVariable);
if(ArrayUtil.isNotEmpty(types)) {
return types[0];
}
return null;
} | java | public static Type getActualType(Type actualType, Class<?> typeDefineClass, Type typeVariable) {
Type[] types = getActualTypes(actualType, typeDefineClass, typeVariable);
if(ArrayUtil.isNotEmpty(types)) {
return types[0];
}
return null;
} | [
"public",
"static",
"Type",
"getActualType",
"(",
"Type",
"actualType",
",",
"Class",
"<",
"?",
">",
"typeDefineClass",
",",
"Type",
"typeVariable",
")",
"{",
"Type",
"[",
"]",
"types",
"=",
"getActualTypes",
"(",
"actualType",
",",
"typeDefineClass",
",",
"... | 获取指定泛型变量对应的真实类型<br>
由于子类中泛型参数实现和父类(接口)中泛型定义位置是一一对应的,因此可以通过对应关系找到泛型实现类型<br>
使用此方法注意:
<pre>
1. superClass必须是clazz的父类或者clazz实现的接口
2. typeVariable必须在superClass中声明
</pre>
@param actualType 真实类型所在类,此类中记录了泛型参数对应的实际类型
@param typeDefineClass 泛型变量声明所在类或接口,此类中定义了泛型类型
@param typeVariable 泛型变量,需要的实际类型对应的泛型参数
@return 给定泛型参数对应的实际类型
@since 4.5.2 | [
"获取指定泛型变量对应的真实类型<br",
">",
"由于子类中泛型参数实现和父类(接口)中泛型定义位置是一一对应的,因此可以通过对应关系找到泛型实现类型<br",
">",
"使用此方法注意:"
] | bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/util/TypeUtil.java#L325-L331 | train | Get the actual type for a given type define class and variable. | [
30522,
2270,
10763,
2828,
2131,
18908,
8787,
13874,
1006,
2828,
5025,
13874,
1010,
2465,
1026,
1029,
1028,
21189,
12879,
3170,
26266,
1010,
2828,
2828,
10755,
19210,
1007,
1063,
2828,
1031,
1033,
4127,
1027,
2131,
18908,
8787,
13874,
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... |
hankcs/HanLP | src/main/java/com/hankcs/hanlp/utility/TextUtility.java | TextUtility.writeString | public static void writeString(String s, DataOutputStream out) throws IOException
{
out.writeInt(s.length());
for (char c : s.toCharArray())
{
out.writeChar(c);
}
} | java | public static void writeString(String s, DataOutputStream out) throws IOException
{
out.writeInt(s.length());
for (char c : s.toCharArray())
{
out.writeChar(c);
}
} | [
"public",
"static",
"void",
"writeString",
"(",
"String",
"s",
",",
"DataOutputStream",
"out",
")",
"throws",
"IOException",
"{",
"out",
".",
"writeInt",
"(",
"s",
".",
"length",
"(",
")",
")",
";",
"for",
"(",
"char",
"c",
":",
"s",
".",
"toCharArray"... | 简单好用的写String方式
@param s
@param out
@throws IOException | [
"简单好用的写String方式"
] | a538d0722ab2e4980a9dcd9ea40324fc3ddba7ce | https://github.com/hankcs/HanLP/blob/a538d0722ab2e4980a9dcd9ea40324fc3ddba7ce/src/main/java/com/hankcs/hanlp/utility/TextUtility.java#L632-L639 | train | Write a string to an output stream. | [
30522,
2270,
10763,
11675,
7009,
18886,
3070,
1006,
5164,
1055,
1010,
2951,
5833,
18780,
21422,
2041,
1007,
11618,
22834,
10288,
24422,
1063,
2041,
1012,
4339,
18447,
1006,
1055,
1012,
3091,
1006,
1007,
1007,
1025,
2005,
1006,
25869,
1039,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
looly/hutool | hutool-crypto/src/main/java/cn/hutool/crypto/KeyUtil.java | KeyUtil.generatePBEKey | public static SecretKey generatePBEKey(String algorithm, char[] key) {
if (StrUtil.isBlank(algorithm) || false == algorithm.startsWith("PBE")) {
throw new CryptoException("Algorithm [{}] is not a PBE algorithm!");
}
if (null == key) {
key = RandomUtil.randomString(32).toCharArray();
}
PBEKeySpec keySpec = new PBEKeySpec(key);
return generateKey(algorithm, keySpec);
} | java | public static SecretKey generatePBEKey(String algorithm, char[] key) {
if (StrUtil.isBlank(algorithm) || false == algorithm.startsWith("PBE")) {
throw new CryptoException("Algorithm [{}] is not a PBE algorithm!");
}
if (null == key) {
key = RandomUtil.randomString(32).toCharArray();
}
PBEKeySpec keySpec = new PBEKeySpec(key);
return generateKey(algorithm, keySpec);
} | [
"public",
"static",
"SecretKey",
"generatePBEKey",
"(",
"String",
"algorithm",
",",
"char",
"[",
"]",
"key",
")",
"{",
"if",
"(",
"StrUtil",
".",
"isBlank",
"(",
"algorithm",
")",
"||",
"false",
"==",
"algorithm",
".",
"startsWith",
"(",
"\"PBE\"",
")",
... | 生成PBE {@link SecretKey}
@param algorithm PBE算法,包括:PBEWithMD5AndDES、PBEWithSHA1AndDESede、PBEWithSHA1AndRC2_40等
@param key 密钥
@return {@link SecretKey} | [
"生成PBE",
"{",
"@link",
"SecretKey",
"}"
] | bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-crypto/src/main/java/cn/hutool/crypto/KeyUtil.java#L169-L179 | train | Generates a PBE key from the specified key. | [
30522,
2270,
10763,
3595,
14839,
9699,
2361,
24597,
3240,
1006,
5164,
9896,
1010,
25869,
1031,
1033,
3145,
1007,
1063,
2065,
1006,
2358,
22134,
4014,
1012,
2003,
28522,
8950,
1006,
9896,
1007,
1064,
1064,
6270,
1027,
1027,
9896,
1012,
4627,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/jetty/JettyServletWebServerFactory.java | JettyServletWebServerFactory.getMimeTypeConfiguration | private Configuration getMimeTypeConfiguration() {
return new AbstractConfiguration() {
@Override
public void configure(WebAppContext context) throws Exception {
MimeTypes mimeTypes = context.getMimeTypes();
for (MimeMappings.Mapping mapping : getMimeMappings()) {
mimeTypes.addMimeMapping(mapping.getExtension(),
mapping.getMimeType());
}
}
};
} | java | private Configuration getMimeTypeConfiguration() {
return new AbstractConfiguration() {
@Override
public void configure(WebAppContext context) throws Exception {
MimeTypes mimeTypes = context.getMimeTypes();
for (MimeMappings.Mapping mapping : getMimeMappings()) {
mimeTypes.addMimeMapping(mapping.getExtension(),
mapping.getMimeType());
}
}
};
} | [
"private",
"Configuration",
"getMimeTypeConfiguration",
"(",
")",
"{",
"return",
"new",
"AbstractConfiguration",
"(",
")",
"{",
"@",
"Override",
"public",
"void",
"configure",
"(",
"WebAppContext",
"context",
")",
"throws",
"Exception",
"{",
"MimeTypes",
"mimeTypes"... | Create a configuration object that adds mime type mappings.
@return a configuration object for adding mime type mappings | [
"Create",
"a",
"configuration",
"object",
"that",
"adds",
"mime",
"type",
"mappings",
"."
] | 0b27f7c70e164b2b1a96477f1d9c1acba56790c1 | https://github.com/spring-projects/spring-boot/blob/0b27f7c70e164b2b1a96477f1d9c1acba56790c1/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/embedded/jetty/JettyServletWebServerFactory.java#L365-L378 | train | Get the mime type configuration. | [
30522,
2797,
9563,
2131,
4328,
11368,
18863,
8663,
8873,
27390,
3370,
1006,
1007,
1063,
2709,
2047,
10061,
8663,
8873,
27390,
3370,
1006,
1007,
1063,
1030,
2058,
15637,
2270,
11675,
9530,
8873,
27390,
2063,
1006,
4773,
29098,
8663,
18209,
6... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
looly/hutool | hutool-core/src/main/java/cn/hutool/core/text/csv/CsvUtil.java | CsvUtil.getWriter | public static CsvWriter getWriter(File file, Charset charset, boolean isAppend) {
return new CsvWriter(file, charset, isAppend);
} | java | public static CsvWriter getWriter(File file, Charset charset, boolean isAppend) {
return new CsvWriter(file, charset, isAppend);
} | [
"public",
"static",
"CsvWriter",
"getWriter",
"(",
"File",
"file",
",",
"Charset",
"charset",
",",
"boolean",
"isAppend",
")",
"{",
"return",
"new",
"CsvWriter",
"(",
"file",
",",
"charset",
",",
"isAppend",
")",
";",
"}"
] | 获取CSV生成器(写出器),使用默认配置
@param file File CSV文件
@param charset 编码
@param isAppend 是否追加 | [
"获取CSV生成器(写出器),使用默认配置"
] | bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/text/csv/CsvUtil.java#L74-L76 | train | Returns a writer that writes a CSV file to the specified file. | [
30522,
2270,
10763,
20116,
2615,
15994,
2131,
15994,
1006,
5371,
5371,
1010,
25869,
13462,
25869,
13462,
1010,
22017,
20898,
18061,
21512,
4859,
1007,
1063,
2709,
2047,
20116,
2615,
15994,
1006,
5371,
1010,
25869,
13462,
1010,
18061,
21512,
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... |
spring-projects/spring-boot | spring-boot-project/spring-boot/src/main/java/org/springframework/boot/builder/SpringApplicationBuilder.java | SpringApplicationBuilder.sibling | public SpringApplicationBuilder sibling(Class<?>[] sources, String... args) {
return runAndExtractParent(args).child(sources);
} | java | public SpringApplicationBuilder sibling(Class<?>[] sources, String... args) {
return runAndExtractParent(args).child(sources);
} | [
"public",
"SpringApplicationBuilder",
"sibling",
"(",
"Class",
"<",
"?",
">",
"[",
"]",
"sources",
",",
"String",
"...",
"args",
")",
"{",
"return",
"runAndExtractParent",
"(",
"args",
")",
".",
"child",
"(",
"sources",
")",
";",
"}"
] | Create a sibling application (one with the same parent). A side effect of calling
this method is that the current application (and its parent) are started if they
are not already running.
@param sources the sources for the application (Spring configuration)
@param args the command line arguments to use when starting the current app and its
parent
@return the new sibling builder | [
"Create",
"a",
"sibling",
"application",
"(",
"one",
"with",
"the",
"same",
"parent",
")",
".",
"A",
"side",
"effect",
"of",
"calling",
"this",
"method",
"is",
"that",
"the",
"current",
"application",
"(",
"and",
"its",
"parent",
")",
"are",
"started",
"... | 0b27f7c70e164b2b1a96477f1d9c1acba56790c1 | https://github.com/spring-projects/spring-boot/blob/0b27f7c70e164b2b1a96477f1d9c1acba56790c1/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/builder/SpringApplicationBuilder.java#L268-L270 | train | Creates a sibling application. | [
30522,
2270,
3500,
29098,
19341,
3508,
8569,
23891,
2099,
22941,
1006,
2465,
1026,
1029,
1028,
1031,
1033,
4216,
1010,
5164,
1012,
1012,
1012,
12098,
5620,
1007,
1063,
2709,
2448,
5685,
10288,
6494,
6593,
19362,
4765,
1006,
12098,
5620,
100... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
apache/flink | flink-core/src/main/java/org/apache/flink/types/Either.java | Either.obtainRight | @Internal
public static <L, R> Right<L, R> obtainRight(Either<L, R> input, TypeSerializer<R> rightSerializer) {
if (input.isRight()) {
return (Right<L, R>) input;
} else {
Left<L, R> left = (Left<L, R>) input;
if (left.right == null) {
left.right = Right.of(rightSerializer.createInstance());
left.right.left = left;
}
return left.right;
}
} | java | @Internal
public static <L, R> Right<L, R> obtainRight(Either<L, R> input, TypeSerializer<R> rightSerializer) {
if (input.isRight()) {
return (Right<L, R>) input;
} else {
Left<L, R> left = (Left<L, R>) input;
if (left.right == null) {
left.right = Right.of(rightSerializer.createInstance());
left.right.left = left;
}
return left.right;
}
} | [
"@",
"Internal",
"public",
"static",
"<",
"L",
",",
"R",
">",
"Right",
"<",
"L",
",",
"R",
">",
"obtainRight",
"(",
"Either",
"<",
"L",
",",
"R",
">",
"input",
",",
"TypeSerializer",
"<",
"R",
">",
"rightSerializer",
")",
"{",
"if",
"(",
"input",
... | Utility function for {@link EitherSerializer} to support object reuse.
To support object reuse both subclasses of Either contain a reference to
an instance of the other type. This method provides access to and
initializes the cross-reference.
@param input container for Left or Right value
@param rightSerializer for creating an instance of the right type
@param <L>
the type of Left
@param <R>
the type of Right
@return input if Right type else input's Right reference | [
"Utility",
"function",
"for",
"{",
"@link",
"EitherSerializer",
"}",
"to",
"support",
"object",
"reuse",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-core/src/main/java/org/apache/flink/types/Either.java#L261-L273 | train | Obtains the right object from the given either. | [
30522,
1030,
4722,
2270,
10763,
1026,
1048,
1010,
1054,
1028,
2157,
1026,
1048,
1010,
1054,
1028,
6855,
15950,
1006,
2593,
1026,
1048,
1010,
1054,
1028,
7953,
1010,
4127,
11610,
28863,
1026,
1054,
1028,
2916,
11610,
28863,
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... |
redisson/redisson | redisson/src/main/java/org/redisson/misc/HighwayHash.java | HighwayHash.finalize128 | public long[] finalize128() {
permuteAndUpdate();
permuteAndUpdate();
permuteAndUpdate();
permuteAndUpdate();
permuteAndUpdate();
permuteAndUpdate();
done = true;
long[] hash = new long[2];
hash[0] = v0[0] + mul0[0] + v1[2] + mul1[2];
hash[1] = v0[1] + mul0[1] + v1[3] + mul1[3];
return hash;
} | java | public long[] finalize128() {
permuteAndUpdate();
permuteAndUpdate();
permuteAndUpdate();
permuteAndUpdate();
permuteAndUpdate();
permuteAndUpdate();
done = true;
long[] hash = new long[2];
hash[0] = v0[0] + mul0[0] + v1[2] + mul1[2];
hash[1] = v0[1] + mul0[1] + v1[3] + mul1[3];
return hash;
} | [
"public",
"long",
"[",
"]",
"finalize128",
"(",
")",
"{",
"permuteAndUpdate",
"(",
")",
";",
"permuteAndUpdate",
"(",
")",
";",
"permuteAndUpdate",
"(",
")",
";",
"permuteAndUpdate",
"(",
")",
";",
"permuteAndUpdate",
"(",
")",
";",
"permuteAndUpdate",
"(",
... | Computes the hash value after all bytes were processed. Invalidates the
state.
NOTE: The 128-bit HighwayHash algorithm is not yet frozen and subject to change.
@return array of size 2 containing 128-bit hash | [
"Computes",
"the",
"hash",
"value",
"after",
"all",
"bytes",
"were",
"processed",
".",
"Invalidates",
"the",
"state",
"."
] | d3acc0249b2d5d658d36d99e2c808ce49332ea44 | https://github.com/redisson/redisson/blob/d3acc0249b2d5d658d36d99e2c808ce49332ea44/redisson/src/main/java/org/redisson/misc/HighwayHash.java#L171-L183 | train | Finalize the sequence by permuting the sequence and then computing the hash. | [
30522,
2270,
2146,
1031,
1033,
2345,
4697,
12521,
2620,
1006,
1007,
1063,
2566,
26746,
5685,
6279,
13701,
1006,
1007,
1025,
2566,
26746,
5685,
6279,
13701,
1006,
1007,
1025,
2566,
26746,
5685,
6279,
13701,
1006,
1007,
1025,
2566,
26746,
568... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
apache/flink | flink-java/src/main/java/org/apache/flink/api/java/operators/DeltaIteration.java | DeltaIteration.setResources | private DeltaIteration<ST, WT> setResources(ResourceSpec resources) {
Preconditions.checkNotNull(resources, "The resources must be not null.");
Preconditions.checkArgument(resources.isValid(), "The values in resources must be not less than 0.");
this.minResources = resources;
this.preferredResources = resources;
return this;
} | java | private DeltaIteration<ST, WT> setResources(ResourceSpec resources) {
Preconditions.checkNotNull(resources, "The resources must be not null.");
Preconditions.checkArgument(resources.isValid(), "The values in resources must be not less than 0.");
this.minResources = resources;
this.preferredResources = resources;
return this;
} | [
"private",
"DeltaIteration",
"<",
"ST",
",",
"WT",
">",
"setResources",
"(",
"ResourceSpec",
"resources",
")",
"{",
"Preconditions",
".",
"checkNotNull",
"(",
"resources",
",",
"\"The resources must be not null.\"",
")",
";",
"Preconditions",
".",
"checkArgument",
"... | Sets the resources for the iteration, and the minimum and preferred resources are the same by default.
The lower and upper resource limits will be considered in dynamic resource resize feature for future plan.
@param resources The resources for the iteration.
@return The iteration with set minimum and preferred resources. | [
"Sets",
"the",
"resources",
"for",
"the",
"iteration",
"and",
"the",
"minimum",
"and",
"preferred",
"resources",
"are",
"the",
"same",
"by",
"default",
".",
"The",
"lower",
"and",
"upper",
"resource",
"limits",
"will",
"be",
"considered",
"in",
"dynamic",
"r... | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-java/src/main/java/org/apache/flink/api/java/operators/DeltaIteration.java#L232-L240 | train | Sets the resources for the iteration. | [
30522,
2797,
7160,
21646,
3370,
1026,
2358,
1010,
1059,
2102,
1028,
2275,
6072,
8162,
9623,
1006,
4219,
5051,
2278,
4219,
1007,
1063,
3653,
8663,
20562,
2015,
1012,
4638,
17048,
11231,
3363,
1006,
4219,
1010,
1000,
1996,
4219,
2442,
2022,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/ClusterAnalyzer.java | ClusterAnalyzer.refined_vector_value | double refined_vector_value(SparseVector composite, SparseVector vec, int sign)
{
double sum = 0.0;
for (Map.Entry<Integer, Double> entry : vec.entrySet())
{
sum += Math.pow(entry.getValue(), 2) + sign * 2 * composite.get(entry.getKey()) * entry.getValue();
}
return sum;
} | java | double refined_vector_value(SparseVector composite, SparseVector vec, int sign)
{
double sum = 0.0;
for (Map.Entry<Integer, Double> entry : vec.entrySet())
{
sum += Math.pow(entry.getValue(), 2) + sign * 2 * composite.get(entry.getKey()) * entry.getValue();
}
return sum;
} | [
"double",
"refined_vector_value",
"(",
"SparseVector",
"composite",
",",
"SparseVector",
"vec",
",",
"int",
"sign",
")",
"{",
"double",
"sum",
"=",
"0.0",
";",
"for",
"(",
"Map",
".",
"Entry",
"<",
"Integer",
",",
"Double",
">",
"entry",
":",
"vec",
".",... | c^2 - 2c(a + c) + d^2 - 2d(b + d)
@param composite (a+c,b+d)
@param vec (c,d)
@param sign
@return | [
"c^2",
"-",
"2c",
"(",
"a",
"+",
"c",
")",
"+",
"d^2",
"-",
"2d",
"(",
"b",
"+",
"d",
")"
] | a538d0722ab2e4980a9dcd9ea40324fc3ddba7ce | https://github.com/hankcs/HanLP/blob/a538d0722ab2e4980a9dcd9ea40324fc3ddba7ce/src/main/java/com/hankcs/hanlp/mining/cluster/ClusterAnalyzer.java#L339-L347 | train | Refined vector value. | [
30522,
3313,
15514,
1035,
9207,
1035,
3643,
1006,
20288,
3726,
16761,
12490,
1010,
20288,
3726,
16761,
2310,
2278,
1010,
20014,
3696,
1007,
1063,
3313,
7680,
1027,
1014,
1012,
1014,
1025,
2005,
1006,
4949,
1012,
4443,
1026,
16109,
1010,
331... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/convert/Convert.java | Convert.toHex | public static String toHex(String str, Charset charset) {
return HexUtil.encodeHexStr(str, charset);
} | java | public static String toHex(String str, Charset charset) {
return HexUtil.encodeHexStr(str, charset);
} | [
"public",
"static",
"String",
"toHex",
"(",
"String",
"str",
",",
"Charset",
"charset",
")",
"{",
"return",
"HexUtil",
".",
"encodeHexStr",
"(",
"str",
",",
"charset",
")",
";",
"}"
] | 字符串转换成十六进制字符串,结果为小写
@param str 待转换的ASCII字符串
@param charset 编码
@return 16进制字符串
@see HexUtil#encodeHexStr(String, Charset) | [
"字符串转换成十六进制字符串,结果为小写"
] | bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/convert/Convert.java#L695-L697 | train | Encode a string to a hex string. | [
30522,
2270,
10763,
5164,
2000,
5369,
2595,
1006,
5164,
2358,
2099,
1010,
25869,
13462,
25869,
13462,
1007,
1063,
2709,
2002,
2595,
21823,
2140,
1012,
4372,
16044,
5369,
2595,
3367,
2099,
1006,
2358,
2099,
1010,
25869,
13462,
1007,
1025,
10... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
looly/hutool | hutool-core/src/main/java/cn/hutool/core/util/RandomUtil.java | RandomUtil.randomEle | public static <T> T randomEle(List<T> list) {
return randomEle(list, list.size());
} | java | public static <T> T randomEle(List<T> list) {
return randomEle(list, list.size());
} | [
"public",
"static",
"<",
"T",
">",
"T",
"randomEle",
"(",
"List",
"<",
"T",
">",
"list",
")",
"{",
"return",
"randomEle",
"(",
"list",
",",
"list",
".",
"size",
"(",
")",
")",
";",
"}"
] | 随机获得列表中的元素
@param <T> 元素类型
@param list 列表
@return 随机元素 | [
"随机获得列表中的元素"
] | bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/util/RandomUtil.java#L262-L264 | train | Returns a random element from the list. | [
30522,
2270,
10763,
1026,
1056,
1028,
1056,
6721,
12260,
1006,
2862,
1026,
1056,
1028,
2862,
1007,
1063,
2709,
6721,
12260,
1006,
2862,
1010,
2862,
1012,
2946,
1006,
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,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/cors/CorsConfigBuilder.java | CorsConfigBuilder.preflightResponseHeader | public CorsConfigBuilder preflightResponseHeader(final CharSequence name, final Object... values) {
if (values.length == 1) {
preflightHeaders.put(name, new ConstantValueGenerator(values[0]));
} else {
preflightResponseHeader(name, Arrays.asList(values));
}
return this;
} | java | public CorsConfigBuilder preflightResponseHeader(final CharSequence name, final Object... values) {
if (values.length == 1) {
preflightHeaders.put(name, new ConstantValueGenerator(values[0]));
} else {
preflightResponseHeader(name, Arrays.asList(values));
}
return this;
} | [
"public",
"CorsConfigBuilder",
"preflightResponseHeader",
"(",
"final",
"CharSequence",
"name",
",",
"final",
"Object",
"...",
"values",
")",
"{",
"if",
"(",
"values",
".",
"length",
"==",
"1",
")",
"{",
"preflightHeaders",
".",
"put",
"(",
"name",
",",
"new... | Returns HTTP response headers that should be added to a CORS preflight response.
An intermediary like a load balancer might require that a CORS preflight request
have certain headers set. This enables such headers to be added.
@param name the name of the HTTP header.
@param values the values for the HTTP header.
@return {@link CorsConfigBuilder} to support method chaining. | [
"Returns",
"HTTP",
"response",
"headers",
"that",
"should",
"be",
"added",
"to",
"a",
"CORS",
"preflight",
"response",
"."
] | ba06eafa1c1824bd154f1a380019e7ea2edf3c4c | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/codec-http/src/main/java/io/netty/handler/codec/http/cors/CorsConfigBuilder.java#L283-L290 | train | Add a preflight response header. | [
30522,
2270,
2522,
2869,
8663,
8873,
18259,
19231,
4063,
3653,
28968,
6072,
26029,
3366,
4974,
2121,
1006,
2345,
25869,
3366,
4226,
5897,
2171,
1010,
2345,
4874,
1012,
1012,
1012,
5300,
1007,
1063,
2065,
1006,
5300,
1012,
3091,
1027,
1027,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
looly/hutool | hutool-log/src/main/java/cn/hutool/log/StaticLog.java | StaticLog.debug | public static void debug(Log log, String format, Object... arguments) {
if (false == log(log, Level.DEBUG, null, format, arguments)) {
log.debug(format, arguments);
}
} | java | public static void debug(Log log, String format, Object... arguments) {
if (false == log(log, Level.DEBUG, null, format, arguments)) {
log.debug(format, arguments);
}
} | [
"public",
"static",
"void",
"debug",
"(",
"Log",
"log",
",",
"String",
"format",
",",
"Object",
"...",
"arguments",
")",
"{",
"if",
"(",
"false",
"==",
"log",
"(",
"log",
",",
"Level",
".",
"DEBUG",
",",
"null",
",",
"format",
",",
"arguments",
")",
... | Debug等级日志,小于Info
@param log 日志对象
@param format 格式文本,{} 代表变量
@param arguments 变量对应的参数 | [
"Debug等级日志,小于Info"
] | bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-log/src/main/java/cn/hutool/log/StaticLog.java#L64-L68 | train | Logs a message at the DEBUG level. | [
30522,
2270,
10763,
11675,
2139,
8569,
2290,
1006,
8833,
8833,
1010,
5164,
4289,
1010,
4874,
1012,
1012,
1012,
9918,
1007,
1063,
2065,
1006,
6270,
1027,
1027,
8833,
1006,
8833,
1010,
2504,
1012,
2139,
8569,
2290,
1010,
19701,
1010,
4289,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
apache/spark | sql/hive-thriftserver/src/main/java/org/apache/hive/service/cli/EmbeddedCLIServiceClient.java | EmbeddedCLIServiceClient.getSchemas | @Override
public OperationHandle getSchemas(SessionHandle sessionHandle, String catalogName,
String schemaName) throws HiveSQLException {
return cliService.getSchemas(sessionHandle, catalogName, schemaName);
} | java | @Override
public OperationHandle getSchemas(SessionHandle sessionHandle, String catalogName,
String schemaName) throws HiveSQLException {
return cliService.getSchemas(sessionHandle, catalogName, schemaName);
} | [
"@",
"Override",
"public",
"OperationHandle",
"getSchemas",
"(",
"SessionHandle",
"sessionHandle",
",",
"String",
"catalogName",
",",
"String",
"schemaName",
")",
"throws",
"HiveSQLException",
"{",
"return",
"cliService",
".",
"getSchemas",
"(",
"sessionHandle",
",",
... | /* (non-Javadoc)
@see org.apache.hive.service.cli.CLIServiceClient#getSchemas(org.apache.hive.service.cli.SessionHandle, java.lang.String, java.lang.String) | [
"/",
"*",
"(",
"non",
"-",
"Javadoc",
")"
] | 25ee0474f47d9c30d6f553a7892d9549f91071cf | https://github.com/apache/spark/blob/25ee0474f47d9c30d6f553a7892d9549f91071cf/sql/hive-thriftserver/src/main/java/org/apache/hive/service/cli/EmbeddedCLIServiceClient.java#L110-L114 | train | Get the schema handle for a sequence of catalog name and schema name. | [
30522,
1030,
2058,
15637,
2270,
3169,
11774,
2571,
4152,
5403,
9335,
1006,
5219,
11774,
2571,
5219,
11774,
2571,
1010,
5164,
12105,
18442,
1010,
5164,
8040,
28433,
18442,
1007,
11618,
26736,
2015,
4160,
2571,
2595,
24422,
1063,
2709,
18856,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/utility/Utility.java | Utility.convertPKUtoCWS | public static void convertPKUtoCWS(String inputFolder, String outputFile, final int begin, final int end) throws IOException
{
final BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(outputFile), "UTF-8"));
CorpusLoader.walk(inputFolder, new CorpusLoader.Handler()
{
int doc = 0;
@Override
public void handle(Document document)
{
++doc;
if (doc < begin || doc > end) return;
try
{
List<List<Word>> sentenceList = convertComplexWordToSimpleWord(document.getComplexSentenceList());
if (sentenceList.size() == 0) return;
for (List<Word> sentence : sentenceList)
{
if (sentence.size() == 0) continue;
int index = 0;
for (IWord iWord : sentence)
{
bw.write(iWord.getValue());
if (++index != sentence.size())
{
bw.write(' ');
}
}
bw.newLine();
}
}
catch (IOException e)
{
e.printStackTrace();
}
}
}
);
bw.close();
} | java | public static void convertPKUtoCWS(String inputFolder, String outputFile, final int begin, final int end) throws IOException
{
final BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(outputFile), "UTF-8"));
CorpusLoader.walk(inputFolder, new CorpusLoader.Handler()
{
int doc = 0;
@Override
public void handle(Document document)
{
++doc;
if (doc < begin || doc > end) return;
try
{
List<List<Word>> sentenceList = convertComplexWordToSimpleWord(document.getComplexSentenceList());
if (sentenceList.size() == 0) return;
for (List<Word> sentence : sentenceList)
{
if (sentence.size() == 0) continue;
int index = 0;
for (IWord iWord : sentence)
{
bw.write(iWord.getValue());
if (++index != sentence.size())
{
bw.write(' ');
}
}
bw.newLine();
}
}
catch (IOException e)
{
e.printStackTrace();
}
}
}
);
bw.close();
} | [
"public",
"static",
"void",
"convertPKUtoCWS",
"(",
"String",
"inputFolder",
",",
"String",
"outputFile",
",",
"final",
"int",
"begin",
",",
"final",
"int",
"end",
")",
"throws",
"IOException",
"{",
"final",
"BufferedWriter",
"bw",
"=",
"new",
"BufferedWriter",
... | 将人民日报格式的分词语料转化为空格分割的语料
@param inputFolder 输入人民日报语料的上级目录(该目录下的所有文件都是一篇人民日报分词文章)
@param outputFile 输出一整个CRF训练格式的语料
@param begin 取多少个文档之后
@param end
@throws IOException 转换过程中的IO异常 | [
"将人民日报格式的分词语料转化为空格分割的语料"
] | a538d0722ab2e4980a9dcd9ea40324fc3ddba7ce | https://github.com/hankcs/HanLP/blob/a538d0722ab2e4980a9dcd9ea40324fc3ddba7ce/src/main/java/com/hankcs/hanlp/model/perceptron/utility/Utility.java#L99-L139 | train | Convert a PKU file to CWS. | [
30522,
2270,
10763,
11675,
10463,
2361,
5283,
3406,
2278,
9333,
1006,
5164,
7953,
10371,
2121,
1010,
5164,
6434,
8873,
2571,
1010,
2345,
20014,
4088,
1010,
2345,
20014,
2203,
1007,
11618,
22834,
10288,
24422,
1063,
2345,
17698,
2098,
15994,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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-common/src/main/java/org/apache/spark/network/client/TransportClient.java | TransportClient.sendRpc | public long sendRpc(ByteBuffer message, RpcResponseCallback callback) {
if (logger.isTraceEnabled()) {
logger.trace("Sending RPC to {}", getRemoteAddress(channel));
}
long requestId = requestId();
handler.addRpcRequest(requestId, callback);
RpcChannelListener listener = new RpcChannelListener(requestId, callback);
channel.writeAndFlush(new RpcRequest(requestId, new NioManagedBuffer(message)))
.addListener(listener);
return requestId;
} | java | public long sendRpc(ByteBuffer message, RpcResponseCallback callback) {
if (logger.isTraceEnabled()) {
logger.trace("Sending RPC to {}", getRemoteAddress(channel));
}
long requestId = requestId();
handler.addRpcRequest(requestId, callback);
RpcChannelListener listener = new RpcChannelListener(requestId, callback);
channel.writeAndFlush(new RpcRequest(requestId, new NioManagedBuffer(message)))
.addListener(listener);
return requestId;
} | [
"public",
"long",
"sendRpc",
"(",
"ByteBuffer",
"message",
",",
"RpcResponseCallback",
"callback",
")",
"{",
"if",
"(",
"logger",
".",
"isTraceEnabled",
"(",
")",
")",
"{",
"logger",
".",
"trace",
"(",
"\"Sending RPC to {}\"",
",",
"getRemoteAddress",
"(",
"ch... | Sends an opaque message to the RpcHandler on the server-side. The callback will be invoked
with the server's response or upon any failure.
@param message The message to send.
@param callback Callback to handle the RPC's reply.
@return The RPC's id. | [
"Sends",
"an",
"opaque",
"message",
"to",
"the",
"RpcHandler",
"on",
"the",
"server",
"-",
"side",
".",
"The",
"callback",
"will",
"be",
"invoked",
"with",
"the",
"server",
"s",
"response",
"or",
"upon",
"any",
"failure",
"."
] | 25ee0474f47d9c30d6f553a7892d9549f91071cf | https://github.com/apache/spark/blob/25ee0474f47d9c30d6f553a7892d9549f91071cf/common/network-common/src/main/java/org/apache/spark/network/client/TransportClient.java#L187-L200 | train | Sends an RPC to the remote server. | [
30522,
2270,
2146,
4604,
14536,
2278,
1006,
24880,
8569,
12494,
4471,
1010,
1054,
15042,
6072,
26029,
3366,
9289,
20850,
8684,
2655,
5963,
1007,
1063,
2065,
1006,
8833,
4590,
1012,
21541,
22903,
8189,
23242,
1006,
1007,
1007,
1063,
8833,
45... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/net/SSLUtils.java | SSLUtils.isRestSSLAuthenticationEnabled | public static boolean isRestSSLAuthenticationEnabled(Configuration sslConfig) {
checkNotNull(sslConfig, "sslConfig");
return isRestSSLEnabled(sslConfig) &&
sslConfig.getBoolean(SecurityOptions.SSL_REST_AUTHENTICATION_ENABLED);
} | java | public static boolean isRestSSLAuthenticationEnabled(Configuration sslConfig) {
checkNotNull(sslConfig, "sslConfig");
return isRestSSLEnabled(sslConfig) &&
sslConfig.getBoolean(SecurityOptions.SSL_REST_AUTHENTICATION_ENABLED);
} | [
"public",
"static",
"boolean",
"isRestSSLAuthenticationEnabled",
"(",
"Configuration",
"sslConfig",
")",
"{",
"checkNotNull",
"(",
"sslConfig",
",",
"\"sslConfig\"",
")",
";",
"return",
"isRestSSLEnabled",
"(",
"sslConfig",
")",
"&&",
"sslConfig",
".",
"getBoolean",
... | Checks whether mutual SSL authentication for the external REST endpoint is enabled. | [
"Checks",
"whether",
"mutual",
"SSL",
"authentication",
"for",
"the",
"external",
"REST",
"endpoint",
"is",
"enabled",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/net/SSLUtils.java#L74-L78 | train | Checks if SSL authentication is enabled for REST requests. | [
30522,
2270,
10763,
22017,
20898,
2003,
28533,
4757,
17298,
10760,
16778,
10719,
8189,
23242,
1006,
9563,
7020,
22499,
2078,
8873,
2290,
1007,
1063,
4638,
17048,
11231,
3363,
1006,
7020,
22499,
2078,
8873,
2290,
1010,
1000,
7020,
22499,
2078,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/api/condition/Conditions.java | Conditions.in | public static Condition in(String name, Object... values) {
List<Condition> conditions = new ArrayList<Condition>();
for (Object value : values) {
conditions.add(eq(name, value));
}
return or(conditions.toArray(new Condition[conditions.size()]));
} | java | public static Condition in(String name, Object... values) {
List<Condition> conditions = new ArrayList<Condition>();
for (Object value : values) {
conditions.add(eq(name, value));
}
return or(conditions.toArray(new Condition[conditions.size()]));
} | [
"public",
"static",
"Condition",
"in",
"(",
"String",
"name",
",",
"Object",
"...",
"values",
")",
"{",
"List",
"<",
"Condition",
">",
"conditions",
"=",
"new",
"ArrayList",
"<",
"Condition",
">",
"(",
")",
";",
"for",
"(",
"Object",
"value",
":",
"val... | Returns "IN" condition for property by <code>name</code> and allowed set of <code>values</code>
@param name - name of property
@param values - array of allowed values
@return condition | [
"Returns",
"IN",
"condition",
"for",
"property",
"by",
"<code",
">",
"name<",
"/",
"code",
">",
"and",
"allowed",
"set",
"of",
"<code",
">",
"values<",
"/",
"code",
">"
] | d3acc0249b2d5d658d36d99e2c808ce49332ea44 | https://github.com/redisson/redisson/blob/d3acc0249b2d5d658d36d99e2c808ce49332ea44/redisson/src/main/java/org/redisson/api/condition/Conditions.java#L41-L47 | train | Gets a condition that returns true if the name is in the set of values. | [
30522,
2270,
10763,
4650,
1999,
1006,
5164,
2171,
1010,
4874,
1012,
1012,
1012,
5300,
1007,
1063,
2862,
1026,
4650,
1028,
3785,
1027,
2047,
9140,
9863,
1026,
4650,
1028,
1006,
1007,
1025,
2005,
1006,
4874,
3643,
1024,
5300,
1007,
1063,
37... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/api/serialization/SpanningRecordSerializer.java | SpanningRecordSerializer.copyToBufferBuilder | @Override
public SerializationResult copyToBufferBuilder(BufferBuilder targetBuffer) {
targetBuffer.append(lengthBuffer);
targetBuffer.append(dataBuffer);
targetBuffer.commit();
return getSerializationResult(targetBuffer);
} | java | @Override
public SerializationResult copyToBufferBuilder(BufferBuilder targetBuffer) {
targetBuffer.append(lengthBuffer);
targetBuffer.append(dataBuffer);
targetBuffer.commit();
return getSerializationResult(targetBuffer);
} | [
"@",
"Override",
"public",
"SerializationResult",
"copyToBufferBuilder",
"(",
"BufferBuilder",
"targetBuffer",
")",
"{",
"targetBuffer",
".",
"append",
"(",
"lengthBuffer",
")",
";",
"targetBuffer",
".",
"append",
"(",
"dataBuffer",
")",
";",
"targetBuffer",
".",
... | Copies an intermediate data serialization buffer into the target BufferBuilder.
@param targetBuffer the target BufferBuilder to copy to
@return how much information was written to the target buffer and
whether this buffer is full | [
"Copies",
"an",
"intermediate",
"data",
"serialization",
"buffer",
"into",
"the",
"target",
"BufferBuilder",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/io/network/api/serialization/SpanningRecordSerializer.java#L93-L100 | train | Copy the contents of this buffer to the target buffer builder. | [
30522,
1030,
2058,
15637,
2270,
7642,
3989,
6072,
11314,
6100,
3406,
8569,
12494,
8569,
23891,
2099,
1006,
17698,
8569,
23891,
2099,
4539,
8569,
12494,
1007,
1063,
4539,
8569,
12494,
1012,
10439,
10497,
1006,
3091,
8569,
12494,
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... |
alibaba/canal | dbsync/src/main/java/com/taobao/tddl/dbsync/binlog/FileLogFetcher.java | FileLogFetcher.open | public void open(String filePath, final long filePosition) throws FileNotFoundException, IOException {
open(new File(filePath), filePosition);
} | java | public void open(String filePath, final long filePosition) throws FileNotFoundException, IOException {
open(new File(filePath), filePosition);
} | [
"public",
"void",
"open",
"(",
"String",
"filePath",
",",
"final",
"long",
"filePosition",
")",
"throws",
"FileNotFoundException",
",",
"IOException",
"{",
"open",
"(",
"new",
"File",
"(",
"filePath",
")",
",",
"filePosition",
")",
";",
"}"
] | Open binlog file in local disk to fetch. | [
"Open",
"binlog",
"file",
"in",
"local",
"disk",
"to",
"fetch",
"."
] | 8f088cddc0755f4350c5aaae95c6e4002d90a40f | https://github.com/alibaba/canal/blob/8f088cddc0755f4350c5aaae95c6e4002d90a40f/dbsync/src/main/java/com/taobao/tddl/dbsync/binlog/FileLogFetcher.java#L67-L69 | train | Opens a new file with the specified file position. | [
30522,
2270,
11675,
2330,
1006,
5164,
5371,
15069,
1010,
2345,
2146,
5371,
26994,
1007,
11618,
5371,
17048,
14876,
8630,
10288,
24422,
1010,
22834,
10288,
24422,
1063,
2330,
1006,
2047,
5371,
1006,
5371,
15069,
1007,
1010,
5371,
26994,
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... |
alibaba/canal | protocol/src/main/java/com/alibaba/otter/canal/protocol/position/EntryPosition.java | EntryPosition.compareTo | public int compareTo(EntryPosition o) {
final int val = journalName.compareTo(o.journalName);
if (val == 0) {
return (int) (position - o.position);
}
return val;
} | java | public int compareTo(EntryPosition o) {
final int val = journalName.compareTo(o.journalName);
if (val == 0) {
return (int) (position - o.position);
}
return val;
} | [
"public",
"int",
"compareTo",
"(",
"EntryPosition",
"o",
")",
"{",
"final",
"int",
"val",
"=",
"journalName",
".",
"compareTo",
"(",
"o",
".",
"journalName",
")",
";",
"if",
"(",
"val",
"==",
"0",
")",
"{",
"return",
"(",
"int",
")",
"(",
"position",... | {@inheritDoc}
@see java.lang.Comparable#compareTo(java.lang.Object) | [
"{",
"@inheritDoc",
"}"
] | 8f088cddc0755f4350c5aaae95c6e4002d90a40f | https://github.com/alibaba/canal/blob/8f088cddc0755f4350c5aaae95c6e4002d90a40f/protocol/src/main/java/com/alibaba/otter/canal/protocol/position/EntryPosition.java#L138-L145 | train | Compares two EntryPosition objects. | [
30522,
2270,
20014,
12826,
3406,
1006,
4443,
26994,
1051,
1007,
1063,
2345,
20014,
11748,
1027,
3485,
18442,
1012,
12826,
3406,
1006,
1051,
1012,
3485,
18442,
1007,
1025,
2065,
1006,
11748,
1027,
1027,
1014,
1007,
1063,
2709,
1006,
20014,
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-yarn/src/main/java/org/apache/flink/yarn/AbstractYarnClusterDescriptor.java | AbstractYarnClusterDescriptor.deployInternal | protected ClusterClient<ApplicationId> deployInternal(
ClusterSpecification clusterSpecification,
String applicationName,
String yarnClusterEntrypoint,
@Nullable JobGraph jobGraph,
boolean detached) throws Exception {
// ------------------ Check if configuration is valid --------------------
validateClusterSpecification(clusterSpecification);
if (UserGroupInformation.isSecurityEnabled()) {
// note: UGI::hasKerberosCredentials inaccurately reports false
// for logins based on a keytab (fixed in Hadoop 2.6.1, see HADOOP-10786),
// so we check only in ticket cache scenario.
boolean useTicketCache = flinkConfiguration.getBoolean(SecurityOptions.KERBEROS_LOGIN_USETICKETCACHE);
UserGroupInformation loginUser = UserGroupInformation.getCurrentUser();
if (loginUser.getAuthenticationMethod() == UserGroupInformation.AuthenticationMethod.KERBEROS
&& useTicketCache && !loginUser.hasKerberosCredentials()) {
LOG.error("Hadoop security with Kerberos is enabled but the login user does not have Kerberos credentials");
throw new RuntimeException("Hadoop security with Kerberos is enabled but the login user " +
"does not have Kerberos credentials");
}
}
isReadyForDeployment(clusterSpecification);
// ------------------ Check if the specified queue exists --------------------
checkYarnQueues(yarnClient);
// ------------------ Add dynamic properties to local flinkConfiguraton ------
Map<String, String> dynProperties = getDynamicProperties(dynamicPropertiesEncoded);
for (Map.Entry<String, String> dynProperty : dynProperties.entrySet()) {
flinkConfiguration.setString(dynProperty.getKey(), dynProperty.getValue());
}
// ------------------ Check if the YARN ClusterClient has the requested resources --------------
// Create application via yarnClient
final YarnClientApplication yarnApplication = yarnClient.createApplication();
final GetNewApplicationResponse appResponse = yarnApplication.getNewApplicationResponse();
Resource maxRes = appResponse.getMaximumResourceCapability();
final ClusterResourceDescription freeClusterMem;
try {
freeClusterMem = getCurrentFreeClusterResources(yarnClient);
} catch (YarnException | IOException e) {
failSessionDuringDeployment(yarnClient, yarnApplication);
throw new YarnDeploymentException("Could not retrieve information about free cluster resources.", e);
}
final int yarnMinAllocationMB = yarnConfiguration.getInt(YarnConfiguration.RM_SCHEDULER_MINIMUM_ALLOCATION_MB, 0);
final ClusterSpecification validClusterSpecification;
try {
validClusterSpecification = validateClusterResources(
clusterSpecification,
yarnMinAllocationMB,
maxRes,
freeClusterMem);
} catch (YarnDeploymentException yde) {
failSessionDuringDeployment(yarnClient, yarnApplication);
throw yde;
}
LOG.info("Cluster specification: {}", validClusterSpecification);
final ClusterEntrypoint.ExecutionMode executionMode = detached ?
ClusterEntrypoint.ExecutionMode.DETACHED
: ClusterEntrypoint.ExecutionMode.NORMAL;
flinkConfiguration.setString(ClusterEntrypoint.EXECUTION_MODE, executionMode.toString());
ApplicationReport report = startAppMaster(
flinkConfiguration,
applicationName,
yarnClusterEntrypoint,
jobGraph,
yarnClient,
yarnApplication,
validClusterSpecification);
String host = report.getHost();
int port = report.getRpcPort();
// Correctly initialize the Flink config
flinkConfiguration.setString(JobManagerOptions.ADDRESS, host);
flinkConfiguration.setInteger(JobManagerOptions.PORT, port);
flinkConfiguration.setString(RestOptions.ADDRESS, host);
flinkConfiguration.setInteger(RestOptions.PORT, port);
// the Flink cluster is deployed in YARN. Represent cluster
return createYarnClusterClient(
this,
validClusterSpecification.getNumberTaskManagers(),
validClusterSpecification.getSlotsPerTaskManager(),
report,
flinkConfiguration,
true);
} | java | protected ClusterClient<ApplicationId> deployInternal(
ClusterSpecification clusterSpecification,
String applicationName,
String yarnClusterEntrypoint,
@Nullable JobGraph jobGraph,
boolean detached) throws Exception {
// ------------------ Check if configuration is valid --------------------
validateClusterSpecification(clusterSpecification);
if (UserGroupInformation.isSecurityEnabled()) {
// note: UGI::hasKerberosCredentials inaccurately reports false
// for logins based on a keytab (fixed in Hadoop 2.6.1, see HADOOP-10786),
// so we check only in ticket cache scenario.
boolean useTicketCache = flinkConfiguration.getBoolean(SecurityOptions.KERBEROS_LOGIN_USETICKETCACHE);
UserGroupInformation loginUser = UserGroupInformation.getCurrentUser();
if (loginUser.getAuthenticationMethod() == UserGroupInformation.AuthenticationMethod.KERBEROS
&& useTicketCache && !loginUser.hasKerberosCredentials()) {
LOG.error("Hadoop security with Kerberos is enabled but the login user does not have Kerberos credentials");
throw new RuntimeException("Hadoop security with Kerberos is enabled but the login user " +
"does not have Kerberos credentials");
}
}
isReadyForDeployment(clusterSpecification);
// ------------------ Check if the specified queue exists --------------------
checkYarnQueues(yarnClient);
// ------------------ Add dynamic properties to local flinkConfiguraton ------
Map<String, String> dynProperties = getDynamicProperties(dynamicPropertiesEncoded);
for (Map.Entry<String, String> dynProperty : dynProperties.entrySet()) {
flinkConfiguration.setString(dynProperty.getKey(), dynProperty.getValue());
}
// ------------------ Check if the YARN ClusterClient has the requested resources --------------
// Create application via yarnClient
final YarnClientApplication yarnApplication = yarnClient.createApplication();
final GetNewApplicationResponse appResponse = yarnApplication.getNewApplicationResponse();
Resource maxRes = appResponse.getMaximumResourceCapability();
final ClusterResourceDescription freeClusterMem;
try {
freeClusterMem = getCurrentFreeClusterResources(yarnClient);
} catch (YarnException | IOException e) {
failSessionDuringDeployment(yarnClient, yarnApplication);
throw new YarnDeploymentException("Could not retrieve information about free cluster resources.", e);
}
final int yarnMinAllocationMB = yarnConfiguration.getInt(YarnConfiguration.RM_SCHEDULER_MINIMUM_ALLOCATION_MB, 0);
final ClusterSpecification validClusterSpecification;
try {
validClusterSpecification = validateClusterResources(
clusterSpecification,
yarnMinAllocationMB,
maxRes,
freeClusterMem);
} catch (YarnDeploymentException yde) {
failSessionDuringDeployment(yarnClient, yarnApplication);
throw yde;
}
LOG.info("Cluster specification: {}", validClusterSpecification);
final ClusterEntrypoint.ExecutionMode executionMode = detached ?
ClusterEntrypoint.ExecutionMode.DETACHED
: ClusterEntrypoint.ExecutionMode.NORMAL;
flinkConfiguration.setString(ClusterEntrypoint.EXECUTION_MODE, executionMode.toString());
ApplicationReport report = startAppMaster(
flinkConfiguration,
applicationName,
yarnClusterEntrypoint,
jobGraph,
yarnClient,
yarnApplication,
validClusterSpecification);
String host = report.getHost();
int port = report.getRpcPort();
// Correctly initialize the Flink config
flinkConfiguration.setString(JobManagerOptions.ADDRESS, host);
flinkConfiguration.setInteger(JobManagerOptions.PORT, port);
flinkConfiguration.setString(RestOptions.ADDRESS, host);
flinkConfiguration.setInteger(RestOptions.PORT, port);
// the Flink cluster is deployed in YARN. Represent cluster
return createYarnClusterClient(
this,
validClusterSpecification.getNumberTaskManagers(),
validClusterSpecification.getSlotsPerTaskManager(),
report,
flinkConfiguration,
true);
} | [
"protected",
"ClusterClient",
"<",
"ApplicationId",
">",
"deployInternal",
"(",
"ClusterSpecification",
"clusterSpecification",
",",
"String",
"applicationName",
",",
"String",
"yarnClusterEntrypoint",
",",
"@",
"Nullable",
"JobGraph",
"jobGraph",
",",
"boolean",
"detache... | This method will block until the ApplicationMaster/JobManager have been deployed on YARN.
@param clusterSpecification Initial cluster specification for the Flink cluster to be deployed
@param applicationName name of the Yarn application to start
@param yarnClusterEntrypoint Class name of the Yarn cluster entry point.
@param jobGraph A job graph which is deployed with the Flink cluster, {@code null} if none
@param detached True if the cluster should be started in detached mode | [
"This",
"method",
"will",
"block",
"until",
"the",
"ApplicationMaster",
"/",
"JobManager",
"have",
"been",
"deployed",
"on",
"YARN",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-yarn/src/main/java/org/apache/flink/yarn/AbstractYarnClusterDescriptor.java#L435-L537 | train | Deploy the application using the YARN cluster specification. | [
30522,
5123,
9324,
20464,
11638,
1026,
4646,
3593,
1028,
21296,
18447,
11795,
2389,
1006,
12906,
5051,
6895,
10803,
12906,
5051,
6895,
10803,
1010,
5164,
4646,
18442,
1010,
5164,
27158,
20464,
19966,
7869,
3372,
2854,
8400,
1010,
1030,
19701,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
looly/hutool | hutool-system/src/main/java/cn/hutool/system/SystemUtil.java | SystemUtil.getBoolean | public static boolean getBoolean(String key, boolean defaultValue) {
String value = get(key);
if (value == null) {
return defaultValue;
}
value = value.trim().toLowerCase();
if (value.isEmpty()) {
return true;
}
if ("true".equals(value) || "yes".equals(value) || "1".equals(value)) {
return true;
}
if ("false".equals(value) || "no".equals(value) || "0".equals(value)) {
return false;
}
return defaultValue;
} | java | public static boolean getBoolean(String key, boolean defaultValue) {
String value = get(key);
if (value == null) {
return defaultValue;
}
value = value.trim().toLowerCase();
if (value.isEmpty()) {
return true;
}
if ("true".equals(value) || "yes".equals(value) || "1".equals(value)) {
return true;
}
if ("false".equals(value) || "no".equals(value) || "0".equals(value)) {
return false;
}
return defaultValue;
} | [
"public",
"static",
"boolean",
"getBoolean",
"(",
"String",
"key",
",",
"boolean",
"defaultValue",
")",
"{",
"String",
"value",
"=",
"get",
"(",
"key",
")",
";",
"if",
"(",
"value",
"==",
"null",
")",
"{",
"return",
"defaultValue",
";",
"}",
"value",
"... | 获得boolean类型值
@param key 键
@param defaultValue 默认值
@return 值 | [
"获得boolean类型值"
] | bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-system/src/main/java/cn/hutool/system/SystemUtil.java#L146-L166 | train | Returns the boolean value for the given key. | [
30522,
2270,
10763,
22017,
20898,
2131,
5092,
9890,
2319,
1006,
5164,
3145,
1010,
22017,
20898,
12398,
10175,
5657,
1007,
1063,
5164,
3643,
1027,
2131,
1006,
3145,
1007,
1025,
2065,
1006,
3643,
1027,
1027,
19701,
1007,
1063,
2709,
12398,
10... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
looly/hutool | hutool-db/src/main/java/cn/hutool/db/sql/SqlExecutor.java | SqlExecutor.query | public static <T> T query(Connection conn, String sql, RsHandler<T> rsh, Map<String, Object> paramMap) throws SQLException {
final NamedSql namedSql = new NamedSql(sql, paramMap);
return query(conn, namedSql.getSql(), rsh, namedSql.getParams());
} | java | public static <T> T query(Connection conn, String sql, RsHandler<T> rsh, Map<String, Object> paramMap) throws SQLException {
final NamedSql namedSql = new NamedSql(sql, paramMap);
return query(conn, namedSql.getSql(), rsh, namedSql.getParams());
} | [
"public",
"static",
"<",
"T",
">",
"T",
"query",
"(",
"Connection",
"conn",
",",
"String",
"sql",
",",
"RsHandler",
"<",
"T",
">",
"rsh",
",",
"Map",
"<",
"String",
",",
"Object",
">",
"paramMap",
")",
"throws",
"SQLException",
"{",
"final",
"NamedSql"... | 执行查询语句<br>
此方法不会关闭Connection
@param <T> 处理结果类型
@param conn 数据库连接对象
@param sql 查询语句,使用参数名占位符,例如:name
@param rsh 结果集处理对象
@param paramMap 参数对
@return 结果对象
@throws SQLException SQL执行异常
@since 4.0.10 | [
"执行查询语句<br",
">",
"此方法不会关闭Connection"
] | bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-db/src/main/java/cn/hutool/db/sql/SqlExecutor.java#L241-L244 | train | Query for rows. | [
30522,
2270,
10763,
1026,
1056,
1028,
1056,
23032,
1006,
4434,
9530,
2078,
1010,
5164,
29296,
1010,
12667,
11774,
3917,
1026,
1056,
1028,
12667,
2232,
1010,
4949,
30524,
2140,
2315,
2015,
4160,
2140,
1027,
2047,
2315,
2015,
4160,
2140,
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... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.