repo stringclasses 11
values | path stringlengths 41 214 | func_name stringlengths 7 82 | original_string stringlengths 77 11.9k | language stringclasses 1
value | code stringlengths 77 11.9k | code_tokens listlengths 22 1.57k | docstring stringlengths 2 2.27k | docstring_tokens listlengths 1 352 | sha stringclasses 11
values | url stringlengths 129 319 | partition stringclasses 1
value | summary stringlengths 7 191 | input_ids listlengths 502 502 | token_type_ids listlengths 502 502 | attention_mask listlengths 502 502 | labels listlengths 502 502 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
looly/hutool | hutool-core/src/main/java/cn/hutool/core/io/IoUtil.java | IoUtil.contentEquals | public static boolean contentEquals(Reader input1, Reader input2) throws IORuntimeException {
input1 = getReader(input1);
input2 = getReader(input2);
try {
int ch = input1.read();
while (EOF != ch) {
int ch2 = input2.read();
if (ch != ch2) {
return false;
}
ch = input1.read(... | java | public static boolean contentEquals(Reader input1, Reader input2) throws IORuntimeException {
input1 = getReader(input1);
input2 = getReader(input2);
try {
int ch = input1.read();
while (EOF != ch) {
int ch2 = input2.read();
if (ch != ch2) {
return false;
}
ch = input1.read(... | [
"public",
"static",
"boolean",
"contentEquals",
"(",
"Reader",
"input1",
",",
"Reader",
"input2",
")",
"throws",
"IORuntimeException",
"{",
"input1",
"=",
"getReader",
"(",
"input1",
")",
";",
"input2",
"=",
"getReader",
"(",
"input2",
")",
";",
"try",
"{",
... | 对比两个Reader的内容是否一致<br>
内部会转换流为 {@link BufferedInputStream}
@param input1 第一个reader
@param input2 第二个reader
@return 两个流的内容一致返回true,否则false
@throws IORuntimeException IO异常
@since 4.0.6 | [
"对比两个Reader的内容是否一致<br",
">",
"内部会转换流为",
"{",
"@link",
"BufferedInputStream",
"}"
] | bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/io/IoUtil.java#L1057-L1076 | train | Returns true if the contents of two Reader objects are equal. | [
30522,
2270,
10763,
22017,
20898,
4180,
2063,
26426,
2015,
1006,
8068,
7953,
2487,
1010,
8068,
7953,
2475,
1007,
11618,
22834,
15532,
7292,
10288,
24422,
1063,
7953,
2487,
1027,
2131,
16416,
4063,
1006,
7953,
2487,
1007,
1025,
7953,
2475,
1... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
apache/flink | flink-streaming-java/src/main/java/org/apache/flink/streaming/api/environment/StreamExecutionEnvironment.java | StreamExecutionEnvironment.socketTextStream | @PublicEvolving
public DataStreamSource<String> socketTextStream(String hostname, int port, String delimiter) {
return socketTextStream(hostname, port, delimiter, 0);
} | java | @PublicEvolving
public DataStreamSource<String> socketTextStream(String hostname, int port, String delimiter) {
return socketTextStream(hostname, port, delimiter, 0);
} | [
"@",
"PublicEvolving",
"public",
"DataStreamSource",
"<",
"String",
">",
"socketTextStream",
"(",
"String",
"hostname",
",",
"int",
"port",
",",
"String",
"delimiter",
")",
"{",
"return",
"socketTextStream",
"(",
"hostname",
",",
"port",
",",
"delimiter",
",",
... | Creates a new data stream that contains the strings received infinitely from a socket. Received strings are
decoded by the system's default character set. The reader is terminated immediately when the socket is down.
@param hostname
The host name which a server socket binds
@param port
The port number which a server s... | [
"Creates",
"a",
"new",
"data",
"stream",
"that",
"contains",
"the",
"strings",
"received",
"infinitely",
"from",
"a",
"socket",
".",
"Received",
"strings",
"are",
"decoded",
"by",
"the",
"system",
"s",
"default",
"character",
"set",
".",
"The",
"reader",
"is... | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-streaming-java/src/main/java/org/apache/flink/streaming/api/environment/StreamExecutionEnvironment.java#L1254-L1257 | train | Returns a DataStreamSource that reads from the specified hostname on the specified port using the specified delimiter. | [
30522,
1030,
2270,
6777,
4747,
6455,
2270,
2951,
21422,
6499,
3126,
3401,
1026,
5164,
1028,
22278,
18209,
21422,
1006,
5164,
3677,
18442,
1010,
20014,
3417,
1010,
5164,
3972,
27605,
3334,
1007,
1063,
2709,
22278,
18209,
21422,
1006,
3677,
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-libraries/flink-cep/src/main/java/org/apache/flink/cep/pattern/Pattern.java | Pattern.notNext | public Pattern<T, T> notNext(final String name) {
if (quantifier.hasProperty(Quantifier.QuantifierProperty.OPTIONAL)) {
throw new UnsupportedOperationException(
"Specifying a pattern with an optional path to NOT condition is not supported yet. " +
"You can simulate such pattern with two independent patte... | java | public Pattern<T, T> notNext(final String name) {
if (quantifier.hasProperty(Quantifier.QuantifierProperty.OPTIONAL)) {
throw new UnsupportedOperationException(
"Specifying a pattern with an optional path to NOT condition is not supported yet. " +
"You can simulate such pattern with two independent patte... | [
"public",
"Pattern",
"<",
"T",
",",
"T",
">",
"notNext",
"(",
"final",
"String",
"name",
")",
"{",
"if",
"(",
"quantifier",
".",
"hasProperty",
"(",
"Quantifier",
".",
"QuantifierProperty",
".",
"OPTIONAL",
")",
")",
"{",
"throw",
"new",
"UnsupportedOperat... | Appends a new pattern to the existing one. The new pattern enforces that there is no event matching this pattern
right after the preceding matched event.
@param name Name of the new pattern
@return A new pattern which is appended to this one | [
"Appends",
"a",
"new",
"pattern",
"to",
"the",
"existing",
"one",
".",
"The",
"new",
"pattern",
"enforces",
"that",
"there",
"is",
"no",
"event",
"matching",
"this",
"pattern",
"right",
"after",
"the",
"preceding",
"matched",
"event",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-libraries/flink-cep/src/main/java/org/apache/flink/cep/pattern/Pattern.java#L272-L280 | train | Creates a pattern that matches only the next occurrence of the pattern. | [
30522,
2270,
5418,
1026,
1056,
1010,
1056,
1028,
2025,
2638,
18413,
1006,
2345,
5164,
2171,
1007,
1063,
2065,
1006,
24110,
3775,
8873,
2121,
1012,
2038,
21572,
4842,
3723,
1006,
24110,
3775,
8873,
2121,
1012,
24110,
3775,
8873,
2121,
21572,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
looly/hutool | hutool-json/src/main/java/cn/hutool/json/JSONUtil.java | JSONUtil.parseFromResourceBundle | public static JSONObject parseFromResourceBundle(ResourceBundle bundle) {
JSONObject jsonObject = new JSONObject();
Enumeration<String> keys = bundle.getKeys();
while (keys.hasMoreElements()) {
String key = keys.nextElement();
if (key != null) {
InternalJSONUtil.propertyPut(jsonObject, key, bundle... | java | public static JSONObject parseFromResourceBundle(ResourceBundle bundle) {
JSONObject jsonObject = new JSONObject();
Enumeration<String> keys = bundle.getKeys();
while (keys.hasMoreElements()) {
String key = keys.nextElement();
if (key != null) {
InternalJSONUtil.propertyPut(jsonObject, key, bundle... | [
"public",
"static",
"JSONObject",
"parseFromResourceBundle",
"(",
"ResourceBundle",
"bundle",
")",
"{",
"JSONObject",
"jsonObject",
"=",
"new",
"JSONObject",
"(",
")",
";",
"Enumeration",
"<",
"String",
">",
"keys",
"=",
"bundle",
".",
"getKeys",
"(",
")",
";"... | ResourceBundle转化为JSONObject
@param bundle ResourceBundle文件
@return JSONObject | [
"ResourceBundle转化为JSONObject"
] | bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-json/src/main/java/cn/hutool/json/JSONUtil.java#L190-L200 | train | Creates a new JSONObject from a ResourceBundle. | [
30522,
2270,
10763,
1046,
3385,
16429,
20614,
11968,
20106,
21716,
6072,
8162,
3401,
27265,
2571,
1006,
7692,
27265,
2571,
14012,
1007,
1063,
1046,
3385,
16429,
20614,
1046,
3385,
16429,
20614,
1027,
2047,
1046,
3385,
16429,
20614,
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/tokenizer/NLPTokenizer.java | NLPTokenizer.seg2sentence | public static List<List<Term>> seg2sentence(String text, boolean shortest)
{
return ANALYZER.seg2sentence(text, shortest);
} | java | public static List<List<Term>> seg2sentence(String text, boolean shortest)
{
return ANALYZER.seg2sentence(text, shortest);
} | [
"public",
"static",
"List",
"<",
"List",
"<",
"Term",
">",
">",
"seg2sentence",
"(",
"String",
"text",
",",
"boolean",
"shortest",
")",
"{",
"return",
"ANALYZER",
".",
"seg2sentence",
"(",
"text",
",",
"shortest",
")",
";",
"}"
] | 分词断句 输出句子形式
@param text 待分词句子
@param shortest 是否断句为最细的子句(将逗号也视作分隔符)
@return 句子列表,每个句子由一个单词列表组成 | [
"分词断句",
"输出句子形式"
] | a538d0722ab2e4980a9dcd9ea40324fc3ddba7ce | https://github.com/hankcs/HanLP/blob/a538d0722ab2e4980a9dcd9ea40324fc3ddba7ce/src/main/java/com/hankcs/hanlp/tokenizer/NLPTokenizer.java#L92-L95 | train | seg2sentence - returns a list of lists of terms from a sentence. | [
30522,
2270,
10763,
2862,
1026,
2862,
1026,
2744,
1028,
1028,
7367,
2290,
2475,
5054,
6528,
3401,
1006,
5164,
3793,
1010,
22017,
20898,
20047,
1007,
1063,
2709,
17908,
2099,
1012,
7367,
2290,
2475,
5054,
6528,
3401,
1006,
3793,
1010,
20047,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
apache/flink | flink-libraries/flink-gelly/src/main/java/org/apache/flink/graph/asm/translate/Translate.java | Translate.translateEdgeValues | @SuppressWarnings("unchecked")
public static <K, OLD, NEW> DataSet<Edge<K, NEW>> translateEdgeValues(DataSet<Edge<K, OLD>> edges, TranslateFunction<OLD, NEW> translator, int parallelism) {
Preconditions.checkNotNull(edges);
Preconditions.checkNotNull(translator);
Class<Edge<K, NEW>> edgeClass = (Class<Edge<K, N... | java | @SuppressWarnings("unchecked")
public static <K, OLD, NEW> DataSet<Edge<K, NEW>> translateEdgeValues(DataSet<Edge<K, OLD>> edges, TranslateFunction<OLD, NEW> translator, int parallelism) {
Preconditions.checkNotNull(edges);
Preconditions.checkNotNull(translator);
Class<Edge<K, NEW>> edgeClass = (Class<Edge<K, N... | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"static",
"<",
"K",
",",
"OLD",
",",
"NEW",
">",
"DataSet",
"<",
"Edge",
"<",
"K",
",",
"NEW",
">",
">",
"translateEdgeValues",
"(",
"DataSet",
"<",
"Edge",
"<",
"K",
",",
"OLD",
">",
">",... | Translate {@link Edge} values using the given {@link TranslateFunction}.
@param edges input edges
@param translator implements conversion from {@code OLD} to {@code NEW}
@param parallelism operator parallelism
@param <K> vertex ID type
@param <OLD> old edge value type
@param <NEW> new edge value type
@return translate... | [
"Translate",
"{",
"@link",
"Edge",
"}",
"values",
"using",
"the",
"given",
"{",
"@link",
"TranslateFunction",
"}",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-libraries/flink-gelly/src/main/java/org/apache/flink/graph/asm/translate/Translate.java#L319-L344 | train | Translate edge values. | [
30522,
1030,
16081,
9028,
5582,
2015,
1006,
1000,
4895,
5403,
18141,
1000,
1007,
2270,
10763,
1026,
1047,
1010,
2214,
1010,
2047,
1028,
2951,
13462,
1026,
3341,
1026,
1047,
1010,
2047,
1028,
1028,
17637,
24225,
10175,
15808,
1006,
2951,
134... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
apache/flink | flink-core/src/main/java/org/apache/flink/api/java/typeutils/runtime/PojoSerializerSnapshot.java | PojoSerializerSnapshot.restoreSerializers | private static <K> LinkedHashMap<K, TypeSerializer<?>> restoreSerializers(LinkedHashMap<K, TypeSerializerSnapshot<?>> snapshotsMap) {
final LinkedHashMap<K, TypeSerializer<?>> restoredSerializersMap = new LinkedHashMap<>(snapshotsMap.size());
snapshotsMap.forEach((key, snapshot) -> restoredSerializersMap.put(key, s... | java | private static <K> LinkedHashMap<K, TypeSerializer<?>> restoreSerializers(LinkedHashMap<K, TypeSerializerSnapshot<?>> snapshotsMap) {
final LinkedHashMap<K, TypeSerializer<?>> restoredSerializersMap = new LinkedHashMap<>(snapshotsMap.size());
snapshotsMap.forEach((key, snapshot) -> restoredSerializersMap.put(key, s... | [
"private",
"static",
"<",
"K",
">",
"LinkedHashMap",
"<",
"K",
",",
"TypeSerializer",
"<",
"?",
">",
">",
"restoreSerializers",
"(",
"LinkedHashMap",
"<",
"K",
",",
"TypeSerializerSnapshot",
"<",
"?",
">",
">",
"snapshotsMap",
")",
"{",
"final",
"LinkedHashM... | Transforms a {@link LinkedHashMap} with {@link TypeSerializerSnapshot}s as
the value to {@link TypeSerializer} as the value by restoring the snapshot. | [
"Transforms",
"a",
"{"
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-core/src/main/java/org/apache/flink/api/java/typeutils/runtime/PojoSerializerSnapshot.java#L234-L238 | train | Restore serializers from the given map. | [
30522,
2797,
10763,
1026,
1047,
1028,
5799,
14949,
22444,
2361,
1026,
1047,
1010,
4127,
11610,
28863,
1026,
1029,
1028,
1028,
9239,
8043,
4818,
17629,
2015,
1006,
5799,
14949,
22444,
2361,
1026,
1047,
1010,
4127,
11610,
28863,
2015,
2532,
4... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
looly/hutool | hutool-core/src/main/java/cn/hutool/core/thread/ThreadUtil.java | ThreadUtil.currentThreadGroup | public static ThreadGroup currentThreadGroup() {
final SecurityManager s = System.getSecurityManager();
return (null != s) ? s.getThreadGroup() : Thread.currentThread().getThreadGroup();
} | java | public static ThreadGroup currentThreadGroup() {
final SecurityManager s = System.getSecurityManager();
return (null != s) ? s.getThreadGroup() : Thread.currentThread().getThreadGroup();
} | [
"public",
"static",
"ThreadGroup",
"currentThreadGroup",
"(",
")",
"{",
"final",
"SecurityManager",
"s",
"=",
"System",
".",
"getSecurityManager",
"(",
")",
";",
"return",
"(",
"null",
"!=",
"s",
")",
"?",
"s",
".",
"getThreadGroup",
"(",
")",
":",
"Thread... | 获取当前线程的线程组
@return 线程组
@since 3.1.2 | [
"获取当前线程的线程组"
] | bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/thread/ThreadUtil.java#L383-L386 | train | Gets the ThreadGroup for the current thread. | [
30522,
2270,
10763,
11689,
17058,
2783,
2705,
16416,
2094,
17058,
1006,
1007,
1063,
2345,
3036,
24805,
4590,
1055,
1027,
2291,
1012,
4152,
8586,
25137,
24805,
4590,
1006,
1007,
1025,
2709,
1006,
19701,
999,
1027,
1055,
1007,
1029,
1055,
305... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/server/src/org/openqa/grid/internal/DefaultGridRegistry.java | DefaultGridRegistry._release | private void _release(TestSlot testSlot, SessionTerminationReason reason) {
if (!testSlot.startReleaseProcess()) {
return;
}
if (!testSlot.performAfterSessionEvent()) {
return;
}
final String internalKey = testSlot.getInternalKey();
try {
lock.lock();
testSlot.finishRe... | java | private void _release(TestSlot testSlot, SessionTerminationReason reason) {
if (!testSlot.startReleaseProcess()) {
return;
}
if (!testSlot.performAfterSessionEvent()) {
return;
}
final String internalKey = testSlot.getInternalKey();
try {
lock.lock();
testSlot.finishRe... | [
"private",
"void",
"_release",
"(",
"TestSlot",
"testSlot",
",",
"SessionTerminationReason",
"reason",
")",
"{",
"if",
"(",
"!",
"testSlot",
".",
"startReleaseProcess",
"(",
")",
")",
"{",
"return",
";",
"}",
"if",
"(",
"!",
"testSlot",
".",
"performAfterSes... | Release the test slot. Free the resource on the slot itself and the registry. If also invokes
the {@link org.openqa.grid.internal.listeners.TestSessionListener#afterSession(TestSession)} if
applicable.
@param testSlot The slot to release | [
"Release",
"the",
"test",
"slot",
".",
"Free",
"the",
"resource",
"on",
"the",
"slot",
"itself",
"and",
"the",
"registry",
".",
"If",
"also",
"invokes",
"the",
"{",
"@link",
"org",
".",
"openqa",
".",
"grid",
".",
"internal",
".",
"listeners",
".",
"Te... | 7af172729f17b20269c8ca4ea6f788db48616535 | https://github.com/SeleniumHQ/selenium/blob/7af172729f17b20269c8ca4ea6f788db48616535/java/server/src/org/openqa/grid/internal/DefaultGridRegistry.java#L126-L144 | train | Release the test slot. | [
30522,
2797,
11675,
1035,
2713,
1006,
5852,
10994,
5852,
10994,
1010,
5219,
3334,
22311,
3508,
16416,
3385,
3114,
1007,
1063,
2065,
1006,
999,
5852,
10994,
1012,
2707,
16570,
19500,
21572,
9623,
2015,
1006,
1007,
1007,
1063,
2709,
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... |
networknt/light-4j | service/src/main/java/com/networknt/service/ServiceUtil.java | ServiceUtil.construct | public static Object construct(Object something) throws Exception {
if (something instanceof String) {
return Class.forName((String)something).getConstructor().newInstance();
} else if (something instanceof Map) {
// keys are the class name, values are the parameters.
... | java | public static Object construct(Object something) throws Exception {
if (something instanceof String) {
return Class.forName((String)something).getConstructor().newInstance();
} else if (something instanceof Map) {
// keys are the class name, values are the parameters.
... | [
"public",
"static",
"Object",
"construct",
"(",
"Object",
"something",
")",
"throws",
"Exception",
"{",
"if",
"(",
"something",
"instanceof",
"String",
")",
"{",
"return",
"Class",
".",
"forName",
"(",
"(",
"String",
")",
"something",
")",
".",
"getConstruct... | Instantiates and returns an object out of a given configuration.
If the configuration is simply a class name, assume default empty constructor.
If the configuration is a map, assume keyed by class name, with values being one of 2 options:
- map: keys are field names, values are field values.
- list: items are each maps... | [
"Instantiates",
"and",
"returns",
"an",
"object",
"out",
"of",
"a",
"given",
"configuration",
".",
"If",
"the",
"configuration",
"is",
"simply",
"a",
"class",
"name",
"assume",
"default",
"empty",
"constructor",
".",
"If",
"the",
"configuration",
"is",
"a",
... | 2a60257c60663684c8f6dc8b5ea3cf184e534db6 | https://github.com/networknt/light-4j/blob/2a60257c60663684c8f6dc8b5ea3cf184e534db6/service/src/main/java/com/networknt/service/ServiceUtil.java#L43-L57 | train | Construct an object from a Map or a String. | [
30522,
2270,
10763,
4874,
9570,
1006,
4874,
2242,
1007,
11618,
6453,
1063,
2065,
1006,
2242,
6013,
11253,
5164,
1007,
1063,
2709,
2465,
1012,
2005,
18442,
1006,
1006,
5164,
1007,
2242,
1007,
1012,
2131,
8663,
3367,
6820,
16761,
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... |
networknt/light-4j | utility/src/main/java/com/networknt/utility/NioUtils.java | NioUtils.list | public static void list(String zipFilename) throws IOException{
if(logger.isDebugEnabled()) logger.debug("Listing Archive: %s",zipFilename);
//create the file system
try (FileSystem zipFileSystem = createZipFileSystem(zipFilename, false)) {
final Path root = zipFileSystem.getPath(... | java | public static void list(String zipFilename) throws IOException{
if(logger.isDebugEnabled()) logger.debug("Listing Archive: %s",zipFilename);
//create the file system
try (FileSystem zipFileSystem = createZipFileSystem(zipFilename, false)) {
final Path root = zipFileSystem.getPath(... | [
"public",
"static",
"void",
"list",
"(",
"String",
"zipFilename",
")",
"throws",
"IOException",
"{",
"if",
"(",
"logger",
".",
"isDebugEnabled",
"(",
")",
")",
"logger",
".",
"debug",
"(",
"\"Listing Archive: %s\"",
",",
"zipFilename",
")",
";",
"//create the... | List the contents of the specified zip file
@param zipFilename zip filename
@throws IOException IOException | [
"List",
"the",
"contents",
"of",
"the",
"specified",
"zip",
"file"
] | 2a60257c60663684c8f6dc8b5ea3cf184e534db6 | https://github.com/networknt/light-4j/blob/2a60257c60663684c8f6dc8b5ea3cf184e534db6/utility/src/main/java/com/networknt/utility/NioUtils.java#L179-L222 | train | List the contents of a zip file. | [
30522,
2270,
10763,
11675,
2862,
1006,
5164,
14101,
8873,
20844,
4168,
1007,
11618,
22834,
10288,
24422,
1063,
2065,
1006,
8833,
4590,
1012,
2003,
3207,
8569,
6914,
3085,
2094,
1006,
1007,
1007,
8833,
4590,
1012,
2139,
8569,
2290,
1006,
100... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
hankcs/HanLP | src/main/java/com/hankcs/hanlp/dependency/nnparser/NeuralNetworkParser.java | NeuralNetworkParser.load | public boolean load(ByteArray byteArray)
{
if (byteArray == null) return false;
model_header = byteArray.nextString();
root = byteArray.nextString();
use_distance = byteArray.nextInt() == 1;
use_valency = byteArray.nextInt() == 1;
use_cluster = byteArray.nextInt() ==... | java | public boolean load(ByteArray byteArray)
{
if (byteArray == null) return false;
model_header = byteArray.nextString();
root = byteArray.nextString();
use_distance = byteArray.nextInt() == 1;
use_valency = byteArray.nextInt() == 1;
use_cluster = byteArray.nextInt() ==... | [
"public",
"boolean",
"load",
"(",
"ByteArray",
"byteArray",
")",
"{",
"if",
"(",
"byteArray",
"==",
"null",
")",
"return",
"false",
";",
"model_header",
"=",
"byteArray",
".",
"nextString",
"(",
")",
";",
"root",
"=",
"byteArray",
".",
"nextString",
"(",
... | 从bin加载
@param byteArray
@return | [
"从bin加载"
] | a538d0722ab2e4980a9dcd9ea40324fc3ddba7ce | https://github.com/hankcs/HanLP/blob/a538d0722ab2e4980a9dcd9ea40324fc3ddba7ce/src/main/java/com/hankcs/hanlp/dependency/nnparser/NeuralNetworkParser.java#L238-L288 | train | Load the class file from the specified byte array. | [
30522,
2270,
22017,
20898,
7170,
1006,
24880,
2906,
9447,
24880,
2906,
9447,
1007,
1063,
2065,
1006,
24880,
2906,
9447,
1027,
1027,
19701,
1007,
2709,
6270,
1025,
2944,
1035,
20346,
1027,
24880,
2906,
9447,
1012,
2279,
3367,
4892,
1006,
100... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
netty/netty | resolver-dns/src/main/java/io/netty/resolver/dns/DnsNameResolver.java | DnsNameResolver.resolveAll | public final Future<List<InetAddress>> resolveAll(String inetHost, Iterable<DnsRecord> additionals,
Promise<List<InetAddress>> promise) {
checkNotNull(promise, "promise");
DnsRecord[] additionalsArray = toArray(additionals, true);
try {
... | java | public final Future<List<InetAddress>> resolveAll(String inetHost, Iterable<DnsRecord> additionals,
Promise<List<InetAddress>> promise) {
checkNotNull(promise, "promise");
DnsRecord[] additionalsArray = toArray(additionals, true);
try {
... | [
"public",
"final",
"Future",
"<",
"List",
"<",
"InetAddress",
">",
">",
"resolveAll",
"(",
"String",
"inetHost",
",",
"Iterable",
"<",
"DnsRecord",
">",
"additionals",
",",
"Promise",
"<",
"List",
"<",
"InetAddress",
">",
">",
"promise",
")",
"{",
"checkNo... | Resolves the specified host name and port into a list of address.
@param inetHost the name to resolve
@param additionals additional records ({@code OPT})
@param promise the {@link Promise} which will be fulfilled when the name resolution is finished
@return the list of the address as the result of the resolution | [
"Resolves",
"the",
"specified",
"host",
"name",
"and",
"port",
"into",
"a",
"list",
"of",
"address",
"."
] | ba06eafa1c1824bd154f1a380019e7ea2edf3c4c | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/resolver-dns/src/main/java/io/netty/resolver/dns/DnsNameResolver.java#L683-L693 | train | Resolves all the dns records in the specified inet host. | [
30522,
2270,
2345,
2925,
1026,
2862,
1026,
1999,
12928,
14141,
8303,
30524,
2862,
1026,
1999,
12928,
14141,
8303,
1028,
1028,
4872,
1007,
1063,
4638,
17048,
11231,
3363,
1006,
4872,
1010,
1000,
4872,
1000,
1007,
1025,
1040,
3619,
2890,
2710... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/Record.java | Record.writeVarLengthInt | private static final void writeVarLengthInt(DataOutput out, int value) throws IOException {
while (value >= MAX_BIT) {
out.write(value | MAX_BIT);
value >>= 7;
}
out.write(value);
} | java | private static final void writeVarLengthInt(DataOutput out, int value) throws IOException {
while (value >= MAX_BIT) {
out.write(value | MAX_BIT);
value >>= 7;
}
out.write(value);
} | [
"private",
"static",
"final",
"void",
"writeVarLengthInt",
"(",
"DataOutput",
"out",
",",
"int",
"value",
")",
"throws",
"IOException",
"{",
"while",
"(",
"value",
">=",
"MAX_BIT",
")",
"{",
"out",
".",
"write",
"(",
"value",
"|",
"MAX_BIT",
")",
";",
"v... | -------------------------------------------------------------------------------------------- | [
"--------------------------------------------------------------------------------------------"
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-core/src/main/java/org/apache/flink/types/Record.java#L1239-L1245 | train | Write var length int. | [
30522,
2797,
10763,
2345,
11675,
4339,
10755,
7770,
13512,
10606,
2102,
1006,
2951,
5833,
18780,
2041,
1010,
20014,
3643,
1007,
11618,
22834,
10288,
24422,
1063,
2096,
1006,
3643,
1028,
1027,
4098,
1035,
2978,
1007,
1063,
2041,
1012,
4339,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
netty/netty | handler/src/main/java/io/netty/handler/traffic/TrafficCounter.java | TrafficCounter.readTimeToWait | public long readTimeToWait(final long size, final long limitTraffic, final long maxTime, final long now) {
bytesRecvFlowControl(size);
if (size == 0 || limitTraffic == 0) {
return 0;
}
final long lastTimeCheck = lastTime.get();
long sum = currentReadBytes.get();
... | java | public long readTimeToWait(final long size, final long limitTraffic, final long maxTime, final long now) {
bytesRecvFlowControl(size);
if (size == 0 || limitTraffic == 0) {
return 0;
}
final long lastTimeCheck = lastTime.get();
long sum = currentReadBytes.get();
... | [
"public",
"long",
"readTimeToWait",
"(",
"final",
"long",
"size",
",",
"final",
"long",
"limitTraffic",
",",
"final",
"long",
"maxTime",
",",
"final",
"long",
"now",
")",
"{",
"bytesRecvFlowControl",
"(",
"size",
")",
";",
"if",
"(",
"size",
"==",
"0",
"... | Returns the time to wait (if any) for the given length message, using the given limitTraffic and the max wait
time.
@param size
the recv size
@param limitTraffic
the traffic limit in bytes per second
@param maxTime
the max time in ms to wait in case of excess of traffic.
@param now the current time
@return the current... | [
"Returns",
"the",
"time",
"to",
"wait",
"(",
"if",
"any",
")",
"for",
"the",
"given",
"length",
"message",
"using",
"the",
"given",
"limitTraffic",
"and",
"the",
"max",
"wait",
"time",
"."
] | ba06eafa1c1824bd154f1a380019e7ea2edf3c4c | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/handler/src/main/java/io/netty/handler/traffic/TrafficCounter.java#L498-L541 | train | readTimeToWait This method is used to determine how long to wait for a message to be read. | [
30522,
2270,
2146,
3191,
7292,
18790,
4886,
30524,
2146,
4098,
7292,
1010,
2345,
2146,
2085,
1007,
1063,
27507,
2890,
2278,
2615,
12314,
8663,
13181,
2140,
1006,
2946,
1007,
1025,
2065,
1006,
2946,
1027,
1027,
1014,
1064,
1064,
5787,
6494,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
looly/hutool | hutool-core/src/main/java/cn/hutool/core/collection/CollUtil.java | CollUtil.addAll | public static <T> Collection<T> addAll(Collection<T> collection, Iterable<T> iterable) {
return addAll(collection, iterable.iterator());
} | java | public static <T> Collection<T> addAll(Collection<T> collection, Iterable<T> iterable) {
return addAll(collection, iterable.iterator());
} | [
"public",
"static",
"<",
"T",
">",
"Collection",
"<",
"T",
">",
"addAll",
"(",
"Collection",
"<",
"T",
">",
"collection",
",",
"Iterable",
"<",
"T",
">",
"iterable",
")",
"{",
"return",
"addAll",
"(",
"collection",
",",
"iterable",
".",
"iterator",
"("... | 加入全部
@param <T> 集合元素类型
@param collection 被加入的集合 {@link Collection}
@param iterable 要加入的内容{@link Iterable}
@return 原集合 | [
"加入全部"
] | bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/collection/CollUtil.java#L1771-L1773 | train | Adds all elements from the iterable to the collection. | [
30522,
2270,
10763,
1026,
1056,
1028,
3074,
1026,
1056,
1028,
5587,
8095,
1006,
3074,
1026,
1056,
1028,
3074,
1010,
2009,
6906,
3468,
1026,
1056,
1028,
2009,
6906,
3468,
1007,
1063,
2709,
5587,
8095,
1006,
3074,
1010,
2009,
6906,
3468,
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... |
spring-projects/spring-boot | spring-boot-project/spring-boot-devtools/src/main/java/org/springframework/boot/devtools/tunnel/client/TunnelClient.java | TunnelClient.stop | public void stop() throws IOException {
synchronized (this.monitor) {
if (this.serverThread != null) {
this.serverThread.close();
try {
this.serverThread.join(2000);
}
catch (InterruptedException ex) {
Thread.currentThread().interrupt();
}
this.serverThread = null;
}
}
} | java | public void stop() throws IOException {
synchronized (this.monitor) {
if (this.serverThread != null) {
this.serverThread.close();
try {
this.serverThread.join(2000);
}
catch (InterruptedException ex) {
Thread.currentThread().interrupt();
}
this.serverThread = null;
}
}
} | [
"public",
"void",
"stop",
"(",
")",
"throws",
"IOException",
"{",
"synchronized",
"(",
"this",
".",
"monitor",
")",
"{",
"if",
"(",
"this",
".",
"serverThread",
"!=",
"null",
")",
"{",
"this",
".",
"serverThread",
".",
"close",
"(",
")",
";",
"try",
... | Stop the client, disconnecting any servers.
@throws IOException in case of I/O errors | [
"Stop",
"the",
"client",
"disconnecting",
"any",
"servers",
"."
] | 0b27f7c70e164b2b1a96477f1d9c1acba56790c1 | https://github.com/spring-projects/spring-boot/blob/0b27f7c70e164b2b1a96477f1d9c1acba56790c1/spring-boot-project/spring-boot-devtools/src/main/java/org/springframework/boot/devtools/tunnel/client/TunnelClient.java#L102-L115 | train | Stop the server. | [
30522,
2270,
11675,
2644,
1006,
1007,
11618,
22834,
10288,
24422,
1063,
25549,
1006,
2023,
1012,
8080,
1007,
1063,
2065,
1006,
2023,
1012,
8241,
2705,
16416,
2094,
999,
1027,
19701,
1007,
1063,
2023,
1012,
8241,
2705,
16416,
2094,
1012,
248... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
looly/hutool | hutool-db/src/main/java/cn/hutool/db/SqlConnRunner.java | SqlConnRunner.update | public int update(Connection conn, Entity record, Entity where) throws SQLException {
checkConn(conn);
if(CollectionUtil.isEmpty(record)){
throw new SQLException("Empty entity provided!");
}
if(CollectionUtil.isEmpty(where)){
//不允许做全表更新
throw new SQLException("Empty where provided!");
}
... | java | public int update(Connection conn, Entity record, Entity where) throws SQLException {
checkConn(conn);
if(CollectionUtil.isEmpty(record)){
throw new SQLException("Empty entity provided!");
}
if(CollectionUtil.isEmpty(where)){
//不允许做全表更新
throw new SQLException("Empty where provided!");
}
... | [
"public",
"int",
"update",
"(",
"Connection",
"conn",
",",
"Entity",
"record",
",",
"Entity",
"where",
")",
"throws",
"SQLException",
"{",
"checkConn",
"(",
"conn",
")",
";",
"if",
"(",
"CollectionUtil",
".",
"isEmpty",
"(",
"record",
")",
")",
"{",
"thr... | 更新数据<br>
此方法不会关闭Connection
@param conn 数据库连接
@param record 记录
@param where 条件
@return 影响行数
@throws SQLException SQL执行异常 | [
"更新数据<br",
">",
"此方法不会关闭Connection"
] | bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-db/src/main/java/cn/hutool/db/SqlConnRunner.java#L263-L290 | train | Updates the specified entity in the database. | [
30522,
2270,
20014,
10651,
1006,
4434,
9530,
2078,
1010,
9178,
2501,
1010,
9178,
2073,
1007,
11618,
29296,
10288,
24422,
1063,
4638,
8663,
2078,
1006,
9530,
2078,
1007,
1025,
2065,
1006,
3074,
21823,
2140,
1012,
2003,
6633,
13876,
2100,
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/util/FileUtils.java | FileUtils.writeCompletely | public static void writeCompletely(WritableByteChannel channel, ByteBuffer src) throws IOException {
while (src.hasRemaining()) {
channel.write(src);
}
} | java | public static void writeCompletely(WritableByteChannel channel, ByteBuffer src) throws IOException {
while (src.hasRemaining()) {
channel.write(src);
}
} | [
"public",
"static",
"void",
"writeCompletely",
"(",
"WritableByteChannel",
"channel",
",",
"ByteBuffer",
"src",
")",
"throws",
"IOException",
"{",
"while",
"(",
"src",
".",
"hasRemaining",
"(",
")",
")",
"{",
"channel",
".",
"write",
"(",
"src",
")",
";",
... | ------------------------------------------------------------------------ | [
"------------------------------------------------------------------------"
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-core/src/main/java/org/apache/flink/util/FileUtils.java#L74-L78 | train | Write a complete ByteBuffer to a channel. | [
30522,
2270,
10763,
11675,
4339,
9006,
10814,
9834,
2100,
1006,
25697,
3085,
3762,
15007,
20147,
2140,
3149,
1010,
24880,
8569,
12494,
5034,
2278,
1007,
11618,
22834,
10288,
24422,
1063,
2096,
1006,
5034,
2278,
1012,
2038,
28578,
8113,
2075,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
apache/flink | flink-libraries/flink-cep/src/main/java/org/apache/flink/cep/PatternStream.java | PatternStream.flatSelect | public <L, R> SingleOutputStreamOperator<R> flatSelect(
final OutputTag<L> timedOutPartialMatchesTag,
final PatternFlatTimeoutFunction<T, L> patternFlatTimeoutFunction,
final TypeInformation<R> outTypeInfo,
final PatternFlatSelectFunction<T, R> patternFlatSelectFunction) {
final PatternProcessFunction<T,... | java | public <L, R> SingleOutputStreamOperator<R> flatSelect(
final OutputTag<L> timedOutPartialMatchesTag,
final PatternFlatTimeoutFunction<T, L> patternFlatTimeoutFunction,
final TypeInformation<R> outTypeInfo,
final PatternFlatSelectFunction<T, R> patternFlatSelectFunction) {
final PatternProcessFunction<T,... | [
"public",
"<",
"L",
",",
"R",
">",
"SingleOutputStreamOperator",
"<",
"R",
">",
"flatSelect",
"(",
"final",
"OutputTag",
"<",
"L",
">",
"timedOutPartialMatchesTag",
",",
"final",
"PatternFlatTimeoutFunction",
"<",
"T",
",",
"L",
">",
"patternFlatTimeoutFunction",
... | Applies a flat select function to the detected pattern sequence. For each pattern sequence the
provided {@link PatternFlatSelectFunction} is called. The pattern select function can produce
exactly one resulting element.
<p>Applies a timeout function to a partial pattern sequence which has timed out. For each
partial p... | [
"Applies",
"a",
"flat",
"select",
"function",
"to",
"the",
"detected",
"pattern",
"sequence",
".",
"For",
"each",
"pattern",
"sequence",
"the",
"provided",
"{",
"@link",
"PatternFlatSelectFunction",
"}",
"is",
"called",
".",
"The",
"pattern",
"select",
"function... | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-libraries/flink-cep/src/main/java/org/apache/flink/cep/PatternStream.java#L440-L452 | train | Flat select. | [
30522,
2270,
1026,
1048,
1010,
1054,
1028,
2309,
5833,
18780,
21422,
25918,
8844,
1026,
1054,
1028,
14201,
12260,
6593,
1006,
2345,
6434,
15900,
1026,
1048,
1028,
22313,
5833,
19362,
20925,
18900,
8376,
15900,
1010,
2345,
5418,
10258,
19321,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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.splitsOrderedBy | public SplitDataProperties<T> splitsOrderedBy(String orderFields, Order[] orders) {
if (orderFields == null || orders == null) {
throw new InvalidProgramException("OrderFields or Orders may not be null.");
}
String[] orderKeysA = orderFields.split(";");
if (orderKeysA.length == 0) {
throw new InvalidPro... | java | public SplitDataProperties<T> splitsOrderedBy(String orderFields, Order[] orders) {
if (orderFields == null || orders == null) {
throw new InvalidProgramException("OrderFields or Orders may not be null.");
}
String[] orderKeysA = orderFields.split(";");
if (orderKeysA.length == 0) {
throw new InvalidPro... | [
"public",
"SplitDataProperties",
"<",
"T",
">",
"splitsOrderedBy",
"(",
"String",
"orderFields",
",",
"Order",
"[",
"]",
"orders",
")",
"{",
"if",
"(",
"orderFields",
"==",
"null",
"||",
"orders",
"==",
"null",
")",
"{",
"throw",
"new",
"InvalidProgramExcept... | Defines that the data within an input split is sorted on the fields defined by the field expressions
in the specified orders. Multiple field expressions must be separated by the semicolon ';' character.
All records of an input split must be emitted by the input format in the defined order.
<p><b>
IMPORTANT: Providing ... | [
"Defines",
"that",
"the",
"data",
"within",
"an",
"input",
"split",
"is",
"sorted",
"on",
"the",
"fields",
"defined",
"by",
"the",
"field",
"expressions",
"in",
"the",
"specified",
"orders",
".",
"Multiple",
"field",
"expressions",
"must",
"be",
"separated",
... | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-java/src/main/java/org/apache/flink/api/java/io/SplitDataProperties.java#L312-L350 | train | Splits the data in the data source in order by the specified fields. | [
30522,
2270,
3975,
2850,
2696,
21572,
4842,
7368,
1026,
1056,
1028,
19584,
8551,
6850,
3762,
1006,
5164,
2344,
15155,
1010,
2344,
1031,
1033,
4449,
1007,
1063,
2065,
1006,
2344,
15155,
1027,
1027,
19701,
1064,
1064,
4449,
1027,
1027,
19701,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
hankcs/HanLP | src/main/java/com/hankcs/hanlp/dependency/nnparser/NeuralNetworkParser.java | NeuralNetworkParser.DEPREL | int DEPREL(final List<Integer> deprels, int id)
{
return ((id != -1) ? (deprels.get(id) + kDeprelInFeaturespace) : kNilDeprel);
} | java | int DEPREL(final List<Integer> deprels, int id)
{
return ((id != -1) ? (deprels.get(id) + kDeprelInFeaturespace) : kNilDeprel);
} | [
"int",
"DEPREL",
"(",
"final",
"List",
"<",
"Integer",
">",
"deprels",
",",
"int",
"id",
")",
"{",
"return",
"(",
"(",
"id",
"!=",
"-",
"1",
")",
"?",
"(",
"deprels",
".",
"get",
"(",
"id",
")",
"+",
"kDeprelInFeaturespace",
")",
":",
"kNilDeprel",... | 获取依存
@param deprels 依存列表
@param id 依存下标
@return 依存 | [
"获取依存"
] | a538d0722ab2e4980a9dcd9ea40324fc3ddba7ce | https://github.com/hankcs/HanLP/blob/a538d0722ab2e4980a9dcd9ea40324fc3ddba7ce/src/main/java/com/hankcs/hanlp/dependency/nnparser/NeuralNetworkParser.java#L650-L653 | train | Get the DEPREL value for a given ID. | [
30522,
20014,
2139,
28139,
2140,
1006,
2345,
2862,
1026,
16109,
1028,
2139,
28139,
4877,
1010,
20014,
8909,
1007,
1063,
2709,
1006,
1006,
8909,
999,
1027,
1011,
1015,
1007,
1029,
1006,
2139,
28139,
4877,
1012,
2131,
1006,
8909,
1007,
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... |
apache/flink | flink-runtime/src/main/java/org/apache/flink/runtime/jobgraph/JobVertex.java | JobVertex.getInvokableClass | public Class<? extends AbstractInvokable> getInvokableClass(ClassLoader cl) {
if (cl == null) {
throw new NullPointerException("The classloader must not be null.");
}
if (invokableClassName == null) {
return null;
}
try {
return Class.forName(invokableClassName, true, cl).asSubclass(AbstractInvokabl... | java | public Class<? extends AbstractInvokable> getInvokableClass(ClassLoader cl) {
if (cl == null) {
throw new NullPointerException("The classloader must not be null.");
}
if (invokableClassName == null) {
return null;
}
try {
return Class.forName(invokableClassName, true, cl).asSubclass(AbstractInvokabl... | [
"public",
"Class",
"<",
"?",
"extends",
"AbstractInvokable",
">",
"getInvokableClass",
"(",
"ClassLoader",
"cl",
")",
"{",
"if",
"(",
"cl",
"==",
"null",
")",
"{",
"throw",
"new",
"NullPointerException",
"(",
"\"The classloader must not be null.\"",
")",
";",
"}... | Returns the invokable class which represents the task of this vertex
@param cl The classloader used to resolve user-defined classes
@return The invokable class, <code>null</code> if it is not set | [
"Returns",
"the",
"invokable",
"class",
"which",
"represents",
"the",
"task",
"of",
"this",
"vertex"
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/jobgraph/JobVertex.java#L257-L274 | train | Returns the user - code class that is invoked by the specified classloader. | [
30522,
2270,
2465,
1026,
1029,
8908,
10061,
2378,
6767,
2912,
3468,
1028,
2131,
2378,
6767,
2912,
3468,
26266,
1006,
2465,
11066,
2121,
18856,
1007,
1063,
2065,
1006,
18856,
1027,
1027,
19701,
1007,
1063,
5466,
2047,
19701,
8400,
7869,
2595... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
hankcs/HanLP | src/main/java/com/hankcs/hanlp/model/perceptron/utility/Utility.java | Utility.convertSentenceToNER | public static List<String[]> convertSentenceToNER(Sentence sentence, NERTagSet tagSet)
{
List<String[]> collector = new LinkedList<String[]>();
Set<String> nerLabels = tagSet.nerLabels;
for (IWord word : sentence.wordList)
{
if (word instanceof CompoundWord)
{... | java | public static List<String[]> convertSentenceToNER(Sentence sentence, NERTagSet tagSet)
{
List<String[]> collector = new LinkedList<String[]>();
Set<String> nerLabels = tagSet.nerLabels;
for (IWord word : sentence.wordList)
{
if (word instanceof CompoundWord)
{... | [
"public",
"static",
"List",
"<",
"String",
"[",
"]",
">",
"convertSentenceToNER",
"(",
"Sentence",
"sentence",
",",
"NERTagSet",
"tagSet",
")",
"{",
"List",
"<",
"String",
"[",
"]",
">",
"collector",
"=",
"new",
"LinkedList",
"<",
"String",
"[",
"]",
">"... | 将句子转换为 (单词,词性,NER标签)三元组
@param sentence
@param tagSet
@return | [
"将句子转换为",
"(单词,词性,NER标签)三元组"
] | a538d0722ab2e4980a9dcd9ea40324fc3ddba7ce | https://github.com/hankcs/HanLP/blob/a538d0722ab2e4980a9dcd9ea40324fc3ddba7ce/src/main/java/com/hankcs/hanlp/model/perceptron/utility/Utility.java#L316-L359 | train | Convert sentence to nER tag set | [
30522,
2270,
10763,
2862,
1026,
5164,
1031,
1033,
1028,
19884,
15781,
5897,
5524,
2099,
1006,
6251,
6251,
1010,
11265,
13320,
5620,
3388,
22073,
3388,
1007,
1063,
2862,
1026,
5164,
1031,
1033,
1028,
10018,
1027,
2047,
5799,
9863,
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/io/IoUtil.java | IoUtil.toStream | public static ByteArrayInputStream toStream(String content, String charsetName) {
return toStream(content, CharsetUtil.charset(charsetName));
} | java | public static ByteArrayInputStream toStream(String content, String charsetName) {
return toStream(content, CharsetUtil.charset(charsetName));
} | [
"public",
"static",
"ByteArrayInputStream",
"toStream",
"(",
"String",
"content",
",",
"String",
"charsetName",
")",
"{",
"return",
"toStream",
"(",
"content",
",",
"CharsetUtil",
".",
"charset",
"(",
"charsetName",
")",
")",
";",
"}"
] | String 转为流
@param content 内容
@param charsetName 编码
@return 字节流 | [
"String",
"转为流"
] | bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/io/IoUtil.java#L739-L741 | train | Converts a String to an InputStream. | [
30522,
2270,
10763,
24880,
2906,
9447,
2378,
18780,
21422,
2000,
21422,
1006,
5164,
4180,
1010,
5164,
25869,
13462,
18442,
1007,
1063,
2709,
2000,
21422,
1006,
4180,
1010,
25869,
13462,
21823,
2140,
1012,
25869,
13462,
1006,
25869,
13462,
184... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/server/src/org/openqa/grid/internal/utils/SelfRegisteringRemote.java | SelfRegisteringRemote.addBrowser | public void addBrowser(DesiredCapabilities cap, int instances) {
String s = cap.getBrowserName();
if (s == null || "".equals(s)) {
throw new InvalidParameterException(cap + " does seems to be a valid browser.");
}
if (cap.getPlatform() == null) {
cap.setPlatform(Platform.getCurrent());
}... | java | public void addBrowser(DesiredCapabilities cap, int instances) {
String s = cap.getBrowserName();
if (s == null || "".equals(s)) {
throw new InvalidParameterException(cap + " does seems to be a valid browser.");
}
if (cap.getPlatform() == null) {
cap.setPlatform(Platform.getCurrent());
}... | [
"public",
"void",
"addBrowser",
"(",
"DesiredCapabilities",
"cap",
",",
"int",
"instances",
")",
"{",
"String",
"s",
"=",
"cap",
".",
"getBrowserName",
"(",
")",
";",
"if",
"(",
"s",
"==",
"null",
"||",
"\"\"",
".",
"equals",
"(",
"s",
")",
")",
"{",... | Adding the browser described by the capability, automatically finding out what platform the
node is launched from
@param cap describing the browser
@param instances number of times this browser can be started on the node. | [
"Adding",
"the",
"browser",
"described",
"by",
"the",
"capability",
"automatically",
"finding",
"out",
"what",
"platform",
"the",
"node",
"is",
"launched",
"from"
] | 7af172729f17b20269c8ca4ea6f788db48616535 | https://github.com/SeleniumHQ/selenium/blob/7af172729f17b20269c8ca4ea6f788db48616535/java/server/src/org/openqa/grid/internal/utils/SelfRegisteringRemote.java#L139-L150 | train | Add a browser to the configuration | [
30522,
2270,
11675,
5587,
12618,
9333,
2121,
1006,
9059,
17695,
28518,
15909,
3111,
6178,
1010,
20014,
12107,
1007,
1063,
5164,
1055,
1027,
6178,
1012,
2131,
12618,
9333,
30524,
1063,
5466,
2047,
19528,
28689,
22828,
10288,
24422,
1006,
6178,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
apache/flink | flink-table/flink-sql-client/src/main/java/org/apache/flink/table/client/cli/CliClient.java | CliClient.createDefaultTerminal | private static Terminal createDefaultTerminal() {
try {
return TerminalBuilder.builder()
.name(CliStrings.CLI_NAME)
.build();
} catch (IOException e) {
throw new SqlClientException("Error opening command line interface.", e);
}
} | java | private static Terminal createDefaultTerminal() {
try {
return TerminalBuilder.builder()
.name(CliStrings.CLI_NAME)
.build();
} catch (IOException e) {
throw new SqlClientException("Error opening command line interface.", e);
}
} | [
"private",
"static",
"Terminal",
"createDefaultTerminal",
"(",
")",
"{",
"try",
"{",
"return",
"TerminalBuilder",
".",
"builder",
"(",
")",
".",
"name",
"(",
"CliStrings",
".",
"CLI_NAME",
")",
".",
"build",
"(",
")",
";",
"}",
"catch",
"(",
"IOException",... | -------------------------------------------------------------------------------------------- | [
"--------------------------------------------------------------------------------------------"
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-table/flink-sql-client/src/main/java/org/apache/flink/table/client/cli/CliClient.java#L554-L562 | train | Creates a Terminal instance with default settings. | [
30522,
2797,
10763,
5536,
2580,
12879,
23505,
3334,
22311,
2140,
1006,
1007,
1063,
3046,
1063,
2709,
5536,
8569,
23891,
2099,
1012,
12508,
1006,
1007,
1012,
2171,
1006,
18856,
2923,
4892,
2015,
1012,
18856,
2072,
1035,
2171,
1007,
1012,
385... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
apache/flink | flink-table/flink-table-runtime-blink/src/main/java/org/apache/flink/table/generated/CompileUtils.java | CompileUtils.compile | public static <T> Class<T> compile(ClassLoader cl, String name, String code) {
Tuple2<ClassLoader, String> cacheKey = Tuple2.of(cl, name);
Class<?> clazz = COMPILED_CACHE.getIfPresent(cacheKey);
if (clazz == null) {
clazz = doCompile(cl, name, code);
COMPILED_CACHE.put(cacheKey, clazz);
}
//noinspection... | java | public static <T> Class<T> compile(ClassLoader cl, String name, String code) {
Tuple2<ClassLoader, String> cacheKey = Tuple2.of(cl, name);
Class<?> clazz = COMPILED_CACHE.getIfPresent(cacheKey);
if (clazz == null) {
clazz = doCompile(cl, name, code);
COMPILED_CACHE.put(cacheKey, clazz);
}
//noinspection... | [
"public",
"static",
"<",
"T",
">",
"Class",
"<",
"T",
">",
"compile",
"(",
"ClassLoader",
"cl",
",",
"String",
"name",
",",
"String",
"code",
")",
"{",
"Tuple2",
"<",
"ClassLoader",
",",
"String",
">",
"cacheKey",
"=",
"Tuple2",
".",
"of",
"(",
"cl",... | Compiles a generated code to a Class.
@param cl the ClassLoader used to load the class
@param name the class name
@param code the generated code
@param <T> the class type
@return the compiled class | [
"Compiles",
"a",
"generated",
"code",
"to",
"a",
"Class",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-table/flink-table-runtime-blink/src/main/java/org/apache/flink/table/generated/CompileUtils.java#L61-L70 | train | Compile a class with the given name and code. | [
30522,
2270,
10763,
1026,
1056,
1028,
2465,
1026,
1056,
1028,
4012,
22090,
1006,
2465,
11066,
2121,
18856,
1010,
5164,
2171,
1010,
5164,
3642,
1007,
1063,
10722,
10814,
2475,
1026,
2465,
11066,
2121,
1010,
5164,
1028,
17053,
14839,
1027,
10... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
apache/flink | flink-yarn/src/main/java/org/apache/flink/yarn/Utils.java | Utils.createTaskExecutorContext | static ContainerLaunchContext createTaskExecutorContext(
org.apache.flink.configuration.Configuration flinkConfig,
YarnConfiguration yarnConfig,
Map<String, String> env,
ContaineredTaskManagerParameters tmParams,
org.apache.flink.configuration.Configuration taskManagerConfig,
String workingDirectory,
Clas... | java | static ContainerLaunchContext createTaskExecutorContext(
org.apache.flink.configuration.Configuration flinkConfig,
YarnConfiguration yarnConfig,
Map<String, String> env,
ContaineredTaskManagerParameters tmParams,
org.apache.flink.configuration.Configuration taskManagerConfig,
String workingDirectory,
Clas... | [
"static",
"ContainerLaunchContext",
"createTaskExecutorContext",
"(",
"org",
".",
"apache",
".",
"flink",
".",
"configuration",
".",
"Configuration",
"flinkConfig",
",",
"YarnConfiguration",
"yarnConfig",
",",
"Map",
"<",
"String",
",",
"String",
">",
"env",
",",
... | Creates the launch context, which describes how to bring up a TaskExecutor / TaskManager process in
an allocated YARN container.
<p>This code is extremely YARN specific and registers all the resources that the TaskExecutor
needs (such as JAR file, config file, ...) and all environment variables in a YARN
container lau... | [
"Creates",
"the",
"launch",
"context",
"which",
"describes",
"how",
"to",
"bring",
"up",
"a",
"TaskExecutor",
"/",
"TaskManager",
"process",
"in",
"an",
"allocated",
"YARN",
"container",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-yarn/src/main/java/org/apache/flink/yarn/Utils.java#L380-L579 | train | Create a new container executor context. | [
30522,
10763,
11661,
17298,
12680,
8663,
18209,
3443,
10230,
3489,
2595,
8586,
16161,
29566,
10111,
18413,
1006,
8917,
1012,
15895,
1012,
13109,
19839,
1012,
9563,
1012,
9563,
13109,
19839,
8663,
8873,
2290,
1010,
27158,
8663,
8873,
27390,
33... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
SeleniumHQ/selenium | java/client/src/org/openqa/selenium/net/NetworkUtils.java | NetworkUtils.getNonLoopbackAddressOfThisMachine | public String getNonLoopbackAddressOfThisMachine() {
InetAddress ip4NonLoopbackAddressOfThisMachine = getIp4NonLoopbackAddressOfThisMachine();
if (! Objects.equals(cachedIp4NonLoopbackAddressOfThisMachine, ip4NonLoopbackAddressOfThisMachine)) {
cachedIp4NonLoopbackAddressOfThisMachine = ip4NonLoopbackAddr... | java | public String getNonLoopbackAddressOfThisMachine() {
InetAddress ip4NonLoopbackAddressOfThisMachine = getIp4NonLoopbackAddressOfThisMachine();
if (! Objects.equals(cachedIp4NonLoopbackAddressOfThisMachine, ip4NonLoopbackAddressOfThisMachine)) {
cachedIp4NonLoopbackAddressOfThisMachine = ip4NonLoopbackAddr... | [
"public",
"String",
"getNonLoopbackAddressOfThisMachine",
"(",
")",
"{",
"InetAddress",
"ip4NonLoopbackAddressOfThisMachine",
"=",
"getIp4NonLoopbackAddressOfThisMachine",
"(",
")",
";",
"if",
"(",
"!",
"Objects",
".",
"equals",
"(",
"cachedIp4NonLoopbackAddressOfThisMachine"... | Used by the mobile emulators that refuse to access localhost or 127.0.0.1 The IP4/IP6
requirements of this method are as-of-yet unspecified, but we return the string that is
associated with the IP4 interface
@return A String representing the host name or non-loopback IP4 address of this machine. | [
"Used",
"by",
"the",
"mobile",
"emulators",
"that",
"refuse",
"to",
"access",
"localhost",
"or",
"127",
".",
"0",
".",
"0",
".",
"1",
"The",
"IP4",
"/",
"IP6",
"requirements",
"of",
"this",
"method",
"are",
"as",
"-",
"of",
"-",
"yet",
"unspecified",
... | 7af172729f17b20269c8ca4ea6f788db48616535 | https://github.com/SeleniumHQ/selenium/blob/7af172729f17b20269c8ca4ea6f788db48616535/java/client/src/org/openqa/selenium/net/NetworkUtils.java#L84-L91 | train | Get the Non - loopback address of this machine. | [
30522,
2270,
5164,
2131,
8540,
4135,
7361,
5963,
4215,
16200,
24137,
6199,
23108,
21046,
2638,
1006,
1007,
1063,
1999,
12928,
14141,
8303,
12997,
2549,
8540,
4135,
7361,
5963,
4215,
16200,
24137,
6199,
23108,
21046,
2638,
1027,
2131,
11514,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
looly/hutool | hutool-extra/src/main/java/cn/hutool/extra/ftp/Ftp.java | Ftp.lsFiles | public FTPFile[] lsFiles(String path){
String pwd = null;
if(StrUtil.isNotBlank(path)) {
pwd = pwd();
cd(path);
}
FTPFile[] ftpFiles;
try {
ftpFiles = this.client.listFiles();
} catch (IOException e) {
throw new FtpException(e);
}
if(StrUtil.isNotBlank(pwd)) {
// 回到原目... | java | public FTPFile[] lsFiles(String path){
String pwd = null;
if(StrUtil.isNotBlank(path)) {
pwd = pwd();
cd(path);
}
FTPFile[] ftpFiles;
try {
ftpFiles = this.client.listFiles();
} catch (IOException e) {
throw new FtpException(e);
}
if(StrUtil.isNotBlank(pwd)) {
// 回到原目... | [
"public",
"FTPFile",
"[",
"]",
"lsFiles",
"(",
"String",
"path",
")",
"{",
"String",
"pwd",
"=",
"null",
";",
"if",
"(",
"StrUtil",
".",
"isNotBlank",
"(",
"path",
")",
")",
"{",
"pwd",
"=",
"pwd",
"(",
")",
";",
"cd",
"(",
"path",
")",
";",
"}... | 遍历某个目录下所有文件和目录,不会递归遍历
@param path 目录
@return 文件或目录列表 | [
"遍历某个目录下所有文件和目录,不会递归遍历"
] | bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-extra/src/main/java/cn/hutool/extra/ftp/Ftp.java#L250-L270 | train | Gets the contents of a directory and its contents. | [
30522,
2270,
3027,
14376,
9463,
1031,
1033,
1048,
22747,
9463,
2015,
1006,
5164,
4130,
1007,
1063,
5164,
1052,
21724,
1027,
19701,
1025,
2065,
1006,
2358,
22134,
4014,
1012,
3475,
4140,
28522,
8950,
1006,
4130,
1007,
1007,
1063,
1052,
21724... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
apache/flink | flink-runtime/src/main/java/org/apache/flink/runtime/checkpoint/hooks/MasterHooks.java | MasterHooks.restoreMasterHooks | public static void restoreMasterHooks(
final Map<String, MasterTriggerRestoreHook<?>> masterHooks,
final Collection<MasterState> states,
final long checkpointId,
final boolean allowUnmatchedState,
final Logger log) throws FlinkException {
// early out
if (states == null || states.isEmpty() || master... | java | public static void restoreMasterHooks(
final Map<String, MasterTriggerRestoreHook<?>> masterHooks,
final Collection<MasterState> states,
final long checkpointId,
final boolean allowUnmatchedState,
final Logger log) throws FlinkException {
// early out
if (states == null || states.isEmpty() || master... | [
"public",
"static",
"void",
"restoreMasterHooks",
"(",
"final",
"Map",
"<",
"String",
",",
"MasterTriggerRestoreHook",
"<",
"?",
">",
">",
"masterHooks",
",",
"final",
"Collection",
"<",
"MasterState",
">",
"states",
",",
"final",
"long",
"checkpointId",
",",
... | Calls the restore method given checkpoint master hooks and passes the given master
state to them where state with a matching name is found.
<p>If state is found and no hook with the same name is found, the method throws an
exception, unless the {@code allowUnmatchedState} flag is set.
@param masterHooks The hooks to ... | [
"Calls",
"the",
"restore",
"method",
"given",
"checkpoint",
"master",
"hooks",
"and",
"passes",
"the",
"given",
"master",
"state",
"to",
"them",
"where",
"state",
"with",
"a",
"matching",
"name",
"is",
"found",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/checkpoint/hooks/MasterHooks.java#L225-L276 | train | Restore the master hooks. | [
30522,
2270,
10763,
11675,
9239,
8706,
6806,
6559,
2015,
1006,
2345,
4949,
1026,
5164,
1010,
3040,
18886,
13327,
28533,
5686,
6806,
6559,
1026,
1029,
1028,
1028,
3040,
6806,
6559,
2015,
1010,
2345,
3074,
1026,
5972,
12259,
1028,
2163,
1010,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
apache/flink | flink-libraries/flink-gelly/src/main/java/org/apache/flink/graph/Graph.java | Graph.groupReduceOnEdges | public <T> DataSet<T> groupReduceOnEdges(EdgesFunctionWithVertexValue<K, VV, EV, T> edgesFunction,
EdgeDirection direction) throws IllegalArgumentException {
switch (direction) {
case IN:
return vertices.coGroup(edges).where(0).equalTo(1)
.with(new ApplyCoGroupFunction<>(edgesFunction)).name("GroupReduc... | java | public <T> DataSet<T> groupReduceOnEdges(EdgesFunctionWithVertexValue<K, VV, EV, T> edgesFunction,
EdgeDirection direction) throws IllegalArgumentException {
switch (direction) {
case IN:
return vertices.coGroup(edges).where(0).equalTo(1)
.with(new ApplyCoGroupFunction<>(edgesFunction)).name("GroupReduc... | [
"public",
"<",
"T",
">",
"DataSet",
"<",
"T",
">",
"groupReduceOnEdges",
"(",
"EdgesFunctionWithVertexValue",
"<",
"K",
",",
"VV",
",",
"EV",
",",
"T",
">",
"edgesFunction",
",",
"EdgeDirection",
"direction",
")",
"throws",
"IllegalArgumentException",
"{",
"sw... | Groups by vertex and computes a GroupReduce transformation over the edge values of each vertex.
The edgesFunction applied on the edges has access to both the id and the value
of the grouping vertex.
<p>For each vertex, the edgesFunction can iterate over all edges of this vertex
with the specified direction, and emit a... | [
"Groups",
"by",
"vertex",
"and",
"computes",
"a",
"GroupReduce",
"transformation",
"over",
"the",
"edge",
"values",
"of",
"each",
"vertex",
".",
"The",
"edgesFunction",
"applied",
"on",
"the",
"edges",
"has",
"access",
"to",
"both",
"the",
"id",
"and",
"the"... | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-libraries/flink-gelly/src/main/java/org/apache/flink/graph/Graph.java#L1006-L1024 | train | Group reduce on edges. | [
30522,
2270,
1026,
1056,
1028,
2951,
13462,
1026,
1056,
1028,
2177,
5596,
18796,
17799,
8449,
1006,
7926,
11263,
27989,
24415,
16874,
10288,
10175,
5657,
1026,
1047,
1010,
1058,
2615,
1010,
23408,
1010,
1056,
1028,
7926,
11263,
27989,
1010,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
netty/netty | codec-http2/src/main/java/io/netty/handler/codec/http2/WeightedFairQueueByteDistributor.java | WeightedFairQueueByteDistributor.isChild | boolean isChild(int childId, int parentId, short weight) {
State parent = state(parentId);
State child;
return parent.children.containsKey(childId) &&
(child = state(childId)).parent == parent && child.weight == weight;
} | java | boolean isChild(int childId, int parentId, short weight) {
State parent = state(parentId);
State child;
return parent.children.containsKey(childId) &&
(child = state(childId)).parent == parent && child.weight == weight;
} | [
"boolean",
"isChild",
"(",
"int",
"childId",
",",
"int",
"parentId",
",",
"short",
"weight",
")",
"{",
"State",
"parent",
"=",
"state",
"(",
"parentId",
")",
";",
"State",
"child",
";",
"return",
"parent",
".",
"children",
".",
"containsKey",
"(",
"child... | For testing only! | [
"For",
"testing",
"only!"
] | ba06eafa1c1824bd154f1a380019e7ea2edf3c4c | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/codec-http2/src/main/java/io/netty/handler/codec/http2/WeightedFairQueueByteDistributor.java#L357-L362 | train | Is child. | [
30522,
22017,
20898,
2003,
19339,
1006,
20014,
2775,
3593,
1010,
20014,
6687,
3593,
1010,
2460,
3635,
1007,
1063,
2110,
6687,
1027,
2110,
1006,
6687,
3593,
1007,
1025,
2110,
2775,
1025,
2709,
6687,
1012,
2336,
1012,
3397,
14839,
1006,
2775,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
apache/flink | flink-table/flink-table-runtime-blink/src/main/java/org/apache/flink/table/runtime/functions/SqlDateTimeUtils.java | SqlDateTimeUtils.dateFormat | public static String dateFormat(String dateStr, String fromFormat, String toFormat, TimeZone tz) {
SimpleDateFormat fromFormatter = FORMATTER_CACHE.get(fromFormat);
fromFormatter.setTimeZone(tz);
SimpleDateFormat toFormatter = FORMATTER_CACHE.get(toFormat);
toFormatter.setTimeZone(tz);
try {
return toForma... | java | public static String dateFormat(String dateStr, String fromFormat, String toFormat, TimeZone tz) {
SimpleDateFormat fromFormatter = FORMATTER_CACHE.get(fromFormat);
fromFormatter.setTimeZone(tz);
SimpleDateFormat toFormatter = FORMATTER_CACHE.get(toFormat);
toFormatter.setTimeZone(tz);
try {
return toForma... | [
"public",
"static",
"String",
"dateFormat",
"(",
"String",
"dateStr",
",",
"String",
"fromFormat",
",",
"String",
"toFormat",
",",
"TimeZone",
"tz",
")",
"{",
"SimpleDateFormat",
"fromFormatter",
"=",
"FORMATTER_CACHE",
".",
"get",
"(",
"fromFormat",
")",
";",
... | Format a string datetime as specific.
@param dateStr the string datetime.
@param fromFormat the original date format.
@param toFormat the target date format.
@param tz the time zone. | [
"Format",
"a",
"string",
"datetime",
"as",
"specific",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-table/flink-table-runtime-blink/src/main/java/org/apache/flink/table/runtime/functions/SqlDateTimeUtils.java#L340-L352 | train | Format a date string using the given formats. | [
30522,
2270,
10763,
5164,
3058,
14192,
4017,
1006,
5164,
5246,
16344,
1010,
5164,
2013,
14192,
4017,
1010,
5164,
2000,
14192,
4017,
1010,
2051,
15975,
1056,
2480,
1007,
1063,
3722,
13701,
14192,
4017,
2013,
14192,
20097,
1027,
4289,
3334,
1... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
hankcs/HanLP | src/main/java/com/hankcs/hanlp/seg/WordBasedSegment.java | WordBasedSegment.mergeContinueNumIntoOne | private static void mergeContinueNumIntoOne(List<Vertex> linkedArray)
{
if (linkedArray.size() < 2)
return;
ListIterator<Vertex> listIterator = linkedArray.listIterator();
Vertex next = listIterator.next();
Vertex current = next;
while (listIterator.hasNext())
... | java | private static void mergeContinueNumIntoOne(List<Vertex> linkedArray)
{
if (linkedArray.size() < 2)
return;
ListIterator<Vertex> listIterator = linkedArray.listIterator();
Vertex next = listIterator.next();
Vertex current = next;
while (listIterator.hasNext())
... | [
"private",
"static",
"void",
"mergeContinueNumIntoOne",
"(",
"List",
"<",
"Vertex",
">",
"linkedArray",
")",
"{",
"if",
"(",
"linkedArray",
".",
"size",
"(",
")",
"<",
"2",
")",
"return",
";",
"ListIterator",
"<",
"Vertex",
">",
"listIterator",
"=",
"linke... | 将连续的数字节点合并为一个
@param linkedArray | [
"将连续的数字节点合并为一个"
] | a538d0722ab2e4980a9dcd9ea40324fc3ddba7ce | https://github.com/hankcs/HanLP/blob/a538d0722ab2e4980a9dcd9ea40324fc3ddba7ce/src/main/java/com/hankcs/hanlp/seg/WordBasedSegment.java#L345-L379 | train | Merge continue num into one. | [
30522,
2797,
10763,
11675,
13590,
8663,
7629,
24997,
12717,
13663,
5643,
1006,
2862,
1026,
19449,
1028,
5799,
2906,
9447,
1007,
1063,
2065,
1006,
5799,
2906,
9447,
1012,
2946,
1006,
1007,
1026,
1016,
1007,
2709,
1025,
2862,
21646,
8844,
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-poi/src/main/java/cn/hutool/poi/excel/ExcelWriter.java | ExcelWriter.getInitedAliasComparator | private Comparator<String> getInitedAliasComparator() {
if (MapUtil.isEmpty(this.headerAlias)) {
return null;
}
Comparator<String> aliasComparator = this.aliasComparator;
if (null == aliasComparator) {
Set<String> keySet = this.headerAlias.keySet();
aliasComparator = new IndexedComparator<>(keyS... | java | private Comparator<String> getInitedAliasComparator() {
if (MapUtil.isEmpty(this.headerAlias)) {
return null;
}
Comparator<String> aliasComparator = this.aliasComparator;
if (null == aliasComparator) {
Set<String> keySet = this.headerAlias.keySet();
aliasComparator = new IndexedComparator<>(keyS... | [
"private",
"Comparator",
"<",
"String",
">",
"getInitedAliasComparator",
"(",
")",
"{",
"if",
"(",
"MapUtil",
".",
"isEmpty",
"(",
"this",
".",
"headerAlias",
")",
")",
"{",
"return",
"null",
";",
"}",
"Comparator",
"<",
"String",
">",
"aliasComparator",
"... | 获取单例的别名比较器,比较器的顺序为别名加入的顺序
@return Comparator
@since 4.1.5 | [
"获取单例的别名比较器,比较器的顺序为别名加入的顺序"
] | bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-poi/src/main/java/cn/hutool/poi/excel/ExcelWriter.java#L901-L912 | train | Gets the initialized aliasComparator. | [
30522,
2797,
4012,
28689,
4263,
1026,
5164,
1028,
2131,
5498,
3064,
22786,
9363,
8737,
25879,
2953,
1006,
1007,
1063,
2065,
1006,
4949,
21823,
2140,
1012,
2003,
6633,
13876,
2100,
1006,
2023,
1012,
20346,
22786,
2015,
1007,
1007,
1063,
2709... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
apache/flink | flink-runtime/src/main/java/org/apache/flink/runtime/rpc/akka/AkkaInvocationHandler.java | AkkaInvocationHandler.extractRpcTimeout | private static Time extractRpcTimeout(Annotation[][] parameterAnnotations, Object[] args, Time defaultTimeout) {
if (args != null) {
Preconditions.checkArgument(parameterAnnotations.length == args.length);
for (int i = 0; i < parameterAnnotations.length; i++) {
if (isRpcTimeout(parameterAnnotations[i])) {
... | java | private static Time extractRpcTimeout(Annotation[][] parameterAnnotations, Object[] args, Time defaultTimeout) {
if (args != null) {
Preconditions.checkArgument(parameterAnnotations.length == args.length);
for (int i = 0; i < parameterAnnotations.length; i++) {
if (isRpcTimeout(parameterAnnotations[i])) {
... | [
"private",
"static",
"Time",
"extractRpcTimeout",
"(",
"Annotation",
"[",
"]",
"[",
"]",
"parameterAnnotations",
",",
"Object",
"[",
"]",
"args",
",",
"Time",
"defaultTimeout",
")",
"{",
"if",
"(",
"args",
"!=",
"null",
")",
"{",
"Preconditions",
".",
"che... | Extracts the {@link RpcTimeout} annotated rpc timeout value from the list of given method
arguments. If no {@link RpcTimeout} annotated parameter could be found, then the default
timeout is returned.
@param parameterAnnotations Parameter annotations
@param args Array of arguments
@param defaultTimeout Default timeout ... | [
"Extracts",
"the",
"{",
"@link",
"RpcTimeout",
"}",
"annotated",
"rpc",
"timeout",
"value",
"from",
"the",
"list",
"of",
"given",
"method",
"arguments",
".",
"If",
"no",
"{",
"@link",
"RpcTimeout",
"}",
"annotated",
"parameter",
"could",
"be",
"found",
"then... | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/rpc/akka/AkkaInvocationHandler.java#L298-L316 | train | Extract the rpc timeout from the arguments. | [
30522,
2797,
10763,
2051,
14817,
14536,
6593,
14428,
5833,
1006,
5754,
17287,
3508,
1031,
1033,
1031,
1033,
16381,
11639,
17287,
9285,
1010,
4874,
1031,
1033,
12098,
5620,
1010,
2051,
12398,
7292,
30524,
1025,
1045,
1026,
16381,
11639,
17287,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/HashedWheelTimer.java | HashedWheelTimer.start | public void start() {
switch (WORKER_STATE_UPDATER.get(this)) {
case WORKER_STATE_INIT:
if (WORKER_STATE_UPDATER.compareAndSet(this, WORKER_STATE_INIT, WORKER_STATE_STARTED)) {
workerThread.start();
}
break;
case WORKER_... | java | public void start() {
switch (WORKER_STATE_UPDATER.get(this)) {
case WORKER_STATE_INIT:
if (WORKER_STATE_UPDATER.compareAndSet(this, WORKER_STATE_INIT, WORKER_STATE_STARTED)) {
workerThread.start();
}
break;
case WORKER_... | [
"public",
"void",
"start",
"(",
")",
"{",
"switch",
"(",
"WORKER_STATE_UPDATER",
".",
"get",
"(",
"this",
")",
")",
"{",
"case",
"WORKER_STATE_INIT",
":",
"if",
"(",
"WORKER_STATE_UPDATER",
".",
"compareAndSet",
"(",
"this",
",",
"WORKER_STATE_INIT",
",",
"W... | Starts the background thread explicitly. The background thread will
start automatically on demand even if you did not call this method.
@throws IllegalStateException if this timer has been
{@linkplain #stop() stopped} already | [
"Starts",
"the",
"background",
"thread",
"explicitly",
".",
"The",
"background",
"thread",
"will",
"start",
"automatically",
"on",
"demand",
"even",
"if",
"you",
"did",
"not",
"call",
"this",
"method",
"."
] | ba06eafa1c1824bd154f1a380019e7ea2edf3c4c | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/common/src/main/java/io/netty/util/HashedWheelTimer.java#L340-L363 | train | Start the worker thread. | [
30522,
2270,
11675,
2707,
1006,
1007,
1063,
6942,
1006,
7309,
1035,
2110,
1035,
10651,
2099,
1012,
2131,
1006,
2023,
1007,
1007,
1063,
2553,
7309,
1035,
2110,
1035,
1999,
4183,
1024,
2065,
1006,
7309,
1035,
2110,
1035,
10651,
2099,
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-connectors/flink-hbase/src/main/java/org/apache/flink/addons/hbase/TableInputFormat.java | TableInputFormat.configure | @Override
public void configure(Configuration parameters) {
table = createTable();
if (table != null) {
scan = getScanner();
}
} | java | @Override
public void configure(Configuration parameters) {
table = createTable();
if (table != null) {
scan = getScanner();
}
} | [
"@",
"Override",
"public",
"void",
"configure",
"(",
"Configuration",
"parameters",
")",
"{",
"table",
"=",
"createTable",
"(",
")",
";",
"if",
"(",
"table",
"!=",
"null",
")",
"{",
"scan",
"=",
"getScanner",
"(",
")",
";",
"}",
"}"
] | Creates a {@link Scan} object and opens the {@link HTable} connection.
These are opened here because they are needed in the createInputSplits
which is called before the openInputFormat method.
So the connection is opened in {@link #configure(Configuration)} and closed in {@link #closeInputFormat()}.
@param parameters ... | [
"Creates",
"a",
"{",
"@link",
"Scan",
"}",
"object",
"and",
"opens",
"the",
"{",
"@link",
"HTable",
"}",
"connection",
".",
"These",
"are",
"opened",
"here",
"because",
"they",
"are",
"needed",
"in",
"the",
"createInputSplits",
"which",
"is",
"called",
"be... | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-connectors/flink-hbase/src/main/java/org/apache/flink/addons/hbase/TableInputFormat.java#L67-L73 | train | Override this to configure the table and scan. | [
30522,
1030,
2058,
15637,
2270,
11675,
9530,
8873,
27390,
2063,
1006,
9563,
11709,
1007,
1063,
2795,
1027,
3443,
10880,
1006,
1007,
1025,
2065,
1006,
2795,
999,
1027,
19701,
1007,
1063,
13594,
1027,
4152,
9336,
3678,
1006,
1007,
1025,
1065,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
apache/flink | flink-runtime/src/main/java/org/apache/flink/runtime/taskexecutor/slot/TaskSlotTable.java | TaskSlotTable.addTask | public boolean addTask(Task task) throws SlotNotFoundException, SlotNotActiveException {
Preconditions.checkNotNull(task);
TaskSlot taskSlot = getTaskSlot(task.getAllocationId());
if (taskSlot != null) {
if (taskSlot.isActive(task.getJobID(), task.getAllocationId())) {
if (taskSlot.add(task)) {
task... | java | public boolean addTask(Task task) throws SlotNotFoundException, SlotNotActiveException {
Preconditions.checkNotNull(task);
TaskSlot taskSlot = getTaskSlot(task.getAllocationId());
if (taskSlot != null) {
if (taskSlot.isActive(task.getJobID(), task.getAllocationId())) {
if (taskSlot.add(task)) {
task... | [
"public",
"boolean",
"addTask",
"(",
"Task",
"task",
")",
"throws",
"SlotNotFoundException",
",",
"SlotNotActiveException",
"{",
"Preconditions",
".",
"checkNotNull",
"(",
"task",
")",
";",
"TaskSlot",
"taskSlot",
"=",
"getTaskSlot",
"(",
"task",
".",
"getAllocati... | Add the given task to the slot identified by the task's allocation id.
@param task to add to the task slot with the respective allocation id
@throws SlotNotFoundException if there was no slot for the given allocation id
@throws SlotNotActiveException if there was no slot active for task's job and allocation id
@return... | [
"Add",
"the",
"given",
"task",
"to",
"the",
"slot",
"identified",
"by",
"the",
"task",
"s",
"allocation",
"id",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/taskexecutor/slot/TaskSlotTable.java#L471-L491 | train | Adds a task to the task slot. | [
30522,
2270,
22017,
20898,
5587,
10230,
2243,
1006,
4708,
4708,
1007,
11618,
10453,
17048,
14876,
8630,
10288,
24422,
1010,
10453,
17048,
19620,
10288,
24422,
1063,
3653,
8663,
20562,
2015,
1012,
4638,
17048,
11231,
3363,
1006,
4708,
1007,
10... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
alibaba/canal | client-adapter/elasticsearch/src/main/java/com/alibaba/otter/canal/client/adapter/es/service/ESSyncService.java | ESSyncService.update | private void update(ESSyncConfig config, Dml dml) {
List<Map<String, Object>> dataList = dml.getData();
List<Map<String, Object>> oldList = dml.getOld();
if (dataList == null || dataList.isEmpty() || oldList == null || oldList.isEmpty()) {
return;
}
SchemaItem schemaI... | java | private void update(ESSyncConfig config, Dml dml) {
List<Map<String, Object>> dataList = dml.getData();
List<Map<String, Object>> oldList = dml.getOld();
if (dataList == null || dataList.isEmpty() || oldList == null || oldList.isEmpty()) {
return;
}
SchemaItem schemaI... | [
"private",
"void",
"update",
"(",
"ESSyncConfig",
"config",
",",
"Dml",
"dml",
")",
"{",
"List",
"<",
"Map",
"<",
"String",
",",
"Object",
">",
">",
"dataList",
"=",
"dml",
".",
"getData",
"(",
")",
";",
"List",
"<",
"Map",
"<",
"String",
",",
"Obj... | 更新操作dml
@param config es配置
@param dml dml数据 | [
"更新操作dml"
] | 8f088cddc0755f4350c5aaae95c6e4002d90a40f | https://github.com/alibaba/canal/blob/8f088cddc0755f4350c5aaae95c6e4002d90a40f/client-adapter/elasticsearch/src/main/java/com/alibaba/otter/canal/client/adapter/es/service/ESSyncService.java#L193-L316 | train | Update DML. | [
30522,
2797,
11675,
10651,
1006,
9686,
6508,
12273,
8663,
8873,
2290,
9530,
8873,
2290,
1010,
1040,
19968,
1040,
19968,
1007,
1063,
2862,
1026,
4949,
1026,
5164,
1010,
4874,
1028,
1028,
2951,
9863,
1027,
1040,
19968,
1012,
2131,
2850,
2696,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
apache/flink | flink-table/flink-table-common/src/main/java/org/apache/flink/table/factories/TableFormatFactoryBase.java | TableFormatFactoryBase.deriveSchema | public static TableSchema deriveSchema(Map<String, String> properties) {
final DescriptorProperties descriptorProperties = new DescriptorProperties();
descriptorProperties.putProperties(properties);
final TableSchema.Builder builder = TableSchema.builder();
final TableSchema baseSchema = descriptorProperties.... | java | public static TableSchema deriveSchema(Map<String, String> properties) {
final DescriptorProperties descriptorProperties = new DescriptorProperties();
descriptorProperties.putProperties(properties);
final TableSchema.Builder builder = TableSchema.builder();
final TableSchema baseSchema = descriptorProperties.... | [
"public",
"static",
"TableSchema",
"deriveSchema",
"(",
"Map",
"<",
"String",
",",
"String",
">",
"properties",
")",
"{",
"final",
"DescriptorProperties",
"descriptorProperties",
"=",
"new",
"DescriptorProperties",
"(",
")",
";",
"descriptorProperties",
".",
"putPro... | Finds the table schema that can be used for a format schema (without time attributes). | [
"Finds",
"the",
"table",
"schema",
"that",
"can",
"be",
"used",
"for",
"a",
"format",
"schema",
"(",
"without",
"time",
"attributes",
")",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-table/flink-table-common/src/main/java/org/apache/flink/table/factories/TableFormatFactoryBase.java#L131-L164 | train | Derive the schema from the given properties. | [
30522,
2270,
10763,
7251,
5403,
2863,
12153,
5403,
2863,
1006,
4949,
1026,
5164,
1010,
5164,
1028,
5144,
1007,
1063,
2345,
4078,
23235,
2953,
21572,
4842,
7368,
4078,
23235,
2953,
21572,
4842,
7368,
1027,
2047,
4078,
23235,
2953,
21572,
484... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
apache/flink | flink-core/src/main/java/org/apache/flink/util/ExceptionUtils.java | ExceptionUtils.rethrowIOException | public static void rethrowIOException(Throwable t) throws IOException {
if (t instanceof IOException) {
throw (IOException) t;
}
else if (t instanceof RuntimeException) {
throw (RuntimeException) t;
}
else if (t instanceof Error) {
throw (Error) t;
}
else {
throw new IOException(t.getMessage()... | java | public static void rethrowIOException(Throwable t) throws IOException {
if (t instanceof IOException) {
throw (IOException) t;
}
else if (t instanceof RuntimeException) {
throw (RuntimeException) t;
}
else if (t instanceof Error) {
throw (Error) t;
}
else {
throw new IOException(t.getMessage()... | [
"public",
"static",
"void",
"rethrowIOException",
"(",
"Throwable",
"t",
")",
"throws",
"IOException",
"{",
"if",
"(",
"t",
"instanceof",
"IOException",
")",
"{",
"throw",
"(",
"IOException",
")",
"t",
";",
"}",
"else",
"if",
"(",
"t",
"instanceof",
"Runti... | Re-throws the given {@code Throwable} in scenarios where the signatures allows only IOExceptions
(and RuntimeException and Error).
<p>Throws this exception directly, if it is an IOException, a RuntimeException, or an Error. Otherwise it
wraps it in an IOException and throws it.
@param t The Throwable to be thrown. | [
"Re",
"-",
"throws",
"the",
"given",
"{",
"@code",
"Throwable",
"}",
"in",
"scenarios",
"where",
"the",
"signatures",
"allows",
"only",
"IOExceptions",
"(",
"and",
"RuntimeException",
"and",
"Error",
")",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-core/src/main/java/org/apache/flink/util/ExceptionUtils.java#L302-L315 | train | Re - throws an IOException. | [
30522,
2270,
10763,
11675,
2128,
2705,
10524,
3695,
10288,
24422,
1006,
5466,
3085,
1056,
1007,
11618,
22834,
10288,
24422,
1063,
2065,
1006,
1056,
6013,
11253,
22834,
10288,
24422,
1007,
1063,
5466,
1006,
22834,
10288,
24422,
1007,
1056,
102... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
netty/netty | codec-http/src/main/java/io/netty/handler/codec/http/multipart/HttpPostBodyUtil.java | HttpPostBodyUtil.findNonWhitespace | static int findNonWhitespace(String sb, int offset) {
int result;
for (result = offset; result < sb.length(); result ++) {
if (!Character.isWhitespace(sb.charAt(result))) {
break;
}
}
return result;
} | java | static int findNonWhitespace(String sb, int offset) {
int result;
for (result = offset; result < sb.length(); result ++) {
if (!Character.isWhitespace(sb.charAt(result))) {
break;
}
}
return result;
} | [
"static",
"int",
"findNonWhitespace",
"(",
"String",
"sb",
",",
"int",
"offset",
")",
"{",
"int",
"result",
";",
"for",
"(",
"result",
"=",
"offset",
";",
"result",
"<",
"sb",
".",
"length",
"(",
")",
";",
"result",
"++",
")",
"{",
"if",
"(",
"!",
... | Find the first non whitespace
@return the rank of the first non whitespace | [
"Find",
"the",
"first",
"non",
"whitespace"
] | ba06eafa1c1824bd154f1a380019e7ea2edf3c4c | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/codec-http/src/main/java/io/netty/handler/codec/http/multipart/HttpPostBodyUtil.java#L129-L137 | train | Find the first non - whitespace character in the string. | [
30522,
10763,
20014,
2424,
8540,
2860,
16584,
2229,
15327,
1006,
5164,
24829,
1010,
20014,
16396,
1007,
1063,
20014,
2765,
1025,
2005,
1006,
2765,
1027,
16396,
1025,
2765,
1026,
24829,
1012,
3091,
1006,
1007,
1025,
2765,
1009,
1009,
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... |
netty/netty | example/src/main/java/io/netty/example/ocsp/OcspRequestBuilder.java | OcspRequestBuilder.build | public OCSPReq build() throws OCSPException, IOException, CertificateEncodingException {
SecureRandom generator = checkNotNull(this.generator, "generator");
DigestCalculator calculator = checkNotNull(this.calculator, "calculator");
X509Certificate certificate = checkNotNull(this.certificate, "ce... | java | public OCSPReq build() throws OCSPException, IOException, CertificateEncodingException {
SecureRandom generator = checkNotNull(this.generator, "generator");
DigestCalculator calculator = checkNotNull(this.calculator, "calculator");
X509Certificate certificate = checkNotNull(this.certificate, "ce... | [
"public",
"OCSPReq",
"build",
"(",
")",
"throws",
"OCSPException",
",",
"IOException",
",",
"CertificateEncodingException",
"{",
"SecureRandom",
"generator",
"=",
"checkNotNull",
"(",
"this",
".",
"generator",
",",
"\"generator\"",
")",
";",
"DigestCalculator",
"cal... | ATTENTION: The returned {@link OCSPReq} is not re-usable/cacheable! It contains a one-time nonce
and CA's will (should) reject subsequent requests that have the same nonce value. | [
"ATTENTION",
":",
"The",
"returned",
"{"
] | ba06eafa1c1824bd154f1a380019e7ea2edf3c4c | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/example/src/main/java/io/netty/example/ocsp/OcspRequestBuilder.java#L79-L103 | train | Build an OCSPReq object. | [
30522,
2270,
1051,
6169,
28139,
4160,
3857,
1006,
1007,
11618,
1051,
6169,
5051,
2595,
24422,
1010,
22834,
10288,
24422,
1010,
8196,
2368,
3597,
4667,
10288,
24422,
1063,
5851,
13033,
5358,
13103,
1027,
4638,
17048,
11231,
3363,
1006,
2023,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
apache/flink | flink-streaming-java/src/main/java/org/apache/flink/streaming/api/windowing/evictors/TimeEvictor.java | TimeEvictor.hasTimestamp | private boolean hasTimestamp(Iterable<TimestampedValue<Object>> elements) {
Iterator<TimestampedValue<Object>> it = elements.iterator();
if (it.hasNext()) {
return it.next().hasTimestamp();
}
return false;
} | java | private boolean hasTimestamp(Iterable<TimestampedValue<Object>> elements) {
Iterator<TimestampedValue<Object>> it = elements.iterator();
if (it.hasNext()) {
return it.next().hasTimestamp();
}
return false;
} | [
"private",
"boolean",
"hasTimestamp",
"(",
"Iterable",
"<",
"TimestampedValue",
"<",
"Object",
">",
">",
"elements",
")",
"{",
"Iterator",
"<",
"TimestampedValue",
"<",
"Object",
">>",
"it",
"=",
"elements",
".",
"iterator",
"(",
")",
";",
"if",
"(",
"it",... | Returns true if the first element in the Iterable of {@link TimestampedValue} has a timestamp. | [
"Returns",
"true",
"if",
"the",
"first",
"element",
"in",
"the",
"Iterable",
"of",
"{"
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-streaming-java/src/main/java/org/apache/flink/streaming/api/windowing/evictors/TimeEvictor.java#L86-L92 | train | Checks if the given iterable contains a timestamp. | [
30522,
2797,
22017,
20898,
2038,
7292,
9153,
8737,
1006,
2009,
6906,
3468,
1026,
2335,
15464,
5669,
10175,
5657,
1026,
4874,
1028,
1028,
3787,
1007,
1063,
2009,
6906,
4263,
1026,
2335,
15464,
5669,
10175,
5657,
1026,
4874,
1028,
1028,
2009,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
apache/flink | flink-runtime/src/main/java/org/apache/flink/runtime/io/network/netty/PartitionRequestClientHandler.java | PartitionRequestClientHandler.exceptionCaught | @Override
public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) throws Exception {
if (cause instanceof TransportException) {
notifyAllChannelsOfErrorAndClose(cause);
}
else {
final SocketAddress remoteAddr = ctx.channel().remoteAddress();
final TransportException tex;
// Improve... | java | @Override
public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) throws Exception {
if (cause instanceof TransportException) {
notifyAllChannelsOfErrorAndClose(cause);
}
else {
final SocketAddress remoteAddr = ctx.channel().remoteAddress();
final TransportException tex;
// Improve... | [
"@",
"Override",
"public",
"void",
"exceptionCaught",
"(",
"ChannelHandlerContext",
"ctx",
",",
"Throwable",
"cause",
")",
"throws",
"Exception",
"{",
"if",
"(",
"cause",
"instanceof",
"TransportException",
")",
"{",
"notifyAllChannelsOfErrorAndClose",
"(",
"cause",
... | Called on exceptions in the client handler pipeline.
<p> Remote exceptions are received as regular payload. | [
"Called",
"on",
"exceptions",
"in",
"the",
"client",
"handler",
"pipeline",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/io/network/netty/PartitionRequestClientHandler.java#L145-L174 | train | Override exceptionCaught to handle TransportExceptions. | [
30522,
1030,
2058,
15637,
2270,
11675,
6453,
3540,
18533,
1006,
3149,
11774,
3917,
8663,
18209,
14931,
2595,
1010,
5466,
3085,
3426,
1007,
11618,
6453,
1063,
2065,
1006,
3426,
6013,
11253,
3665,
10288,
24422,
1007,
1063,
2025,
8757,
8095,
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... |
spring-projects/spring-boot | spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/condition/ConditionMessage.java | ConditionMessage.forCondition | public static Builder forCondition(String condition, Object... details) {
return new ConditionMessage().andCondition(condition, details);
} | java | public static Builder forCondition(String condition, Object... details) {
return new ConditionMessage().andCondition(condition, details);
} | [
"public",
"static",
"Builder",
"forCondition",
"(",
"String",
"condition",
",",
"Object",
"...",
"details",
")",
"{",
"return",
"new",
"ConditionMessage",
"(",
")",
".",
"andCondition",
"(",
"condition",
",",
"details",
")",
";",
"}"
] | Factory method for a builder to construct a new {@link ConditionMessage} for a
condition.
@param condition the condition
@param details details of the condition
@return a {@link Builder} builder
@see #forCondition(Class, Object...)
@see #andCondition(String, Object...) | [
"Factory",
"method",
"for",
"a",
"builder",
"to",
"construct",
"a",
"new",
"{"
] | 0b27f7c70e164b2b1a96477f1d9c1acba56790c1 | https://github.com/spring-projects/spring-boot/blob/0b27f7c70e164b2b1a96477f1d9c1acba56790c1/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/condition/ConditionMessage.java#L194-L196 | train | Creates a builder for a condition message. | [
30522,
2270,
10763,
12508,
2005,
8663,
20562,
1006,
5164,
4650,
1010,
4874,
1012,
1012,
1012,
4751,
1007,
1063,
2709,
2047,
4650,
7834,
3736,
3351,
1006,
1007,
1012,
1998,
8663,
20562,
1006,
4650,
1010,
4751,
1007,
1025,
1065,
102,
0,
0,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
looly/hutool | hutool-core/src/main/java/cn/hutool/core/swing/clipboard/ClipboardUtil.java | ClipboardUtil.get | public static Object get(Transferable content, DataFlavor flavor) {
if (null != content && content.isDataFlavorSupported(flavor)) {
try {
return content.getTransferData(flavor);
} catch (UnsupportedFlavorException | IOException e) {
throw new UtilException(e);
}
}
return null;
} | java | public static Object get(Transferable content, DataFlavor flavor) {
if (null != content && content.isDataFlavorSupported(flavor)) {
try {
return content.getTransferData(flavor);
} catch (UnsupportedFlavorException | IOException e) {
throw new UtilException(e);
}
}
return null;
} | [
"public",
"static",
"Object",
"get",
"(",
"Transferable",
"content",
",",
"DataFlavor",
"flavor",
")",
"{",
"if",
"(",
"null",
"!=",
"content",
"&&",
"content",
".",
"isDataFlavorSupported",
"(",
"flavor",
")",
")",
"{",
"try",
"{",
"return",
"content",
".... | 获取剪贴板内容
@param content {@link Transferable}
@param flavor 数据元信息,标识数据类型
@return 剪贴板内容,类型根据flavor不同而不同 | [
"获取剪贴板内容"
] | bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/swing/clipboard/ClipboardUtil.java#L68-L77 | train | Gets the object that represents the specified transferable object with the specified data flavor. | [
30522,
2270,
10763,
4874,
2131,
1006,
4651,
3085,
4180,
1010,
2951,
10258,
11431,
2953,
14894,
1007,
1063,
2065,
1006,
19701,
999,
1027,
4180,
1004,
1004,
4180,
1012,
2003,
2850,
2696,
10258,
11431,
5668,
6279,
6442,
2098,
1006,
14894,
1007... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
looly/hutool | hutool-crypto/src/main/java/cn/hutool/crypto/KeyUtil.java | KeyUtil.getCertificateFactory | public static CertificateFactory getCertificateFactory(String type) {
final Provider provider = GlobalBouncyCastleProvider.INSTANCE.getProvider();
CertificateFactory factory;
try {
factory = (null == provider) ? CertificateFactory.getInstance(type) : CertificateFactory.getInstance(type, provider);
} c... | java | public static CertificateFactory getCertificateFactory(String type) {
final Provider provider = GlobalBouncyCastleProvider.INSTANCE.getProvider();
CertificateFactory factory;
try {
factory = (null == provider) ? CertificateFactory.getInstance(type) : CertificateFactory.getInstance(type, provider);
} c... | [
"public",
"static",
"CertificateFactory",
"getCertificateFactory",
"(",
"String",
"type",
")",
"{",
"final",
"Provider",
"provider",
"=",
"GlobalBouncyCastleProvider",
".",
"INSTANCE",
".",
"getProvider",
"(",
")",
";",
"CertificateFactory",
"factory",
";",
"try",
"... | 获取{@link CertificateFactory}
@param type 类型,例如X.509
@return {@link KeyPairGenerator}
@since 4.5.0 | [
"获取",
"{",
"@link",
"CertificateFactory",
"}"
] | bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-crypto/src/main/java/cn/hutool/crypto/KeyUtil.java#L723-L733 | train | Gets the CertificateFactory for the given type. | [
30522,
2270,
10763,
8196,
21450,
2131,
17119,
3775,
8873,
16280,
21450,
1006,
5164,
2828,
1007,
1063,
2345,
10802,
10802,
1027,
3795,
5092,
4609,
5666,
23662,
21572,
17258,
2121,
1012,
6013,
1012,
2131,
21572,
17258,
2121,
1006,
1007,
1025,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
looly/hutool | hutool-core/src/main/java/cn/hutool/core/thread/GlobalThreadPool.java | GlobalThreadPool.execute | public static void execute(Runnable runnable) {
try {
executor.execute(runnable);
} catch (Exception e) {
throw new UtilException(e, "Exception when running task!");
}
} | java | public static void execute(Runnable runnable) {
try {
executor.execute(runnable);
} catch (Exception e) {
throw new UtilException(e, "Exception when running task!");
}
} | [
"public",
"static",
"void",
"execute",
"(",
"Runnable",
"runnable",
")",
"{",
"try",
"{",
"executor",
".",
"execute",
"(",
"runnable",
")",
";",
"}",
"catch",
"(",
"Exception",
"e",
")",
"{",
"throw",
"new",
"UtilException",
"(",
"e",
",",
"\"Exception w... | 直接在公共线程池中执行线程
@param runnable 可运行对象 | [
"直接在公共线程池中执行线程"
] | bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/thread/GlobalThreadPool.java#L64-L70 | train | Execute a Runnable. | [
30522,
2270,
10763,
11675,
15389,
1006,
2448,
22966,
2448,
22966,
1007,
1063,
3046,
1063,
4654,
8586,
16161,
2099,
1012,
15389,
1006,
2448,
22966,
1007,
1025,
1065,
4608,
1006,
6453,
1041,
1007,
1063,
5466,
2047,
21183,
9463,
2595,
24422,
1... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
apache/spark | core/src/main/java/org/apache/spark/memory/TaskMemoryManager.java | TaskMemoryManager.cleanUpAllAllocatedMemory | public long cleanUpAllAllocatedMemory() {
synchronized (this) {
for (MemoryConsumer c: consumers) {
if (c != null && c.getUsed() > 0) {
// In case of failed task, it's normal to see leaked memory
logger.debug("unreleased " + Utils.bytesToString(c.getUsed()) + " memory from " + c);
... | java | public long cleanUpAllAllocatedMemory() {
synchronized (this) {
for (MemoryConsumer c: consumers) {
if (c != null && c.getUsed() > 0) {
// In case of failed task, it's normal to see leaked memory
logger.debug("unreleased " + Utils.bytesToString(c.getUsed()) + " memory from " + c);
... | [
"public",
"long",
"cleanUpAllAllocatedMemory",
"(",
")",
"{",
"synchronized",
"(",
"this",
")",
"{",
"for",
"(",
"MemoryConsumer",
"c",
":",
"consumers",
")",
"{",
"if",
"(",
"c",
"!=",
"null",
"&&",
"c",
".",
"getUsed",
"(",
")",
">",
"0",
")",
"{",... | Clean up all allocated memory and pages. Returns the number of bytes freed. A non-zero return
value can be used to detect memory leaks. | [
"Clean",
"up",
"all",
"allocated",
"memory",
"and",
"pages",
".",
"Returns",
"the",
"number",
"of",
"bytes",
"freed",
".",
"A",
"non",
"-",
"zero",
"return",
"value",
"can",
"be",
"used",
"to",
"detect",
"memory",
"leaks",
"."
] | 25ee0474f47d9c30d6f553a7892d9549f91071cf | https://github.com/apache/spark/blob/25ee0474f47d9c30d6f553a7892d9549f91071cf/core/src/main/java/org/apache/spark/memory/TaskMemoryManager.java#L428-L452 | train | Clean up all allocated memory. | [
30522,
2270,
2146,
27686,
25425,
7174,
12921,
4168,
5302,
2854,
1006,
1007,
1063,
25549,
1006,
2023,
1007,
1063,
2005,
1006,
3638,
8663,
23545,
2099,
1039,
1024,
10390,
1007,
1063,
2065,
1006,
1039,
999,
1027,
19701,
1004,
1004,
1039,
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/api/common/typeinfo/Types.java | Types.OBJECT_ARRAY | @SuppressWarnings("unchecked")
public static <E> TypeInformation<E[]> OBJECT_ARRAY(TypeInformation<E> elementType) {
if (elementType == Types.STRING) {
return (TypeInformation) BasicArrayTypeInfo.STRING_ARRAY_TYPE_INFO;
}
return ObjectArrayTypeInfo.getInfoFor(elementType);
} | java | @SuppressWarnings("unchecked")
public static <E> TypeInformation<E[]> OBJECT_ARRAY(TypeInformation<E> elementType) {
if (elementType == Types.STRING) {
return (TypeInformation) BasicArrayTypeInfo.STRING_ARRAY_TYPE_INFO;
}
return ObjectArrayTypeInfo.getInfoFor(elementType);
} | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"static",
"<",
"E",
">",
"TypeInformation",
"<",
"E",
"[",
"]",
">",
"OBJECT_ARRAY",
"(",
"TypeInformation",
"<",
"E",
">",
"elementType",
")",
"{",
"if",
"(",
"elementType",
"==",
"Types",
".",... | Returns type information for Java arrays of object types (such as <code>String[]</code>,
<code>Integer[]</code>). The array itself must not be null. Null values for elements are supported.
@param elementType element type of the array | [
"Returns",
"type",
"information",
"for",
"Java",
"arrays",
"of",
"object",
"types",
"(",
"such",
"as",
"<code",
">",
"String",
"[]",
"<",
"/",
"code",
">",
"<code",
">",
"Integer",
"[]",
"<",
"/",
"code",
">",
")",
".",
"The",
"array",
"itself",
"mus... | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-core/src/main/java/org/apache/flink/api/common/typeinfo/Types.java#L373-L379 | train | Returns the type information for an object array type. | [
30522,
1030,
16081,
9028,
5582,
2015,
1006,
1000,
4895,
5403,
18141,
1000,
1007,
2270,
10763,
1026,
1041,
1028,
2828,
2378,
14192,
3370,
1026,
1041,
1031,
1033,
1028,
4874,
1035,
9140,
1006,
2828,
2378,
14192,
3370,
1026,
1041,
1028,
5783,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
hankcs/HanLP | src/main/java/com/hankcs/hanlp/mining/word/TfIdf.java | TfIdf.tfIdf | public static <TERM> Map<TERM, Double> tfIdf(Map<TERM, Double> tf, Map<TERM, Double> idf)
{
return tfIdf(tf, idf, Normalization.NONE);
} | java | public static <TERM> Map<TERM, Double> tfIdf(Map<TERM, Double> tf, Map<TERM, Double> idf)
{
return tfIdf(tf, idf, Normalization.NONE);
} | [
"public",
"static",
"<",
"TERM",
">",
"Map",
"<",
"TERM",
",",
"Double",
">",
"tfIdf",
"(",
"Map",
"<",
"TERM",
",",
"Double",
">",
"tf",
",",
"Map",
"<",
"TERM",
",",
"Double",
">",
"idf",
")",
"{",
"return",
"tfIdf",
"(",
"tf",
",",
"idf",
",... | 计算文档的tf-idf(不正规化)
@param tf 词频
@param idf 倒排频率
@param <TERM> 词语类型
@return 一个词语->tf-idf的Map | [
"计算文档的tf",
"-",
"idf(不正规化)"
] | a538d0722ab2e4980a9dcd9ea40324fc3ddba7ce | https://github.com/hankcs/HanLP/blob/a538d0722ab2e4980a9dcd9ea40324fc3ddba7ce/src/main/java/com/hankcs/hanlp/mining/word/TfIdf.java#L217-L220 | train | Get the TF IDF map. | [
30522,
2270,
10763,
1026,
2744,
1028,
4949,
1026,
2744,
1010,
3313,
1028,
1056,
8873,
20952,
1006,
4949,
1026,
2744,
1010,
3313,
1028,
1056,
2546,
1010,
4949,
1026,
2744,
1010,
3313,
1028,
24011,
1007,
1063,
2709,
1056,
8873,
20952,
1006,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
looly/hutool | hutool-core/src/main/java/cn/hutool/core/util/ArrayUtil.java | ArrayUtil.join | public static String join(Object array, CharSequence conjunction) {
if (isArray(array)) {
final Class<?> componentType = array.getClass().getComponentType();
if (componentType.isPrimitive()) {
final String componentTypeName = componentType.getName();
switch (componentTypeName) {
case "long":
... | java | public static String join(Object array, CharSequence conjunction) {
if (isArray(array)) {
final Class<?> componentType = array.getClass().getComponentType();
if (componentType.isPrimitive()) {
final String componentTypeName = componentType.getName();
switch (componentTypeName) {
case "long":
... | [
"public",
"static",
"String",
"join",
"(",
"Object",
"array",
",",
"CharSequence",
"conjunction",
")",
"{",
"if",
"(",
"isArray",
"(",
"array",
")",
")",
"{",
"final",
"Class",
"<",
"?",
">",
"componentType",
"=",
"array",
".",
"getClass",
"(",
")",
".... | 以 conjunction 为分隔符将数组转换为字符串
@param array 数组
@param conjunction 分隔符
@return 连接后的字符串 | [
"以",
"conjunction",
"为分隔符将数组转换为字符串"
] | bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/util/ArrayUtil.java#L2541-L2571 | train | Returns a String containing the elements of the specified array in the specified conjunction. | [
30522,
2270,
10763,
5164,
3693,
1006,
4874,
9140,
1010,
25869,
3366,
4226,
5897,
9595,
1007,
1063,
2065,
1006,
18061,
11335,
2100,
1006,
9140,
1007,
1007,
1063,
2345,
2465,
1026,
1029,
1028,
6922,
13874,
1027,
9140,
1012,
2131,
26266,
1006,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
looly/hutool | hutool-core/src/main/java/cn/hutool/core/net/URLEncoder.java | URLEncoder.encode | public String encode(String path, Charset charset) {
int maxBytesPerChar = 10;
final StringBuilder rewrittenPath = new StringBuilder(path.length());
ByteArrayOutputStream buf = new ByteArrayOutputStream(maxBytesPerChar);
OutputStreamWriter writer = new OutputStreamWriter(buf, charset);
int c;
for ... | java | public String encode(String path, Charset charset) {
int maxBytesPerChar = 10;
final StringBuilder rewrittenPath = new StringBuilder(path.length());
ByteArrayOutputStream buf = new ByteArrayOutputStream(maxBytesPerChar);
OutputStreamWriter writer = new OutputStreamWriter(buf, charset);
int c;
for ... | [
"public",
"String",
"encode",
"(",
"String",
"path",
",",
"Charset",
"charset",
")",
"{",
"int",
"maxBytesPerChar",
"=",
"10",
";",
"final",
"StringBuilder",
"rewrittenPath",
"=",
"new",
"StringBuilder",
"(",
"path",
".",
"length",
"(",
")",
")",
";",
"Byt... | 将URL中的字符串编码为%形式
@param path 需要编码的字符串
@param charset 编码
@return 编码后的字符串 | [
"将URL中的字符串编码为%形式"
] | bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/net/URLEncoder.java#L196-L232 | train | Encodes the given path using the given charset. | [
30522,
2270,
5164,
4372,
16044,
1006,
5164,
4130,
1010,
25869,
13462,
25869,
13462,
1007,
1063,
20014,
4098,
3762,
4570,
4842,
7507,
2099,
1027,
2184,
1025,
2345,
5164,
8569,
23891,
2099,
2128,
15773,
15069,
1027,
2047,
5164,
8569,
23891,
2... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
apache/spark | core/src/main/java/org/apache/spark/util/collection/unsafe/sort/UnsafeExternalSorter.java | UnsafeExternalSorter.getMemoryUsage | private long getMemoryUsage() {
long totalPageSize = 0;
for (MemoryBlock page : allocatedPages) {
totalPageSize += page.size();
}
return ((inMemSorter == null) ? 0 : inMemSorter.getMemoryUsage()) + totalPageSize;
} | java | private long getMemoryUsage() {
long totalPageSize = 0;
for (MemoryBlock page : allocatedPages) {
totalPageSize += page.size();
}
return ((inMemSorter == null) ? 0 : inMemSorter.getMemoryUsage()) + totalPageSize;
} | [
"private",
"long",
"getMemoryUsage",
"(",
")",
"{",
"long",
"totalPageSize",
"=",
"0",
";",
"for",
"(",
"MemoryBlock",
"page",
":",
"allocatedPages",
")",
"{",
"totalPageSize",
"+=",
"page",
".",
"size",
"(",
")",
";",
"}",
"return",
"(",
"(",
"inMemSort... | Return the total memory usage of this sorter, including the data pages and the sorter's pointer
array. | [
"Return",
"the",
"total",
"memory",
"usage",
"of",
"this",
"sorter",
"including",
"the",
"data",
"pages",
"and",
"the",
"sorter",
"s",
"pointer",
"array",
"."
] | 25ee0474f47d9c30d6f553a7892d9549f91071cf | https://github.com/apache/spark/blob/25ee0474f47d9c30d6f553a7892d9549f91071cf/core/src/main/java/org/apache/spark/util/collection/unsafe/sort/UnsafeExternalSorter.java#L242-L248 | train | Get the memory usage of the in - memory sorter. | [
30522,
2797,
2146,
2131,
4168,
5302,
2854,
10383,
3351,
1006,
1007,
1063,
2146,
2561,
13704,
5332,
4371,
1027,
1014,
1025,
2005,
1006,
3638,
30524,
1006,
1007,
1025,
1065,
2709,
1006,
1006,
1999,
4168,
5244,
11589,
2121,
1027,
1027,
19701,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
apache/flink | flink-runtime/src/main/java/org/apache/flink/runtime/rest/handler/legacy/backpressure/StackTraceSampleCoordinator.java | StackTraceSampleCoordinator.triggerStackTraceSample | @SuppressWarnings("unchecked")
public CompletableFuture<StackTraceSample> triggerStackTraceSample(
ExecutionVertex[] tasksToSample,
int numSamples,
Time delayBetweenSamples,
int maxStackTraceDepth) {
checkNotNull(tasksToSample, "Tasks to sample");
checkArgument(tasksToSample.length >= 1, "No tasks to ... | java | @SuppressWarnings("unchecked")
public CompletableFuture<StackTraceSample> triggerStackTraceSample(
ExecutionVertex[] tasksToSample,
int numSamples,
Time delayBetweenSamples,
int maxStackTraceDepth) {
checkNotNull(tasksToSample, "Tasks to sample");
checkArgument(tasksToSample.length >= 1, "No tasks to ... | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"CompletableFuture",
"<",
"StackTraceSample",
">",
"triggerStackTraceSample",
"(",
"ExecutionVertex",
"[",
"]",
"tasksToSample",
",",
"int",
"numSamples",
",",
"Time",
"delayBetweenSamples",
",",
"int",
"ma... | Triggers a stack trace sample to all tasks.
@param tasksToSample Tasks to sample.
@param numSamples Number of stack trace samples to collect.
@param delayBetweenSamples Delay between consecutive samples.
@param maxStackTraceDepth Maximum depth of the stack trace. 0 indicates
no maximum and keeps the co... | [
"Triggers",
"a",
"stack",
"trace",
"sample",
"to",
"all",
"tasks",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/rest/handler/legacy/backpressure/StackTraceSampleCoordinator.java#L106-L184 | train | Triggers a stack trace sample. | [
30522,
1030,
16081,
9028,
5582,
2015,
1006,
1000,
4895,
5403,
18141,
1000,
1007,
2270,
4012,
10814,
10880,
11263,
11244,
1026,
9991,
6494,
30524,
4244,
1010,
2051,
8536,
20915,
28394,
3619,
16613,
4244,
1010,
20014,
4098,
9153,
3600,
6494,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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-state-backends/flink-statebackend-rocksdb/src/main/java/org/apache/flink/contrib/streaming/state/RocksDBIncrementalCheckpointUtils.java | RocksDBIncrementalCheckpointUtils.beforeThePrefixBytes | public static boolean beforeThePrefixBytes(@Nonnull byte[] bytes, @Nonnull byte[] prefixBytes) {
final int prefixLength = prefixBytes.length;
for (int i = 0; i < prefixLength; ++i) {
int r = (char) prefixBytes[i] - (char) bytes[i];
if (r != 0) {
return r > 0;
}
}
return false;
} | java | public static boolean beforeThePrefixBytes(@Nonnull byte[] bytes, @Nonnull byte[] prefixBytes) {
final int prefixLength = prefixBytes.length;
for (int i = 0; i < prefixLength; ++i) {
int r = (char) prefixBytes[i] - (char) bytes[i];
if (r != 0) {
return r > 0;
}
}
return false;
} | [
"public",
"static",
"boolean",
"beforeThePrefixBytes",
"(",
"@",
"Nonnull",
"byte",
"[",
"]",
"bytes",
",",
"@",
"Nonnull",
"byte",
"[",
"]",
"prefixBytes",
")",
"{",
"final",
"int",
"prefixLength",
"=",
"prefixBytes",
".",
"length",
";",
"for",
"(",
"int"... | check whether the bytes is before prefixBytes in the character order. | [
"check",
"whether",
"the",
"bytes",
"is",
"before",
"prefixBytes",
"in",
"the",
"character",
"order",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-state-backends/flink-statebackend-rocksdb/src/main/java/org/apache/flink/contrib/streaming/state/RocksDBIncrementalCheckpointUtils.java#L138-L147 | train | Returns true if the bytes are before the prefix bytes. | [
30522,
2270,
10763,
22017,
20898,
2077,
10760,
28139,
8873,
2595,
3762,
4570,
1006,
1030,
2512,
11231,
3363,
24880,
1031,
1033,
27507,
1010,
1030,
2512,
11231,
3363,
24880,
1031,
1033,
17576,
3762,
4570,
1007,
1063,
2345,
20014,
17576,
7770,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/ClassUtil.java | ClassUtil.isSimpleTypeOrArray | public static boolean isSimpleTypeOrArray(Class<?> clazz) {
if (null == clazz) {
return false;
}
return isSimpleValueType(clazz) || (clazz.isArray() && isSimpleValueType(clazz.getComponentType()));
} | java | public static boolean isSimpleTypeOrArray(Class<?> clazz) {
if (null == clazz) {
return false;
}
return isSimpleValueType(clazz) || (clazz.isArray() && isSimpleValueType(clazz.getComponentType()));
} | [
"public",
"static",
"boolean",
"isSimpleTypeOrArray",
"(",
"Class",
"<",
"?",
">",
"clazz",
")",
"{",
"if",
"(",
"null",
"==",
"clazz",
")",
"{",
"return",
"false",
";",
"}",
"return",
"isSimpleValueType",
"(",
"clazz",
")",
"||",
"(",
"clazz",
".",
"i... | 是否简单值类型或简单值类型的数组<br>
包括:原始类型,、String、other CharSequence, a Number, a Date, a URI, a URL, a Locale or a Class及其数组
@param clazz 属性类
@return 是否简单值类型或简单值类型的数组 | [
"是否简单值类型或简单值类型的数组<br",
">",
"包括:原始类型",
"、String、other",
"CharSequence",
"a",
"Number",
"a",
"Date",
"a",
"URI",
"a",
"URL",
"a",
"Locale",
"or",
"a",
"Class及其数组"
] | bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/util/ClassUtil.java#L733-L738 | train | Checks if the given class is a simple type or array type. | [
30522,
2270,
10763,
22017,
20898,
26354,
5714,
10814,
13874,
6525,
11335,
2100,
1006,
2465,
1026,
1029,
1028,
18856,
10936,
2480,
1007,
1063,
2065,
1006,
19701,
1027,
1027,
18856,
10936,
2480,
1007,
1063,
2709,
6270,
1025,
1065,
2709,
26354,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
apache/flink | flink-libraries/flink-gelly/src/main/java/org/apache/flink/graph/Graph.java | Graph.runGatherSumApplyIteration | public <M> Graph<K, VV, EV> runGatherSumApplyIteration(
org.apache.flink.graph.gsa.GatherFunction<VV, EV, M> gatherFunction, SumFunction<VV, EV, M> sumFunction,
ApplyFunction<K, VV, M> applyFunction, int maximumNumberOfIterations,
GSAConfiguration parameters) {
GatherSumApplyIteration<K, VV, EV, M> iteratio... | java | public <M> Graph<K, VV, EV> runGatherSumApplyIteration(
org.apache.flink.graph.gsa.GatherFunction<VV, EV, M> gatherFunction, SumFunction<VV, EV, M> sumFunction,
ApplyFunction<K, VV, M> applyFunction, int maximumNumberOfIterations,
GSAConfiguration parameters) {
GatherSumApplyIteration<K, VV, EV, M> iteratio... | [
"public",
"<",
"M",
">",
"Graph",
"<",
"K",
",",
"VV",
",",
"EV",
">",
"runGatherSumApplyIteration",
"(",
"org",
".",
"apache",
".",
"flink",
".",
"graph",
".",
"gsa",
".",
"GatherFunction",
"<",
"VV",
",",
"EV",
",",
"M",
">",
"gatherFunction",
",",... | Runs a Gather-Sum-Apply iteration on the graph with configuration options.
@param gatherFunction the gather function collects information about adjacent vertices and edges
@param sumFunction the sum function aggregates the gathered information
@param applyFunction the apply function updates the vertex values with the ... | [
"Runs",
"a",
"Gather",
"-",
"Sum",
"-",
"Apply",
"iteration",
"on",
"the",
"graph",
"with",
"configuration",
"options",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-libraries/flink-gelly/src/main/java/org/apache/flink/graph/Graph.java#L1799-L1812 | train | Runs a Gather Sum Apply Iteration on the graph. | [
30522,
2270,
1026,
1049,
1028,
10629,
1026,
1047,
1010,
1058,
2615,
1010,
23408,
1028,
2448,
20697,
22328,
12248,
9397,
2135,
21646,
3370,
1006,
8917,
1012,
15895,
1012,
13109,
19839,
1012,
10629,
1012,
28177,
2050,
1012,
8587,
11263,
27989,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
apache/flink | flink-core/src/main/java/org/apache/flink/types/StringValue.java | StringValue.readString | public static String readString(DataInput in) throws IOException {
// the length we read is offset by one, because a length of zero indicates a null value
int len = in.readUnsignedByte();
if (len == 0) {
return null;
}
if (len >= HIGH_BIT) {
int shift = 7;
int curr;
len = len & 0x7f;
while ... | java | public static String readString(DataInput in) throws IOException {
// the length we read is offset by one, because a length of zero indicates a null value
int len = in.readUnsignedByte();
if (len == 0) {
return null;
}
if (len >= HIGH_BIT) {
int shift = 7;
int curr;
len = len & 0x7f;
while ... | [
"public",
"static",
"String",
"readString",
"(",
"DataInput",
"in",
")",
"throws",
"IOException",
"{",
"// the length we read is offset by one, because a length of zero indicates a null value",
"int",
"len",
"=",
"in",
".",
"readUnsignedByte",
"(",
")",
";",
"if",
"(",
... | -------------------------------------------------------------------------------------------- | [
"--------------------------------------------------------------------------------------------"
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-core/src/main/java/org/apache/flink/types/StringValue.java#L744-L786 | train | Reads a String from the specified input. | [
30522,
2270,
10763,
5164,
9631,
18886,
3070,
1006,
2951,
2378,
18780,
1999,
1007,
11618,
22834,
10288,
24422,
1063,
1013,
1013,
1996,
3091,
2057,
3191,
2003,
16396,
2011,
2028,
1010,
2138,
1037,
3091,
1997,
5717,
7127,
1037,
19701,
3643,
20... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
apache/incubator-shardingsphere | sharding-core/sharding-core-common/src/main/java/org/apache/shardingsphere/core/strategy/encrypt/ShardingEncryptorEngine.java | ShardingEncryptorEngine.getShardingEncryptor | public Optional<ShardingEncryptor> getShardingEncryptor(final String logicTableName, final String columnName) {
for (ShardingEncryptorStrategy each : shardingEncryptorStrategies.values()) {
Optional<ShardingEncryptor> result = each.getShardingEncryptor(logicTableName, columnName);
if (re... | java | public Optional<ShardingEncryptor> getShardingEncryptor(final String logicTableName, final String columnName) {
for (ShardingEncryptorStrategy each : shardingEncryptorStrategies.values()) {
Optional<ShardingEncryptor> result = each.getShardingEncryptor(logicTableName, columnName);
if (re... | [
"public",
"Optional",
"<",
"ShardingEncryptor",
">",
"getShardingEncryptor",
"(",
"final",
"String",
"logicTableName",
",",
"final",
"String",
"columnName",
")",
"{",
"for",
"(",
"ShardingEncryptorStrategy",
"each",
":",
"shardingEncryptorStrategies",
".",
"values",
"... | Get sharding encryptor.
@param logicTableName logic table name
@param columnName column name
@return optional of sharding encryptor | [
"Get",
"sharding",
"encryptor",
"."
] | f88fd29fc345dfb31fdce12e9e96cbfa0fd2402d | https://github.com/apache/incubator-shardingsphere/blob/f88fd29fc345dfb31fdce12e9e96cbfa0fd2402d/sharding-core/sharding-core-common/src/main/java/org/apache/shardingsphere/core/strategy/encrypt/ShardingEncryptorEngine.java#L56-L64 | train | Get sharding encryptor Optional. | [
30522,
2270,
11887,
1026,
21146,
17080,
25997,
26775,
22571,
4263,
1028,
4152,
11783,
15542,
26775,
22571,
4263,
1006,
2345,
5164,
7961,
10880,
18442,
1010,
2345,
5164,
5930,
18442,
1007,
1063,
2005,
1006,
21146,
17080,
25997,
26775,
22571,
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-extra/src/main/java/cn/hutool/extra/qrcode/QrCodeUtil.java | QrCodeUtil.decode | public static String decode(Image image, boolean isTryHarder, boolean isPureBarcode) {
final MultiFormatReader formatReader = new MultiFormatReader();
final LuminanceSource source = new BufferedImageLuminanceSource(ImgUtil.toBufferedImage(image));
final Binarizer binarizer = new HybridBinarizer(source);
f... | java | public static String decode(Image image, boolean isTryHarder, boolean isPureBarcode) {
final MultiFormatReader formatReader = new MultiFormatReader();
final LuminanceSource source = new BufferedImageLuminanceSource(ImgUtil.toBufferedImage(image));
final Binarizer binarizer = new HybridBinarizer(source);
f... | [
"public",
"static",
"String",
"decode",
"(",
"Image",
"image",
",",
"boolean",
"isTryHarder",
",",
"boolean",
"isPureBarcode",
")",
"{",
"final",
"MultiFormatReader",
"formatReader",
"=",
"new",
"MultiFormatReader",
"(",
")",
";",
"final",
"LuminanceSource",
"sour... | 将二维码图片解码为文本
@param image {@link Image} 二维码图片
@param isTryHarder 是否优化精度
@param isPureBarcode 是否使用复杂模式,扫描带logo的二维码设为true
@return 解码后的文本
@since 4.3.1 | [
"将二维码图片解码为文本"
] | bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-extra/src/main/java/cn/hutool/extra/qrcode/QrCodeUtil.java#L303-L330 | train | Decodes the given image. | [
30522,
2270,
10763,
5164,
30524,
3401,
3120,
1027,
2047,
17698,
2098,
9581,
12439,
12717,
7229,
9623,
8162,
3401,
1006,
10047,
27920,
4014,
1012,
2000,
8569,
12494,
2098,
9581,
3351,
1006,
3746,
1007,
1007,
1025,
2345,
8026,
8486,
6290,
802... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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 | resolver-dns/src/main/java/io/netty/resolver/dns/Cache.java | Cache.get | final List<? extends E> get(String hostname) {
Entries entries = resolveCache.get(hostname);
return entries == null ? null : entries.get();
} | java | final List<? extends E> get(String hostname) {
Entries entries = resolveCache.get(hostname);
return entries == null ? null : entries.get();
} | [
"final",
"List",
"<",
"?",
"extends",
"E",
">",
"get",
"(",
"String",
"hostname",
")",
"{",
"Entries",
"entries",
"=",
"resolveCache",
".",
"get",
"(",
"hostname",
")",
";",
"return",
"entries",
"==",
"null",
"?",
"null",
":",
"entries",
".",
"get",
... | Returns all caches entries for the given hostname. | [
"Returns",
"all",
"caches",
"entries",
"for",
"the",
"given",
"hostname",
"."
] | ba06eafa1c1824bd154f1a380019e7ea2edf3c4c | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/resolver-dns/src/main/java/io/netty/resolver/dns/Cache.java#L116-L119 | train | Get the domain information for the given hostname. | [
30522,
2345,
2862,
1026,
1029,
8908,
1041,
1028,
2131,
1006,
5164,
3677,
18442,
1007,
1063,
10445,
10445,
1027,
10663,
3540,
5403,
1012,
2131,
1006,
3677,
18442,
1007,
1025,
2709,
10445,
1027,
1027,
19701,
1029,
19701,
1024,
10445,
1012,
21... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
apache/spark | common/unsafe/src/main/java/org/apache/spark/unsafe/types/UTF8String.java | UTF8String.getBytes | public byte[] getBytes() {
// avoid copy if `base` is `byte[]`
if (offset == BYTE_ARRAY_OFFSET && base instanceof byte[]
&& ((byte[]) base).length == numBytes) {
return (byte[]) base;
} else {
byte[] bytes = new byte[numBytes];
copyMemory(base, offset, bytes, BYTE_ARRAY_OFFSET, numBy... | java | public byte[] getBytes() {
// avoid copy if `base` is `byte[]`
if (offset == BYTE_ARRAY_OFFSET && base instanceof byte[]
&& ((byte[]) base).length == numBytes) {
return (byte[]) base;
} else {
byte[] bytes = new byte[numBytes];
copyMemory(base, offset, bytes, BYTE_ARRAY_OFFSET, numBy... | [
"public",
"byte",
"[",
"]",
"getBytes",
"(",
")",
"{",
"// avoid copy if `base` is `byte[]`",
"if",
"(",
"offset",
"==",
"BYTE_ARRAY_OFFSET",
"&&",
"base",
"instanceof",
"byte",
"[",
"]",
"&&",
"(",
"(",
"byte",
"[",
"]",
")",
"base",
")",
".",
"length",
... | Returns the underline bytes, will be a copy of it if it's part of another array. | [
"Returns",
"the",
"underline",
"bytes",
"will",
"be",
"a",
"copy",
"of",
"it",
"if",
"it",
"s",
"part",
"of",
"another",
"array",
"."
] | 25ee0474f47d9c30d6f553a7892d9549f91071cf | https://github.com/apache/spark/blob/25ee0474f47d9c30d6f553a7892d9549f91071cf/common/unsafe/src/main/java/org/apache/spark/unsafe/types/UTF8String.java#L291-L301 | train | Gets the bytes. | [
30522,
2270,
24880,
1031,
1033,
2131,
3762,
4570,
1006,
1007,
1063,
1013,
1013,
4468,
6100,
2065,
1036,
2918,
1036,
2003,
1036,
24880,
1031,
1033,
1036,
2065,
1006,
16396,
1027,
1027,
24880,
1035,
9140,
1035,
16396,
1004,
1004,
2918,
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-runtime/src/main/java/org/apache/flink/runtime/io/disk/iomanager/IOManagerAsync.java | IOManagerAsync.createBlockChannelWriter | @Override
public BlockChannelWriter<MemorySegment> createBlockChannelWriter(FileIOChannel.ID channelID,
LinkedBlockingQueue<MemorySegment> returnQueue) throws IOException
{
checkState(!isShutdown.get(), "I/O-Manager is shut down.");
return new AsynchronousBlockWriter(channelID, this.writers[channelID.getT... | java | @Override
public BlockChannelWriter<MemorySegment> createBlockChannelWriter(FileIOChannel.ID channelID,
LinkedBlockingQueue<MemorySegment> returnQueue) throws IOException
{
checkState(!isShutdown.get(), "I/O-Manager is shut down.");
return new AsynchronousBlockWriter(channelID, this.writers[channelID.getT... | [
"@",
"Override",
"public",
"BlockChannelWriter",
"<",
"MemorySegment",
">",
"createBlockChannelWriter",
"(",
"FileIOChannel",
".",
"ID",
"channelID",
",",
"LinkedBlockingQueue",
"<",
"MemorySegment",
">",
"returnQueue",
")",
"throws",
"IOException",
"{",
"checkState",
... | ------------------------------------------------------------------------ | [
"------------------------------------------------------------------------"
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/io/disk/iomanager/IOManagerAsync.java#L196-L202 | train | Create a block channel writer. | [
30522,
1030,
2058,
15637,
2270,
3796,
26058,
15994,
1026,
3638,
3366,
21693,
4765,
1028,
3443,
23467,
26058,
15994,
1006,
5371,
3695,
26058,
1012,
8909,
3149,
3593,
1010,
5799,
23467,
2075,
4226,
5657,
1026,
3638,
3366,
21693,
4765,
1028,
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... |
SeleniumHQ/selenium | java/client/src/org/openqa/selenium/interactions/Actions.java | Actions.contextClick | public Actions contextClick() {
if (isBuildingActions()) {
action.addAction(new ContextClickAction(jsonMouse, null));
}
return clickInTicks(RIGHT);
} | java | public Actions contextClick() {
if (isBuildingActions()) {
action.addAction(new ContextClickAction(jsonMouse, null));
}
return clickInTicks(RIGHT);
} | [
"public",
"Actions",
"contextClick",
"(",
")",
"{",
"if",
"(",
"isBuildingActions",
"(",
")",
")",
"{",
"action",
".",
"addAction",
"(",
"new",
"ContextClickAction",
"(",
"jsonMouse",
",",
"null",
")",
")",
";",
"}",
"return",
"clickInTicks",
"(",
"RIGHT",... | Performs a context-click at the current mouse location.
@return A self reference. | [
"Performs",
"a",
"context",
"-",
"click",
"at",
"the",
"current",
"mouse",
"location",
"."
] | 7af172729f17b20269c8ca4ea6f788db48616535 | https://github.com/SeleniumHQ/selenium/blob/7af172729f17b20269c8ca4ea6f788db48616535/java/client/src/org/openqa/selenium/interactions/Actions.java#L432-L438 | train | Clicks the context of the current element. | [
30522,
2270,
4506,
6123,
20464,
6799,
1006,
1007,
1063,
2065,
1006,
2003,
25820,
18908,
8496,
1006,
1007,
1007,
1063,
2895,
1012,
5587,
18908,
3258,
1006,
2047,
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... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
apache/flink | flink-streaming-java/src/main/java/org/apache/flink/streaming/api/graph/StreamGraphGenerator.java | StreamGraphGenerator.transformSplit | private <T> Collection<Integer> transformSplit(SplitTransformation<T> split) {
StreamTransformation<T> input = split.getInput();
Collection<Integer> resultIds = transform(input);
validateSplitTransformation(input);
// the recursive transform call might have transformed this already
if (alreadyTransformed.c... | java | private <T> Collection<Integer> transformSplit(SplitTransformation<T> split) {
StreamTransformation<T> input = split.getInput();
Collection<Integer> resultIds = transform(input);
validateSplitTransformation(input);
// the recursive transform call might have transformed this already
if (alreadyTransformed.c... | [
"private",
"<",
"T",
">",
"Collection",
"<",
"Integer",
">",
"transformSplit",
"(",
"SplitTransformation",
"<",
"T",
">",
"split",
")",
"{",
"StreamTransformation",
"<",
"T",
">",
"input",
"=",
"split",
".",
"getInput",
"(",
")",
";",
"Collection",
"<",
... | Transforms a {@code SplitTransformation}.
<p>We add the output selector to previously transformed nodes. | [
"Transforms",
"a",
"{",
"@code",
"SplitTransformation",
"}",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-streaming-java/src/main/java/org/apache/flink/streaming/api/graph/StreamGraphGenerator.java#L263-L280 | train | Transform a split transformation. | [
30522,
2797,
1026,
1056,
1028,
3074,
1026,
16109,
1028,
21743,
24759,
4183,
1006,
3975,
6494,
3619,
14192,
3370,
1026,
1056,
1028,
3975,
1007,
1063,
5460,
6494,
3619,
14192,
3370,
1026,
1056,
1028,
7953,
1027,
3975,
1012,
2131,
2378,
18780,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
looly/hutool | hutool-db/src/main/java/cn/hutool/db/nosql/mongo/MongoFactory.java | MongoFactory.getDS | public static MongoDS getDS(Collection<String> groups) {
return getDS(groups.toArray(new String[groups.size()]));
} | java | public static MongoDS getDS(Collection<String> groups) {
return getDS(groups.toArray(new String[groups.size()]));
} | [
"public",
"static",
"MongoDS",
"getDS",
"(",
"Collection",
"<",
"String",
">",
"groups",
")",
"{",
"return",
"getDS",
"(",
"groups",
".",
"toArray",
"(",
"new",
"String",
"[",
"groups",
".",
"size",
"(",
")",
"]",
")",
")",
";",
"}"
] | 获取MongoDB数据源<br>
@param groups 分组列表
@return MongoDB连接 | [
"获取MongoDB数据源<br",
">"
] | bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-db/src/main/java/cn/hutool/db/nosql/mongo/MongoFactory.java#L79-L81 | train | Gets the DS object for the given collection of groups. | [
30522,
2270,
10763,
12256,
3995,
5104,
2131,
5104,
1006,
3074,
1026,
5164,
1028,
2967,
1007,
1063,
2709,
2131,
5104,
1006,
2967,
1012,
2000,
2906,
9447,
1006,
2047,
5164,
1031,
2967,
1012,
2946,
1006,
1007,
1033,
1007,
1007,
1025,
1065,
1... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
alibaba/canal | client-adapter/elasticsearch/src/main/java/com/alibaba/otter/canal/client/adapter/es/support/ESTemplate.java | ESTemplate.getESDataFromDmlData | public Object getESDataFromDmlData(ESMapping mapping, Map<String, Object> dmlData,
Map<String, Object> esFieldData) {
SchemaItem schemaItem = mapping.getSchemaItem();
String idFieldName = mapping.get_id() == null ? mapping.getPk() : mapping.get_id();
Object... | java | public Object getESDataFromDmlData(ESMapping mapping, Map<String, Object> dmlData,
Map<String, Object> esFieldData) {
SchemaItem schemaItem = mapping.getSchemaItem();
String idFieldName = mapping.get_id() == null ? mapping.getPk() : mapping.get_id();
Object... | [
"public",
"Object",
"getESDataFromDmlData",
"(",
"ESMapping",
"mapping",
",",
"Map",
"<",
"String",
",",
"Object",
">",
"dmlData",
",",
"Map",
"<",
"String",
",",
"Object",
">",
"esFieldData",
")",
"{",
"SchemaItem",
"schemaItem",
"=",
"mapping",
".",
"getSc... | 将dml的data转换为es的data
@param mapping 配置mapping
@param dmlData dml data
@param esFieldData es data
@return 返回 id 值 | [
"将dml的data转换为es的data"
] | 8f088cddc0755f4350c5aaae95c6e4002d90a40f | https://github.com/alibaba/canal/blob/8f088cddc0755f4350c5aaae95c6e4002d90a40f/client-adapter/elasticsearch/src/main/java/com/alibaba/otter/canal/client/adapter/es/support/ESTemplate.java#L371-L393 | train | Get ES data from DML data. | [
30522,
2270,
4874,
2131,
2229,
2850,
2696,
19699,
5358,
22117,
15150,
2696,
1006,
9686,
2863,
14853,
12375,
1010,
4949,
1026,
5164,
1010,
4874,
1028,
1040,
19968,
2850,
2696,
1010,
4949,
1026,
5164,
1010,
4874,
1028,
9686,
3790,
2850,
2696,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
looly/hutool | hutool-core/src/main/java/cn/hutool/core/lang/ClassScaner.java | ClassScaner.loadClass | private Class<?> loadClass(String className) {
Class<?> clazz = null;
try {
clazz = Class.forName(className, this.initialize, ClassUtil.getClassLoader());
} catch (NoClassDefFoundError e) {
// 由于依赖库导致的类无法加载,直接跳过此类
} catch (UnsupportedClassVersionError e) {
// 版本导致的不兼容的类,跳过
} catch (Exception ... | java | private Class<?> loadClass(String className) {
Class<?> clazz = null;
try {
clazz = Class.forName(className, this.initialize, ClassUtil.getClassLoader());
} catch (NoClassDefFoundError e) {
// 由于依赖库导致的类无法加载,直接跳过此类
} catch (UnsupportedClassVersionError e) {
// 版本导致的不兼容的类,跳过
} catch (Exception ... | [
"private",
"Class",
"<",
"?",
">",
"loadClass",
"(",
"String",
"className",
")",
"{",
"Class",
"<",
"?",
">",
"clazz",
"=",
"null",
";",
"try",
"{",
"clazz",
"=",
"Class",
".",
"forName",
"(",
"className",
",",
"this",
".",
"initialize",
",",
"ClassU... | 加载类
@param className 类名
@return 加载的类 | [
"加载类"
] | bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/lang/ClassScaner.java#L263-L276 | train | Load a class from the classpath. | [
30522,
2797,
2465,
1026,
1029,
1028,
7170,
26266,
1006,
5164,
2465,
18442,
1007,
1063,
2465,
1026,
1029,
1028,
18856,
10936,
2480,
1027,
19701,
1025,
3046,
1063,
18856,
10936,
2480,
1027,
2465,
1012,
2005,
18442,
1006,
2465,
18442,
1010,
20... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
apache/flink | flink-libraries/flink-gelly/src/main/java/org/apache/flink/graph/spargel/ScatterGatherIteration.java | ScatterGatherIteration.createResult | @Override
public DataSet<Vertex<K, VV>> createResult() {
if (this.initialVertices == null) {
throw new IllegalStateException("The input data set has not been set.");
}
// prepare some type information
TypeInformation<K> keyType = ((TupleTypeInfo<?>) initialVertices.getType()).getTypeAt(0);
TypeInformatio... | java | @Override
public DataSet<Vertex<K, VV>> createResult() {
if (this.initialVertices == null) {
throw new IllegalStateException("The input data set has not been set.");
}
// prepare some type information
TypeInformation<K> keyType = ((TupleTypeInfo<?>) initialVertices.getType()).getTypeAt(0);
TypeInformatio... | [
"@",
"Override",
"public",
"DataSet",
"<",
"Vertex",
"<",
"K",
",",
"VV",
">",
">",
"createResult",
"(",
")",
"{",
"if",
"(",
"this",
".",
"initialVertices",
"==",
"null",
")",
"{",
"throw",
"new",
"IllegalStateException",
"(",
"\"The input data set has not ... | Creates the operator that represents this scatter-gather graph computation.
@return The operator that represents this scatter-gather graph computation. | [
"Creates",
"the",
"operator",
"that",
"represents",
"this",
"scatter",
"-",
"gather",
"graph",
"computation",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-libraries/flink-gelly/src/main/java/org/apache/flink/graph/spargel/ScatterGatherIteration.java#L137-L179 | train | Creates the result data set. | [
30522,
1030,
2058,
15637,
2270,
2951,
13462,
1026,
19449,
1026,
1047,
1010,
1058,
2615,
1028,
1028,
3443,
6072,
11314,
1006,
1007,
1063,
2065,
1006,
2023,
1012,
3988,
16874,
23522,
1027,
1027,
19701,
1007,
1063,
5466,
2047,
6206,
9153,
1738... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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.getReader | public static ImageReader getReader(String type) {
final Iterator<ImageReader> iterator = ImageIO.getImageReadersByFormatName(type);
if (iterator.hasNext()) {
return iterator.next();
}
return null;
} | java | public static ImageReader getReader(String type) {
final Iterator<ImageReader> iterator = ImageIO.getImageReadersByFormatName(type);
if (iterator.hasNext()) {
return iterator.next();
}
return null;
} | [
"public",
"static",
"ImageReader",
"getReader",
"(",
"String",
"type",
")",
"{",
"final",
"Iterator",
"<",
"ImageReader",
">",
"iterator",
"=",
"ImageIO",
".",
"getImageReadersByFormatName",
"(",
"type",
")",
";",
"if",
"(",
"iterator",
".",
"hasNext",
"(",
... | 获得{@link ImageReader}
@param type 图片文件类型,例如 "jpeg" 或 "tiff"
@return {@link ImageReader} | [
"获得",
"{",
"@link",
"ImageReader",
"}"
] | bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/img/ImgUtil.java#L1508-L1514 | train | Gets the ImageReader for the specified format name. | [
30522,
2270,
10763,
3746,
16416,
4063,
2131,
16416,
4063,
1006,
5164,
2828,
1007,
1063,
2345,
2009,
6906,
4263,
1026,
3746,
16416,
4063,
1028,
2009,
6906,
4263,
1027,
3746,
3695,
1012,
2131,
9581,
4590,
13775,
2545,
3762,
14192,
4017,
18442... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
looly/hutool | hutool-core/src/main/java/cn/hutool/core/util/ClassUtil.java | ClassUtil.getPublicMethod | public static Method getPublicMethod(Class<?> clazz, String methodName, Class<?>... paramTypes) throws SecurityException {
return ReflectUtil.getPublicMethod(clazz, methodName, paramTypes);
} | java | public static Method getPublicMethod(Class<?> clazz, String methodName, Class<?>... paramTypes) throws SecurityException {
return ReflectUtil.getPublicMethod(clazz, methodName, paramTypes);
} | [
"public",
"static",
"Method",
"getPublicMethod",
"(",
"Class",
"<",
"?",
">",
"clazz",
",",
"String",
"methodName",
",",
"Class",
"<",
"?",
">",
"...",
"paramTypes",
")",
"throws",
"SecurityException",
"{",
"return",
"ReflectUtil",
".",
"getPublicMethod",
"(",... | 查找指定Public方法 如果找不到对应的方法或方法不为public的则返回<code>null</code>
@param clazz 类
@param methodName 方法名
@param paramTypes 参数类型
@return 方法
@throws SecurityException 无权访问抛出异常 | [
"查找指定Public方法",
"如果找不到对应的方法或方法不为public的则返回<code",
">",
"null<",
"/",
"code",
">"
] | bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/util/ClassUtil.java#L294-L296 | train | Get a public method from a class. | [
30522,
2270,
10763,
4118,
2131,
14289,
16558,
2594,
11368,
6806,
2094,
1006,
2465,
1026,
1029,
1028,
18856,
10936,
2480,
1010,
5164,
4118,
18442,
1010,
2465,
1026,
1029,
1028,
1012,
1012,
1012,
11498,
20492,
18863,
2015,
1007,
11618,
3036,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/taskexecutor/slot/TaskSlot.java | TaskSlot.markFree | public boolean markFree() {
if (isEmpty()) {
state = TaskSlotState.FREE;
this.jobId = null;
this.allocationId = null;
return true;
} else {
return false;
}
} | java | public boolean markFree() {
if (isEmpty()) {
state = TaskSlotState.FREE;
this.jobId = null;
this.allocationId = null;
return true;
} else {
return false;
}
} | [
"public",
"boolean",
"markFree",
"(",
")",
"{",
"if",
"(",
"isEmpty",
"(",
")",
")",
"{",
"state",
"=",
"TaskSlotState",
".",
"FREE",
";",
"this",
".",
"jobId",
"=",
"null",
";",
"this",
".",
"allocationId",
"=",
"null",
";",
"return",
"true",
";",
... | Mark the slot as free. A slot can only be marked as free if it's empty.
@return True if the new state is free; otherwise false | [
"Mark",
"the",
"slot",
"as",
"free",
".",
"A",
"slot",
"can",
"only",
"be",
"marked",
"as",
"free",
"if",
"it",
"s",
"empty",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/taskexecutor/slot/TaskSlot.java#L268-L278 | train | Mark this slot as free. | [
30522,
2270,
22017,
20898,
2928,
23301,
1006,
1007,
1063,
2065,
1006,
2003,
6633,
13876,
2100,
1006,
1007,
1007,
1063,
2110,
1027,
8518,
10994,
9153,
2618,
1012,
2489,
1025,
2023,
1012,
3105,
3593,
1027,
19701,
1025,
2023,
1012,
16169,
3593... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
apache/flink | flink-runtime/src/main/java/org/apache/flink/runtime/checkpoint/savepoint/SavepointSerializers.java | SavepointSerializers.getSerializer | @SuppressWarnings("unchecked")
public static <T extends Savepoint> SavepointSerializer<T> getSerializer(T savepoint) {
Preconditions.checkNotNull(savepoint, "Savepoint");
SavepointSerializer<T> serializer = (SavepointSerializer<T>) SERIALIZERS.get(savepoint.getVersion());
if (serializer != null) {
return seri... | java | @SuppressWarnings("unchecked")
public static <T extends Savepoint> SavepointSerializer<T> getSerializer(T savepoint) {
Preconditions.checkNotNull(savepoint, "Savepoint");
SavepointSerializer<T> serializer = (SavepointSerializer<T>) SERIALIZERS.get(savepoint.getVersion());
if (serializer != null) {
return seri... | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"static",
"<",
"T",
"extends",
"Savepoint",
">",
"SavepointSerializer",
"<",
"T",
">",
"getSerializer",
"(",
"T",
"savepoint",
")",
"{",
"Preconditions",
".",
"checkNotNull",
"(",
"savepoint",
",",
... | Returns the {@link SavepointSerializer} for the given savepoint.
@param savepoint Savepoint to get serializer for
@param <T> Type of savepoint
@return Savepoint serializer for the savepoint
@throws IllegalArgumentException If unknown savepoint version | [
"Returns",
"the",
"{",
"@link",
"SavepointSerializer",
"}",
"for",
"the",
"given",
"savepoint",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/checkpoint/savepoint/SavepointSerializers.java#L56-L65 | train | Gets the serializer for the given savepoint. | [
30522,
1030,
16081,
9028,
5582,
2015,
1006,
1000,
4895,
5403,
18141,
1000,
1007,
2270,
10763,
1026,
1056,
8908,
3828,
8400,
1028,
3828,
26521,
11610,
28863,
1026,
1056,
1028,
4152,
11610,
28863,
1006,
1056,
3828,
8400,
1007,
1063,
3653,
866... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
netty/netty | codec-http/src/main/java/io/netty/handler/codec/http/HttpHeaders.java | HttpHeaders.setDateHeader | @Deprecated
public static void setDateHeader(HttpMessage message, String name, Iterable<Date> values) {
message.headers().set(name, values);
} | java | @Deprecated
public static void setDateHeader(HttpMessage message, String name, Iterable<Date> values) {
message.headers().set(name, values);
} | [
"@",
"Deprecated",
"public",
"static",
"void",
"setDateHeader",
"(",
"HttpMessage",
"message",
",",
"String",
"name",
",",
"Iterable",
"<",
"Date",
">",
"values",
")",
"{",
"message",
".",
"headers",
"(",
")",
".",
"set",
"(",
"name",
",",
"values",
")",... | @deprecated Use {@link #set(CharSequence, Iterable)} instead.
@see #setDateHeader(HttpMessage, CharSequence, Iterable) | [
"@deprecated",
"Use",
"{",
"@link",
"#set",
"(",
"CharSequence",
"Iterable",
")",
"}",
"instead",
"."
] | ba06eafa1c1824bd154f1a380019e7ea2edf3c4c | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/codec-http/src/main/java/io/netty/handler/codec/http/HttpHeaders.java#L914-L917 | train | Sets a date header. | [
30522,
1030,
2139,
28139,
12921,
2270,
10763,
11675,
2275,
13701,
4974,
2121,
1006,
8299,
7834,
3736,
3351,
4471,
1010,
5164,
2171,
1010,
2009,
6906,
3468,
1026,
3058,
1028,
5300,
1007,
1063,
4471,
1012,
20346,
2015,
1006,
1007,
1012,
2275,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
looly/hutool | hutool-core/src/main/java/cn/hutool/core/collection/CollUtil.java | CollUtil.filter | public static <T> List<T> filter(List<T> list, Filter<T> filter) {
if (null == list || null == filter) {
return list;
}
final List<T> list2 = (list instanceof LinkedList) ? new LinkedList<T>() : new ArrayList<T>(list.size());
for (T t : list) {
if (filter.accept(t)) {
list2.add(t);
}
}
... | java | public static <T> List<T> filter(List<T> list, Filter<T> filter) {
if (null == list || null == filter) {
return list;
}
final List<T> list2 = (list instanceof LinkedList) ? new LinkedList<T>() : new ArrayList<T>(list.size());
for (T t : list) {
if (filter.accept(t)) {
list2.add(t);
}
}
... | [
"public",
"static",
"<",
"T",
">",
"List",
"<",
"T",
">",
"filter",
"(",
"List",
"<",
"T",
">",
"list",
",",
"Filter",
"<",
"T",
">",
"filter",
")",
"{",
"if",
"(",
"null",
"==",
"list",
"||",
"null",
"==",
"filter",
")",
"{",
"return",
"list",... | 过滤<br>
过滤过程通过传入的Filter实现来过滤返回需要的元素内容,这个Filter实现可以实现以下功能:
<pre>
1、过滤出需要的对象,{@link Filter#accept(Object)}方法返回true的对象将被加入结果集合中
</pre>
@param <T> 集合元素类型
@param list 集合
@param filter 过滤器
@return 过滤后的数组
@since 4.1.8 | [
"过滤<br",
">",
"过滤过程通过传入的Filter实现来过滤返回需要的元素内容,这个Filter实现可以实现以下功能:"
] | bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/collection/CollUtil.java#L1039-L1050 | train | Returns a new list that contains only those objects that match the given filter. | [
30522,
2270,
10763,
1026,
1056,
1028,
2862,
1026,
1056,
1028,
11307,
1006,
2862,
1026,
1056,
1028,
2862,
1010,
11307,
1026,
1056,
1028,
11307,
1007,
1063,
2065,
1006,
19701,
1027,
1027,
2862,
1064,
1064,
19701,
1027,
1027,
11307,
1007,
1063... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
apache/spark | sql/hive-thriftserver/src/gen/java/org/apache/hive/service/cli/thrift/TOpenSessionReq.java | TOpenSessionReq.isSet | public boolean isSet(_Fields field) {
if (field == null) {
throw new IllegalArgumentException();
}
switch (field) {
case CLIENT_PROTOCOL:
return isSetClient_protocol();
case USERNAME:
return isSetUsername();
case PASSWORD:
return isSetPassword();
case CONFIGURATION:
... | java | public boolean isSet(_Fields field) {
if (field == null) {
throw new IllegalArgumentException();
}
switch (field) {
case CLIENT_PROTOCOL:
return isSetClient_protocol();
case USERNAME:
return isSetUsername();
case PASSWORD:
return isSetPassword();
case CONFIGURATION:
... | [
"public",
"boolean",
"isSet",
"(",
"_Fields",
"field",
")",
"{",
"if",
"(",
"field",
"==",
"null",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
")",
";",
"}",
"switch",
"(",
"field",
")",
"{",
"case",
"CLIENT_PROTOCOL",
":",
"return",
"isSe... | Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise | [
"Returns",
"true",
"if",
"field",
"corresponding",
"to",
"fieldID",
"is",
"set",
"(",
"has",
"been",
"assigned",
"a",
"value",
")",
"and",
"false",
"otherwise"
] | 25ee0474f47d9c30d6f553a7892d9549f91071cf | https://github.com/apache/spark/blob/25ee0474f47d9c30d6f553a7892d9549f91071cf/sql/hive-thriftserver/src/gen/java/org/apache/hive/service/cli/thrift/TOpenSessionReq.java#L365-L381 | train | Checks if field is set to a value of a CRAsCTYPE | [
30522,
2270,
22017,
20898,
26354,
3388,
1006,
1035,
4249,
2492,
1007,
1063,
2065,
1006,
2492,
1027,
1027,
19701,
1007,
1063,
5466,
2047,
6206,
2906,
22850,
15781,
2595,
24422,
1006,
1007,
1025,
1065,
6942,
1006,
2492,
1007,
1063,
2553,
7396... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/InternalMailUtil.java | InternalMailUtil.parseAddressFromStrs | public static InternetAddress[] parseAddressFromStrs(String[] addrStrs, Charset charset) {
final List<InternetAddress> resultList = new ArrayList<>(addrStrs.length);
InternetAddress[] addrs;
for (int i = 0; i < addrStrs.length; i++) {
addrs = parseAddress(addrStrs[i], charset);
if(ArrayUtil.isNotEmpty(... | java | public static InternetAddress[] parseAddressFromStrs(String[] addrStrs, Charset charset) {
final List<InternetAddress> resultList = new ArrayList<>(addrStrs.length);
InternetAddress[] addrs;
for (int i = 0; i < addrStrs.length; i++) {
addrs = parseAddress(addrStrs[i], charset);
if(ArrayUtil.isNotEmpty(... | [
"public",
"static",
"InternetAddress",
"[",
"]",
"parseAddressFromStrs",
"(",
"String",
"[",
"]",
"addrStrs",
",",
"Charset",
"charset",
")",
"{",
"final",
"List",
"<",
"InternetAddress",
">",
"resultList",
"=",
"new",
"ArrayList",
"<>",
"(",
"addrStrs",
".",
... | 将多个字符串邮件地址转为{@link InternetAddress}列表<br>
单个字符串地址可以是多个地址合并的字符串
@param addrStrs 地址数组
@param charset 编码(主要用于中文用户名的编码)
@return 地址数组
@since 4.0.3 | [
"将多个字符串邮件地址转为",
"{",
"@link",
"InternetAddress",
"}",
"列表<br",
">",
"单个字符串地址可以是多个地址合并的字符串"
] | bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-extra/src/main/java/cn/hutool/extra/mail/InternalMailUtil.java#L30-L42 | train | Parses an array of strings containing a list of IPv4 addresses. | [
30522,
2270,
10763,
4274,
4215,
16200,
4757,
1031,
1033,
11968,
17310,
14141,
8303,
19699,
22225,
16344,
2015,
1006,
5164,
1031,
1033,
5587,
12096,
2869,
1010,
25869,
13462,
25869,
13462,
1007,
1063,
2345,
2862,
1026,
4274,
4215,
16200,
4757,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/query/QueryableStateUtils.java | QueryableStateUtils.createKvStateClientProxy | public static KvStateClientProxy createKvStateClientProxy(
final InetAddress address,
final Iterator<Integer> ports,
final int eventLoopThreads,
final int queryThreads,
final KvStateRequestStats stats) {
Preconditions.checkNotNull(address, "address");
Preconditions.checkNotNull(stats, "stats");
P... | java | public static KvStateClientProxy createKvStateClientProxy(
final InetAddress address,
final Iterator<Integer> ports,
final int eventLoopThreads,
final int queryThreads,
final KvStateRequestStats stats) {
Preconditions.checkNotNull(address, "address");
Preconditions.checkNotNull(stats, "stats");
P... | [
"public",
"static",
"KvStateClientProxy",
"createKvStateClientProxy",
"(",
"final",
"InetAddress",
"address",
",",
"final",
"Iterator",
"<",
"Integer",
">",
"ports",
",",
"final",
"int",
"eventLoopThreads",
",",
"final",
"int",
"queryThreads",
",",
"final",
"KvState... | Initializes the {@link KvStateClientProxy client proxy} responsible for
receiving requests from the external (to the cluster) client and forwarding them internally.
@param address the address to bind to.
@param ports the range of ports the proxy will attempt to listen to
(see {@link org.apache.flink.configuration.Quer... | [
"Initializes",
"the",
"{",
"@link",
"KvStateClientProxy",
"client",
"proxy",
"}",
"responsible",
"for",
"receiving",
"requests",
"from",
"the",
"external",
"(",
"to",
"the",
"cluster",
")",
"client",
"and",
"forwarding",
"them",
"internally",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/query/QueryableStateUtils.java#L56-L94 | train | Creates a new Queryable State Client Proxy. | [
30522,
2270,
10763,
24888,
9153,
26557,
8751,
3372,
21572,
18037,
3443,
2243,
15088,
12259,
20464,
11638,
21572,
18037,
1006,
2345,
1999,
12928,
14141,
8303,
4769,
1010,
2345,
2009,
6906,
4263,
1026,
16109,
1028,
8831,
1010,
2345,
20014,
2724... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/server/OneForOneStreamManager.java | OneForOneStreamManager.parseStreamChunkId | public static Pair<Long, Integer> parseStreamChunkId(String streamChunkId) {
String[] array = streamChunkId.split("_");
assert array.length == 2:
"Stream id and chunk index should be specified.";
long streamId = Long.valueOf(array[0]);
int chunkIndex = Integer.valueOf(array[1]);
return Immutab... | java | public static Pair<Long, Integer> parseStreamChunkId(String streamChunkId) {
String[] array = streamChunkId.split("_");
assert array.length == 2:
"Stream id and chunk index should be specified.";
long streamId = Long.valueOf(array[0]);
int chunkIndex = Integer.valueOf(array[1]);
return Immutab... | [
"public",
"static",
"Pair",
"<",
"Long",
",",
"Integer",
">",
"parseStreamChunkId",
"(",
"String",
"streamChunkId",
")",
"{",
"String",
"[",
"]",
"array",
"=",
"streamChunkId",
".",
"split",
"(",
"\"_\"",
")",
";",
"assert",
"array",
".",
"length",
"==",
... | stream. | [
"stream",
"."
] | 25ee0474f47d9c30d6f553a7892d9549f91071cf | https://github.com/apache/spark/blob/25ee0474f47d9c30d6f553a7892d9549f91071cf/common/network-common/src/main/java/org/apache/spark/network/server/OneForOneStreamManager.java#L109-L116 | train | Parses a chunk id. | [
30522,
2270,
10763,
3940,
1026,
2146,
1010,
16109,
1028,
11968,
8583,
25379,
20760,
8950,
3593,
1006,
5164,
5460,
20760,
8950,
3593,
1007,
1063,
5164,
1031,
1033,
9140,
1027,
5460,
20760,
8950,
3593,
1012,
3975,
1006,
1000,
1035,
1000,
1007... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
apache/spark | launcher/src/main/java/org/apache/spark/launcher/CommandBuilderUtils.java | CommandBuilderUtils.firstNonEmptyValue | static String firstNonEmptyValue(String key, Map<?, ?>... maps) {
for (Map<?, ?> map : maps) {
String value = (String) map.get(key);
if (!isEmpty(value)) {
return value;
}
}
return null;
} | java | static String firstNonEmptyValue(String key, Map<?, ?>... maps) {
for (Map<?, ?> map : maps) {
String value = (String) map.get(key);
if (!isEmpty(value)) {
return value;
}
}
return null;
} | [
"static",
"String",
"firstNonEmptyValue",
"(",
"String",
"key",
",",
"Map",
"<",
"?",
",",
"?",
">",
"...",
"maps",
")",
"{",
"for",
"(",
"Map",
"<",
"?",
",",
"?",
">",
"map",
":",
"maps",
")",
"{",
"String",
"value",
"=",
"(",
"String",
")",
... | Returns the first non-empty value mapped to the given key in the given maps, or null otherwise. | [
"Returns",
"the",
"first",
"non",
"-",
"empty",
"value",
"mapped",
"to",
"the",
"given",
"key",
"in",
"the",
"given",
"maps",
"or",
"null",
"otherwise",
"."
] | 25ee0474f47d9c30d6f553a7892d9549f91071cf | https://github.com/apache/spark/blob/25ee0474f47d9c30d6f553a7892d9549f91071cf/launcher/src/main/java/org/apache/spark/launcher/CommandBuilderUtils.java#L70-L78 | train | Get the first non - empty value from the map. | [
30522,
10763,
5164,
2034,
8540,
6633,
13876,
2100,
10175,
5657,
1006,
5164,
3145,
1010,
4949,
1026,
1029,
1010,
1029,
1028,
1012,
1012,
1012,
7341,
1007,
1063,
2005,
1006,
4949,
1026,
1029,
1010,
1029,
1028,
4949,
1024,
7341,
1007,
1063,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
netty/netty | handler/src/main/java/io/netty/handler/ssl/ReferenceCountedOpenSslContext.java | ReferenceCountedOpenSslContext.providerFor | static OpenSslKeyMaterialProvider providerFor(KeyManagerFactory factory, String password) {
if (factory instanceof OpenSslX509KeyManagerFactory) {
return ((OpenSslX509KeyManagerFactory) factory).newProvider();
}
X509KeyManager keyManager = chooseX509KeyManager(factory.getKeyManagers... | java | static OpenSslKeyMaterialProvider providerFor(KeyManagerFactory factory, String password) {
if (factory instanceof OpenSslX509KeyManagerFactory) {
return ((OpenSslX509KeyManagerFactory) factory).newProvider();
}
X509KeyManager keyManager = chooseX509KeyManager(factory.getKeyManagers... | [
"static",
"OpenSslKeyMaterialProvider",
"providerFor",
"(",
"KeyManagerFactory",
"factory",
",",
"String",
"password",
")",
"{",
"if",
"(",
"factory",
"instanceof",
"OpenSslX509KeyManagerFactory",
")",
"{",
"return",
"(",
"(",
"OpenSslX509KeyManagerFactory",
")",
"facto... | Returns the {@link OpenSslKeyMaterialProvider} that should be used for OpenSSL. Depending on the given
{@link KeyManagerFactory} this may cache the {@link OpenSslKeyMaterial} for better performance if it can
ensure that the same material is always returned for the same alias. | [
"Returns",
"the",
"{"
] | ba06eafa1c1824bd154f1a380019e7ea2edf3c4c | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/handler/src/main/java/io/netty/handler/ssl/ReferenceCountedOpenSslContext.java#L899-L911 | train | Returns a new OpenSslKeyMaterialProvider based on the key manager factory. | [
30522,
10763,
7480,
14540,
14839,
8585,
14482,
21572,
17258,
2121,
10802,
29278,
1006,
3145,
24805,
4590,
21450,
4713,
1010,
5164,
20786,
1007,
1063,
2065,
1006,
4713,
6013,
11253,
7480,
14540,
2595,
12376,
2683,
14839,
24805,
4590,
21450,
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... |
spring-projects/spring-boot | spring-boot-project/spring-boot-tools/spring-boot-loader-tools/src/main/java/org/springframework/boot/loader/tools/JarWriter.java | JarWriter.writeEntry | @Override
public void writeEntry(String entryName, InputStream inputStream) throws IOException {
JarArchiveEntry entry = new JarArchiveEntry(entryName);
writeEntry(entry, new InputStreamEntryWriter(inputStream, true));
} | java | @Override
public void writeEntry(String entryName, InputStream inputStream) throws IOException {
JarArchiveEntry entry = new JarArchiveEntry(entryName);
writeEntry(entry, new InputStreamEntryWriter(inputStream, true));
} | [
"@",
"Override",
"public",
"void",
"writeEntry",
"(",
"String",
"entryName",
",",
"InputStream",
"inputStream",
")",
"throws",
"IOException",
"{",
"JarArchiveEntry",
"entry",
"=",
"new",
"JarArchiveEntry",
"(",
"entryName",
")",
";",
"writeEntry",
"(",
"entry",
... | Writes an entry. The {@code inputStream} is closed once the entry has been written
@param entryName the name of the entry
@param inputStream the stream from which the entry's data can be read
@throws IOException if the write fails | [
"Writes",
"an",
"entry",
".",
"The",
"{"
] | 0b27f7c70e164b2b1a96477f1d9c1acba56790c1 | https://github.com/spring-projects/spring-boot/blob/0b27f7c70e164b2b1a96477f1d9c1acba56790c1/spring-boot-project/spring-boot-tools/spring-boot-loader-tools/src/main/java/org/springframework/boot/loader/tools/JarWriter.java#L167-L171 | train | Write an entry to the jar archive. | [
30522,
1030,
2058,
15637,
2270,
11675,
4339,
4765,
2854,
1006,
5164,
4443,
18442,
1010,
20407,
25379,
20407,
25379,
1007,
11618,
22834,
10288,
24422,
1063,
15723,
2906,
5428,
3726,
4765,
2854,
4443,
1027,
2047,
15723,
2906,
5428,
3726,
4765,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/DoubleArrayTrie.java | DoubleArrayTrie.fetch | private int fetch(Node parent, List<Node> siblings)
{
if (error_ < 0)
return 0;
int prev = 0;
for (int i = parent.left; i < parent.right; i++)
{
if ((length != null ? length[i] : key.get(i).length()) < parent.depth)
continue;
Str... | java | private int fetch(Node parent, List<Node> siblings)
{
if (error_ < 0)
return 0;
int prev = 0;
for (int i = parent.left; i < parent.right; i++)
{
if ((length != null ? length[i] : key.get(i).length()) < parent.depth)
continue;
Str... | [
"private",
"int",
"fetch",
"(",
"Node",
"parent",
",",
"List",
"<",
"Node",
">",
"siblings",
")",
"{",
"if",
"(",
"error_",
"<",
"0",
")",
"return",
"0",
";",
"int",
"prev",
"=",
"0",
";",
"for",
"(",
"int",
"i",
"=",
"parent",
".",
"left",
";"... | 获取直接相连的子节点
@param parent 父节点
@param siblings (子)兄弟节点
@return 兄弟节点个数 | [
"获取直接相连的子节点"
] | a538d0722ab2e4980a9dcd9ea40324fc3ddba7ce | https://github.com/hankcs/HanLP/blob/a538d0722ab2e4980a9dcd9ea40324fc3ddba7ce/src/main/java/com/hankcs/hanlp/collection/trie/DoubleArrayTrie.java#L110-L153 | train | Fetch the count of nodes from a node. | [
30522,
2797,
20014,
18584,
1006,
13045,
6687,
1010,
2862,
1026,
13045,
1028,
9504,
1007,
1063,
2065,
1006,
7561,
1035,
1026,
1014,
1007,
2709,
1014,
1025,
20014,
3653,
2615,
1027,
1014,
1025,
2005,
1006,
20014,
1045,
1027,
6687,
1012,
2187,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
apache/flink | flink-filesystems/flink-fs-hadoop-shaded/src/main/java/org/apache/hadoop/conf/Configuration.java | Configuration.getInt | public int getInt(String name, int defaultValue) {
String valueString = getTrimmed(name);
if (valueString == null)
return defaultValue;
String hexString = getHexDigits(valueString);
if (hexString != null) {
return Integer.parseInt(hexString, 16);
}
return Integer.parseInt(valueString);
} | java | public int getInt(String name, int defaultValue) {
String valueString = getTrimmed(name);
if (valueString == null)
return defaultValue;
String hexString = getHexDigits(valueString);
if (hexString != null) {
return Integer.parseInt(hexString, 16);
}
return Integer.parseInt(valueString);
} | [
"public",
"int",
"getInt",
"(",
"String",
"name",
",",
"int",
"defaultValue",
")",
"{",
"String",
"valueString",
"=",
"getTrimmed",
"(",
"name",
")",
";",
"if",
"(",
"valueString",
"==",
"null",
")",
"return",
"defaultValue",
";",
"String",
"hexString",
"=... | Get the value of the <code>name</code> property as an <code>int</code>.
If no such property exists, the provided default value is returned,
or if the specified value is not a valid <code>int</code>,
then an error is thrown.
@param name property name.
@param defaultValue default value.
@throws NumberFormatException wh... | [
"Get",
"the",
"value",
"of",
"the",
"<code",
">",
"name<",
"/",
"code",
">",
"property",
"as",
"an",
"<code",
">",
"int<",
"/",
"code",
">",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-filesystems/flink-fs-hadoop-shaded/src/main/java/org/apache/hadoop/conf/Configuration.java#L1353-L1362 | train | Returns the value of the specified attribute as an int. | [
30522,
2270,
20014,
2131,
18447,
1006,
5164,
2171,
1010,
20014,
12398,
10175,
5657,
1007,
1063,
5164,
5300,
18886,
3070,
1027,
2131,
18886,
20058,
2094,
1006,
2171,
1007,
1025,
2065,
1006,
5300,
18886,
3070,
1027,
1027,
19701,
1007,
2709,
1... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
alibaba/canal | driver/src/main/java/com/alibaba/otter/canal/parse/driver/mysql/packets/client/BinlogDumpCommandPacket.java | BinlogDumpCommandPacket.toBytes | public byte[] toBytes() throws IOException {
ByteArrayOutputStream out = new ByteArrayOutputStream();
// 0. write command number
out.write(getCommand());
// 1. write 4 bytes bin-log position to start at
ByteHelper.writeUnsignedIntLittleEndian(binlogPosition, out);
// 2. w... | java | public byte[] toBytes() throws IOException {
ByteArrayOutputStream out = new ByteArrayOutputStream();
// 0. write command number
out.write(getCommand());
// 1. write 4 bytes bin-log position to start at
ByteHelper.writeUnsignedIntLittleEndian(binlogPosition, out);
// 2. w... | [
"public",
"byte",
"[",
"]",
"toBytes",
"(",
")",
"throws",
"IOException",
"{",
"ByteArrayOutputStream",
"out",
"=",
"new",
"ByteArrayOutputStream",
"(",
")",
";",
"// 0. write command number",
"out",
".",
"write",
"(",
"getCommand",
"(",
")",
")",
";",
"// 1. ... | <pre>
Bytes Name
----- ----
1 command
n arg
--------------------------------------------------------
Bytes Name
----- ----
4 binlog position to sta... | [
"<pre",
">",
"Bytes",
"Name",
"-----",
"----",
"1",
"command",
"n",
"arg",
"--------------------------------------------------------",
"Bytes",
"Name",
"-----",
"----",
"4",
"binlog",
"position",
"to",
"start",
"at",
"(",
"little",
"endian",
")",
"2",
"binlog",
... | 8f088cddc0755f4350c5aaae95c6e4002d90a40f | https://github.com/alibaba/canal/blob/8f088cddc0755f4350c5aaae95c6e4002d90a40f/driver/src/main/java/com/alibaba/otter/canal/parse/driver/mysql/packets/client/BinlogDumpCommandPacket.java#L50-L68 | train | Serialize the record to bytes. | [
30522,
2270,
24880,
1031,
1033,
11291,
4570,
1006,
1007,
11618,
22834,
10288,
24422,
1063,
24880,
2906,
9447,
5833,
18780,
21422,
2041,
1027,
2047,
24880,
2906,
9447,
5833,
18780,
21422,
1006,
1007,
1025,
1013,
1013,
1014,
1012,
4339,
3094,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
apache/flink | flink-table/flink-table-runtime-blink/src/main/java/org/apache/flink/table/util/SegmentsUtil.java | SegmentsUtil.setLong | public static void setLong(MemorySegment[] segments, int offset, long value) {
if (inFirstSegment(segments, offset, 8)) {
segments[0].putLong(offset, value);
} else {
setLongMultiSegments(segments, offset, value);
}
} | java | public static void setLong(MemorySegment[] segments, int offset, long value) {
if (inFirstSegment(segments, offset, 8)) {
segments[0].putLong(offset, value);
} else {
setLongMultiSegments(segments, offset, value);
}
} | [
"public",
"static",
"void",
"setLong",
"(",
"MemorySegment",
"[",
"]",
"segments",
",",
"int",
"offset",
",",
"long",
"value",
")",
"{",
"if",
"(",
"inFirstSegment",
"(",
"segments",
",",
"offset",
",",
"8",
")",
")",
"{",
"segments",
"[",
"0",
"]",
... | set long from segments.
@param segments target segments.
@param offset value offset. | [
"set",
"long",
"from",
"segments",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-table/flink-table-runtime-blink/src/main/java/org/apache/flink/table/util/SegmentsUtil.java#L755-L761 | train | set long from segments. | [
30522,
2270,
10763,
11675,
2275,
10052,
1006,
3638,
3366,
21693,
4765,
1031,
1033,
9214,
1010,
20014,
16396,
1010,
2146,
3643,
1007,
1063,
2065,
1006,
1999,
8873,
12096,
3366,
21693,
4765,
1006,
9214,
1010,
16396,
1010,
1022,
1007,
1007,
10... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
apache/flink | flink-libraries/flink-gelly/src/main/java/org/apache/flink/graph/Graph.java | Graph.reduceOnNeighbors | public DataSet<Tuple2<K, VV>> reduceOnNeighbors(ReduceNeighborsFunction<VV> reduceNeighborsFunction,
EdgeDirection direction) throws IllegalArgumentException {
switch (direction) {
case IN:
// create <vertex-source value> pairs
final DataSet<Tuple2<K, VV>> verticesWithSourceNeighborValues = edges
... | java | public DataSet<Tuple2<K, VV>> reduceOnNeighbors(ReduceNeighborsFunction<VV> reduceNeighborsFunction,
EdgeDirection direction) throws IllegalArgumentException {
switch (direction) {
case IN:
// create <vertex-source value> pairs
final DataSet<Tuple2<K, VV>> verticesWithSourceNeighborValues = edges
... | [
"public",
"DataSet",
"<",
"Tuple2",
"<",
"K",
",",
"VV",
">",
">",
"reduceOnNeighbors",
"(",
"ReduceNeighborsFunction",
"<",
"VV",
">",
"reduceNeighborsFunction",
",",
"EdgeDirection",
"direction",
")",
"throws",
"IllegalArgumentException",
"{",
"switch",
"(",
"di... | Compute a reduce transformation over the neighbors' vertex values of each vertex.
For each vertex, the transformation consecutively calls a
{@link ReduceNeighborsFunction} until only a single value for each vertex remains.
The {@link ReduceNeighborsFunction} combines a pair of neighbor vertex values
into one new value ... | [
"Compute",
"a",
"reduce",
"transformation",
"over",
"the",
"neighbors",
"vertex",
"values",
"of",
"each",
"vertex",
".",
"For",
"each",
"vertex",
"the",
"transformation",
"consecutively",
"calls",
"a",
"{",
"@link",
"ReduceNeighborsFunction",
"}",
"until",
"only",... | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-libraries/flink-gelly/src/main/java/org/apache/flink/graph/Graph.java#L2242-L2273 | train | Reduce the data set on neighbors of this graph. | [
30522,
2270,
2951,
13462,
1026,
10722,
10814,
2475,
1026,
1047,
1010,
1058,
2615,
1028,
1028,
5547,
18256,
18377,
12821,
2015,
1006,
5547,
2638,
18377,
12821,
22747,
4609,
7542,
1026,
1058,
2615,
1028,
5547,
2638,
18377,
12821,
22747,
4609,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/SecureUtil.java | SecureUtil.signParams | public static String signParams(DigestAlgorithm digestAlgorithm, Map<?, ?> params) {
return signParams(digestAlgorithm, params, StrUtil.EMPTY, StrUtil.EMPTY, true);
} | java | public static String signParams(DigestAlgorithm digestAlgorithm, Map<?, ?> params) {
return signParams(digestAlgorithm, params, StrUtil.EMPTY, StrUtil.EMPTY, true);
} | [
"public",
"static",
"String",
"signParams",
"(",
"DigestAlgorithm",
"digestAlgorithm",
",",
"Map",
"<",
"?",
",",
"?",
">",
"params",
")",
"{",
"return",
"signParams",
"(",
"digestAlgorithm",
",",
"params",
",",
"StrUtil",
".",
"EMPTY",
",",
"StrUtil",
".",
... | 对参数做签名<br>
参数签名为对Map参数按照key的顺序排序后拼接为字符串,然后根据提供的签名算法生成签名字符串<br>
拼接后的字符串键值对之间无符号,键值对之间无符号,忽略null值
@param digestAlgorithm 摘要算法
@param params 参数
@return 签名
@since 4.0.1 | [
"对参数做签名<br",
">",
"参数签名为对Map参数按照key的顺序排序后拼接为字符串,然后根据提供的签名算法生成签名字符串<br",
">",
"拼接后的字符串键值对之间无符号,键值对之间无符号,忽略null值"
] | bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-crypto/src/main/java/cn/hutool/crypto/SecureUtil.java#L904-L906 | train | Creates a signature string from the given parameters. | [
30522,
2270,
10763,
5164,
3696,
28689,
5244,
1006,
17886,
2389,
20255,
8939,
2213,
17886,
2389,
20255,
8939,
2213,
1010,
4949,
1026,
1029,
1010,
1029,
1028,
11498,
5244,
1007,
1063,
2709,
3696,
28689,
5244,
1006,
17886,
2389,
20255,
8939,
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/core/fs/FileSystemSafetyNet.java | FileSystemSafetyNet.wrapWithSafetyNetWhenActivated | static FileSystem wrapWithSafetyNetWhenActivated(FileSystem fs) {
SafetyNetCloseableRegistry reg = REGISTRIES.get();
return reg != null ? new SafetyNetWrapperFileSystem(fs, reg) : fs;
} | java | static FileSystem wrapWithSafetyNetWhenActivated(FileSystem fs) {
SafetyNetCloseableRegistry reg = REGISTRIES.get();
return reg != null ? new SafetyNetWrapperFileSystem(fs, reg) : fs;
} | [
"static",
"FileSystem",
"wrapWithSafetyNetWhenActivated",
"(",
"FileSystem",
"fs",
")",
"{",
"SafetyNetCloseableRegistry",
"reg",
"=",
"REGISTRIES",
".",
"get",
"(",
")",
";",
"return",
"reg",
"!=",
"null",
"?",
"new",
"SafetyNetWrapperFileSystem",
"(",
"fs",
",",... | ------------------------------------------------------------------------ | [
"------------------------------------------------------------------------"
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-core/src/main/java/org/apache/flink/core/fs/FileSystemSafetyNet.java#L131-L134 | train | Wrap a FileSystem with a SafetyNetFileSystem when the system is activated. | [
30522,
10763,
6764,
27268,
6633,
10236,
24415,
3736,
7959,
25680,
3388,
2860,
10222,
18908,
21967,
1006,
6764,
27268,
6633,
1042,
2015,
1007,
1063,
3808,
7159,
20464,
9232,
3085,
2890,
24063,
2854,
19723,
1027,
20588,
21011,
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... |
looly/hutool | hutool-cron/src/main/java/cn/hutool/cron/pattern/CronPatternUtil.java | CronPatternUtil.matchedDates | public static List<Date> matchedDates(CronPattern pattern, long start, long end, int count, boolean isMatchSecond) {
Assert.isTrue(start < end, "Start date is later than end !");
final List<Date> result = new ArrayList<>(count);
long step = isMatchSecond ? DateUnit.SECOND.getMillis() : DateUnit.MINUTE.getMil... | java | public static List<Date> matchedDates(CronPattern pattern, long start, long end, int count, boolean isMatchSecond) {
Assert.isTrue(start < end, "Start date is later than end !");
final List<Date> result = new ArrayList<>(count);
long step = isMatchSecond ? DateUnit.SECOND.getMillis() : DateUnit.MINUTE.getMil... | [
"public",
"static",
"List",
"<",
"Date",
">",
"matchedDates",
"(",
"CronPattern",
"pattern",
",",
"long",
"start",
",",
"long",
"end",
",",
"int",
"count",
",",
"boolean",
"isMatchSecond",
")",
"{",
"Assert",
".",
"isTrue",
"(",
"start",
"<",
"end",
",",... | 列举指定日期范围内所有匹配表达式的日期
@param pattern 表达式
@param start 起始时间
@param end 结束时间
@param count 列举数量
@param isMatchSecond 是否匹配秒
@return 日期列表 | [
"列举指定日期范围内所有匹配表达式的日期"
] | bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-cron/src/main/java/cn/hutool/cron/pattern/CronPatternUtil.java#L70-L84 | train | Returns a list of dates that match the specified cron pattern. | [
30522,
2270,
10763,
2862,
1026,
3058,
1028,
10349,
27122,
1006,
13675,
2239,
4502,
12079,
2078,
5418,
1010,
2146,
2707,
1010,
2146,
2203,
1010,
20014,
4175,
1010,
22017,
20898,
2003,
18900,
18069,
8586,
15422,
1007,
1063,
20865,
1012,
21541,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/TypeDescriptor.java | TypeDescriptor.getColumnSize | public Integer getColumnSize() {
if (type.isNumericType()) {
return getPrecision();
}
switch (type) {
case STRING_TYPE:
case BINARY_TYPE:
return Integer.MAX_VALUE;
case CHAR_TYPE:
case VARCHAR_TYPE:
return typeQualifiers.getCharacterMaximumLength();
case DATE_TYPE:
... | java | public Integer getColumnSize() {
if (type.isNumericType()) {
return getPrecision();
}
switch (type) {
case STRING_TYPE:
case BINARY_TYPE:
return Integer.MAX_VALUE;
case CHAR_TYPE:
case VARCHAR_TYPE:
return typeQualifiers.getCharacterMaximumLength();
case DATE_TYPE:
... | [
"public",
"Integer",
"getColumnSize",
"(",
")",
"{",
"if",
"(",
"type",
".",
"isNumericType",
"(",
")",
")",
"{",
"return",
"getPrecision",
"(",
")",
";",
"}",
"switch",
"(",
"type",
")",
"{",
"case",
"STRING_TYPE",
":",
"case",
"BINARY_TYPE",
":",
"re... | The column size for this type.
For numeric data this is the maximum precision.
For character data this is the length in characters.
For datetime types this is the length in characters of the String representation
(assuming the maximum allowed precision of the fractional seconds component).
For binary data this is the l... | [
"The",
"column",
"size",
"for",
"this",
"type",
".",
"For",
"numeric",
"data",
"this",
"is",
"the",
"maximum",
"precision",
".",
"For",
"character",
"data",
"this",
"is",
"the",
"length",
"in",
"characters",
".",
"For",
"datetime",
"types",
"this",
"is",
... | 25ee0474f47d9c30d6f553a7892d9549f91071cf | https://github.com/apache/spark/blob/25ee0474f47d9c30d6f553a7892d9549f91071cf/sql/hive-thriftserver/src/main/java/org/apache/hive/service/cli/TypeDescriptor.java#L103-L121 | train | Get the column size of the column. | [
30522,
2270,
16109,
2131,
25778,
2819,
3619,
4697,
1006,
1007,
1063,
2065,
1006,
2828,
1012,
3475,
17897,
7277,
13874,
1006,
1007,
1007,
1063,
2709,
2131,
28139,
28472,
1006,
1007,
1025,
1065,
6942,
1006,
2828,
1007,
1063,
2553,
5164,
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-core/src/main/java/org/apache/flink/api/java/typeutils/runtime/RowComparator.java | RowComparator.getFlatComparator | @Override
public void getFlatComparator(List<TypeComparator> flatComparators) {
for (NullAwareComparator<Object> c : comparators) {
Collections.addAll(flatComparators, c.getFlatComparators());
}
} | java | @Override
public void getFlatComparator(List<TypeComparator> flatComparators) {
for (NullAwareComparator<Object> c : comparators) {
Collections.addAll(flatComparators, c.getFlatComparators());
}
} | [
"@",
"Override",
"public",
"void",
"getFlatComparator",
"(",
"List",
"<",
"TypeComparator",
">",
"flatComparators",
")",
"{",
"for",
"(",
"NullAwareComparator",
"<",
"Object",
">",
"c",
":",
"comparators",
")",
"{",
"Collections",
".",
"addAll",
"(",
"flatComp... | -------------------------------------------------------------------------------------------- | [
"--------------------------------------------------------------------------------------------"
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-core/src/main/java/org/apache/flink/api/java/typeutils/runtime/RowComparator.java#L157-L162 | train | Gets the flat comparators. | [
30522,
1030,
2058,
15637,
2270,
11675,
2131,
10258,
4017,
9006,
28689,
4263,
1006,
2862,
1026,
2828,
9006,
28689,
4263,
1028,
4257,
9006,
28689,
6591,
1007,
1063,
2005,
1006,
19701,
10830,
2890,
9006,
28689,
4263,
1026,
4874,
1028,
1039,
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-captcha/src/main/java/cn/hutool/captcha/CaptchaUtil.java | CaptchaUtil.createShearCaptcha | public static ShearCaptcha createShearCaptcha(int width, int height, int codeCount, int thickness) {
return new ShearCaptcha(width, height, codeCount, thickness);
} | java | public static ShearCaptcha createShearCaptcha(int width, int height, int codeCount, int thickness) {
return new ShearCaptcha(width, height, codeCount, thickness);
} | [
"public",
"static",
"ShearCaptcha",
"createShearCaptcha",
"(",
"int",
"width",
",",
"int",
"height",
",",
"int",
"codeCount",
",",
"int",
"thickness",
")",
"{",
"return",
"new",
"ShearCaptcha",
"(",
"width",
",",
"height",
",",
"codeCount",
",",
"thickness",
... | 创建扭曲干扰的验证码,默认5位验证码
@param width 图片宽
@param height 图片高
@param codeCount 字符个数
@param thickness 干扰线宽度
@return {@link ShearCaptcha}
@since 3.3.0 | [
"创建扭曲干扰的验证码,默认5位验证码"
] | bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-captcha/src/main/java/cn/hutool/captcha/CaptchaUtil.java#L83-L85 | train | Create a ShearCaptcha object. | [
30522,
2270,
10763,
18330,
17695,
10649,
2050,
9005,
26560,
17695,
10649,
2050,
1006,
20014,
9381,
1010,
20014,
4578,
1010,
20014,
3642,
3597,
16671,
1010,
20014,
14983,
1007,
1063,
2709,
2047,
18330,
17695,
10649,
2050,
1006,
9381,
1010,
457... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/disk/iomanager/IOManager.java | IOManager.shutdown | public void shutdown() {
// remove all of our temp directories
for (File path : paths) {
try {
if (path != null) {
if (path.exists()) {
FileUtils.deleteDirectory(path);
LOG.info("I/O manager removed spill file directory {}", path.getAbsolutePath());
}
}
} catch (Throwable t) {
... | java | public void shutdown() {
// remove all of our temp directories
for (File path : paths) {
try {
if (path != null) {
if (path.exists()) {
FileUtils.deleteDirectory(path);
LOG.info("I/O manager removed spill file directory {}", path.getAbsolutePath());
}
}
} catch (Throwable t) {
... | [
"public",
"void",
"shutdown",
"(",
")",
"{",
"// remove all of our temp directories",
"for",
"(",
"File",
"path",
":",
"paths",
")",
"{",
"try",
"{",
"if",
"(",
"path",
"!=",
"null",
")",
"{",
"if",
"(",
"path",
".",
"exists",
"(",
")",
")",
"{",
"Fi... | Close method, marks the I/O manager as closed
and removed all temporary files. | [
"Close",
"method",
"marks",
"the",
"I",
"/",
"O",
"manager",
"as",
"closed",
"and",
"removed",
"all",
"temporary",
"files",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/io/disk/iomanager/IOManager.java#L87-L101 | train | Shutdown the IO manager. | [
30522,
2270,
30524,
1007,
1063,
1013,
1013,
6366,
2035,
1997,
2256,
8915,
8737,
2472,
3111,
2005,
1006,
5371,
4130,
1024,
10425,
1007,
1063,
3046,
1063,
2065,
1006,
4130,
999,
1027,
19701,
1007,
1063,
2065,
1006,
4130,
1012,
6526,
1006,
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-dns/src/main/java/io/netty/handler/codec/dns/DnsOpCode.java | DnsOpCode.valueOf | public static DnsOpCode valueOf(int b) {
switch (b) {
case 0x00:
return QUERY;
case 0x01:
return IQUERY;
case 0x02:
return STATUS;
case 0x04:
return NOTIFY;
case 0x05:
return UPDATE;
}
return new... | java | public static DnsOpCode valueOf(int b) {
switch (b) {
case 0x00:
return QUERY;
case 0x01:
return IQUERY;
case 0x02:
return STATUS;
case 0x04:
return NOTIFY;
case 0x05:
return UPDATE;
}
return new... | [
"public",
"static",
"DnsOpCode",
"valueOf",
"(",
"int",
"b",
")",
"{",
"switch",
"(",
"b",
")",
"{",
"case",
"0x00",
":",
"return",
"QUERY",
";",
"case",
"0x01",
":",
"return",
"IQUERY",
";",
"case",
"0x02",
":",
"return",
"STATUS",
";",
"case",
"0x0... | Returns the {@link DnsOpCode} instance of the specified byte value. | [
"Returns",
"the",
"{"
] | ba06eafa1c1824bd154f1a380019e7ea2edf3c4c | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/codec-dns/src/main/java/io/netty/handler/codec/dns/DnsOpCode.java#L56-L71 | train | Gets the DnsOpCode from the given integer. | [
30522,
2270,
10763,
1040,
3619,
7361,
16044,
3643,
11253,
1006,
20014,
1038,
1007,
1063,
6942,
1006,
1038,
1007,
1063,
2553,
1014,
2595,
8889,
1024,
2709,
23032,
1025,
2553,
1014,
2595,
24096,
1024,
2709,
26264,
13094,
2100,
1025,
2553,
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... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.