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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
apache/flink | flink-libraries/flink-cep/src/main/java/org/apache/flink/cep/nfa/sharedbuffer/SharedBufferAccessor.java | SharedBufferAccessor.lockNode | public void lockNode(final NodeId node) {
Lockable<SharedBufferNode> sharedBufferNode = sharedBuffer.getEntry(node);
if (sharedBufferNode != null) {
sharedBufferNode.lock();
sharedBuffer.upsertEntry(node, sharedBufferNode);
}
} | java | public void lockNode(final NodeId node) {
Lockable<SharedBufferNode> sharedBufferNode = sharedBuffer.getEntry(node);
if (sharedBufferNode != null) {
sharedBufferNode.lock();
sharedBuffer.upsertEntry(node, sharedBufferNode);
}
} | [
"public",
"void",
"lockNode",
"(",
"final",
"NodeId",
"node",
")",
"{",
"Lockable",
"<",
"SharedBufferNode",
">",
"sharedBufferNode",
"=",
"sharedBuffer",
".",
"getEntry",
"(",
"node",
")",
";",
"if",
"(",
"sharedBufferNode",
"!=",
"null",
")",
"{",
"sharedB... | Increases the reference counter for the given entry so that it is not
accidentally removed.
@param node id of the entry | [
"Increases",
"the",
"reference",
"counter",
"for",
"the",
"given",
"entry",
"so",
"that",
"it",
"is",
"not",
"accidentally",
"removed",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-libraries/flink-cep/src/main/java/org/apache/flink/cep/nfa/sharedbuffer/SharedBufferAccessor.java#L222-L228 | train | Lock the given node. | [
30522,
2270,
11675,
5843,
3630,
3207,
1006,
2345,
13045,
3593,
13045,
1007,
1063,
5843,
3085,
1026,
4207,
8569,
12494,
3630,
3207,
1028,
4207,
8569,
12494,
3630,
3207,
1027,
4207,
8569,
12494,
1012,
2131,
4765,
2854,
1006,
13045,
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/util/ZipUtil.java | ZipUtil.unzip | @SuppressWarnings("unchecked")
public static File unzip(File zipFile, File outFile, Charset charset) throws UtilException {
charset = (null == charset) ? DEFAULT_CHARSET : charset;
ZipFile zipFileObj = null;
try {
zipFileObj = new ZipFile(zipFile, charset);
final Enumeration<ZipEntry> em = (Enumera... | java | @SuppressWarnings("unchecked")
public static File unzip(File zipFile, File outFile, Charset charset) throws UtilException {
charset = (null == charset) ? DEFAULT_CHARSET : charset;
ZipFile zipFileObj = null;
try {
zipFileObj = new ZipFile(zipFile, charset);
final Enumeration<ZipEntry> em = (Enumera... | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"static",
"File",
"unzip",
"(",
"File",
"zipFile",
",",
"File",
"outFile",
",",
"Charset",
"charset",
")",
"throws",
"UtilException",
"{",
"charset",
"=",
"(",
"null",
"==",
"charset",
")",
"?",
... | 解压
@param zipFile zip文件
@param outFile 解压到的目录
@param charset 编码
@return 解压的目录
@throws UtilException IO异常
@since 3.2.2 | [
"解压"
] | bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/util/ZipUtil.java#L384-L411 | train | Unzip a file and writes it to a file. | [
30522,
1030,
16081,
9028,
5582,
30524,
25869,
13462,
1024,
25869,
13462,
1025,
14101,
8873,
2571,
14101,
8873,
2571,
16429,
3501,
1027,
19701,
1025,
3046,
1063,
14101,
8873,
2571,
16429,
3501,
1027,
2047,
14101,
8873,
2571,
1006,
14101,
8873,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
spring-projects/spring-boot | spring-boot-project/spring-boot/src/main/java/org/springframework/boot/webservices/client/WebServiceTemplateBuilder.java | WebServiceTemplateBuilder.customizers | public WebServiceTemplateBuilder customizers(
WebServiceTemplateCustomizer... customizers) {
Assert.notNull(customizers, "Customizers must not be null");
return customizers(Arrays.asList(customizers));
} | java | public WebServiceTemplateBuilder customizers(
WebServiceTemplateCustomizer... customizers) {
Assert.notNull(customizers, "Customizers must not be null");
return customizers(Arrays.asList(customizers));
} | [
"public",
"WebServiceTemplateBuilder",
"customizers",
"(",
"WebServiceTemplateCustomizer",
"...",
"customizers",
")",
"{",
"Assert",
".",
"notNull",
"(",
"customizers",
",",
"\"Customizers must not be null\"",
")",
";",
"return",
"customizers",
"(",
"Arrays",
".",
"asLi... | Set {@link WebServiceTemplateCustomizer WebServiceTemplateCustomizers} that should
be applied to the {@link WebServiceTemplate}. Customizers are applied in the order
that they were added after builder configuration has been applied. Setting this
value will replace any previously configured customizers.
@param customize... | [
"Set",
"{"
] | 0b27f7c70e164b2b1a96477f1d9c1acba56790c1 | https://github.com/spring-projects/spring-boot/blob/0b27f7c70e164b2b1a96477f1d9c1acba56790c1/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/webservices/client/WebServiceTemplateBuilder.java#L267-L271 | train | Add customizers to the template. | [
30522,
2270,
4773,
8043,
7903,
12870,
8737,
13806,
8569,
23891,
2099,
7661,
17629,
2015,
1006,
4773,
8043,
7903,
12870,
8737,
13806,
7874,
20389,
17629,
1012,
1012,
1012,
7661,
17629,
2015,
1007,
1063,
20865,
1012,
2025,
11231,
3363,
1006,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
spring-projects/spring-boot | spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/trace/http/HttpExchangeTracer.java | HttpExchangeTracer.sendingResponse | public final void sendingResponse(HttpTrace trace, TraceableResponse response,
Supplier<Principal> principal, Supplier<String> sessionId) {
setIfIncluded(Include.TIME_TAKEN,
() -> System.currentTimeMillis() - trace.getTimestamp().toEpochMilli(),
trace::setTimeTaken);
setIfIncluded(Include.SESSION_ID, ses... | java | public final void sendingResponse(HttpTrace trace, TraceableResponse response,
Supplier<Principal> principal, Supplier<String> sessionId) {
setIfIncluded(Include.TIME_TAKEN,
() -> System.currentTimeMillis() - trace.getTimestamp().toEpochMilli(),
trace::setTimeTaken);
setIfIncluded(Include.SESSION_ID, ses... | [
"public",
"final",
"void",
"sendingResponse",
"(",
"HttpTrace",
"trace",
",",
"TraceableResponse",
"response",
",",
"Supplier",
"<",
"Principal",
">",
"principal",
",",
"Supplier",
"<",
"String",
">",
"sessionId",
")",
"{",
"setIfIncluded",
"(",
"Include",
".",
... | Ends the tracing of the exchange that is being concluded by sending the given
{@code response}.
@param trace the trace for the exchange
@param response the response that concludes the exchange
@param principal a supplier for the exchange's principal
@param sessionId a supplier for the id of the exchange's session | [
"Ends",
"the",
"tracing",
"of",
"the",
"exchange",
"that",
"is",
"being",
"concluded",
"by",
"sending",
"the",
"given",
"{"
] | 0b27f7c70e164b2b1a96477f1d9c1acba56790c1 | https://github.com/spring-projects/spring-boot/blob/0b27f7c70e164b2b1a96477f1d9c1acba56790c1/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/trace/http/HttpExchangeTracer.java#L69-L78 | train | Sends a response to the trace. | [
30522,
2270,
2345,
11675,
6016,
6072,
26029,
3366,
1006,
8299,
6494,
3401,
7637,
1010,
7637,
3085,
6072,
26029,
3366,
3433,
1010,
17024,
1026,
4054,
1028,
4054,
1010,
17024,
1026,
5164,
1028,
5219,
3593,
1007,
1063,
2275,
10128,
2378,
20464... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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.count | public int count(Connection conn, Entity where) throws SQLException {
checkConn(conn);
final Query query = new Query(SqlUtil.buildConditions(where), where.getTableName());
PreparedStatement ps = null;
try {
ps = dialect.psForCount(conn, query);
return SqlExecutor.query(ps, new NumberHandler()).i... | java | public int count(Connection conn, Entity where) throws SQLException {
checkConn(conn);
final Query query = new Query(SqlUtil.buildConditions(where), where.getTableName());
PreparedStatement ps = null;
try {
ps = dialect.psForCount(conn, query);
return SqlExecutor.query(ps, new NumberHandler()).i... | [
"public",
"int",
"count",
"(",
"Connection",
"conn",
",",
"Entity",
"where",
")",
"throws",
"SQLException",
"{",
"checkConn",
"(",
"conn",
")",
";",
"final",
"Query",
"query",
"=",
"new",
"Query",
"(",
"SqlUtil",
".",
"buildConditions",
"(",
"where",
")",
... | 结果的条目数
@param conn 数据库连接对象
@param where 查询条件
@return 复合条件的结果数
@throws SQLException SQL执行异常 | [
"结果的条目数"
] | bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-db/src/main/java/cn/hutool/db/SqlConnRunner.java#L439-L452 | train | Returns the number of rows matching the given condition. | [
30522,
2270,
20014,
4175,
1006,
4434,
9530,
2078,
1010,
9178,
2073,
1007,
11618,
29296,
10288,
24422,
1063,
4638,
8663,
2078,
1006,
9530,
2078,
1007,
1025,
2345,
23032,
23032,
1027,
2047,
23032,
1006,
29296,
21823,
2140,
1012,
3857,
8663,
2... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
apache/flink | flink-runtime/src/main/java/org/apache/flink/runtime/io/network/buffer/BufferBuilder.java | BufferBuilder.append | public int append(ByteBuffer source) {
checkState(!isFinished());
int needed = source.remaining();
int available = getMaxCapacity() - positionMarker.getCached();
int toCopy = Math.min(needed, available);
memorySegment.put(positionMarker.getCached(), source, toCopy);
positionMarker.move(toCopy);
return t... | java | public int append(ByteBuffer source) {
checkState(!isFinished());
int needed = source.remaining();
int available = getMaxCapacity() - positionMarker.getCached();
int toCopy = Math.min(needed, available);
memorySegment.put(positionMarker.getCached(), source, toCopy);
positionMarker.move(toCopy);
return t... | [
"public",
"int",
"append",
"(",
"ByteBuffer",
"source",
")",
"{",
"checkState",
"(",
"!",
"isFinished",
"(",
")",
")",
";",
"int",
"needed",
"=",
"source",
".",
"remaining",
"(",
")",
";",
"int",
"available",
"=",
"getMaxCapacity",
"(",
")",
"-",
"posi... | Append as many data as possible from {@code source}. Not everything might be copied if there is not enough
space in the underlying {@link MemorySegment}
@return number of copied bytes | [
"Append",
"as",
"many",
"data",
"as",
"possible",
"from",
"{",
"@code",
"source",
"}",
".",
"Not",
"everything",
"might",
"be",
"copied",
"if",
"there",
"is",
"not",
"enough",
"space",
"in",
"the",
"underlying",
"{",
"@link",
"MemorySegment",
"}"
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/io/network/buffer/BufferBuilder.java#L78-L88 | train | Append the given byte buffer to the end of the buffer. | [
30522,
2270,
20014,
10439,
10497,
1006,
24880,
8569,
12494,
3120,
1007,
1063,
14148,
12259,
1006,
999,
2003,
16294,
13295,
1006,
1007,
1007,
1025,
20014,
2734,
1027,
3120,
1012,
3588,
1006,
1007,
1025,
20014,
2800,
1027,
2131,
17848,
17695,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
apache/incubator-shardingsphere | sharding-proxy/sharding-proxy-transport/sharding-proxy-transport-mysql/src/main/java/org/apache/shardingsphere/shardingproxy/transport/mysql/packet/command/query/binary/MySQLBinaryStatementRegistry.java | MySQLBinaryStatementRegistry.register | public synchronized int register(final String sql, final int parametersCount) {
Integer result = statementIdAssigner.get(sql);
if (null != result) {
return result;
}
result = sequence.incrementAndGet();
statementIdAssigner.putIfAbsent(sql, result);
binaryState... | java | public synchronized int register(final String sql, final int parametersCount) {
Integer result = statementIdAssigner.get(sql);
if (null != result) {
return result;
}
result = sequence.incrementAndGet();
statementIdAssigner.putIfAbsent(sql, result);
binaryState... | [
"public",
"synchronized",
"int",
"register",
"(",
"final",
"String",
"sql",
",",
"final",
"int",
"parametersCount",
")",
"{",
"Integer",
"result",
"=",
"statementIdAssigner",
".",
"get",
"(",
"sql",
")",
";",
"if",
"(",
"null",
"!=",
"result",
")",
"{",
... | Register SQL.
@param sql SQL
@param parametersCount parameters count
@return statement ID | [
"Register",
"SQL",
"."
] | f88fd29fc345dfb31fdce12e9e96cbfa0fd2402d | https://github.com/apache/incubator-shardingsphere/blob/f88fd29fc345dfb31fdce12e9e96cbfa0fd2402d/sharding-proxy/sharding-proxy-transport/sharding-proxy-transport-mysql/src/main/java/org/apache/shardingsphere/shardingproxy/transport/mysql/packet/command/query/binary/MySQLBinaryStatementRegistry.java#L61-L70 | train | Registers a new SQL statement. | [
30522,
2270,
25549,
20014,
4236,
1006,
2345,
5164,
29296,
1010,
2345,
20014,
11709,
3597,
16671,
1007,
1063,
16109,
2765,
1027,
4861,
8524,
18719,
10177,
2099,
1012,
2131,
1006,
29296,
1007,
1025,
2065,
1006,
19701,
999,
1027,
2765,
1007,
1... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
apache/flink | flink-runtime/src/main/java/org/apache/flink/runtime/deployment/TaskDeploymentDescriptor.java | TaskDeploymentDescriptor.loadBigData | public void loadBigData(@Nullable PermanentBlobService blobService)
throws IOException, ClassNotFoundException {
// re-integrate offloaded job info from blob
// here, if this fails, we need to throw the exception as there is no backup path anymore
if (serializedJobInformation instanceof Offloaded) {
Perman... | java | public void loadBigData(@Nullable PermanentBlobService blobService)
throws IOException, ClassNotFoundException {
// re-integrate offloaded job info from blob
// here, if this fails, we need to throw the exception as there is no backup path anymore
if (serializedJobInformation instanceof Offloaded) {
Perman... | [
"public",
"void",
"loadBigData",
"(",
"@",
"Nullable",
"PermanentBlobService",
"blobService",
")",
"throws",
"IOException",
",",
"ClassNotFoundException",
"{",
"// re-integrate offloaded job info from blob",
"// here, if this fails, we need to throw the exception as there is no backup ... | Loads externalized data from the BLOB store back to the object.
@param blobService
the blob store to use (may be <tt>null</tt> if {@link #serializedJobInformation} and {@link
#serializedTaskInformation} are non-<tt>null</tt>)
@throws IOException
during errors retrieving or reading the BLOBs
@throws ClassNotFoundExcep... | [
"Loads",
"externalized",
"data",
"from",
"the",
"BLOB",
"store",
"back",
"to",
"the",
"object",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/deployment/TaskDeploymentDescriptor.java#L288-L325 | train | Load the big data from the blob service. | [
30522,
2270,
11675,
7170,
5638,
2290,
2850,
2696,
1006,
1030,
19701,
3085,
4568,
16558,
16429,
8043,
7903,
2063,
1038,
4135,
5910,
2121,
7903,
2063,
1007,
11618,
22834,
10288,
24422,
1010,
2465,
17048,
14876,
8630,
10288,
24422,
1063,
1013,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
looly/hutool | hutool-core/src/main/java/cn/hutool/core/util/ReflectUtil.java | ReflectUtil.getConstructors | @SuppressWarnings("unchecked")
public static <T> Constructor<T>[] getConstructors(Class<T> beanClass) throws SecurityException {
Assert.notNull(beanClass);
Constructor<?>[] constructors = CONSTRUCTORS_CACHE.get(beanClass);
if (null != constructors) {
return (Constructor<T>[]) constructors;
}
cons... | java | @SuppressWarnings("unchecked")
public static <T> Constructor<T>[] getConstructors(Class<T> beanClass) throws SecurityException {
Assert.notNull(beanClass);
Constructor<?>[] constructors = CONSTRUCTORS_CACHE.get(beanClass);
if (null != constructors) {
return (Constructor<T>[]) constructors;
}
cons... | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"static",
"<",
"T",
">",
"Constructor",
"<",
"T",
">",
"[",
"]",
"getConstructors",
"(",
"Class",
"<",
"T",
">",
"beanClass",
")",
"throws",
"SecurityException",
"{",
"Assert",
".",
"notNull",
"... | 获得一个类中所有构造列表
@param <T> 构造的对象类型
@param beanClass 类
@return 字段列表
@throws SecurityException 安全检查异常 | [
"获得一个类中所有构造列表"
] | bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/util/ReflectUtil.java#L69-L79 | train | Gets the constructors of the specified class. | [
30522,
1030,
16081,
9028,
5582,
2015,
1006,
1000,
4895,
5403,
18141,
1000,
1007,
2270,
10763,
1026,
1056,
1028,
9570,
2953,
1026,
1056,
1028,
1031,
1033,
2131,
8663,
3367,
6820,
24817,
1006,
2465,
1026,
1056,
1028,
14068,
26266,
1007,
11618... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
apache/spark | sql/core/src/main/java/org/apache/spark/sql/execution/vectorized/ColumnVectorUtils.java | ColumnVectorUtils.toBatch | public static ColumnarBatch toBatch(
StructType schema, MemoryMode memMode, Iterator<Row> row) {
int capacity = 4 * 1024;
WritableColumnVector[] columnVectors;
if (memMode == MemoryMode.OFF_HEAP) {
columnVectors = OffHeapColumnVector.allocateColumns(capacity, schema);
} else {
columnVe... | java | public static ColumnarBatch toBatch(
StructType schema, MemoryMode memMode, Iterator<Row> row) {
int capacity = 4 * 1024;
WritableColumnVector[] columnVectors;
if (memMode == MemoryMode.OFF_HEAP) {
columnVectors = OffHeapColumnVector.allocateColumns(capacity, schema);
} else {
columnVe... | [
"public",
"static",
"ColumnarBatch",
"toBatch",
"(",
"StructType",
"schema",
",",
"MemoryMode",
"memMode",
",",
"Iterator",
"<",
"Row",
">",
"row",
")",
"{",
"int",
"capacity",
"=",
"4",
"*",
"1024",
";",
"WritableColumnVector",
"[",
"]",
"columnVectors",
";... | Converts an iterator of rows into a single ColumnBatch. | [
"Converts",
"an",
"iterator",
"of",
"rows",
"into",
"a",
"single",
"ColumnBatch",
"."
] | 25ee0474f47d9c30d6f553a7892d9549f91071cf | https://github.com/apache/spark/blob/25ee0474f47d9c30d6f553a7892d9549f91071cf/sql/core/src/main/java/org/apache/spark/sql/execution/vectorized/ColumnVectorUtils.java#L208-L229 | train | Create a ColumnarBatch from an iterator of rows. | [
30522,
2270,
10763,
5930,
2906,
14479,
2818,
2000,
14479,
2818,
1006,
2358,
6820,
6593,
13874,
8040,
28433,
1010,
3638,
5302,
3207,
2033,
7382,
10244,
1010,
2009,
6906,
4263,
1026,
5216,
1028,
5216,
1007,
1063,
20014,
3977,
1027,
1018,
1008... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
apache/flink | flink-java/src/main/java/org/apache/flink/api/java/operators/UnsortedGrouping.java | UnsortedGrouping.sortGroup | public SortedGrouping<T> sortGroup(int field, Order order) {
if (this.getKeys() instanceof Keys.SelectorFunctionKeys) {
throw new InvalidProgramException("KeySelector grouping keys and field index group-sorting keys cannot be used together.");
}
SortedGrouping<T> sg = new SortedGrouping<T>(this.inputDataSet, ... | java | public SortedGrouping<T> sortGroup(int field, Order order) {
if (this.getKeys() instanceof Keys.SelectorFunctionKeys) {
throw new InvalidProgramException("KeySelector grouping keys and field index group-sorting keys cannot be used together.");
}
SortedGrouping<T> sg = new SortedGrouping<T>(this.inputDataSet, ... | [
"public",
"SortedGrouping",
"<",
"T",
">",
"sortGroup",
"(",
"int",
"field",
",",
"Order",
"order",
")",
"{",
"if",
"(",
"this",
".",
"getKeys",
"(",
")",
"instanceof",
"Keys",
".",
"SelectorFunctionKeys",
")",
"{",
"throw",
"new",
"InvalidProgramException",... | Sorts {@link org.apache.flink.api.java.tuple.Tuple} elements within a group on the specified field in the specified {@link Order}.
<p><b>Note: Only groups of Tuple elements and Pojos can be sorted.</b>
<p>Groups can be sorted by multiple fields by chaining {@link #sortGroup(int, Order)} calls.
@param field The Tuple... | [
"Sorts",
"{",
"@link",
"org",
".",
"apache",
".",
"flink",
".",
"api",
".",
"java",
".",
"tuple",
".",
"Tuple",
"}",
"elements",
"within",
"a",
"group",
"on",
"the",
"specified",
"field",
"in",
"the",
"specified",
"{",
"@link",
"Order",
"}",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-java/src/main/java/org/apache/flink/api/java/operators/UnsortedGrouping.java#L271-L279 | train | Sort the data set using the specified field and order. | [
30522,
2270,
19616,
17058,
2075,
1026,
1056,
1028,
4066,
17058,
1006,
20014,
2492,
1010,
2344,
2344,
1007,
1063,
2065,
1006,
2023,
1012,
2131,
14839,
2015,
1006,
1007,
6013,
11253,
6309,
1012,
27000,
11263,
27989,
14839,
2015,
1007,
1063,
5... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
apache/flink | flink-runtime/src/main/java/org/apache/flink/runtime/executiongraph/ExecutionVertex.java | ExecutionVertex.finishAllBlockingPartitions | List<IntermediateResultPartition> finishAllBlockingPartitions() {
List<IntermediateResultPartition> finishedBlockingPartitions = null;
for (IntermediateResultPartition partition : resultPartitions.values()) {
if (partition.getResultType().isBlocking() && partition.markFinished()) {
if (finishedBlockingParti... | java | List<IntermediateResultPartition> finishAllBlockingPartitions() {
List<IntermediateResultPartition> finishedBlockingPartitions = null;
for (IntermediateResultPartition partition : resultPartitions.values()) {
if (partition.getResultType().isBlocking() && partition.markFinished()) {
if (finishedBlockingParti... | [
"List",
"<",
"IntermediateResultPartition",
">",
"finishAllBlockingPartitions",
"(",
")",
"{",
"List",
"<",
"IntermediateResultPartition",
">",
"finishedBlockingPartitions",
"=",
"null",
";",
"for",
"(",
"IntermediateResultPartition",
"partition",
":",
"resultPartitions",
... | Returns all blocking result partitions whose receivers can be scheduled/updated. | [
"Returns",
"all",
"blocking",
"result",
"partitions",
"whose",
"receivers",
"can",
"be",
"scheduled",
"/",
"updated",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/executiongraph/ExecutionVertex.java#L741-L760 | train | Finish all blocking partitions. | [
30522,
2862,
1026,
7783,
6072,
11314,
19362,
3775,
3508,
1028,
3926,
8095,
23467,
2075,
19362,
3775,
9285,
1006,
1007,
1063,
2862,
1026,
7783,
6072,
11314,
19362,
3775,
3508,
1028,
2736,
23467,
2075,
19362,
3775,
9285,
1027,
19701,
1025,
20... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
looly/hutool | hutool-db/src/main/java/cn/hutool/db/sql/SqlBuilder.java | SqlBuilder.on | public SqlBuilder on(LogicalOperator logicalOperator, Condition... conditions) {
if (ArrayUtil.isNotEmpty(conditions)) {
if (null != wrapper) {
// 包装字段名
conditions = wrapper.wrap(conditions);
}
on(buildCondition(logicalOperator, conditions));
}
return this;
} | java | public SqlBuilder on(LogicalOperator logicalOperator, Condition... conditions) {
if (ArrayUtil.isNotEmpty(conditions)) {
if (null != wrapper) {
// 包装字段名
conditions = wrapper.wrap(conditions);
}
on(buildCondition(logicalOperator, conditions));
}
return this;
} | [
"public",
"SqlBuilder",
"on",
"(",
"LogicalOperator",
"logicalOperator",
",",
"Condition",
"...",
"conditions",
")",
"{",
"if",
"(",
"ArrayUtil",
".",
"isNotEmpty",
"(",
"conditions",
")",
")",
"{",
"if",
"(",
"null",
"!=",
"wrapper",
")",
"{",
"// 包装字段名\r",... | 配合JOIN的 ON语句,多表关联的条件语句<br>
只支持单一的逻辑运算符(例如多个条件之间)
@param logicalOperator 逻辑运算符
@param conditions 条件
@return 自己 | [
"配合JOIN的",
"ON语句,多表关联的条件语句<br",
">",
"只支持单一的逻辑运算符(例如多个条件之间)"
] | bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-db/src/main/java/cn/hutool/db/sql/SqlBuilder.java#L463-L473 | train | Creates a INNER JOIN statement with the specified conditions. | [
30522,
2270,
29296,
8569,
23891,
2099,
2006,
1006,
11177,
25918,
8844,
11177,
25918,
8844,
1010,
4650,
1012,
1012,
1012,
3785,
1007,
1063,
2065,
1006,
9140,
21823,
2140,
1012,
3475,
12184,
27718,
2100,
1006,
3785,
1007,
1007,
1063,
2065,
10... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
apache/flink | flink-core/src/main/java/org/apache/flink/api/java/typeutils/ValueTypeInfo.java | ValueTypeInfo.createCopyableValueSerializer | private static <X extends CopyableValue<X>> CopyableValueSerializer<X> createCopyableValueSerializer(Class<X> clazz) {
return new CopyableValueSerializer<X>(clazz);
} | java | private static <X extends CopyableValue<X>> CopyableValueSerializer<X> createCopyableValueSerializer(Class<X> clazz) {
return new CopyableValueSerializer<X>(clazz);
} | [
"private",
"static",
"<",
"X",
"extends",
"CopyableValue",
"<",
"X",
">",
">",
"CopyableValueSerializer",
"<",
"X",
">",
"createCopyableValueSerializer",
"(",
"Class",
"<",
"X",
">",
"clazz",
")",
"{",
"return",
"new",
"CopyableValueSerializer",
"<",
"X",
">",... | utility method to summon the necessary bound | [
"utility",
"method",
"to",
"summon",
"the",
"necessary",
"bound"
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-core/src/main/java/org/apache/flink/api/java/typeutils/ValueTypeInfo.java#L234-L236 | train | Create a serializer for a given class. | [
30522,
2797,
10763,
1026,
1060,
8908,
6100,
3085,
10175,
5657,
1026,
1060,
1028,
1028,
6100,
3085,
10175,
15808,
11610,
28863,
1026,
1060,
1028,
3443,
3597,
7685,
3085,
10175,
15808,
11610,
28863,
1006,
2465,
1026,
1060,
1028,
18856,
10936,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
apache/flink | flink-streaming-java/src/main/java/org/apache/flink/streaming/api/operators/InternalTimeServiceManager.java | InternalTimeServiceManager.numProcessingTimeTimers | @VisibleForTesting
public int numProcessingTimeTimers() {
int count = 0;
for (InternalTimerServiceImpl<?, ?> timerService : timerServices.values()) {
count += timerService.numProcessingTimeTimers();
}
return count;
} | java | @VisibleForTesting
public int numProcessingTimeTimers() {
int count = 0;
for (InternalTimerServiceImpl<?, ?> timerService : timerServices.values()) {
count += timerService.numProcessingTimeTimers();
}
return count;
} | [
"@",
"VisibleForTesting",
"public",
"int",
"numProcessingTimeTimers",
"(",
")",
"{",
"int",
"count",
"=",
"0",
";",
"for",
"(",
"InternalTimerServiceImpl",
"<",
"?",
",",
"?",
">",
"timerService",
":",
"timerServices",
".",
"values",
"(",
")",
")",
"{",
"c... | ////////////////// Methods used ONLY IN TESTS //////////////////// | [
"//////////////////",
"Methods",
"used",
"ONLY",
"IN",
"TESTS",
"////////////////////"
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-streaming-java/src/main/java/org/apache/flink/streaming/api/operators/InternalTimeServiceManager.java#L158-L165 | train | Returns the number of processing time timers. | [
30522,
1030,
5710,
13028,
4355,
2075,
2270,
20014,
16371,
8737,
3217,
9623,
7741,
7292,
7292,
2869,
1006,
1007,
1063,
20014,
4175,
1027,
1014,
1025,
2005,
1006,
30524,
3217,
9623,
7741,
7292,
7292,
2869,
1006,
1007,
1025,
1065,
2709,
4175,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
apache/flink | flink-runtime/src/main/java/org/apache/flink/runtime/clusterframework/BootstrapTools.java | BootstrapTools.startActorSystem | public static ActorSystem startActorSystem(
Configuration configuration,
String listeningAddress,
String portRangeDefinition,
Logger logger) throws Exception {
return startActorSystem(
configuration,
listeningAddress,
portRangeDefinition,
logger,
ForkJoinExecutorConfiguration.fromConfiguration(... | java | public static ActorSystem startActorSystem(
Configuration configuration,
String listeningAddress,
String portRangeDefinition,
Logger logger) throws Exception {
return startActorSystem(
configuration,
listeningAddress,
portRangeDefinition,
logger,
ForkJoinExecutorConfiguration.fromConfiguration(... | [
"public",
"static",
"ActorSystem",
"startActorSystem",
"(",
"Configuration",
"configuration",
",",
"String",
"listeningAddress",
",",
"String",
"portRangeDefinition",
",",
"Logger",
"logger",
")",
"throws",
"Exception",
"{",
"return",
"startActorSystem",
"(",
"configura... | Starts an ActorSystem with the given configuration listening at the address/ports.
@param configuration The Flink configuration
@param listeningAddress The address to listen at.
@param portRangeDefinition The port range to choose a port from.
@param logger The logger to output log information.
@return The ActorSystem w... | [
"Starts",
"an",
"ActorSystem",
"with",
"the",
"given",
"configuration",
"listening",
"at",
"the",
"address",
"/",
"ports",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/clusterframework/BootstrapTools.java#L82-L93 | train | Start an actor system from a configuration object. | [
30522,
2270,
10763,
5889,
27268,
6633,
2707,
18908,
5668,
27268,
6633,
1006,
9563,
9563,
1010,
5164,
5962,
4215,
16200,
4757,
1010,
5164,
3417,
24388,
14728,
16294,
22753,
1010,
8833,
4590,
8833,
4590,
1007,
11618,
6453,
1063,
2709,
2707,
1... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
alibaba/canal | server/src/main/java/com/alibaba/otter/canal/server/embedded/CanalServerWithEmbedded.java | CanalServerWithEmbedded.rollback | @Override
public void rollback(ClientIdentity clientIdentity) throws CanalServerException {
checkStart(clientIdentity.getDestination());
CanalInstance canalInstance = canalInstances.get(clientIdentity.getDestination());
// 因为存在第一次链接时自动rollback的情况,所以需要忽略未订阅
boolean hasSubscribe = cana... | java | @Override
public void rollback(ClientIdentity clientIdentity) throws CanalServerException {
checkStart(clientIdentity.getDestination());
CanalInstance canalInstance = canalInstances.get(clientIdentity.getDestination());
// 因为存在第一次链接时自动rollback的情况,所以需要忽略未订阅
boolean hasSubscribe = cana... | [
"@",
"Override",
"public",
"void",
"rollback",
"(",
"ClientIdentity",
"clientIdentity",
")",
"throws",
"CanalServerException",
"{",
"checkStart",
"(",
"clientIdentity",
".",
"getDestination",
"(",
")",
")",
";",
"CanalInstance",
"canalInstance",
"=",
"canalInstances",... | 回滚到未进行 {@link #ack} 的地方,下次fetch的时候,可以从最后一个没有 {@link #ack} 的地方开始拿 | [
"回滚到未进行",
"{"
] | 8f088cddc0755f4350c5aaae95c6e4002d90a40f | https://github.com/alibaba/canal/blob/8f088cddc0755f4350c5aaae95c6e4002d90a40f/server/src/main/java/com/alibaba/otter/canal/server/embedded/CanalServerWithEmbedded.java#L442-L459 | train | Rollback the transaction | [
30522,
1030,
2058,
15637,
2270,
11675,
4897,
5963,
1006,
7396,
5178,
16778,
3723,
7396,
5178,
16778,
3723,
1007,
11618,
17263,
2121,
28943,
2595,
24422,
1063,
14148,
7559,
2102,
1006,
7396,
5178,
16778,
3723,
1012,
2131,
6155,
13770,
3508,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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 | parse/src/main/java/com/alibaba/otter/canal/parse/inbound/mysql/tsdb/DatabaseTableMeta.java | DatabaseTableMeta.applySnapshotToDB | private boolean applySnapshotToDB(EntryPosition position, boolean init) {
// 获取一份快照
Map<String, String> schemaDdls = null;
lock.readLock().lock();
try {
if (!init && !hasNewDdl) {
// 如果是持续构建,则识别一下是否有DDL变更过,如果没有就忽略了
return false;
}
... | java | private boolean applySnapshotToDB(EntryPosition position, boolean init) {
// 获取一份快照
Map<String, String> schemaDdls = null;
lock.readLock().lock();
try {
if (!init && !hasNewDdl) {
// 如果是持续构建,则识别一下是否有DDL变更过,如果没有就忽略了
return false;
}
... | [
"private",
"boolean",
"applySnapshotToDB",
"(",
"EntryPosition",
"position",
",",
"boolean",
"init",
")",
"{",
"// 获取一份快照",
"Map",
"<",
"String",
",",
"String",
">",
"schemaDdls",
"=",
"null",
";",
"lock",
".",
"readLock",
"(",
")",
".",
"lock",
"(",
")",
... | 发布数据到console上 | [
"发布数据到console上"
] | 8f088cddc0755f4350c5aaae95c6e4002d90a40f | https://github.com/alibaba/canal/blob/8f088cddc0755f4350c5aaae95c6e4002d90a40f/parse/src/main/java/com/alibaba/otter/canal/parse/inbound/mysql/tsdb/DatabaseTableMeta.java#L289-L355 | train | Apply snapshot to database. | [
30522,
2797,
22017,
20898,
6611,
2015,
2532,
4523,
12326,
3406,
18939,
1006,
4443,
26994,
2597,
1010,
22017,
20898,
1999,
4183,
1007,
1063,
1013,
1013,
100,
100,
1740,
100,
100,
100,
4949,
1026,
5164,
1010,
5164,
1028,
8040,
28433,
14141,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/web/reactive/error/AbstractErrorWebExceptionHandler.java | AbstractErrorWebExceptionHandler.getErrorAttributes | protected Map<String, Object> getErrorAttributes(ServerRequest request,
boolean includeStackTrace) {
return this.errorAttributes.getErrorAttributes(request, includeStackTrace);
} | java | protected Map<String, Object> getErrorAttributes(ServerRequest request,
boolean includeStackTrace) {
return this.errorAttributes.getErrorAttributes(request, includeStackTrace);
} | [
"protected",
"Map",
"<",
"String",
",",
"Object",
">",
"getErrorAttributes",
"(",
"ServerRequest",
"request",
",",
"boolean",
"includeStackTrace",
")",
"{",
"return",
"this",
".",
"errorAttributes",
".",
"getErrorAttributes",
"(",
"request",
",",
"includeStackTrace"... | Extract the error attributes from the current request, to be used to populate error
views or JSON payloads.
@param request the source request
@param includeStackTrace whether to include the error stacktrace information
@return the error attributes as a Map. | [
"Extract",
"the",
"error",
"attributes",
"from",
"the",
"current",
"request",
"to",
"be",
"used",
"to",
"populate",
"error",
"views",
"or",
"JSON",
"payloads",
"."
] | 0b27f7c70e164b2b1a96477f1d9c1acba56790c1 | https://github.com/spring-projects/spring-boot/blob/0b27f7c70e164b2b1a96477f1d9c1acba56790c1/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/reactive/error/AbstractErrorWebExceptionHandler.java#L138-L141 | train | Get the error attributes for the specified request. | [
30522,
5123,
4949,
1026,
5164,
1010,
4874,
1028,
2131,
2121,
29165,
19321,
3089,
8569,
4570,
1006,
8241,
2890,
15500,
5227,
1010,
22017,
20898,
2950,
2696,
3600,
6494,
3401,
1007,
1063,
2709,
2023,
1012,
7561,
19321,
3089,
8569,
4570,
1012,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
netty/netty | resolver-dns/src/main/java/io/netty/resolver/dns/UnixResolverDnsServerAddressStreamProvider.java | UnixResolverDnsServerAddressStreamProvider.parseEtcResolverSearchDomains | static List<String> parseEtcResolverSearchDomains(File etcResolvConf) throws IOException {
String localDomain = null;
List<String> searchDomains = new ArrayList<String>();
FileReader fr = new FileReader(etcResolvConf);
BufferedReader br = null;
try {
br = new Buffere... | java | static List<String> parseEtcResolverSearchDomains(File etcResolvConf) throws IOException {
String localDomain = null;
List<String> searchDomains = new ArrayList<String>();
FileReader fr = new FileReader(etcResolvConf);
BufferedReader br = null;
try {
br = new Buffere... | [
"static",
"List",
"<",
"String",
">",
"parseEtcResolverSearchDomains",
"(",
"File",
"etcResolvConf",
")",
"throws",
"IOException",
"{",
"String",
"localDomain",
"=",
"null",
";",
"List",
"<",
"String",
">",
"searchDomains",
"=",
"new",
"ArrayList",
"<",
"String"... | Parse a file of the format <a href="https://linux.die.net/man/5/resolver">/etc/resolv.conf</a> and return the
list of search domains found in it or an empty list if not found.
@param etcResolvConf a file of the format <a href="https://linux.die.net/man/5/resolver">/etc/resolv.conf</a>.
@return List of search domains.
@... | [
"Parse",
"a",
"file",
"of",
"the",
"format",
"<a",
"href",
"=",
"https",
":",
"//",
"linux",
".",
"die",
".",
"net",
"/",
"man",
"/",
"5",
"/",
"resolver",
">",
"/",
"etc",
"/",
"resolv",
".",
"conf<",
"/",
"a",
">",
"and",
"return",
"the",
"li... | ba06eafa1c1824bd154f1a380019e7ea2edf3c4c | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/resolver-dns/src/main/java/io/netty/resolver/dns/UnixResolverDnsServerAddressStreamProvider.java#L309-L346 | train | Parses the etcResolvConf file to get the list of search domains. | [
30522,
10763,
2862,
1026,
5164,
1028,
11968,
19763,
13535,
6072,
4747,
16070,
2906,
2818,
9527,
28247,
1006,
5371,
4385,
6072,
4747,
25465,
2239,
2546,
1007,
11618,
22834,
10288,
24422,
1063,
5164,
2334,
9527,
8113,
1027,
19701,
1025,
2862,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/RobotUtil.java | RobotUtil.keyPressWithCtrl | public static void keyPressWithCtrl(int key) {
robot.keyPress(KeyEvent.VK_CONTROL);
robot.keyPress(key);
robot.keyRelease(key);
robot.keyRelease(KeyEvent.VK_CONTROL);
delay();
} | java | public static void keyPressWithCtrl(int key) {
robot.keyPress(KeyEvent.VK_CONTROL);
robot.keyPress(key);
robot.keyRelease(key);
robot.keyRelease(KeyEvent.VK_CONTROL);
delay();
} | [
"public",
"static",
"void",
"keyPressWithCtrl",
"(",
"int",
"key",
")",
"{",
"robot",
".",
"keyPress",
"(",
"KeyEvent",
".",
"VK_CONTROL",
")",
";",
"robot",
".",
"keyPress",
"(",
"key",
")",
";",
"robot",
".",
"keyRelease",
"(",
"key",
")",
";",
"robo... | ctrl+ 按键
@param key 按键 | [
"ctrl",
"+",
"按键"
] | bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/swing/RobotUtil.java#L135-L141 | train | Shortcut method for pressing control key events. | [
30522,
2270,
10763,
11675,
3145,
20110,
24415,
6593,
12190,
1006,
20014,
3145,
1007,
1063,
8957,
1012,
3145,
20110,
1006,
3145,
18697,
3372,
1012,
1058,
2243,
1035,
2491,
1007,
1025,
8957,
1012,
3145,
20110,
1006,
3145,
1007,
1025,
8957,
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-connectors/flink-connector-kafka-0.8/src/main/java/org/apache/flink/streaming/connectors/kafka/internals/Kafka08PartitionDiscoverer.java | Kafka08PartitionDiscoverer.getPartitionLeadersForTopics | public List<KafkaTopicPartitionLeader> getPartitionLeadersForTopics(List<String> topics) {
List<KafkaTopicPartitionLeader> partitions = new LinkedList<>();
retryLoop: for (int retry = 0; retry < numRetries; retry++) {
brokersLoop: for (int arrIdx = 0; arrIdx < seedBrokerAddresses.length; arrIdx++) {
LOG.inf... | java | public List<KafkaTopicPartitionLeader> getPartitionLeadersForTopics(List<String> topics) {
List<KafkaTopicPartitionLeader> partitions = new LinkedList<>();
retryLoop: for (int retry = 0; retry < numRetries; retry++) {
brokersLoop: for (int arrIdx = 0; arrIdx < seedBrokerAddresses.length; arrIdx++) {
LOG.inf... | [
"public",
"List",
"<",
"KafkaTopicPartitionLeader",
">",
"getPartitionLeadersForTopics",
"(",
"List",
"<",
"String",
">",
"topics",
")",
"{",
"List",
"<",
"KafkaTopicPartitionLeader",
">",
"partitions",
"=",
"new",
"LinkedList",
"<>",
"(",
")",
";",
"retryLoop",
... | Send request to Kafka to get partitions for topics.
@param topics The name of the topics. | [
"Send",
"request",
"to",
"Kafka",
"to",
"get",
"partitions",
"for",
"topics",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-connectors/flink-connector-kafka-0.8/src/main/java/org/apache/flink/streaming/connectors/kafka/internals/Kafka08PartitionDiscoverer.java#L184-L241 | train | Gets the list of KafkaTopicPartitionLeaders for a list of topics. | [
30522,
2270,
2862,
1026,
10556,
24316,
10610,
24330,
19362,
3775,
3508,
19000,
1028,
2131,
19362,
3775,
3508,
19000,
22747,
11589,
7361,
6558,
1006,
2862,
1026,
5164,
1028,
7832,
1007,
1063,
2862,
1026,
10556,
24316,
10610,
24330,
19362,
3775... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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.scanPackageByAnnotation | public static Set<Class<?>> scanPackageByAnnotation(String packageName, final Class<? extends Annotation> annotationClass) {
return scanPackage(packageName, new Filter<Class<?>>() {
@Override
public boolean accept(Class<?> clazz) {
return clazz.isAnnotationPresent(annotationClass);
}
});
} | java | public static Set<Class<?>> scanPackageByAnnotation(String packageName, final Class<? extends Annotation> annotationClass) {
return scanPackage(packageName, new Filter<Class<?>>() {
@Override
public boolean accept(Class<?> clazz) {
return clazz.isAnnotationPresent(annotationClass);
}
});
} | [
"public",
"static",
"Set",
"<",
"Class",
"<",
"?",
">",
">",
"scanPackageByAnnotation",
"(",
"String",
"packageName",
",",
"final",
"Class",
"<",
"?",
"extends",
"Annotation",
">",
"annotationClass",
")",
"{",
"return",
"scanPackage",
"(",
"packageName",
",",
... | 扫描指定包路径下所有包含指定注解的类
@param packageName 包路径
@param annotationClass 注解类
@return 类集合 | [
"扫描指定包路径下所有包含指定注解的类"
] | bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/lang/ClassScaner.java#L58-L65 | train | Scans a package for classes annotated with the given annotation. | [
30522,
2270,
10763,
2275,
1026,
2465,
1026,
1029,
1028,
1028,
13594,
23947,
4270,
3762,
11639,
17287,
3508,
1006,
5164,
7427,
18442,
1010,
2345,
2465,
1026,
1029,
8908,
5754,
17287,
3508,
1028,
5754,
17287,
3508,
26266,
1007,
1063,
2709,
13... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
alibaba/canal | client/src/main/java/com/alibaba/otter/canal/client/CanalConnectors.java | CanalConnectors.newClusterConnector | public static CanalConnector newClusterConnector(String zkServers, String destination, String username,
String password) {
ClusterCanalConnector canalConnector = new ClusterCanalConnector(username,
password,
destination,
ne... | java | public static CanalConnector newClusterConnector(String zkServers, String destination, String username,
String password) {
ClusterCanalConnector canalConnector = new ClusterCanalConnector(username,
password,
destination,
ne... | [
"public",
"static",
"CanalConnector",
"newClusterConnector",
"(",
"String",
"zkServers",
",",
"String",
"destination",
",",
"String",
"username",
",",
"String",
"password",
")",
"{",
"ClusterCanalConnector",
"canalConnector",
"=",
"new",
"ClusterCanalConnector",
"(",
... | 创建带cluster模式的客户端链接,自动完成failover切换,服务器列表自动扫描
@param zkServers
@param destination
@param username
@param password
@return | [
"创建带cluster模式的客户端链接,自动完成failover切换,服务器列表自动扫描"
] | 8f088cddc0755f4350c5aaae95c6e4002d90a40f | https://github.com/alibaba/canal/blob/8f088cddc0755f4350c5aaae95c6e4002d90a40f/client/src/main/java/com/alibaba/otter/canal/client/CanalConnectors.java#L66-L75 | train | Create a new ClusterCanalConnector | [
30522,
2270,
10763,
5033,
8663,
2638,
16761,
2047,
20464,
19966,
2121,
8663,
2638,
16761,
1006,
5164,
1062,
5705,
2121,
14028,
1010,
5164,
7688,
1010,
5164,
5310,
18442,
1010,
5164,
20786,
1007,
1063,
9324,
28621,
22499,
10087,
16761,
5033,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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.asXmlDocument | private synchronized Document asXmlDocument(String propertyName)
throws IOException, IllegalArgumentException {
Document doc;
try {
doc = DocumentBuilderFactory
.newInstance()
.newDocumentBuilder()
.newDocument();
} catch (ParserConfigurationException pe) {
throw new IOException(pe);
}
... | java | private synchronized Document asXmlDocument(String propertyName)
throws IOException, IllegalArgumentException {
Document doc;
try {
doc = DocumentBuilderFactory
.newInstance()
.newDocumentBuilder()
.newDocument();
} catch (ParserConfigurationException pe) {
throw new IOException(pe);
}
... | [
"private",
"synchronized",
"Document",
"asXmlDocument",
"(",
"String",
"propertyName",
")",
"throws",
"IOException",
",",
"IllegalArgumentException",
"{",
"Document",
"doc",
";",
"try",
"{",
"doc",
"=",
"DocumentBuilderFactory",
".",
"newInstance",
"(",
")",
".",
... | Return the XML DOM corresponding to this Configuration. | [
"Return",
"the",
"XML",
"DOM",
"corresponding",
"to",
"this",
"Configuration",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-filesystems/flink-fs-hadoop-shaded/src/main/java/org/apache/hadoop/conf/Configuration.java#L3146-L3181 | train | Returns the XML document for the given property name. | [
30522,
2797,
30524,
7076,
26897,
1006,
1007,
1012,
2047,
3527,
24894,
4765,
8569,
23891,
2099,
1006,
1007,
1012,
2047,
3527,
24894,
4765,
1006,
1007,
1025,
1065,
4608,
1006,
11968,
8043,
8663,
8873,
27390,
3370,
10288,
24422,
21877,
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 | codec-http/src/main/java/io/netty/handler/codec/http/multipart/HttpPostMultipartRequestDecoder.java | HttpPostMultipartRequestDecoder.destroy | @Override
public void destroy() {
checkDestroyed();
cleanFiles();
destroyed = true;
if (undecodedChunk != null && undecodedChunk.refCnt() > 0) {
undecodedChunk.release();
undecodedChunk = null;
}
// release all data which was not yet pulled
... | java | @Override
public void destroy() {
checkDestroyed();
cleanFiles();
destroyed = true;
if (undecodedChunk != null && undecodedChunk.refCnt() > 0) {
undecodedChunk.release();
undecodedChunk = null;
}
// release all data which was not yet pulled
... | [
"@",
"Override",
"public",
"void",
"destroy",
"(",
")",
"{",
"checkDestroyed",
"(",
")",
";",
"cleanFiles",
"(",
")",
";",
"destroyed",
"=",
"true",
";",
"if",
"(",
"undecodedChunk",
"!=",
"null",
"&&",
"undecodedChunk",
".",
"refCnt",
"(",
")",
">",
"... | Destroy the {@link HttpPostMultipartRequestDecoder} and release all it resources. After this method
was called it is not possible to operate on it anymore. | [
"Destroy",
"the",
"{"
] | ba06eafa1c1824bd154f1a380019e7ea2edf3c4c | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/codec-http/src/main/java/io/netty/handler/codec/http/multipart/HttpPostMultipartRequestDecoder.java#L934-L949 | train | Destroy the base class. | [
30522,
1030,
2058,
15637,
2270,
11675,
6033,
1006,
1007,
1063,
4638,
6155,
13181,
20821,
1006,
1007,
1025,
4550,
8873,
4244,
1006,
1007,
1025,
3908,
1027,
2995,
1025,
2065,
1006,
6151,
8586,
10244,
16409,
17157,
2243,
999,
1027,
19701,
1004... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
SeleniumHQ/selenium | java/client/src/org/openqa/selenium/support/ui/ExpectedConditions.java | ExpectedConditions.textToBePresentInElementValue | public static ExpectedCondition<Boolean> textToBePresentInElementValue(final By locator,
final String text) {
return new ExpectedCondition<Boolean>() {
@Override
public Boolean apply(WebDriver driver) {
try {
Str... | java | public static ExpectedCondition<Boolean> textToBePresentInElementValue(final By locator,
final String text) {
return new ExpectedCondition<Boolean>() {
@Override
public Boolean apply(WebDriver driver) {
try {
Str... | [
"public",
"static",
"ExpectedCondition",
"<",
"Boolean",
">",
"textToBePresentInElementValue",
"(",
"final",
"By",
"locator",
",",
"final",
"String",
"text",
")",
"{",
"return",
"new",
"ExpectedCondition",
"<",
"Boolean",
">",
"(",
")",
"{",
"@",
"Override",
"... | An expectation for checking if the given text is present in the specified elements value
attribute.
@param locator used to find the element
@param text to be present in the value attribute of the element found by the locator
@return true once the value attribute of the first element located by locator contains the
... | [
"An",
"expectation",
"for",
"checking",
"if",
"the",
"given",
"text",
"is",
"present",
"in",
"the",
"specified",
"elements",
"value",
"attribute",
"."
] | 7af172729f17b20269c8ca4ea6f788db48616535 | https://github.com/SeleniumHQ/selenium/blob/7af172729f17b20269c8ca4ea6f788db48616535/java/client/src/org/openqa/selenium/support/ui/ExpectedConditions.java#L438-L461 | train | An expectation for checking that an element s text is present in the value of the element s attribute. | [
30522,
2270,
10763,
3517,
8663,
30524,
23663,
2099,
4062,
1007,
1063,
3046,
1063,
5164,
5783,
18209,
1027,
4062,
1012,
2424,
12260,
3672,
1006,
8840,
11266,
2953,
1007,
1012,
2131,
19321,
3089,
8569,
2618,
1006,
1000,
3643,
1000,
1007,
1025... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
apache/flink | flink-connectors/flink-connector-kafka-base/src/main/java/org/apache/flink/streaming/connectors/kafka/internals/KafkaTopicPartitionAssigner.java | KafkaTopicPartitionAssigner.assign | public static int assign(KafkaTopicPartition partition, int numParallelSubtasks) {
int startIndex = ((partition.getTopic().hashCode() * 31) & 0x7FFFFFFF) % numParallelSubtasks;
// here, the assumption is that the id of Kafka partitions are always ascending
// starting from 0, and therefore can be used directly a... | java | public static int assign(KafkaTopicPartition partition, int numParallelSubtasks) {
int startIndex = ((partition.getTopic().hashCode() * 31) & 0x7FFFFFFF) % numParallelSubtasks;
// here, the assumption is that the id of Kafka partitions are always ascending
// starting from 0, and therefore can be used directly a... | [
"public",
"static",
"int",
"assign",
"(",
"KafkaTopicPartition",
"partition",
",",
"int",
"numParallelSubtasks",
")",
"{",
"int",
"startIndex",
"=",
"(",
"(",
"partition",
".",
"getTopic",
"(",
")",
".",
"hashCode",
"(",
")",
"*",
"31",
")",
"&",
"0x7FFFFF... | Returns the index of the target subtask that a specific Kafka partition should be
assigned to.
<p>The resulting distribution of partitions of a single topic has the following contract:
<ul>
<li>1. Uniformly distributed across subtasks</li>
<li>2. Partitions are round-robin distributed (strictly clockwise w.r.t. ascend... | [
"Returns",
"the",
"index",
"of",
"the",
"target",
"subtask",
"that",
"a",
"specific",
"Kafka",
"partition",
"should",
"be",
"assigned",
"to",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-connectors/flink-connector-kafka-base/src/main/java/org/apache/flink/streaming/connectors/kafka/internals/KafkaTopicPartitionAssigner.java#L51-L57 | train | Assign a partition to a Kafka topic. | [
30522,
2270,
10763,
20014,
23911,
1006,
10556,
24316,
10610,
24330,
19362,
3775,
3508,
13571,
1010,
20014,
16371,
8737,
5400,
6216,
4877,
12083,
10230,
5705,
1007,
1063,
20014,
2707,
22254,
10288,
1027,
1006,
1006,
13571,
1012,
2131,
14399,
2... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
looly/hutool | hutool-core/src/main/java/cn/hutool/core/collection/IterUtil.java | IterUtil.toMap | public static <K, V> Map<K, V> toMap(Iterator<K> keys, Iterator<V> values, boolean isOrder) {
final Map<K, V> resultMap = MapUtil.newHashMap(isOrder);
if (isNotEmpty(keys)) {
while (keys.hasNext()) {
resultMap.put(keys.next(), (null != values && values.hasNext()) ? values.next() : null);
}
}
re... | java | public static <K, V> Map<K, V> toMap(Iterator<K> keys, Iterator<V> values, boolean isOrder) {
final Map<K, V> resultMap = MapUtil.newHashMap(isOrder);
if (isNotEmpty(keys)) {
while (keys.hasNext()) {
resultMap.put(keys.next(), (null != values && values.hasNext()) ? values.next() : null);
}
}
re... | [
"public",
"static",
"<",
"K",
",",
"V",
">",
"Map",
"<",
"K",
",",
"V",
">",
"toMap",
"(",
"Iterator",
"<",
"K",
">",
"keys",
",",
"Iterator",
"<",
"V",
">",
"values",
",",
"boolean",
"isOrder",
")",
"{",
"final",
"Map",
"<",
"K",
",",
"V",
"... | 将键列表和值列表转换为Map<br>
以键为准,值与键位置需对应。如果键元素数多于值元素,多余部分值用null代替。<br>
如果值多于键,忽略多余的值。
@param <K> 键类型
@param <V> 值类型
@param keys 键列表
@param values 值列表
@param isOrder 是否有序
@return 标题内容Map
@since 4.1.12 | [
"将键列表和值列表转换为Map<br",
">",
"以键为准,值与键位置需对应。如果键元素数多于值元素,多余部分值用null代替。<br",
">",
"如果值多于键,忽略多余的值。"
] | bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/collection/IterUtil.java#L421-L429 | train | Creates a map from the given iterator. | [
30522,
2270,
10763,
1026,
1047,
1010,
1058,
1028,
4949,
1026,
1047,
1010,
1058,
1028,
3419,
9331,
1006,
2009,
6906,
4263,
1026,
1047,
1028,
6309,
1010,
2009,
6906,
4263,
1026,
1058,
1028,
5300,
1010,
22017,
20898,
11163,
26764,
1007,
1063,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
looly/hutool | hutool-core/src/main/java/cn/hutool/core/bean/copier/BeanCopier.java | BeanCopier.mapToMap | @SuppressWarnings({ "unchecked", "rawtypes" })
private void mapToMap(Map source, Map dest) {
if (null != dest && null != source) {
dest.putAll(source);
}
} | java | @SuppressWarnings({ "unchecked", "rawtypes" })
private void mapToMap(Map source, Map dest) {
if (null != dest && null != source) {
dest.putAll(source);
}
} | [
"@",
"SuppressWarnings",
"(",
"{",
"\"unchecked\"",
",",
"\"rawtypes\"",
"}",
")",
"private",
"void",
"mapToMap",
"(",
"Map",
"source",
",",
"Map",
"dest",
")",
"{",
"if",
"(",
"null",
"!=",
"dest",
"&&",
"null",
"!=",
"source",
")",
"{",
"dest",
".",
... | Map转Map
@param source 源Map
@param dest 目标Map | [
"Map转Map"
] | bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/bean/copier/BeanCopier.java#L137-L142 | train | Maps a map to a map. | [
30522,
1030,
16081,
9028,
5582,
2015,
1006,
1063,
1000,
4895,
5403,
18141,
1000,
1010,
1000,
6315,
13874,
2015,
1000,
1065,
1007,
2797,
11675,
4949,
20389,
9331,
1006,
4949,
3120,
1010,
4949,
4078,
2102,
1007,
1063,
2065,
1006,
19701,
999,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
apache/flink | flink-libraries/flink-gelly/src/main/java/org/apache/flink/graph/asm/translate/Translate.java | Translate.translateEdgeIds | @SuppressWarnings("unchecked")
public static <OLD, NEW, EV> DataSet<Edge<NEW, EV>> translateEdgeIds(DataSet<Edge<OLD, EV>> edges, TranslateFunction<OLD, NEW> translator, int parallelism) {
Preconditions.checkNotNull(edges);
Preconditions.checkNotNull(translator);
Class<Edge<NEW, EV>> edgeClass = (Class<Edge<NEW... | java | @SuppressWarnings("unchecked")
public static <OLD, NEW, EV> DataSet<Edge<NEW, EV>> translateEdgeIds(DataSet<Edge<OLD, EV>> edges, TranslateFunction<OLD, NEW> translator, int parallelism) {
Preconditions.checkNotNull(edges);
Preconditions.checkNotNull(translator);
Class<Edge<NEW, EV>> edgeClass = (Class<Edge<NEW... | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"static",
"<",
"OLD",
",",
"NEW",
",",
"EV",
">",
"DataSet",
"<",
"Edge",
"<",
"NEW",
",",
"EV",
">",
">",
"translateEdgeIds",
"(",
"DataSet",
"<",
"Edge",
"<",
"OLD",
",",
"EV",
">",
">",... | Translate {@link Edge} IDs using the given {@link TranslateFunction}.
@param edges input edges
@param translator implements conversion from {@code OLD} to {@code NEW}
@param parallelism operator parallelism
@param <OLD> old edge ID type
@param <NEW> new edge ID type
@param <EV> edge value type
@return translated edges | [
"Translate",
"{",
"@link",
"Edge",
"}",
"IDs",
"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#L152-L177 | train | Translate edge IDs. | [
30522,
1030,
16081,
9028,
5582,
2015,
1006,
1000,
4895,
5403,
18141,
1000,
1007,
2270,
10763,
1026,
2214,
1010,
2047,
1010,
23408,
1028,
2951,
13462,
1026,
3341,
1026,
2047,
1010,
23408,
1028,
1028,
17637,
24225,
9821,
1006,
2951,
13462,
10... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
apache/flink | flink-core/src/main/java/org/apache/flink/api/java/typeutils/runtime/PojoSerializerSnapshot.java | PojoSerializerSnapshot.newPojoSerializerIsCompatibleWithReconfiguredSerializer | private static <T> boolean newPojoSerializerIsCompatibleWithReconfiguredSerializer(
PojoSerializer<T> newPojoSerializer,
IntermediateCompatibilityResult<T> fieldSerializerCompatibility,
IntermediateCompatibilityResult<T> preExistingRegistrationsCompatibility,
LinkedOptionalMap<Class<?>, TypeSerializerSnapsh... | java | private static <T> boolean newPojoSerializerIsCompatibleWithReconfiguredSerializer(
PojoSerializer<T> newPojoSerializer,
IntermediateCompatibilityResult<T> fieldSerializerCompatibility,
IntermediateCompatibilityResult<T> preExistingRegistrationsCompatibility,
LinkedOptionalMap<Class<?>, TypeSerializerSnapsh... | [
"private",
"static",
"<",
"T",
">",
"boolean",
"newPojoSerializerIsCompatibleWithReconfiguredSerializer",
"(",
"PojoSerializer",
"<",
"T",
">",
"newPojoSerializer",
",",
"IntermediateCompatibilityResult",
"<",
"T",
">",
"fieldSerializerCompatibility",
",",
"IntermediateCompat... | Checks if the new {@link PojoSerializer} is compatible with a reconfigured instance. | [
"Checks",
"if",
"the",
"new",
"{"
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-core/src/main/java/org/apache/flink/api/java/typeutils/runtime/PojoSerializerSnapshot.java#L358-L368 | train | Checks if a new POJO serializer is compatible with a reconfigured serializer. | [
30522,
2797,
10763,
1026,
1056,
1028,
22017,
20898,
2047,
6873,
19929,
11610,
28863,
2483,
9006,
24952,
3468,
24415,
2890,
8663,
8873,
27390,
2098,
8043,
4818,
17629,
1006,
13433,
19929,
11610,
28863,
1026,
1056,
1028,
2047,
6873,
19929,
1161... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
looly/hutool | hutool-core/src/main/java/cn/hutool/core/builder/EqualsBuilder.java | EqualsBuilder.append | public EqualsBuilder append(final Object lhs, final Object rhs) {
if (isEquals == false) {
return this;
}
if (lhs == rhs) {
return this;
}
if (lhs == null || rhs == null) {
this.setEquals(false);
return this;
}
final... | java | public EqualsBuilder append(final Object lhs, final Object rhs) {
if (isEquals == false) {
return this;
}
if (lhs == rhs) {
return this;
}
if (lhs == null || rhs == null) {
this.setEquals(false);
return this;
}
final... | [
"public",
"EqualsBuilder",
"append",
"(",
"final",
"Object",
"lhs",
",",
"final",
"Object",
"rhs",
")",
"{",
"if",
"(",
"isEquals",
"==",
"false",
")",
"{",
"return",
"this",
";",
"}",
"if",
"(",
"lhs",
"==",
"rhs",
")",
"{",
"return",
"this",
";",
... | <p>Test if two <code>Object</code>s are equal using their
<code>equals</code> method.</p>
@param lhs the left hand object
@param rhs the right hand object
@return EqualsBuilder - used to chain calls. | [
"<p",
">",
"Test",
"if",
"two",
"<code",
">",
"Object<",
"/",
"code",
">",
"s",
"are",
"equal",
"using",
"their",
"<code",
">",
"equals<",
"/",
"code",
">",
"method",
".",
"<",
"/",
"p",
">"
] | bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/builder/EqualsBuilder.java#L440-L463 | train | Append the two objects to the EqualsBuilder. | [
30522,
2270,
19635,
8569,
23891,
2099,
10439,
10497,
1006,
2345,
4874,
1048,
7898,
1010,
2345,
4874,
1054,
7898,
1007,
1063,
2065,
1006,
2003,
2063,
26426,
2015,
1027,
1027,
6270,
1007,
1063,
2709,
2023,
1025,
1065,
2065,
1006,
1048,
7898,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/AbstractDb.java | AbstractDb.find | public <T> T find(Entity where, RsHandler<T> rsh, String... fields) throws SQLException {
return find(CollectionUtil.newArrayList(fields), where, rsh);
} | java | public <T> T find(Entity where, RsHandler<T> rsh, String... fields) throws SQLException {
return find(CollectionUtil.newArrayList(fields), where, rsh);
} | [
"public",
"<",
"T",
">",
"T",
"find",
"(",
"Entity",
"where",
",",
"RsHandler",
"<",
"T",
">",
"rsh",
",",
"String",
"...",
"fields",
")",
"throws",
"SQLException",
"{",
"return",
"find",
"(",
"CollectionUtil",
".",
"newArrayList",
"(",
"fields",
")",
... | 查询,返回所有字段<br>
查询条件为多个key value对表示,默认key = value,如果使用其它条件可以使用:where.put("key", " > 1"),value也可以传Condition对象,key被忽略
@param <T> 需要处理成的结果对象类型
@param where 条件实体类(包含表名)
@param rsh 结果集处理对象
@param fields 字段列表,可变长参数如果无值表示查询全部字段
@return 结果对象
@throws SQLException SQL执行异常 | [
"查询,返回所有字段<br",
">",
"查询条件为多个key",
"value对表示,默认key",
"=",
"value,如果使用其它条件可以使用:where",
".",
"put",
"(",
"key",
">",
";",
"1",
")",
",value也可以传Condition对象,key被忽略"
] | bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-db/src/main/java/cn/hutool/db/AbstractDb.java#L478-L480 | train | Find records in the database that match the criteria specified in the where clause. | [
30522,
2270,
1026,
1056,
1028,
1056,
2424,
1006,
9178,
2073,
1010,
12667,
11774,
3917,
1026,
1056,
1028,
12667,
2232,
1010,
5164,
1012,
1012,
1012,
4249,
1007,
11618,
29296,
10288,
24422,
1063,
2709,
2424,
1006,
3074,
21823,
2140,
1012,
204... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
apache/spark | sql/hive-thriftserver/src/gen/java/org/apache/hive/service/cli/thrift/TFetchResultsResp.java | TFetchResultsResp.isSet | public boolean isSet(_Fields field) {
if (field == null) {
throw new IllegalArgumentException();
}
switch (field) {
case STATUS:
return isSetStatus();
case HAS_MORE_ROWS:
return isSetHasMoreRows();
case RESULTS:
return isSetResults();
}
throw new IllegalStateExce... | java | public boolean isSet(_Fields field) {
if (field == null) {
throw new IllegalArgumentException();
}
switch (field) {
case STATUS:
return isSetStatus();
case HAS_MORE_ROWS:
return isSetHasMoreRows();
case RESULTS:
return isSetResults();
}
throw new IllegalStateExce... | [
"public",
"boolean",
"isSet",
"(",
"_Fields",
"field",
")",
"{",
"if",
"(",
"field",
"==",
"null",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
")",
";",
"}",
"switch",
"(",
"field",
")",
"{",
"case",
"STATUS",
":",
"return",
"isSetStatus",... | 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/TFetchResultsResp.java#L281-L295 | train | Checks if field is set to a value of a CRAsCTYPE object. | [
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,
3570... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/AbstractDb.java | AbstractDb.count | public int count(Entity where) throws SQLException {
Connection conn = null;
try {
conn = this.getConnection();
return runner.count(conn, where);
} catch (SQLException e) {
throw e;
} finally {
this.closeConnection(conn);
}
} | java | public int count(Entity where) throws SQLException {
Connection conn = null;
try {
conn = this.getConnection();
return runner.count(conn, where);
} catch (SQLException e) {
throw e;
} finally {
this.closeConnection(conn);
}
} | [
"public",
"int",
"count",
"(",
"Entity",
"where",
")",
"throws",
"SQLException",
"{",
"Connection",
"conn",
"=",
"null",
";",
"try",
"{",
"conn",
"=",
"this",
".",
"getConnection",
"(",
")",
";",
"return",
"runner",
".",
"count",
"(",
"conn",
",",
"whe... | 结果的条目数
@param where 查询条件
@return 复合条件的结果数
@throws SQLException SQL执行异常 | [
"结果的条目数"
] | bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-db/src/main/java/cn/hutool/db/AbstractDb.java#L594-L604 | train | Retrieves the number of rows matching the criteria specified in the WHERE clause. | [
30522,
2270,
20014,
4175,
1006,
9178,
2073,
1007,
11618,
29296,
10288,
24422,
1063,
4434,
9530,
2078,
1027,
19701,
1025,
3046,
1063,
9530,
2078,
1027,
2023,
1012,
2131,
8663,
2638,
7542,
1006,
1007,
1025,
2709,
5479,
1012,
4175,
1006,
9530,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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.unWrap | public static long[] unWrap(Long... values) {
if (null == values) {
return null;
}
final int length = values.length;
if (0 == length) {
return new long[0];
}
final long[] array = new long[length];
for (int i = 0; i < length; i++) {
array[i] = values[i].longValue();
}
return arra... | java | public static long[] unWrap(Long... values) {
if (null == values) {
return null;
}
final int length = values.length;
if (0 == length) {
return new long[0];
}
final long[] array = new long[length];
for (int i = 0; i < length; i++) {
array[i] = values[i].longValue();
}
return arra... | [
"public",
"static",
"long",
"[",
"]",
"unWrap",
"(",
"Long",
"...",
"values",
")",
"{",
"if",
"(",
"null",
"==",
"values",
")",
"{",
"return",
"null",
";",
"}",
"final",
"int",
"length",
"=",
"values",
".",
"length",
";",
"if",
"(",
"0",
"==",
"l... | 包装类数组转为原始类型数组
@param values 包装类型数组
@return 原始类型数组 | [
"包装类数组转为原始类型数组"
] | bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/util/ArrayUtil.java#L1465-L1479 | train | Creates an array of longs that are wrapped in a sequence of longs. | [
30522,
2270,
10763,
2146,
1031,
1033,
4895,
13088,
9331,
1006,
2146,
1012,
1012,
1012,
5300,
1007,
1063,
2065,
1006,
19701,
1027,
1027,
5300,
1007,
1063,
2709,
19701,
1025,
1065,
2345,
20014,
3091,
1027,
5300,
1012,
3091,
1025,
2065,
1006,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
looly/hutool | hutool-poi/src/main/java/cn/hutool/poi/excel/sax/Excel03SaxReader.java | Excel03SaxReader.processRecord | @Override
public void processRecord(Record record) {
if (this.sheetIndex > -1 && this.curSheetIndex > this.sheetIndex) {
// 指定Sheet之后的数据不再处理
return;
}
if (record instanceof BoundSheetRecord) {
// Sheet边界记录,此Record中可以获得Sheet名
boundSheetRecords.add((BoundSheetRecord) record);
} else if (re... | java | @Override
public void processRecord(Record record) {
if (this.sheetIndex > -1 && this.curSheetIndex > this.sheetIndex) {
// 指定Sheet之后的数据不再处理
return;
}
if (record instanceof BoundSheetRecord) {
// Sheet边界记录,此Record中可以获得Sheet名
boundSheetRecords.add((BoundSheetRecord) record);
} else if (re... | [
"@",
"Override",
"public",
"void",
"processRecord",
"(",
"Record",
"record",
")",
"{",
"if",
"(",
"this",
".",
"sheetIndex",
">",
"-",
"1",
"&&",
"this",
".",
"curSheetIndex",
">",
"this",
".",
"sheetIndex",
")",
"{",
"// 指定Sheet之后的数据不再处理\r",
"return",
";"... | HSSFListener 监听方法,处理 Record
@param record 记录 | [
"HSSFListener",
"监听方法,处理",
"Record"
] | bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-poi/src/main/java/cn/hutool/poi/excel/sax/Excel03SaxReader.java#L156-L192 | train | Override the processRecord method to add records to the appropriate list of records. | [
30522,
1030,
2058,
15637,
2270,
11675,
2832,
2890,
27108,
2094,
1006,
2501,
2501,
1007,
1063,
2065,
1006,
2023,
1012,
7123,
22254,
10288,
1028,
1011,
1015,
1004,
1004,
2023,
1012,
12731,
2869,
21030,
7629,
3207,
2595,
1028,
2023,
1012,
7123... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
looly/hutool | hutool-core/src/main/java/cn/hutool/core/util/NumberUtil.java | NumberUtil.sub | public static BigDecimal sub(Number... values) {
if (ArrayUtil.isEmpty(values)) {
return BigDecimal.ZERO;
}
Number value = values[0];
BigDecimal result = new BigDecimal(null == value ? "0" : value.toString());
for (int i = 1; i < values.length; i++) {
value = values[i];
if (null != value) {... | java | public static BigDecimal sub(Number... values) {
if (ArrayUtil.isEmpty(values)) {
return BigDecimal.ZERO;
}
Number value = values[0];
BigDecimal result = new BigDecimal(null == value ? "0" : value.toString());
for (int i = 1; i < values.length; i++) {
value = values[i];
if (null != value) {... | [
"public",
"static",
"BigDecimal",
"sub",
"(",
"Number",
"...",
"values",
")",
"{",
"if",
"(",
"ArrayUtil",
".",
"isEmpty",
"(",
"values",
")",
")",
"{",
"return",
"BigDecimal",
".",
"ZERO",
";",
"}",
"Number",
"value",
"=",
"values",
"[",
"0",
"]",
"... | 提供精确的减法运算<br>
如果传入多个值为null或者空,则返回0
@param values 多个被减值
@return 差
@since 4.0.0 | [
"提供精确的减法运算<br",
">",
"如果传入多个值为null或者空,则返回0"
] | bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/util/NumberUtil.java#L260-L274 | train | Returns the sum of the given number values from this number. | [
30522,
2270,
10763,
2502,
3207,
6895,
9067,
4942,
1006,
2193,
1012,
1012,
1012,
5300,
1007,
1063,
2065,
1006,
9140,
21823,
2140,
1012,
2003,
6633,
13876,
2100,
1006,
5300,
1007,
1007,
1063,
2709,
2502,
3207,
6895,
9067,
1012,
5717,
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... |
netty/netty | resolver-dns/src/main/java/io/netty/resolver/dns/DnsNameResolver.java | DnsNameResolver.query | public Future<AddressedEnvelope<DnsResponse, InetSocketAddress>> query(
InetSocketAddress nameServerAddr, DnsQuestion question, Iterable<DnsRecord> additionals) {
return query0(nameServerAddr, question, toArray(additionals, false), true, ch.newPromise(),
ch.eventLoop().<Address... | java | public Future<AddressedEnvelope<DnsResponse, InetSocketAddress>> query(
InetSocketAddress nameServerAddr, DnsQuestion question, Iterable<DnsRecord> additionals) {
return query0(nameServerAddr, question, toArray(additionals, false), true, ch.newPromise(),
ch.eventLoop().<Address... | [
"public",
"Future",
"<",
"AddressedEnvelope",
"<",
"DnsResponse",
",",
"InetSocketAddress",
">",
">",
"query",
"(",
"InetSocketAddress",
"nameServerAddr",
",",
"DnsQuestion",
"question",
",",
"Iterable",
"<",
"DnsRecord",
">",
"additionals",
")",
"{",
"return",
"q... | Sends a DNS query with the specified question with additional records using the specified name server list. | [
"Sends",
"a",
"DNS",
"query",
"with",
"the",
"specified",
"question",
"with",
"additional",
"records",
"using",
"the",
"specified",
"name",
"server",
"list",
"."
] | ba06eafa1c1824bd154f1a380019e7ea2edf3c4c | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/resolver-dns/src/main/java/io/netty/resolver/dns/DnsNameResolver.java#L1080-L1085 | train | Query a single record in a single dns server. | [
30522,
2270,
2925,
1026,
8280,
2368,
15985,
17635,
1026,
1040,
3619,
6072,
26029,
3366,
1010,
1999,
8454,
7432,
12928,
14141,
8303,
1028,
1028,
23032,
1006,
1999,
8454,
7432,
12928,
14141,
8303,
3415,
2121,
26061,
14141,
2099,
1010,
1040,
3... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
apache/flink | flink-table/flink-table-planner-blink/src/main/java/org/apache/calcite/avatica/util/DateTimeUtils.java | DateTimeUtils.addMonths | public static int addMonths(int date, int m) {
int y0 = (int) DateTimeUtils.unixDateExtract(TimeUnitRange.YEAR, date);
int m0 = (int) DateTimeUtils.unixDateExtract(TimeUnitRange.MONTH, date);
int d0 = (int) DateTimeUtils.unixDateExtract(TimeUnitRange.DAY, date);
int y = m / 12;
y0 += y;
m0 += m - y * 12;
... | java | public static int addMonths(int date, int m) {
int y0 = (int) DateTimeUtils.unixDateExtract(TimeUnitRange.YEAR, date);
int m0 = (int) DateTimeUtils.unixDateExtract(TimeUnitRange.MONTH, date);
int d0 = (int) DateTimeUtils.unixDateExtract(TimeUnitRange.DAY, date);
int y = m / 12;
y0 += y;
m0 += m - y * 12;
... | [
"public",
"static",
"int",
"addMonths",
"(",
"int",
"date",
",",
"int",
"m",
")",
"{",
"int",
"y0",
"=",
"(",
"int",
")",
"DateTimeUtils",
".",
"unixDateExtract",
"(",
"TimeUnitRange",
".",
"YEAR",
",",
"date",
")",
";",
"int",
"m0",
"=",
"(",
"int",... | Adds a given number of months to a date, represented as the number of
days since the epoch. | [
"Adds",
"a",
"given",
"number",
"of",
"months",
"to",
"a",
"date",
"represented",
"as",
"the",
"number",
"of",
"days",
"since",
"the",
"epoch",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-table/flink-table-planner-blink/src/main/java/org/apache/calcite/avatica/util/DateTimeUtils.java#L1070-L1086 | train | Add months to a date. | [
30522,
2270,
10763,
20014,
5587,
9629,
7898,
1006,
20014,
3058,
1010,
20014,
1049,
1007,
1063,
20014,
1061,
2692,
1027,
1006,
20014,
1007,
3058,
7292,
21823,
4877,
1012,
19998,
13701,
10288,
6494,
6593,
1006,
2051,
19496,
30524,
1027,
1006,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
apache/flink | flink-queryable-state/flink-queryable-state-client-java/src/main/java/org/apache/flink/queryablestate/network/Client.java | Client.shutdown | public CompletableFuture<Void> shutdown() {
final CompletableFuture<Void> newShutdownFuture = new CompletableFuture<>();
if (clientShutdownFuture.compareAndSet(null, newShutdownFuture)) {
final List<CompletableFuture<Void>> connectionFutures = new ArrayList<>();
for (Map.Entry<InetSocketAddress, Established... | java | public CompletableFuture<Void> shutdown() {
final CompletableFuture<Void> newShutdownFuture = new CompletableFuture<>();
if (clientShutdownFuture.compareAndSet(null, newShutdownFuture)) {
final List<CompletableFuture<Void>> connectionFutures = new ArrayList<>();
for (Map.Entry<InetSocketAddress, Established... | [
"public",
"CompletableFuture",
"<",
"Void",
">",
"shutdown",
"(",
")",
"{",
"final",
"CompletableFuture",
"<",
"Void",
">",
"newShutdownFuture",
"=",
"new",
"CompletableFuture",
"<>",
"(",
")",
";",
"if",
"(",
"clientShutdownFuture",
".",
"compareAndSet",
"(",
... | Shuts down the client and closes all connections.
<p>After a call to this method, all returned futures will be failed.
@return A {@link CompletableFuture} that will be completed when the shutdown process is done. | [
"Shuts",
"down",
"the",
"client",
"and",
"closes",
"all",
"connections",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-queryable-state/flink-queryable-state-client-java/src/main/java/org/apache/flink/queryablestate/network/Client.java#L178-L226 | train | Shutdowns all connections. | [
30522,
2270,
4012,
10814,
10880,
11263,
11244,
1026,
11675,
1028,
3844,
7698,
1006,
1007,
1063,
2345,
4012,
10814,
10880,
11263,
11244,
1026,
11675,
1028,
2739,
6979,
2102,
7698,
11263,
11244,
1027,
2047,
4012,
10814,
10880,
11263,
11244,
102... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
apache/flink | flink-runtime/src/main/java/org/apache/flink/runtime/rest/handler/legacy/metrics/MetricFetcherImpl.java | MetricFetcherImpl.queryMetrics | private void queryMetrics(final MetricQueryServiceGateway queryServiceGateway) {
LOG.debug("Query metrics for {}.", queryServiceGateway.getAddress());
queryServiceGateway
.queryMetrics(timeout)
.whenCompleteAsync(
(MetricDumpSerialization.MetricSerializationResult result, Throwable t) -> {
if (t != ... | java | private void queryMetrics(final MetricQueryServiceGateway queryServiceGateway) {
LOG.debug("Query metrics for {}.", queryServiceGateway.getAddress());
queryServiceGateway
.queryMetrics(timeout)
.whenCompleteAsync(
(MetricDumpSerialization.MetricSerializationResult result, Throwable t) -> {
if (t != ... | [
"private",
"void",
"queryMetrics",
"(",
"final",
"MetricQueryServiceGateway",
"queryServiceGateway",
")",
"{",
"LOG",
".",
"debug",
"(",
"\"Query metrics for {}.\"",
",",
"queryServiceGateway",
".",
"getAddress",
"(",
")",
")",
";",
"queryServiceGateway",
".",
"queryM... | Query the metrics from the given QueryServiceGateway.
@param queryServiceGateway to query for metrics | [
"Query",
"the",
"metrics",
"from",
"the",
"given",
"QueryServiceGateway",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/rest/handler/legacy/metrics/MetricFetcherImpl.java#L208-L222 | train | Query metrics. | [
30522,
2797,
11675,
23032,
12589,
2015,
1006,
2345,
12046,
4226,
24769,
2121,
7903,
29107,
2618,
4576,
23032,
8043,
7903,
29107,
2618,
4576,
1007,
1063,
8833,
1012,
2139,
8569,
2290,
1006,
1000,
23032,
12046,
2015,
2005,
1063,
1065,
1012,
1... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
SeleniumHQ/selenium | java/client/src/org/openqa/selenium/safari/SafariOptions.java | SafariOptions.fromCapabilities | public static SafariOptions fromCapabilities(Capabilities capabilities)
throws WebDriverException {
if (capabilities instanceof SafariOptions) {
return (SafariOptions) capabilities;
}
Object cap = capabilities.getCapability(SafariOptions.CAPABILITY);
if (cap instanceof SafariOptions) {
... | java | public static SafariOptions fromCapabilities(Capabilities capabilities)
throws WebDriverException {
if (capabilities instanceof SafariOptions) {
return (SafariOptions) capabilities;
}
Object cap = capabilities.getCapability(SafariOptions.CAPABILITY);
if (cap instanceof SafariOptions) {
... | [
"public",
"static",
"SafariOptions",
"fromCapabilities",
"(",
"Capabilities",
"capabilities",
")",
"throws",
"WebDriverException",
"{",
"if",
"(",
"capabilities",
"instanceof",
"SafariOptions",
")",
"{",
"return",
"(",
"SafariOptions",
")",
"capabilities",
";",
"}",
... | Construct a {@link SafariOptions} instance from given capabilities.
When the {@link #CAPABILITY} capability is set, all other capabilities will be ignored!
@param capabilities Desired capabilities from which the options are derived.
@return SafariOptions
@throws WebDriverException If an error occurred during the recon... | [
"Construct",
"a",
"{",
"@link",
"SafariOptions",
"}",
"instance",
"from",
"given",
"capabilities",
".",
"When",
"the",
"{",
"@link",
"#CAPABILITY",
"}",
"capability",
"is",
"set",
"all",
"other",
"capabilities",
"will",
"be",
"ignored!"
] | 7af172729f17b20269c8ca4ea6f788db48616535 | https://github.com/SeleniumHQ/selenium/blob/7af172729f17b20269c8ca4ea6f788db48616535/java/client/src/org/openqa/selenium/safari/SafariOptions.java#L102-L115 | train | Create a new instance of the SafariOptions class from the capabilities | [
30522,
2270,
10763,
23591,
7361,
9285,
2013,
17695,
28518,
15909,
3111,
1006,
9859,
9859,
1007,
11618,
4773,
23663,
2890,
2595,
24422,
1063,
2065,
1006,
9859,
6013,
11253,
23591,
7361,
9285,
1007,
1063,
2709,
1006,
23591,
7361,
9285,
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-db/src/main/java/cn/hutool/db/sql/SqlUtil.java | SqlUtil.rowIdToString | public static String rowIdToString(RowId rowId) {
return StrUtil.str(rowId.getBytes(), CharsetUtil.CHARSET_ISO_8859_1);
} | java | public static String rowIdToString(RowId rowId) {
return StrUtil.str(rowId.getBytes(), CharsetUtil.CHARSET_ISO_8859_1);
} | [
"public",
"static",
"String",
"rowIdToString",
"(",
"RowId",
"rowId",
")",
"{",
"return",
"StrUtil",
".",
"str",
"(",
"rowId",
".",
"getBytes",
"(",
")",
",",
"CharsetUtil",
".",
"CHARSET_ISO_8859_1",
")",
";",
"}"
] | 将RowId转为字符串
@param rowId RowId
@return RowId字符串 | [
"将RowId转为字符串"
] | bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-db/src/main/java/cn/hutool/db/sql/SqlUtil.java#L142-L144 | train | Converts a row id to a string. | [
30522,
2270,
10763,
5164,
5216,
3593,
13122,
18886,
3070,
1006,
5216,
3593,
5216,
3593,
1007,
1063,
2709,
2358,
22134,
4014,
1012,
2358,
2099,
1006,
5216,
3593,
1012,
2131,
3762,
4570,
1006,
1007,
1010,
25869,
13462,
21823,
2140,
1012,
2586... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/StreamGraph.java | StreamGraph.getJobGraph | @SuppressWarnings("deprecation")
@Override
public JobGraph getJobGraph(@Nullable JobID jobID) {
// temporarily forbid checkpointing for iterative jobs
if (isIterative() && checkpointConfig.isCheckpointingEnabled() && !checkpointConfig.isForceCheckpointing()) {
throw new UnsupportedOperationException(
"Chec... | java | @SuppressWarnings("deprecation")
@Override
public JobGraph getJobGraph(@Nullable JobID jobID) {
// temporarily forbid checkpointing for iterative jobs
if (isIterative() && checkpointConfig.isCheckpointingEnabled() && !checkpointConfig.isForceCheckpointing()) {
throw new UnsupportedOperationException(
"Chec... | [
"@",
"SuppressWarnings",
"(",
"\"deprecation\"",
")",
"@",
"Override",
"public",
"JobGraph",
"getJobGraph",
"(",
"@",
"Nullable",
"JobID",
"jobID",
")",
"{",
"// temporarily forbid checkpointing for iterative jobs",
"if",
"(",
"isIterative",
"(",
")",
"&&",
"checkpoin... | Gets the assembled {@link JobGraph} with a given job id. | [
"Gets",
"the",
"assembled",
"{"
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-streaming-java/src/main/java/org/apache/flink/streaming/api/graph/StreamGraph.java#L662-L674 | train | Returns a job graph for the given job ID. | [
30522,
1030,
16081,
9028,
5582,
2015,
1006,
1000,
2139,
30524,
3593,
1007,
1063,
1013,
1013,
8184,
27206,
26520,
2075,
2005,
2009,
25284,
5841,
2065,
1006,
2003,
21646,
8082,
1006,
1007,
1004,
1004,
26520,
8663,
8873,
2290,
1012,
2003,
5403... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
looly/hutool | hutool-setting/src/main/java/cn/hutool/setting/AbsSetting.java | AbsSetting.getStringsWithDefault | public String[] getStringsWithDefault(String key, String[] defaultValue) {
String[] value = getStrings(key, null);
if (null == value) {
value = defaultValue;
}
return value;
} | java | public String[] getStringsWithDefault(String key, String[] defaultValue) {
String[] value = getStrings(key, null);
if (null == value) {
value = defaultValue;
}
return value;
} | [
"public",
"String",
"[",
"]",
"getStringsWithDefault",
"(",
"String",
"key",
",",
"String",
"[",
"]",
"defaultValue",
")",
"{",
"String",
"[",
"]",
"value",
"=",
"getStrings",
"(",
"key",
",",
"null",
")",
";",
"if",
"(",
"null",
"==",
"value",
")",
... | 获得数组型
@param key 属性名
@param defaultValue 默认的值
@return 属性值 | [
"获得数组型"
] | bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-setting/src/main/java/cn/hutool/setting/AbsSetting.java#L108-L115 | train | Returns an array of strings for the given key or the default value if the key does not exist. | [
30522,
2270,
5164,
1031,
1033,
4152,
18886,
3070,
26760,
8939,
3207,
7011,
11314,
1006,
5164,
3145,
1010,
5164,
1031,
1033,
12398,
10175,
5657,
1007,
1063,
5164,
1031,
1033,
3643,
1027,
4152,
18886,
3070,
2015,
1006,
3145,
1010,
19701,
1007... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
alibaba/canal | client-adapter/rdb/src/main/java/com/alibaba/otter/canal/client/adapter/rdb/service/RdbSyncService.java | RdbSyncService.sync | public void sync(Map<String, Map<String, MappingConfig>> mappingConfig, List<Dml> dmls, Properties envProperties) {
sync(dmls, dml -> {
if (dml.getIsDdl() != null && dml.getIsDdl() && StringUtils.isNotEmpty(dml.getSql())) {
// DDL
columnsTypeCache.remove(dml.getDestinatio... | java | public void sync(Map<String, Map<String, MappingConfig>> mappingConfig, List<Dml> dmls, Properties envProperties) {
sync(dmls, dml -> {
if (dml.getIsDdl() != null && dml.getIsDdl() && StringUtils.isNotEmpty(dml.getSql())) {
// DDL
columnsTypeCache.remove(dml.getDestinatio... | [
"public",
"void",
"sync",
"(",
"Map",
"<",
"String",
",",
"Map",
"<",
"String",
",",
"MappingConfig",
">",
">",
"mappingConfig",
",",
"List",
"<",
"Dml",
">",
"dmls",
",",
"Properties",
"envProperties",
")",
"{",
"sync",
"(",
"dmls",
",",
"dml",
"->",
... | 批量同步
@param mappingConfig 配置集合
@param dmls 批量 DML | [
"批量同步"
] | 8f088cddc0755f4350c5aaae95c6e4002d90a40f | https://github.com/alibaba/canal/blob/8f088cddc0755f4350c5aaae95c6e4002d90a40f/client-adapter/rdb/src/main/java/com/alibaba/otter/canal/client/adapter/rdb/service/RdbSyncService.java#L146-L193 | train | Synchronize DMLs with the specified mapping config. | [
30522,
2270,
11675,
26351,
1006,
4949,
1026,
5164,
1010,
4949,
1026,
5164,
1010,
12375,
8663,
8873,
2290,
1028,
1028,
12375,
8663,
8873,
2290,
1010,
2862,
1026,
1040,
19968,
1028,
1040,
19968,
2015,
1010,
5144,
4372,
2615,
21572,
4842,
7368... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
spring-projects/spring-boot | spring-boot-project/spring-boot/src/main/java/org/springframework/boot/EnvironmentConverter.java | EnvironmentConverter.convertEnvironmentIfNecessary | StandardEnvironment convertEnvironmentIfNecessary(ConfigurableEnvironment environment,
Class<? extends StandardEnvironment> type) {
if (type.equals(environment.getClass())) {
return (StandardEnvironment) environment;
}
return convertEnvironment(environment, type);
} | java | StandardEnvironment convertEnvironmentIfNecessary(ConfigurableEnvironment environment,
Class<? extends StandardEnvironment> type) {
if (type.equals(environment.getClass())) {
return (StandardEnvironment) environment;
}
return convertEnvironment(environment, type);
} | [
"StandardEnvironment",
"convertEnvironmentIfNecessary",
"(",
"ConfigurableEnvironment",
"environment",
",",
"Class",
"<",
"?",
"extends",
"StandardEnvironment",
">",
"type",
")",
"{",
"if",
"(",
"type",
".",
"equals",
"(",
"environment",
".",
"getClass",
"(",
")",
... | Converts the given {@code environment} to the given {@link StandardEnvironment}
type. If the environment is already of the same type, no conversion is performed
and it is returned unchanged.
@param environment the Environment to convert
@param type the type to convert the Environment to
@return the converted Environmen... | [
"Converts",
"the",
"given",
"{"
] | 0b27f7c70e164b2b1a96477f1d9c1acba56790c1 | https://github.com/spring-projects/spring-boot/blob/0b27f7c70e164b2b1a96477f1d9c1acba56790c1/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/EnvironmentConverter.java#L71-L77 | train | Convert the given environment to the given type if necessary. | [
30522,
3115,
2368,
21663,
2239,
3672,
10463,
2368,
21663,
2239,
3672,
10128,
2638,
9623,
10286,
2100,
1006,
9530,
8873,
27390,
30524,
1028,
2828,
1007,
1063,
2065,
1006,
2828,
1012,
19635,
1006,
4044,
1012,
2131,
26266,
1006,
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... |
netty/netty | codec-http/src/main/java/io/netty/handler/codec/http/websocketx/WebSocketUtil.java | WebSocketUtil.randomNumber | static int randomNumber(int minimum, int maximum) {
assert minimum < maximum;
double fraction = PlatformDependent.threadLocalRandom().nextDouble();
// the idea here is that nextDouble gives us a random value
//
// 0 <= fraction <= 1
//
// the distanc... | java | static int randomNumber(int minimum, int maximum) {
assert minimum < maximum;
double fraction = PlatformDependent.threadLocalRandom().nextDouble();
// the idea here is that nextDouble gives us a random value
//
// 0 <= fraction <= 1
//
// the distanc... | [
"static",
"int",
"randomNumber",
"(",
"int",
"minimum",
",",
"int",
"maximum",
")",
"{",
"assert",
"minimum",
"<",
"maximum",
";",
"double",
"fraction",
"=",
"PlatformDependent",
".",
"threadLocalRandom",
"(",
")",
".",
"nextDouble",
"(",
")",
";",
"// the i... | Generates a pseudo-random number
@param minimum The minimum allowable value
@param maximum The maximum allowable value
@return A pseudo-random number | [
"Generates",
"a",
"pseudo",
"-",
"random",
"number"
] | ba06eafa1c1824bd154f1a380019e7ea2edf3c4c | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/codec-http/src/main/java/io/netty/handler/codec/http/websocketx/WebSocketUtil.java#L120-L144 | train | Returns a random number in the range [ minimum maximum ). | [
30522,
10763,
20014,
6721,
19172,
5677,
1006,
20014,
6263,
1010,
20014,
4555,
1007,
1063,
20865,
6263,
1026,
4555,
1025,
3313,
12884,
1027,
4132,
3207,
11837,
16454,
1012,
11689,
4135,
9289,
13033,
5358,
1006,
1007,
1012,
2279,
26797,
3468,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
netty/netty | common/src/main/java/io/netty/util/concurrent/FastThreadLocal.java | FastThreadLocal.set | public final void set(V value) {
if (value != InternalThreadLocalMap.UNSET) {
InternalThreadLocalMap threadLocalMap = InternalThreadLocalMap.get();
setKnownNotUnset(threadLocalMap, value);
} else {
remove();
}
} | java | public final void set(V value) {
if (value != InternalThreadLocalMap.UNSET) {
InternalThreadLocalMap threadLocalMap = InternalThreadLocalMap.get();
setKnownNotUnset(threadLocalMap, value);
} else {
remove();
}
} | [
"public",
"final",
"void",
"set",
"(",
"V",
"value",
")",
"{",
"if",
"(",
"value",
"!=",
"InternalThreadLocalMap",
".",
"UNSET",
")",
"{",
"InternalThreadLocalMap",
"threadLocalMap",
"=",
"InternalThreadLocalMap",
".",
"get",
"(",
")",
";",
"setKnownNotUnset",
... | Set the value for the current thread. | [
"Set",
"the",
"value",
"for",
"the",
"current",
"thread",
"."
] | ba06eafa1c1824bd154f1a380019e7ea2edf3c4c | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/common/src/main/java/io/netty/util/concurrent/FastThreadLocal.java#L190-L197 | train | Sets the value of the class attribute. | [
30522,
2270,
2345,
11675,
2275,
1006,
1058,
3643,
1007,
1063,
2065,
1006,
3643,
999,
1027,
4722,
2705,
16416,
19422,
24755,
19145,
2361,
1012,
4895,
13462,
1007,
1063,
4722,
2705,
16416,
19422,
24755,
19145,
2361,
11689,
4135,
9289,
2863,
2... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
netty/netty | codec-http/src/main/java/io/netty/handler/codec/http/multipart/HttpPostMultipartRequestDecoder.java | HttpPostMultipartRequestDecoder.setMultipart | private void setMultipart(String contentType) {
String[] dataBoundary = HttpPostRequestDecoder.getMultipartDataBoundary(contentType);
if (dataBoundary != null) {
multipartDataBoundary = dataBoundary[0];
if (dataBoundary.length > 1 && dataBoundary[1] != null) {
cha... | java | private void setMultipart(String contentType) {
String[] dataBoundary = HttpPostRequestDecoder.getMultipartDataBoundary(contentType);
if (dataBoundary != null) {
multipartDataBoundary = dataBoundary[0];
if (dataBoundary.length > 1 && dataBoundary[1] != null) {
cha... | [
"private",
"void",
"setMultipart",
"(",
"String",
"contentType",
")",
"{",
"String",
"[",
"]",
"dataBoundary",
"=",
"HttpPostRequestDecoder",
".",
"getMultipartDataBoundary",
"(",
"contentType",
")",
";",
"if",
"(",
"dataBoundary",
"!=",
"null",
")",
"{",
"multi... | Set from the request ContentType the multipartDataBoundary and the possible charset. | [
"Set",
"from",
"the",
"request",
"ContentType",
"the",
"multipartDataBoundary",
"and",
"the",
"possible",
"charset",
"."
] | ba06eafa1c1824bd154f1a380019e7ea2edf3c4c | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/codec-http/src/main/java/io/netty/handler/codec/http/multipart/HttpPostMultipartRequestDecoder.java#L195-L206 | train | setMultiPart sets the multipart data boundary and charset | [
30522,
2797,
11675,
2275,
12274,
7096,
11514,
8445,
1006,
5164,
4180,
13874,
1007,
1063,
5164,
1031,
1033,
2951,
15494,
5649,
1027,
8299,
19894,
2890,
15500,
3207,
16044,
2099,
1012,
2131,
12274,
7096,
11514,
8445,
2850,
2696,
15494,
5649,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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-proxy/src/main/java/io/netty/handler/proxy/ProxyHandler.java | ProxyHandler.exceptionMessage | protected final String exceptionMessage(String msg) {
if (msg == null) {
msg = "";
}
StringBuilder buf = new StringBuilder(128 + msg.length())
.append(protocol())
.append(", ")
.append(authScheme())
.append(", ")
.append(pr... | java | protected final String exceptionMessage(String msg) {
if (msg == null) {
msg = "";
}
StringBuilder buf = new StringBuilder(128 + msg.length())
.append(protocol())
.append(", ")
.append(authScheme())
.append(", ")
.append(pr... | [
"protected",
"final",
"String",
"exceptionMessage",
"(",
"String",
"msg",
")",
"{",
"if",
"(",
"msg",
"==",
"null",
")",
"{",
"msg",
"=",
"\"\"",
";",
"}",
"StringBuilder",
"buf",
"=",
"new",
"StringBuilder",
"(",
"128",
"+",
"msg",
".",
"length",
"(",... | Decorates the specified exception message with the common information such as the current protocol,
authentication scheme, proxy address, and destination address. | [
"Decorates",
"the",
"specified",
"exception",
"message",
"with",
"the",
"common",
"information",
"such",
"as",
"the",
"current",
"protocol",
"authentication",
"scheme",
"proxy",
"address",
"and",
"destination",
"address",
"."
] | ba06eafa1c1824bd154f1a380019e7ea2edf3c4c | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/handler-proxy/src/main/java/io/netty/handler/proxy/ProxyHandler.java#L371-L389 | train | Returns the exception message. | [
30522,
5123,
2345,
5164,
6453,
7834,
3736,
3351,
1006,
5164,
5796,
2290,
1007,
1063,
2065,
1006,
5796,
2290,
1027,
1027,
19701,
1007,
1063,
5796,
2290,
1027,
1000,
1000,
1025,
1065,
5164,
8569,
23891,
2099,
20934,
2546,
1027,
2047,
5164,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
hankcs/HanLP | src/main/java/com/hankcs/hanlp/summary/TextRankSentence.java | TextRankSentence.splitSentence | static List<String> splitSentence(String document, String sentence_separator)
{
List<String> sentences = new ArrayList<String>();
for (String line : document.split("[\r\n]"))
{
line = line.trim();
if (line.length() == 0) continue;
for (String sent : line.s... | java | static List<String> splitSentence(String document, String sentence_separator)
{
List<String> sentences = new ArrayList<String>();
for (String line : document.split("[\r\n]"))
{
line = line.trim();
if (line.length() == 0) continue;
for (String sent : line.s... | [
"static",
"List",
"<",
"String",
">",
"splitSentence",
"(",
"String",
"document",
",",
"String",
"sentence_separator",
")",
"{",
"List",
"<",
"String",
">",
"sentences",
"=",
"new",
"ArrayList",
"<",
"String",
">",
"(",
")",
";",
"for",
"(",
"String",
"l... | 将文章分割为句子
@param document 待分割的文档
@param sentence_separator 句子分隔符,正则表达式,如: [。:??!!;;]
@return | [
"将文章分割为句子"
] | a538d0722ab2e4980a9dcd9ea40324fc3ddba7ce | https://github.com/hankcs/HanLP/blob/a538d0722ab2e4980a9dcd9ea40324fc3ddba7ce/src/main/java/com/hankcs/hanlp/summary/TextRankSentence.java#L177-L193 | train | Split a sentence into a list of sentences. | [
30522,
10763,
2862,
1026,
5164,
1028,
19584,
15781,
5897,
1006,
5164,
6254,
1010,
5164,
6251,
1035,
19802,
25879,
2953,
1007,
1063,
2862,
1026,
5164,
1028,
11746,
1027,
2047,
9140,
9863,
1026,
5164,
1028,
1006,
1007,
1025,
2005,
1006,
5164,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
apache/flink | flink-libraries/flink-cep/src/main/java/org/apache/flink/cep/CEP.java | CEP.pattern | public static <T> PatternStream<T> pattern(
DataStream<T> input,
Pattern<T, ?> pattern,
EventComparator<T> comparator) {
final PatternStream<T> stream = new PatternStream<>(input, pattern);
return stream.withComparator(comparator);
} | java | public static <T> PatternStream<T> pattern(
DataStream<T> input,
Pattern<T, ?> pattern,
EventComparator<T> comparator) {
final PatternStream<T> stream = new PatternStream<>(input, pattern);
return stream.withComparator(comparator);
} | [
"public",
"static",
"<",
"T",
">",
"PatternStream",
"<",
"T",
">",
"pattern",
"(",
"DataStream",
"<",
"T",
">",
"input",
",",
"Pattern",
"<",
"T",
",",
"?",
">",
"pattern",
",",
"EventComparator",
"<",
"T",
">",
"comparator",
")",
"{",
"final",
"Patt... | Creates a {@link PatternStream} from an input data stream and a pattern.
@param input DataStream containing the input events
@param pattern Pattern specification which shall be detected
@param comparator Comparator to sort events with equal timestamps
@param <T> Type of the input events
@return Resulting pattern strea... | [
"Creates",
"a",
"{",
"@link",
"PatternStream",
"}",
"from",
"an",
"input",
"data",
"stream",
"and",
"a",
"pattern",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-libraries/flink-cep/src/main/java/org/apache/flink/cep/CEP.java#L51-L57 | train | Creates a pattern stream. | [
30522,
2270,
10763,
1026,
1056,
1028,
7060,
25379,
1026,
1056,
1028,
5418,
1006,
2951,
21422,
1026,
1056,
1028,
7953,
1010,
5418,
1026,
1056,
1010,
1029,
1028,
5418,
1010,
2724,
9006,
28689,
4263,
1026,
1056,
1028,
4012,
28689,
4263,
1007,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
apache/flink | flink-core/src/main/java/org/apache/flink/core/memory/MemorySegment.java | MemorySegment.putShortLittleEndian | public final void putShortLittleEndian(int index, short value) {
if (LITTLE_ENDIAN) {
putShort(index, value);
} else {
putShort(index, Short.reverseBytes(value));
}
} | java | public final void putShortLittleEndian(int index, short value) {
if (LITTLE_ENDIAN) {
putShort(index, value);
} else {
putShort(index, Short.reverseBytes(value));
}
} | [
"public",
"final",
"void",
"putShortLittleEndian",
"(",
"int",
"index",
",",
"short",
"value",
")",
"{",
"if",
"(",
"LITTLE_ENDIAN",
")",
"{",
"putShort",
"(",
"index",
",",
"value",
")",
";",
"}",
"else",
"{",
"putShort",
"(",
"index",
",",
"Short",
"... | Writes the given short integer value (16 bit, 2 bytes) to the given position in little-endian
byte order. This method's speed depends on the system's native byte order, and it
is possibly slower than {@link #putShort(int, short)}. For most cases (such as
transient storage in memory or serialization for I/O and network)... | [
"Writes",
"the",
"given",
"short",
"integer",
"value",
"(",
"16",
"bit",
"2",
"bytes",
")",
"to",
"the",
"given",
"position",
"in",
"little",
"-",
"endian",
"byte",
"order",
".",
"This",
"method",
"s",
"speed",
"depends",
"on",
"the",
"system",
"s",
"n... | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-core/src/main/java/org/apache/flink/core/memory/MemorySegment.java#L647-L653 | train | Puts a 16 - bit Short value into the buffer. | [
30522,
2270,
2345,
11675,
8509,
27794,
15909,
9286,
10497,
2937,
1006,
20014,
5950,
1010,
2460,
3643,
1007,
1063,
2065,
1006,
2210,
30524,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
netty/netty | codec/src/main/java/io/netty/handler/codec/DateFormatter.java | DateFormatter.parseHttpDate | public static Date parseHttpDate(CharSequence txt, int start, int end) {
int length = end - start;
if (length == 0) {
return null;
} else if (length < 0) {
throw new IllegalArgumentException("Can't have end < start");
} else if (length > 64) {
throw ne... | java | public static Date parseHttpDate(CharSequence txt, int start, int end) {
int length = end - start;
if (length == 0) {
return null;
} else if (length < 0) {
throw new IllegalArgumentException("Can't have end < start");
} else if (length > 64) {
throw ne... | [
"public",
"static",
"Date",
"parseHttpDate",
"(",
"CharSequence",
"txt",
",",
"int",
"start",
",",
"int",
"end",
")",
"{",
"int",
"length",
"=",
"end",
"-",
"start",
";",
"if",
"(",
"length",
"==",
"0",
")",
"{",
"return",
"null",
";",
"}",
"else",
... | Parse some text into a {@link Date}, according to RFC6265
@param txt text to parse
@param start the start index inside {@code txt}
@param end the end index inside {@code txt}
@return a {@link Date}, or null if text couldn't be parsed | [
"Parse",
"some",
"text",
"into",
"a",
"{"
] | ba06eafa1c1824bd154f1a380019e7ea2edf3c4c | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/codec/src/main/java/io/netty/handler/codec/DateFormatter.java#L95-L106 | train | Parse a date from a string of text. | [
30522,
2270,
10763,
3058,
11968,
3366,
11039,
25856,
13701,
1006,
25869,
3366,
4226,
5897,
19067,
2102,
1010,
20014,
2707,
1010,
20014,
2203,
1007,
1063,
20014,
3091,
1027,
2203,
1011,
2707,
1025,
2065,
1006,
3091,
1027,
1027,
1014,
1007,
1... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
apache/flink | flink-runtime/src/main/java/org/apache/flink/runtime/operators/BatchTask.java | BatchTask.openUserCode | public static void openUserCode(Function stub, Configuration parameters) throws Exception {
try {
FunctionUtils.openFunction(stub, parameters);
} catch (Throwable t) {
throw new Exception("The user defined 'open(Configuration)' method in " + stub.getClass().toString() + " caused an exception: " + t.getMessage... | java | public static void openUserCode(Function stub, Configuration parameters) throws Exception {
try {
FunctionUtils.openFunction(stub, parameters);
} catch (Throwable t) {
throw new Exception("The user defined 'open(Configuration)' method in " + stub.getClass().toString() + " caused an exception: " + t.getMessage... | [
"public",
"static",
"void",
"openUserCode",
"(",
"Function",
"stub",
",",
"Configuration",
"parameters",
")",
"throws",
"Exception",
"{",
"try",
"{",
"FunctionUtils",
".",
"openFunction",
"(",
"stub",
",",
"parameters",
")",
";",
"}",
"catch",
"(",
"Throwable"... | Opens the given stub using its {@link org.apache.flink.api.common.functions.RichFunction#open(Configuration)} method. If the open call produces
an exception, a new exception with a standard error message is created, using the encountered exception
as its cause.
@param stub The user code instance to be opened.
@param p... | [
"Opens",
"the",
"given",
"stub",
"using",
"its",
"{",
"@link",
"org",
".",
"apache",
".",
"flink",
".",
"api",
".",
"common",
".",
"functions",
".",
"RichFunction#open",
"(",
"Configuration",
")",
"}",
"method",
".",
"If",
"the",
"open",
"call",
"produce... | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/operators/BatchTask.java#L1347-L1353 | train | Open a user defined function. | [
30522,
2270,
10763,
11675,
2330,
20330,
16044,
1006,
3853,
24646,
2497,
1010,
9563,
11709,
1007,
11618,
6453,
1063,
3046,
1063,
3853,
21823,
4877,
1012,
2330,
11263,
27989,
1006,
24646,
2497,
1010,
11709,
1007,
1025,
1065,
4608,
1006,
5466,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
hankcs/HanLP | src/main/java/com/hankcs/hanlp/collection/MDAG/MDAG.java | MDAG.calculateMinimizationProcessingStartIndex | private int calculateMinimizationProcessingStartIndex(String prevStr, String currStr)
{
int mpsIndex;
if (!currStr.startsWith(prevStr))
{
//Loop through the corresponding indices of both Strings in search of the first index containing differing characters.
//The _tra... | java | private int calculateMinimizationProcessingStartIndex(String prevStr, String currStr)
{
int mpsIndex;
if (!currStr.startsWith(prevStr))
{
//Loop through the corresponding indices of both Strings in search of the first index containing differing characters.
//The _tra... | [
"private",
"int",
"calculateMinimizationProcessingStartIndex",
"(",
"String",
"prevStr",
",",
"String",
"currStr",
")",
"{",
"int",
"mpsIndex",
";",
"if",
"(",
"!",
"currStr",
".",
"startsWith",
"(",
"prevStr",
")",
")",
"{",
"//Loop through the corresponding indice... | 计算最小化的执行位置,其实是prevStr和currStr的第一个分叉点<br>
Determines the start index of the substring in the String most recently added to the MDAG
that corresponds to the _transition path that will be next up for minimization processing.
<p/>
The "minimization processing start index" is defined as the index in {@code prevStr} which st... | [
"计算最小化的执行位置,其实是prevStr和currStr的第一个分叉点<br",
">",
"Determines",
"the",
"start",
"index",
"of",
"the",
"substring",
"in",
"the",
"String",
"most",
"recently",
"added",
"to",
"the",
"MDAG",
"that",
"corresponds",
"to",
"the",
"_transition",
"path",
"that",
"will",
"be... | a538d0722ab2e4980a9dcd9ea40324fc3ddba7ce | https://github.com/hankcs/HanLP/blob/a538d0722ab2e4980a9dcd9ea40324fc3ddba7ce/src/main/java/com/hankcs/hanlp/collection/MDAG/MDAG.java#L430-L451 | train | Calculate the index of the minimization processing starting from the beginning of the string. | [
30522,
2797,
20014,
18422,
25300,
4328,
9276,
21572,
9623,
7741,
14117,
7629,
3207,
2595,
1006,
5164,
3653,
15088,
16344,
1010,
5164,
12731,
12171,
3367,
2099,
1007,
1063,
20014,
12616,
22254,
10288,
1025,
2065,
1006,
999,
12731,
12171,
3367,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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.hasWarnedDeprecation | public static boolean hasWarnedDeprecation(String name) {
DeprecationContext deprecations = deprecationContext.get();
if(deprecations.getDeprecatedKeyMap().containsKey(name)) {
if(deprecations.getDeprecatedKeyMap().get(name).accessed.get()) {
return true;
}
}
return false;
} | java | public static boolean hasWarnedDeprecation(String name) {
DeprecationContext deprecations = deprecationContext.get();
if(deprecations.getDeprecatedKeyMap().containsKey(name)) {
if(deprecations.getDeprecatedKeyMap().get(name).accessed.get()) {
return true;
}
}
return false;
} | [
"public",
"static",
"boolean",
"hasWarnedDeprecation",
"(",
"String",
"name",
")",
"{",
"DeprecationContext",
"deprecations",
"=",
"deprecationContext",
".",
"get",
"(",
")",
";",
"if",
"(",
"deprecations",
".",
"getDeprecatedKeyMap",
"(",
")",
".",
"containsKey",... | Returns whether or not a deprecated name has been warned. If the name is not
deprecated then always return false | [
"Returns",
"whether",
"or",
"not",
"a",
"deprecated",
"name",
"has",
"been",
"warned",
".",
"If",
"the",
"name",
"is",
"not",
"deprecated",
"then",
"always",
"return",
"false"
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-filesystems/flink-fs-hadoop-shaded/src/main/java/org/apache/hadoop/conf/Configuration.java#L3512-L3520 | train | Returns true if the given name has been deprecated. | [
30522,
2270,
10763,
22017,
20898,
2038,
9028,
7228,
3207,
28139,
10719,
1006,
5164,
2171,
1007,
1063,
2139,
28139,
10719,
8663,
18209,
2139,
28139,
10719,
2015,
1027,
2139,
28139,
10719,
8663,
18209,
30524,
14839,
2863,
2361,
1006,
1007,
1012... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
alibaba/canal | deployer/src/main/java/com/alibaba/otter/canal/deployer/monitor/remote/DbRemoteConfigLoader.java | DbRemoteConfigLoader.overrideLocalCanalConfig | private void overrideLocalCanalConfig(String content) {
try (FileWriter writer = new FileWriter(CommonUtils.getConfPath() + "canal.properties")) {
writer.write(content);
writer.flush();
} catch (Exception e) {
logger.error(e.getMessage(), e);
}
} | java | private void overrideLocalCanalConfig(String content) {
try (FileWriter writer = new FileWriter(CommonUtils.getConfPath() + "canal.properties")) {
writer.write(content);
writer.flush();
} catch (Exception e) {
logger.error(e.getMessage(), e);
}
} | [
"private",
"void",
"overrideLocalCanalConfig",
"(",
"String",
"content",
")",
"{",
"try",
"(",
"FileWriter",
"writer",
"=",
"new",
"FileWriter",
"(",
"CommonUtils",
".",
"getConfPath",
"(",
")",
"+",
"\"canal.properties\"",
")",
")",
"{",
"writer",
".",
"write... | 覆盖本地 canal.properties
@param content 远程配置内容文本 | [
"覆盖本地",
"canal",
".",
"properties"
] | 8f088cddc0755f4350c5aaae95c6e4002d90a40f | https://github.com/alibaba/canal/blob/8f088cddc0755f4350c5aaae95c6e4002d90a40f/deployer/src/main/java/com/alibaba/otter/canal/deployer/monitor/remote/DbRemoteConfigLoader.java#L103-L110 | train | Override the canal. properties file with the content provided in the parameter. | [
30522,
2797,
11675,
2058,
15637,
4135,
9289,
28621,
22499,
2078,
8873,
2290,
1006,
5164,
4180,
1007,
1063,
3046,
1006,
5371,
15994,
3213,
1027,
2047,
5371,
15994,
1006,
2691,
21823,
4877,
1012,
2131,
8663,
22540,
8988,
1006,
1007,
1009,
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-streaming-java/src/main/java/org/apache/flink/streaming/api/operators/InternalTimerServiceImpl.java | InternalTimerServiceImpl.startTimerService | public void startTimerService(
TypeSerializer<K> keySerializer,
TypeSerializer<N> namespaceSerializer,
Triggerable<K, N> triggerTarget) {
if (!isInitialized) {
if (keySerializer == null || namespaceSerializer == null) {
throw new IllegalArgumentException("The TimersService serializers cannot be null... | java | public void startTimerService(
TypeSerializer<K> keySerializer,
TypeSerializer<N> namespaceSerializer,
Triggerable<K, N> triggerTarget) {
if (!isInitialized) {
if (keySerializer == null || namespaceSerializer == null) {
throw new IllegalArgumentException("The TimersService serializers cannot be null... | [
"public",
"void",
"startTimerService",
"(",
"TypeSerializer",
"<",
"K",
">",
"keySerializer",
",",
"TypeSerializer",
"<",
"N",
">",
"namespaceSerializer",
",",
"Triggerable",
"<",
"K",
",",
"N",
">",
"triggerTarget",
")",
"{",
"if",
"(",
"!",
"isInitialized",
... | Starts the local {@link InternalTimerServiceImpl} by:
<ol>
<li>Setting the {@code keySerialized} and {@code namespaceSerializer} for the timers it will contain.</li>
<li>Setting the {@code triggerTarget} which contains the action to be performed when a timer fires.</li>
<li>Re-registering timers that were retrieved aft... | [
"Starts",
"the",
"local",
"{"
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-streaming-java/src/main/java/org/apache/flink/streaming/api/operators/InternalTimerServiceImpl.java#L127-L186 | train | Start the TimerService. | [
30522,
2270,
11675,
2707,
7292,
22573,
2099,
7903,
2063,
1006,
4127,
11610,
30524,
9495,
7559,
18150,
1007,
1063,
2065,
1006,
999,
2003,
5498,
20925,
3550,
1007,
1063,
2065,
1006,
6309,
11610,
28863,
1027,
1027,
19701,
1064,
1064,
3415,
153... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
apache/flink | flink-streaming-java/src/main/java/org/apache/flink/streaming/api/datastream/KeyedStream.java | KeyedStream.countWindow | public WindowedStream<T, KEY, GlobalWindow> countWindow(long size) {
return window(GlobalWindows.create()).trigger(PurgingTrigger.of(CountTrigger.of(size)));
} | java | public WindowedStream<T, KEY, GlobalWindow> countWindow(long size) {
return window(GlobalWindows.create()).trigger(PurgingTrigger.of(CountTrigger.of(size)));
} | [
"public",
"WindowedStream",
"<",
"T",
",",
"KEY",
",",
"GlobalWindow",
">",
"countWindow",
"(",
"long",
"size",
")",
"{",
"return",
"window",
"(",
"GlobalWindows",
".",
"create",
"(",
")",
")",
".",
"trigger",
"(",
"PurgingTrigger",
".",
"of",
"(",
"Coun... | Windows this {@code KeyedStream} into tumbling count windows.
@param size The size of the windows in number of elements. | [
"Windows",
"this",
"{",
"@code",
"KeyedStream",
"}",
"into",
"tumbling",
"count",
"windows",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-streaming-java/src/main/java/org/apache/flink/streaming/api/datastream/KeyedStream.java#L642-L644 | train | Returns a stream of the given size of windows with purging triggers. | [
30522,
2270,
3332,
2098,
21422,
1026,
1056,
1010,
3145,
1010,
3795,
11101,
5004,
1028,
4175,
11101,
5004,
1006,
2146,
2946,
1007,
1063,
2709,
3332,
1006,
3795,
11101,
15568,
1012,
3443,
1006,
1007,
1007,
1012,
9495,
1006,
16405,
10623,
2075... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
apache/flink | flink-runtime/src/main/java/org/apache/flink/runtime/instance/SlotSharingGroupAssignment.java | SlotSharingGroupAssignment.getSlotForTask | public SimpleSlot getSlotForTask(CoLocationConstraint constraint, Iterable<TaskManagerLocation> locationPreferences) {
synchronized (lock) {
if (constraint.isAssignedAndAlive()) {
// the shared slot of the co-location group is initialized and set we allocate a sub-slot
final SharedSlot shared = constraint.... | java | public SimpleSlot getSlotForTask(CoLocationConstraint constraint, Iterable<TaskManagerLocation> locationPreferences) {
synchronized (lock) {
if (constraint.isAssignedAndAlive()) {
// the shared slot of the co-location group is initialized and set we allocate a sub-slot
final SharedSlot shared = constraint.... | [
"public",
"SimpleSlot",
"getSlotForTask",
"(",
"CoLocationConstraint",
"constraint",
",",
"Iterable",
"<",
"TaskManagerLocation",
">",
"locationPreferences",
")",
"{",
"synchronized",
"(",
"lock",
")",
"{",
"if",
"(",
"constraint",
".",
"isAssignedAndAlive",
"(",
")... | Gets a slot for a task that has a co-location constraint. This method tries to grab
a slot form the location-constraint's shared slot. If that slot has not been initialized,
then the method tries to grab another slot that is available for the location-constraint-group.
<p>In cases where the co-location constraint has ... | [
"Gets",
"a",
"slot",
"for",
"a",
"task",
"that",
"has",
"a",
"co",
"-",
"location",
"constraint",
".",
"This",
"method",
"tries",
"to",
"grab",
"a",
"slot",
"form",
"the",
"location",
"-",
"constraint",
"s",
"shared",
"slot",
".",
"If",
"that",
"slot",... | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/instance/SlotSharingGroupAssignment.java#L310-L383 | train | Gets the slot for a co - location constraint. | [
30522,
2270,
3722,
14540,
4140,
4152,
10994,
13028,
19895,
1006,
8902,
23909,
8663,
20528,
18447,
27142,
1010,
2009,
6906,
3468,
1026,
4708,
24805,
4590,
4135,
10719,
1028,
3295,
28139,
25523,
2015,
1007,
1063,
25549,
1006,
5843,
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/flink | flink-java/src/main/java/org/apache/flink/api/java/io/CollectionInputFormat.java | CollectionInputFormat.checkCollection | public static <X> void checkCollection(Collection<X> elements, Class<X> viewedAs) {
if (elements == null || viewedAs == null) {
throw new NullPointerException();
}
for (X elem : elements) {
if (elem == null) {
throw new IllegalArgumentException("The collection must not contain null elements.");
}
... | java | public static <X> void checkCollection(Collection<X> elements, Class<X> viewedAs) {
if (elements == null || viewedAs == null) {
throw new NullPointerException();
}
for (X elem : elements) {
if (elem == null) {
throw new IllegalArgumentException("The collection must not contain null elements.");
}
... | [
"public",
"static",
"<",
"X",
">",
"void",
"checkCollection",
"(",
"Collection",
"<",
"X",
">",
"elements",
",",
"Class",
"<",
"X",
">",
"viewedAs",
")",
"{",
"if",
"(",
"elements",
"==",
"null",
"||",
"viewedAs",
"==",
"null",
")",
"{",
"throw",
"ne... | -------------------------------------------------------------------------------------------- | [
"--------------------------------------------------------------------------------------------"
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-java/src/main/java/org/apache/flink/api/java/io/CollectionInputFormat.java#L142-L164 | train | Checks that the elements in the given collection are all subclasses of the given class. | [
30522,
2270,
10763,
1026,
1060,
1028,
11675,
4638,
26895,
18491,
1006,
3074,
1026,
1060,
1028,
3787,
1010,
2465,
1026,
1060,
1028,
7021,
3022,
1007,
1063,
2065,
1006,
3787,
1027,
1027,
19701,
1064,
1064,
7021,
3022,
1027,
1027,
19701,
1007,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
apache/spark | launcher/src/main/java/org/apache/spark/launcher/SparkLauncher.java | SparkLauncher.setSparkHome | public SparkLauncher setSparkHome(String sparkHome) {
checkNotNull(sparkHome, "sparkHome");
builder.childEnv.put(ENV_SPARK_HOME, sparkHome);
return this;
} | java | public SparkLauncher setSparkHome(String sparkHome) {
checkNotNull(sparkHome, "sparkHome");
builder.childEnv.put(ENV_SPARK_HOME, sparkHome);
return this;
} | [
"public",
"SparkLauncher",
"setSparkHome",
"(",
"String",
"sparkHome",
")",
"{",
"checkNotNull",
"(",
"sparkHome",
",",
"\"sparkHome\"",
")",
";",
"builder",
".",
"childEnv",
".",
"put",
"(",
"ENV_SPARK_HOME",
",",
"sparkHome",
")",
";",
"return",
"this",
";",... | Set a custom Spark installation location for the application.
@param sparkHome Path to the Spark installation to use.
@return This launcher. | [
"Set",
"a",
"custom",
"Spark",
"installation",
"location",
"for",
"the",
"application",
"."
] | 25ee0474f47d9c30d6f553a7892d9549f91071cf | https://github.com/apache/spark/blob/25ee0474f47d9c30d6f553a7892d9549f91071cf/launcher/src/main/java/org/apache/spark/launcher/SparkLauncher.java#L149-L153 | train | Sets the Spark Home. | [
30522,
2270,
12125,
17298,
26091,
2099,
4520,
14432,
23393,
2063,
1006,
5164,
12125,
23393,
2063,
1007,
1063,
4638,
17048,
11231,
3363,
1006,
12125,
23393,
2063,
1010,
1000,
12125,
23393,
2063,
1000,
1007,
1025,
12508,
1012,
2775,
2368,
2615,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
spring-projects/spring-boot | spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/cloudfoundry/reactive/ReactiveCloudFoundrySecurityService.java | ReactiveCloudFoundrySecurityService.getUaaUrl | public Mono<String> getUaaUrl() {
this.uaaUrl = this.webClient.get().uri(this.cloudControllerUrl + "/info")
.retrieve().bodyToMono(Map.class)
.map((response) -> (String) response.get("token_endpoint")).cache()
.onErrorMap((ex) -> new CloudFoundryAuthorizationException(
Reason.SERVICE_UNAVAILABLE,
... | java | public Mono<String> getUaaUrl() {
this.uaaUrl = this.webClient.get().uri(this.cloudControllerUrl + "/info")
.retrieve().bodyToMono(Map.class)
.map((response) -> (String) response.get("token_endpoint")).cache()
.onErrorMap((ex) -> new CloudFoundryAuthorizationException(
Reason.SERVICE_UNAVAILABLE,
... | [
"public",
"Mono",
"<",
"String",
">",
"getUaaUrl",
"(",
")",
"{",
"this",
".",
"uaaUrl",
"=",
"this",
".",
"webClient",
".",
"get",
"(",
")",
".",
"uri",
"(",
"this",
".",
"cloudControllerUrl",
"+",
"\"/info\"",
")",
".",
"retrieve",
"(",
")",
".",
... | Return a Mono of URL of the UAA.
@return the UAA url Mono | [
"Return",
"a",
"Mono",
"of",
"URL",
"of",
"the",
"UAA",
"."
] | 0b27f7c70e164b2b1a96477f1d9c1acba56790c1 | https://github.com/spring-projects/spring-boot/blob/0b27f7c70e164b2b1a96477f1d9c1acba56790c1/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/cloudfoundry/reactive/ReactiveCloudFoundrySecurityService.java#L150-L158 | train | Get the UAA URL | [
30522,
2270,
18847,
1026,
5164,
1028,
2131,
6692,
21159,
2140,
1006,
1007,
1063,
2023,
1012,
25423,
21159,
2140,
1027,
2023,
1012,
4773,
20464,
11638,
1012,
2131,
1006,
1007,
1012,
24471,
2072,
1006,
2023,
1012,
6112,
8663,
13181,
10820,
31... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
apache/flink | flink-java/src/main/java/org/apache/flink/api/java/operators/Operator.java | Operator.setResources | private O setResources(ResourceSpec resources) {
Preconditions.checkNotNull(resources, "The resources must be not null.");
Preconditions.checkArgument(resources.isValid(), "The values in resources must be not less than 0.");
this.minResources = resources;
this.preferredResources = resources;
@SuppressWarnin... | java | private O setResources(ResourceSpec resources) {
Preconditions.checkNotNull(resources, "The resources must be not null.");
Preconditions.checkArgument(resources.isValid(), "The values in resources must be not less than 0.");
this.minResources = resources;
this.preferredResources = resources;
@SuppressWarnin... | [
"private",
"O",
"setResources",
"(",
"ResourceSpec",
"resources",
")",
"{",
"Preconditions",
".",
"checkNotNull",
"(",
"resources",
",",
"\"The resources must be not null.\"",
")",
";",
"Preconditions",
".",
"checkArgument",
"(",
"resources",
".",
"isValid",
"(",
")... | Sets the resources for this operator. This overrides the default minimum and preferred resources.
@param resources The resources for this operator.
@return The operator with set minimum and preferred resources. | [
"Sets",
"the",
"resources",
"for",
"this",
"operator",
".",
"This",
"overrides",
"the",
"default",
"minimum",
"and",
"preferred",
"resources",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-java/src/main/java/org/apache/flink/api/java/operators/Operator.java#L166-L176 | train | Sets the resources. | [
30522,
2797,
1051,
2275,
6072,
8162,
9623,
1006,
4219,
5051,
2278,
4219,
1007,
1063,
3653,
8663,
20562,
2015,
1012,
4638,
17048,
11231,
3363,
1006,
4219,
1010,
1000,
1996,
4219,
2442,
2022,
2025,
19701,
1012,
1000,
1007,
1025,
3653,
8663,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
apache/flink | flink-table/flink-table-planner/src/main/java/org/apache/flink/table/descriptors/ConnectTableDescriptor.java | ConnectTableDescriptor.toProperties | @Override
public Map<String, String> toProperties() {
DescriptorProperties properties = new DescriptorProperties();
// this performs only basic validation
// more validation can only happen within a factory
if (connectorDescriptor.isFormatNeeded() && !formatDescriptor.isPresent()) {
throw new ValidationExc... | java | @Override
public Map<String, String> toProperties() {
DescriptorProperties properties = new DescriptorProperties();
// this performs only basic validation
// more validation can only happen within a factory
if (connectorDescriptor.isFormatNeeded() && !formatDescriptor.isPresent()) {
throw new ValidationExc... | [
"@",
"Override",
"public",
"Map",
"<",
"String",
",",
"String",
">",
"toProperties",
"(",
")",
"{",
"DescriptorProperties",
"properties",
"=",
"new",
"DescriptorProperties",
"(",
")",
";",
"// this performs only basic validation",
"// more validation can only happen withi... | Converts this descriptor into a set of properties. | [
"Converts",
"this",
"descriptor",
"into",
"a",
"set",
"of",
"properties",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-table/flink-table-planner/src/main/java/org/apache/flink/table/descriptors/ConnectTableDescriptor.java#L110-L130 | train | Returns the descriptor properties as a map. | [
30522,
1030,
2058,
15637,
2270,
4949,
1026,
5164,
1010,
5164,
1028,
2327,
18981,
8743,
3111,
1006,
1007,
1063,
4078,
23235,
2953,
21572,
4842,
7368,
5144,
1027,
2047,
4078,
23235,
2953,
21572,
4842,
7368,
1006,
1007,
1025,
1013,
1013,
2023,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
looly/hutool | hutool-cache/src/main/java/cn/hutool/cache/impl/AbstractCache.java | AbstractCache.containsKey | @Override
public boolean containsKey(K key) {
readLock.lock();
try {
// 不存在或已移除
final CacheObj<K, V> co = cacheMap.get(key);
if (co == null) {
return false;
}
if (false == co.isExpired()) {
// 命中
return true;
}
} finally {
readLock.unlock();
}
// 过期
remove(key, true);
... | java | @Override
public boolean containsKey(K key) {
readLock.lock();
try {
// 不存在或已移除
final CacheObj<K, V> co = cacheMap.get(key);
if (co == null) {
return false;
}
if (false == co.isExpired()) {
// 命中
return true;
}
} finally {
readLock.unlock();
}
// 过期
remove(key, true);
... | [
"@",
"Override",
"public",
"boolean",
"containsKey",
"(",
"K",
"key",
")",
"{",
"readLock",
".",
"lock",
"(",
")",
";",
"try",
"{",
"// 不存在或已移除",
"final",
"CacheObj",
"<",
"K",
",",
"V",
">",
"co",
"=",
"cacheMap",
".",
"get",
"(",
"key",
")",
";",... | ---------------------------------------------------------------- get start | [
"----------------------------------------------------------------",
"get",
"start"
] | bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-cache/src/main/java/cn/hutool/cache/impl/AbstractCache.java#L72-L94 | train | Check if the cache contains the specified key. | [
30522,
1030,
2058,
15637,
2270,
22017,
20898,
3397,
14839,
1006,
1047,
3145,
1007,
1063,
3191,
7878,
1012,
5843,
1006,
1007,
1025,
3046,
1063,
1013,
1013,
1744,
100,
100,
100,
100,
100,
100,
2345,
17053,
16429,
3501,
1026,
1047,
1010,
105... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
netty/netty | codec-http2/src/main/java/io/netty/handler/codec/http2/Http2FrameCodec.java | Http2FrameCodec.onStreamError | @Override
protected final void onStreamError(ChannelHandlerContext ctx, boolean outbound, Throwable cause,
Http2Exception.StreamException streamException) {
int streamId = streamException.streamId();
Http2Stream connectionStream = connection().stream(streamId);
... | java | @Override
protected final void onStreamError(ChannelHandlerContext ctx, boolean outbound, Throwable cause,
Http2Exception.StreamException streamException) {
int streamId = streamException.streamId();
Http2Stream connectionStream = connection().stream(streamId);
... | [
"@",
"Override",
"protected",
"final",
"void",
"onStreamError",
"(",
"ChannelHandlerContext",
"ctx",
",",
"boolean",
"outbound",
",",
"Throwable",
"cause",
",",
"Http2Exception",
".",
"StreamException",
"streamException",
")",
"{",
"int",
"streamId",
"=",
"streamExc... | Exceptions for unknown streams, that is streams that have no {@link Http2FrameStream} object attached
are simply logged and replied to by sending a RST_STREAM frame. | [
"Exceptions",
"for",
"unknown",
"streams",
"that",
"is",
"streams",
"that",
"have",
"no",
"{"
] | ba06eafa1c1824bd154f1a380019e7ea2edf3c4c | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/codec-http2/src/main/java/io/netty/handler/codec/http2/Http2FrameCodec.java#L477-L501 | train | Override to handle stream error. | [
30522,
1030,
2058,
15637,
5123,
2345,
11675,
2006,
21422,
2121,
29165,
1006,
3149,
11774,
3917,
8663,
18209,
14931,
2595,
1010,
22017,
20898,
2041,
15494,
1010,
5466,
3085,
3426,
1010,
8299,
2475,
10288,
24422,
1012,
5460,
10288,
24422,
5460,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
apache/flink | flink-table/flink-table-runtime-blink/src/main/java/org/apache/flink/table/util/SegmentsUtil.java | SegmentsUtil.copyToBytes | public static byte[] copyToBytes(MemorySegment[] segments, int offset, byte[] bytes,
int bytesOffset, int numBytes) {
if (inFirstSegment(segments, offset, numBytes)) {
segments[0].get(offset, bytes, bytesOffset, numBytes);
} else {
copyMultiSegmentsToBytes(segments, offset, bytes, bytesOffset, numBytes);
... | java | public static byte[] copyToBytes(MemorySegment[] segments, int offset, byte[] bytes,
int bytesOffset, int numBytes) {
if (inFirstSegment(segments, offset, numBytes)) {
segments[0].get(offset, bytes, bytesOffset, numBytes);
} else {
copyMultiSegmentsToBytes(segments, offset, bytes, bytesOffset, numBytes);
... | [
"public",
"static",
"byte",
"[",
"]",
"copyToBytes",
"(",
"MemorySegment",
"[",
"]",
"segments",
",",
"int",
"offset",
",",
"byte",
"[",
"]",
"bytes",
",",
"int",
"bytesOffset",
",",
"int",
"numBytes",
")",
"{",
"if",
"(",
"inFirstSegment",
"(",
"segment... | Copy segments to target byte[].
@param segments Source segments.
@param offset Source segments offset.
@param bytes target byte[].
@param bytesOffset target byte[] offset.
@param numBytes the number bytes to copy. | [
"Copy",
"segments",
"to",
"target",
"byte",
"[]",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-table/flink-table-runtime-blink/src/main/java/org/apache/flink/table/util/SegmentsUtil.java#L118-L126 | train | Copy bytes from segments to bytes. | [
30522,
2270,
10763,
24880,
1031,
1033,
6100,
3406,
3762,
4570,
1006,
3638,
3366,
21693,
4765,
1031,
1033,
9214,
1010,
20014,
16396,
1010,
24880,
1031,
1033,
27507,
1010,
20014,
27507,
27475,
3388,
1010,
20014,
15903,
17250,
2015,
1007,
1063,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
looly/hutool | hutool-core/src/main/java/cn/hutool/core/util/ArrayUtil.java | ArrayUtil.cast | public static Object[] cast(Class<?> type, Object arrayObj) throws NullPointerException, IllegalArgumentException {
if (null == arrayObj) {
throw new NullPointerException("Argument [arrayObj] is null !");
}
if (false == arrayObj.getClass().isArray()) {
throw new IllegalArgumentException("Argument [arra... | java | public static Object[] cast(Class<?> type, Object arrayObj) throws NullPointerException, IllegalArgumentException {
if (null == arrayObj) {
throw new NullPointerException("Argument [arrayObj] is null !");
}
if (false == arrayObj.getClass().isArray()) {
throw new IllegalArgumentException("Argument [arra... | [
"public",
"static",
"Object",
"[",
"]",
"cast",
"(",
"Class",
"<",
"?",
">",
"type",
",",
"Object",
"arrayObj",
")",
"throws",
"NullPointerException",
",",
"IllegalArgumentException",
"{",
"if",
"(",
"null",
"==",
"arrayObj",
")",
"{",
"throw",
"new",
"Nul... | 强转数组类型<br>
强制转换的前提是数组元素类型可被强制转换<br>
强制转换后会生成一个新数组
@param type 数组类型或数组元素类型
@param arrayObj 原数组
@return 转换后的数组类型
@throws NullPointerException 提供参数为空
@throws IllegalArgumentException 参数arrayObj不是数组
@since 3.0.6 | [
"强转数组类型<br",
">",
"强制转换的前提是数组元素类型可被强制转换<br",
">",
"强制转换后会生成一个新数组"
] | bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/util/ArrayUtil.java#L355-L371 | train | Casts the given array to the given type. | [
30522,
2270,
10763,
4874,
1031,
1033,
3459,
1006,
2465,
1026,
1029,
1028,
2828,
1010,
4874,
9140,
16429,
3501,
1007,
11618,
19701,
8400,
7869,
2595,
24422,
1010,
6206,
2906,
22850,
15781,
2595,
24422,
1063,
2065,
1006,
19701,
1027,
1027,
91... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/RuntimeUtil.java | RuntimeUtil.addShutdownHook | public static void addShutdownHook(Runnable hook) {
Runtime.getRuntime().addShutdownHook((hook instanceof Thread) ? (Thread) hook : new Thread(hook));
} | java | public static void addShutdownHook(Runnable hook) {
Runtime.getRuntime().addShutdownHook((hook instanceof Thread) ? (Thread) hook : new Thread(hook));
} | [
"public",
"static",
"void",
"addShutdownHook",
"(",
"Runnable",
"hook",
")",
"{",
"Runtime",
".",
"getRuntime",
"(",
")",
".",
"addShutdownHook",
"(",
"(",
"hook",
"instanceof",
"Thread",
")",
"?",
"(",
"Thread",
")",
"hook",
":",
"new",
"Thread",
"(",
"... | 增加一个JVM关闭后的钩子,用于在JVM关闭时执行某些操作
@param hook 钩子
@since 4.0.5 | [
"增加一个JVM关闭后的钩子,用于在JVM关闭时执行某些操作"
] | bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/util/RuntimeUtil.java#L250-L252 | train | Add a shutdown hook to the JVM. | [
30522,
2270,
10763,
11675,
9909,
6979,
2102,
7698,
6806,
6559,
1006,
2448,
22966,
8103,
1007,
1063,
2448,
7292,
1012,
2131,
15532,
7292,
1006,
1007,
1012,
9909,
6979,
2102,
7698,
6806,
6559,
1006,
1006,
8103,
6013,
11253,
11689,
1007,
1029,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/HttpPostRequestEncoder.java | HttpPostRequestEncoder.encodeNextChunkMultipart | private HttpContent encodeNextChunkMultipart(int sizeleft) throws ErrorDataEncoderException {
if (currentData == null) {
return null;
}
ByteBuf buffer;
if (currentData instanceof InternalAttribute) {
buffer = ((InternalAttribute) currentData).toByteBuf();
... | java | private HttpContent encodeNextChunkMultipart(int sizeleft) throws ErrorDataEncoderException {
if (currentData == null) {
return null;
}
ByteBuf buffer;
if (currentData instanceof InternalAttribute) {
buffer = ((InternalAttribute) currentData).toByteBuf();
... | [
"private",
"HttpContent",
"encodeNextChunkMultipart",
"(",
"int",
"sizeleft",
")",
"throws",
"ErrorDataEncoderException",
"{",
"if",
"(",
"currentData",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"ByteBuf",
"buffer",
";",
"if",
"(",
"currentData",
"inst... | From the current context (currentBuffer and currentData), returns the next HttpChunk (if possible) trying to get
sizeleft bytes more into the currentBuffer. This is the Multipart version.
@param sizeleft
the number of bytes to try to get from currentData
@return the next HttpChunk or null if not enough bytes were foun... | [
"From",
"the",
"current",
"context",
"(",
"currentBuffer",
"and",
"currentData",
")",
"returns",
"the",
"next",
"HttpChunk",
"(",
"if",
"possible",
")",
"trying",
"to",
"get",
"sizeleft",
"bytes",
"more",
"into",
"the",
"currentBuffer",
".",
"This",
"is",
"t... | ba06eafa1c1824bd154f1a380019e7ea2edf3c4c | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/codec-http/src/main/java/io/netty/handler/codec/http/multipart/HttpPostRequestEncoder.java#L894-L925 | train | Encode the next chunk of data as multipart. | [
30522,
2797,
8299,
8663,
6528,
2102,
4372,
16044,
2638,
18413,
20760,
8950,
12274,
7096,
11514,
8445,
1006,
20014,
2946,
2571,
6199,
1007,
11618,
7561,
2850,
2696,
2368,
16044,
2890,
2595,
24422,
1063,
2065,
1006,
2783,
2850,
2696,
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-runtime/src/main/java/org/apache/flink/runtime/io/network/netty/NettyBufferPool.java | NettyBufferPool.getNumberOfAllocatedChunks | private long getNumberOfAllocatedChunks(Object arena, String chunkListFieldName)
throws NoSuchFieldException, IllegalAccessException {
// Each PoolArena<ByteBuffer> stores its allocated PoolChunk<ByteBuffer>
// instances grouped by usage (field qInit, q000, q025, etc.) in
// PoolChunkList<ByteBuffer> lists. E... | java | private long getNumberOfAllocatedChunks(Object arena, String chunkListFieldName)
throws NoSuchFieldException, IllegalAccessException {
// Each PoolArena<ByteBuffer> stores its allocated PoolChunk<ByteBuffer>
// instances grouped by usage (field qInit, q000, q025, etc.) in
// PoolChunkList<ByteBuffer> lists. E... | [
"private",
"long",
"getNumberOfAllocatedChunks",
"(",
"Object",
"arena",
",",
"String",
"chunkListFieldName",
")",
"throws",
"NoSuchFieldException",
",",
"IllegalAccessException",
"{",
"// Each PoolArena<ByteBuffer> stores its allocated PoolChunk<ByteBuffer>",
"// instances grouped b... | Returns the number of allocated bytes of the given arena and chunk list.
@param arena Arena to gather statistics about.
@param chunkListFieldName Chunk list to check.
@return Number of total allocated bytes by this arena.
@throws NoSuchFieldException Error getting the statistics (should not
happen whe... | [
"Returns",
"the",
"number",
"of",
"allocated",
"bytes",
"of",
"the",
"given",
"arena",
"and",
"chunk",
"list",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/io/network/netty/NettyBufferPool.java#L188-L223 | train | Gets the number of allocated chunks. | [
30522,
2797,
2146,
2131,
19172,
5677,
11253,
8095,
24755,
3064,
20760,
8950,
2015,
1006,
4874,
5196,
1010,
5164,
20000,
9863,
3790,
18442,
1007,
11618,
16839,
10875,
3790,
10288,
24422,
1010,
6206,
6305,
9623,
3366,
2595,
24422,
1063,
1013,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
looly/hutool | hutool-core/src/main/java/cn/hutool/core/util/HexUtil.java | HexUtil.toUnicodeHex | public static String toUnicodeHex(int value) {
final StringBuilder builder = new StringBuilder(6);
builder.append("\\u");
String hex = toHex(value);
int len = hex.length();
if (len < 4) {
builder.append("0000", 0, 4 - len);// 不足4位补0
}
builder.append(hex);
return builder.toString();
} | java | public static String toUnicodeHex(int value) {
final StringBuilder builder = new StringBuilder(6);
builder.append("\\u");
String hex = toHex(value);
int len = hex.length();
if (len < 4) {
builder.append("0000", 0, 4 - len);// 不足4位补0
}
builder.append(hex);
return builder.toString();
} | [
"public",
"static",
"String",
"toUnicodeHex",
"(",
"int",
"value",
")",
"{",
"final",
"StringBuilder",
"builder",
"=",
"new",
"StringBuilder",
"(",
"6",
")",
";",
"builder",
".",
"append",
"(",
"\"\\\\u\"",
")",
";",
"String",
"hex",
"=",
"toHex",
"(",
"... | 将指定int值转换为Unicode字符串形式,常用于特殊字符(例如汉字)转Unicode形式<br>
转换的字符串如果u后不足4位,则前面用0填充,例如:
<pre>
'我' =》\u4f60
</pre>
@param value int值,也可以是char
@return Unicode表现形式 | [
"将指定int值转换为Unicode字符串形式,常用于特殊字符(例如汉字)转Unicode形式<br",
">",
"转换的字符串如果u后不足4位,则前面用0填充,例如:"
] | bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/util/HexUtil.java#L265-L277 | train | Converts an int value into a Unicode hex string. | [
30522,
2270,
10763,
5164,
2000,
19496,
16044,
5369,
2595,
1006,
20014,
3643,
1007,
1063,
2345,
5164,
8569,
23891,
2099,
12508,
1027,
2047,
5164,
8569,
23891,
2099,
1006,
1020,
1007,
1025,
12508,
1012,
10439,
10497,
1006,
1000,
1032,
1032,
1... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
looly/hutool | hutool-core/src/main/java/cn/hutool/core/util/NumberUtil.java | NumberUtil.getBinaryStr | public static String getBinaryStr(Number number) {
if (number instanceof Long) {
return Long.toBinaryString((Long) number);
} else if (number instanceof Integer) {
return Integer.toBinaryString((Integer) number);
} else {
return Long.toBinaryString(number.longValue());
}
} | java | public static String getBinaryStr(Number number) {
if (number instanceof Long) {
return Long.toBinaryString((Long) number);
} else if (number instanceof Integer) {
return Integer.toBinaryString((Integer) number);
} else {
return Long.toBinaryString(number.longValue());
}
} | [
"public",
"static",
"String",
"getBinaryStr",
"(",
"Number",
"number",
")",
"{",
"if",
"(",
"number",
"instanceof",
"Long",
")",
"{",
"return",
"Long",
".",
"toBinaryString",
"(",
"(",
"Long",
")",
"number",
")",
";",
"}",
"else",
"if",
"(",
"number",
... | 获得数字对应的二进制字符串
@param number 数字
@return 二进制字符串 | [
"获得数字对应的二进制字符串"
] | bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/util/NumberUtil.java#L1477-L1485 | train | Returns the binary string representation of the given number. | [
30522,
2270,
10763,
5164,
2131,
21114,
24769,
16344,
1006,
2193,
2193,
1007,
1063,
2065,
1006,
2193,
6013,
11253,
2146,
1007,
1063,
2709,
2146,
1012,
28096,
5649,
3367,
4892,
1006,
1006,
2146,
1007,
2193,
1007,
1025,
1065,
2842,
2065,
1006,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
netty/netty | handler/src/main/java/io/netty/handler/ssl/SslContext.java | SslContext.newClientContext | @Deprecated
public static SslContext newClientContext(
File certChainFile, TrustManagerFactory trustManagerFactory,
Iterable<String> ciphers, Iterable<String> nextProtocols,
long sessionCacheSize, long sessionTimeout) throws SSLException {
return newClientContext(
... | java | @Deprecated
public static SslContext newClientContext(
File certChainFile, TrustManagerFactory trustManagerFactory,
Iterable<String> ciphers, Iterable<String> nextProtocols,
long sessionCacheSize, long sessionTimeout) throws SSLException {
return newClientContext(
... | [
"@",
"Deprecated",
"public",
"static",
"SslContext",
"newClientContext",
"(",
"File",
"certChainFile",
",",
"TrustManagerFactory",
"trustManagerFactory",
",",
"Iterable",
"<",
"String",
">",
"ciphers",
",",
"Iterable",
"<",
"String",
">",
"nextProtocols",
",",
"long... | Creates a new client-side {@link SslContext}.
@param certChainFile an X.509 certificate chain file in PEM format.
{@code null} to use the system default
@param trustManagerFactory the {@link TrustManagerFactory} that provides the {@link TrustManager}s
that verifies the certificates sent from servers.
{@code null} to u... | [
"Creates",
"a",
"new",
"client",
"-",
"side",
"{",
"@link",
"SslContext",
"}",
"."
] | ba06eafa1c1824bd154f1a380019e7ea2edf3c4c | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/handler/src/main/java/io/netty/handler/ssl/SslContext.java#L521-L529 | train | Create a new SslContext using the Ciphers and Next Protocols. | [
30522,
1030,
2139,
28139,
12921,
2270,
10763,
7020,
22499,
10111,
18413,
2047,
20464,
11638,
8663,
18209,
1006,
5371,
8292,
5339,
24925,
2078,
8873,
2571,
1010,
3404,
24805,
4590,
21450,
3404,
24805,
4590,
21450,
1010,
2009,
6906,
3468,
1026,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
netty/netty | codec-http/src/main/java/io/netty/handler/codec/http/HttpHeaders.java | HttpHeaders.add | public HttpHeaders add(CharSequence name, Object value) {
return add(name.toString(), value);
} | java | public HttpHeaders add(CharSequence name, Object value) {
return add(name.toString(), value);
} | [
"public",
"HttpHeaders",
"add",
"(",
"CharSequence",
"name",
",",
"Object",
"value",
")",
"{",
"return",
"add",
"(",
"name",
".",
"toString",
"(",
")",
",",
"value",
")",
";",
"}"
] | Adds a new header with the specified name and value.
If the specified value is not a {@link String}, it is converted
into a {@link String} by {@link Object#toString()}, except in the cases
of {@link Date} and {@link Calendar}, which are formatted to the date
format defined in <a href="http://www.w3.org/Protocols/rfc26... | [
"Adds",
"a",
"new",
"header",
"with",
"the",
"specified",
"name",
"and",
"value",
"."
] | ba06eafa1c1824bd154f1a380019e7ea2edf3c4c | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/codec-http/src/main/java/io/netty/handler/codec/http/HttpHeaders.java#L1379-L1381 | train | Add a header with the specified name and value. | [
30522,
2270,
8299,
4974,
2545,
5587,
1006,
25869,
3366,
4226,
5897,
2171,
1010,
4874,
3643,
1007,
1063,
2709,
5587,
1006,
2171,
1012,
2000,
3367,
4892,
1006,
1007,
1010,
3643,
1007,
1025,
1065,
102,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
spring-projects/spring-boot | spring-boot-project/spring-boot-tools/spring-boot-loader/src/main/java/org/springframework/boot/loader/Launcher.java | Launcher.createMainMethodRunner | protected MainMethodRunner createMainMethodRunner(String mainClass, String[] args,
ClassLoader classLoader) {
return new MainMethodRunner(mainClass, args);
} | java | protected MainMethodRunner createMainMethodRunner(String mainClass, String[] args,
ClassLoader classLoader) {
return new MainMethodRunner(mainClass, args);
} | [
"protected",
"MainMethodRunner",
"createMainMethodRunner",
"(",
"String",
"mainClass",
",",
"String",
"[",
"]",
"args",
",",
"ClassLoader",
"classLoader",
")",
"{",
"return",
"new",
"MainMethodRunner",
"(",
"mainClass",
",",
"args",
")",
";",
"}"
] | Create the {@code MainMethodRunner} used to launch the application.
@param mainClass the main class
@param args the incoming arguments
@param classLoader the classloader
@return the main method runner | [
"Create",
"the",
"{"
] | 0b27f7c70e164b2b1a96477f1d9c1acba56790c1 | https://github.com/spring-projects/spring-boot/blob/0b27f7c70e164b2b1a96477f1d9c1acba56790c1/spring-boot-project/spring-boot-tools/spring-boot-loader/src/main/java/org/springframework/boot/loader/Launcher.java#L97-L100 | train | Create a new instance of the main method runner. | [
30522,
5123,
2364,
11368,
6806,
13626,
4609,
3678,
3443,
24238,
11368,
6806,
30524,
3678,
1006,
2364,
26266,
1010,
12098,
5620,
1007,
1025,
1065,
102,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
apache/flink | flink-table/flink-table-planner/src/main/java/org/apache/calcite/sql/validate/SqlValidatorImpl.java | SqlValidatorImpl.validateGroupByItem | private void validateGroupByItem(SqlSelect select, SqlNode groupByItem) {
final SqlValidatorScope groupByScope = getGroupScope(select);
groupByScope.validateExpr(groupByItem);
} | java | private void validateGroupByItem(SqlSelect select, SqlNode groupByItem) {
final SqlValidatorScope groupByScope = getGroupScope(select);
groupByScope.validateExpr(groupByItem);
} | [
"private",
"void",
"validateGroupByItem",
"(",
"SqlSelect",
"select",
",",
"SqlNode",
"groupByItem",
")",
"{",
"final",
"SqlValidatorScope",
"groupByScope",
"=",
"getGroupScope",
"(",
"select",
")",
";",
"groupByScope",
".",
"validateExpr",
"(",
"groupByItem",
")",
... | Validates an item in the GROUP BY clause of a SELECT statement.
@param select Select statement
@param groupByItem GROUP BY clause item | [
"Validates",
"an",
"item",
"in",
"the",
"GROUP",
"BY",
"clause",
"of",
"a",
"SELECT",
"statement",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-table/flink-table-planner/src/main/java/org/apache/calcite/sql/validate/SqlValidatorImpl.java#L3850-L3853 | train | Validate a GROUP BY clause. | [
30522,
2797,
11675,
9398,
3686,
17058,
3762,
4221,
2213,
1006,
29296,
11246,
22471,
7276,
1010,
29296,
3630,
3207,
2177,
3762,
4221,
2213,
1007,
1063,
2345,
29296,
10175,
8524,
6591,
16186,
2177,
3762,
26127,
1027,
2131,
17058,
26127,
1006,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
netty/netty | resolver-dns/src/main/java/io/netty/resolver/dns/DnsNameResolver.java | DnsNameResolver.resolveAll | public final Future<List<DnsRecord>> resolveAll(DnsQuestion question, Iterable<DnsRecord> additionals) {
return resolveAll(question, additionals, executor().<List<DnsRecord>>newPromise());
} | java | public final Future<List<DnsRecord>> resolveAll(DnsQuestion question, Iterable<DnsRecord> additionals) {
return resolveAll(question, additionals, executor().<List<DnsRecord>>newPromise());
} | [
"public",
"final",
"Future",
"<",
"List",
"<",
"DnsRecord",
">",
">",
"resolveAll",
"(",
"DnsQuestion",
"question",
",",
"Iterable",
"<",
"DnsRecord",
">",
"additionals",
")",
"{",
"return",
"resolveAll",
"(",
"question",
",",
"additionals",
",",
"executor",
... | Resolves the {@link DnsRecord}s that are matched by the specified {@link DnsQuestion}. Unlike
{@link #query(DnsQuestion)}, this method handles redirection, CNAMEs and multiple name servers.
If the specified {@link DnsQuestion} is {@code A} or {@code AAAA}, this method looks up the configured
{@link HostsFileEntries} be... | [
"Resolves",
"the",
"{",
"@link",
"DnsRecord",
"}",
"s",
"that",
"are",
"matched",
"by",
"the",
"specified",
"{",
"@link",
"DnsQuestion",
"}",
".",
"Unlike",
"{",
"@link",
"#query",
"(",
"DnsQuestion",
")",
"}",
"this",
"method",
"handles",
"redirection",
"... | ba06eafa1c1824bd154f1a380019e7ea2edf3c4c | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/resolver-dns/src/main/java/io/netty/resolver/dns/DnsNameResolver.java#L727-L729 | train | Resolves all dns records in the specified question with the specified additionals. | [
30522,
2270,
2345,
2925,
1026,
2862,
1026,
1040,
3619,
2890,
27108,
2094,
1028,
1028,
10663,
8095,
1006,
1040,
3619,
15500,
3258,
3160,
1010,
2009,
6906,
3468,
1026,
1040,
3619,
2890,
27108,
2094,
1028,
3176,
2015,
1007,
1063,
2709,
10663,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
looly/hutool | hutool-db/src/main/java/cn/hutool/db/sql/Condition.java | Condition.buildValuePartForBETWEEN | private void buildValuePartForBETWEEN(StringBuilder conditionStrBuilder, List<Object> paramValues) {
// BETWEEN x AND y 的情况,两个参数
if (isPlaceHolder()) {
// 使用条件表达式占位符
conditionStrBuilder.append(" ?");
if(null != paramValues) {
paramValues.add(this.value);
}
} else {
// 直接使用条件值
condi... | java | private void buildValuePartForBETWEEN(StringBuilder conditionStrBuilder, List<Object> paramValues) {
// BETWEEN x AND y 的情况,两个参数
if (isPlaceHolder()) {
// 使用条件表达式占位符
conditionStrBuilder.append(" ?");
if(null != paramValues) {
paramValues.add(this.value);
}
} else {
// 直接使用条件值
condi... | [
"private",
"void",
"buildValuePartForBETWEEN",
"(",
"StringBuilder",
"conditionStrBuilder",
",",
"List",
"<",
"Object",
">",
"paramValues",
")",
"{",
"// BETWEEN x AND y 的情况,两个参数\r",
"if",
"(",
"isPlaceHolder",
"(",
")",
")",
"{",
"// 使用条件表达式占位符\r",
"conditionStrBuilder... | 构建BETWEEN语句中的值部分<br>
开头必须加空格,类似:" ? AND ?" 或者 " 1 AND 2"
@param conditionStrBuilder 条件语句构建器
@param paramValues 参数集合,用于参数占位符对应参数回填 | [
"构建BETWEEN语句中的值部分<br",
">",
"开头必须加空格,类似:",
"?",
"AND",
"?",
"或者",
"1",
"AND",
"2"
] | bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-db/src/main/java/cn/hutool/db/sql/Condition.java#L320-L345 | train | Build the value part for BETWEEN. | [
30522,
2797,
11675,
3857,
10175,
5657,
19362,
24475,
2953,
20915,
28394,
2078,
1006,
5164,
8569,
23891,
2099,
3785,
16344,
8569,
23891,
2099,
1010,
2862,
1026,
4874,
1028,
11498,
2213,
10175,
15808,
1007,
1063,
1013,
1013,
2090,
1060,
1998,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
apache/flink | flink-core/src/main/java/org/apache/flink/util/NetUtils.java | NetUtils.getPortRangeFromString | public static Iterator<Integer> getPortRangeFromString(String rangeDefinition) throws NumberFormatException {
final String[] ranges = rangeDefinition.trim().split(",");
UnionIterator<Integer> iterators = new UnionIterator<>();
for (String rawRange: ranges) {
Iterator<Integer> rangeIterator;
String range =... | java | public static Iterator<Integer> getPortRangeFromString(String rangeDefinition) throws NumberFormatException {
final String[] ranges = rangeDefinition.trim().split(",");
UnionIterator<Integer> iterators = new UnionIterator<>();
for (String rawRange: ranges) {
Iterator<Integer> rangeIterator;
String range =... | [
"public",
"static",
"Iterator",
"<",
"Integer",
">",
"getPortRangeFromString",
"(",
"String",
"rangeDefinition",
")",
"throws",
"NumberFormatException",
"{",
"final",
"String",
"[",
"]",
"ranges",
"=",
"rangeDefinition",
".",
"trim",
"(",
")",
".",
"split",
"(",... | Returns an iterator over available ports defined by the range definition.
@param rangeDefinition String describing a single port, a range of ports or multiple ranges.
@return Set of ports from the range definition
@throws NumberFormatException If an invalid string is passed. | [
"Returns",
"an",
"iterator",
"over",
"available",
"ports",
"defined",
"by",
"the",
"range",
"definition",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-core/src/main/java/org/apache/flink/util/NetUtils.java#L314-L365 | train | Get the port range from a string. | [
30522,
2270,
10763,
2009,
6906,
4263,
1026,
16109,
1028,
2131,
6442,
24388,
12879,
21716,
3367,
4892,
1006,
5164,
15844,
12879,
5498,
3508,
1007,
11618,
2193,
14192,
3686,
2595,
24422,
1063,
2345,
5164,
1031,
1033,
8483,
1027,
15844,
12879,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
netty/netty | codec-http/src/main/java/io/netty/handler/codec/http/cookie/ServerCookieEncoder.java | ServerCookieEncoder.encode | public List<String> encode(Collection<? extends Cookie> cookies) {
if (checkNotNull(cookies, "cookies").isEmpty()) {
return Collections.emptyList();
}
List<String> encoded = new ArrayList<String>(cookies.size());
Map<String, Integer> nameToIndex = strict && cookies.size() > ... | java | public List<String> encode(Collection<? extends Cookie> cookies) {
if (checkNotNull(cookies, "cookies").isEmpty()) {
return Collections.emptyList();
}
List<String> encoded = new ArrayList<String>(cookies.size());
Map<String, Integer> nameToIndex = strict && cookies.size() > ... | [
"public",
"List",
"<",
"String",
">",
"encode",
"(",
"Collection",
"<",
"?",
"extends",
"Cookie",
">",
"cookies",
")",
"{",
"if",
"(",
"checkNotNull",
"(",
"cookies",
",",
"\"cookies\"",
")",
".",
"isEmpty",
"(",
")",
")",
"{",
"return",
"Collections",
... | Batch encodes cookies into Set-Cookie header values.
@param cookies a bunch of cookies
@return the corresponding bunch of Set-Cookie headers | [
"Batch",
"encodes",
"cookies",
"into",
"Set",
"-",
"Cookie",
"header",
"values",
"."
] | ba06eafa1c1824bd154f1a380019e7ea2edf3c4c | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/codec-http/src/main/java/io/netty/handler/codec/http/cookie/ServerCookieEncoder.java#L181-L197 | train | Encode a collection of cookies into a list of strings. | [
30522,
2270,
2862,
1026,
5164,
1028,
4372,
16044,
1006,
3074,
1026,
1029,
8908,
17387,
1028,
16324,
1007,
30524,
1006,
16324,
1010,
1000,
16324,
1000,
1007,
1012,
2003,
6633,
13876,
2100,
1006,
1007,
1007,
1063,
2709,
6407,
1012,
4064,
9863... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
apache/flink | flink-runtime/src/main/java/org/apache/flink/runtime/state/heap/NestedMapsStateTable.java | NestedMapsStateTable.setMapForKeyGroup | private void setMapForKeyGroup(int keyGroupId, Map<N, Map<K, S>> map) {
try {
state[indexToOffset(keyGroupId)] = map;
} catch (ArrayIndexOutOfBoundsException e) {
throw new IllegalArgumentException("Key group index " + keyGroupId + " is out of range of key group " +
"range [" + keyGroupOffset + ", " + (ke... | java | private void setMapForKeyGroup(int keyGroupId, Map<N, Map<K, S>> map) {
try {
state[indexToOffset(keyGroupId)] = map;
} catch (ArrayIndexOutOfBoundsException e) {
throw new IllegalArgumentException("Key group index " + keyGroupId + " is out of range of key group " +
"range [" + keyGroupOffset + ", " + (ke... | [
"private",
"void",
"setMapForKeyGroup",
"(",
"int",
"keyGroupId",
",",
"Map",
"<",
"N",
",",
"Map",
"<",
"K",
",",
"S",
">",
">",
"map",
")",
"{",
"try",
"{",
"state",
"[",
"indexToOffset",
"(",
"keyGroupId",
")",
"]",
"=",
"map",
";",
"}",
"catch"... | Sets the given map for the given key-group. | [
"Sets",
"the",
"given",
"map",
"for",
"the",
"given",
"key",
"-",
"group",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/state/heap/NestedMapsStateTable.java#L120-L127 | train | Sets the map for the given key group. | [
30522,
2797,
11675,
2275,
2863,
14376,
2953,
14839,
17058,
1006,
20014,
3145,
17058,
3593,
1010,
4949,
1026,
1050,
1010,
4949,
1026,
1047,
1010,
1055,
1028,
1028,
4949,
1007,
1063,
3046,
1063,
2110,
1031,
5950,
3406,
27475,
3388,
1006,
3145... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/configuration/StandaloneConfiguration.java | StandaloneConfiguration.toJson | public Map<String, Object> toJson() {
Map<String, Object> json = new HashMap<>();
json.put("browserTimeout", browserTimeout);
json.put("debug", debug);
json.put("jettyMaxThreads", jettyMaxThreads);
json.put("log", log);
json.put("host", host);
json.put("port", port);
json.put("role", rol... | java | public Map<String, Object> toJson() {
Map<String, Object> json = new HashMap<>();
json.put("browserTimeout", browserTimeout);
json.put("debug", debug);
json.put("jettyMaxThreads", jettyMaxThreads);
json.put("log", log);
json.put("host", host);
json.put("port", port);
json.put("role", rol... | [
"public",
"Map",
"<",
"String",
",",
"Object",
">",
"toJson",
"(",
")",
"{",
"Map",
"<",
"String",
",",
"Object",
">",
"json",
"=",
"new",
"HashMap",
"<>",
"(",
")",
";",
"json",
".",
"put",
"(",
"\"browserTimeout\"",
",",
"browserTimeout",
")",
";",... | Return a JsonElement representation of the configuration. Does not serialize nulls. | [
"Return",
"a",
"JsonElement",
"representation",
"of",
"the",
"configuration",
".",
"Does",
"not",
"serialize",
"nulls",
"."
] | 7af172729f17b20269c8ca4ea6f788db48616535 | https://github.com/SeleniumHQ/selenium/blob/7af172729f17b20269c8ca4ea6f788db48616535/java/server/src/org/openqa/grid/internal/utils/configuration/StandaloneConfiguration.java#L275-L291 | train | Serialize the configuration to a JSON map. | [
30522,
2270,
4949,
1026,
5164,
1010,
4874,
1028,
2000,
22578,
2239,
1006,
1007,
1063,
4949,
1026,
5164,
1010,
4874,
1028,
1046,
3385,
1027,
2047,
23325,
2863,
2361,
1026,
1028,
1006,
1007,
1025,
1046,
3385,
1012,
2404,
1006,
1000,
16602,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-zookeeper-curator/src/main/java/org/apache/shardingsphere/orchestration/reg/zookeeper/curator/CuratorZookeeperExceptionHandler.java | CuratorZookeeperExceptionHandler.handleException | public static void handleException(final Exception cause) {
if (null == cause) {
return;
}
if (isIgnoredException(cause) || null != cause.getCause() && isIgnoredException(cause.getCause())) {
log.debug("Ignored exception for: {}", cause.getMessage());
} else if (c... | java | public static void handleException(final Exception cause) {
if (null == cause) {
return;
}
if (isIgnoredException(cause) || null != cause.getCause() && isIgnoredException(cause.getCause())) {
log.debug("Ignored exception for: {}", cause.getMessage());
} else if (c... | [
"public",
"static",
"void",
"handleException",
"(",
"final",
"Exception",
"cause",
")",
"{",
"if",
"(",
"null",
"==",
"cause",
")",
"{",
"return",
";",
"}",
"if",
"(",
"isIgnoredException",
"(",
"cause",
")",
"||",
"null",
"!=",
"cause",
".",
"getCause",... | Handle exception.
<p>Ignore interrupt and connection invalid exception.</p>
@param cause to be handled exception | [
"Handle",
"exception",
"."
] | f88fd29fc345dfb31fdce12e9e96cbfa0fd2402d | https://github.com/apache/incubator-shardingsphere/blob/f88fd29fc345dfb31fdce12e9e96cbfa0fd2402d/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-zookeeper-curator/src/main/java/org/apache/shardingsphere/orchestration/reg/zookeeper/curator/CuratorZookeeperExceptionHandler.java#L44-L55 | train | Handle exception. | [
30522,
2270,
10763,
11675,
5047,
10288,
24422,
1006,
2345,
6453,
3426,
1007,
1063,
2065,
1006,
19701,
1027,
1027,
3426,
1007,
1063,
2709,
1025,
1065,
2065,
1006,
2003,
23773,
19574,
10288,
24422,
1006,
3426,
1007,
1064,
1064,
19701,
999,
10... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
redisson/redisson | redisson/src/main/java/org/redisson/config/Config.java | Config.fromYAML | public static Config fromYAML(Reader reader) throws IOException {
ConfigSupport support = new ConfigSupport();
return support.fromYAML(reader, Config.class);
} | java | public static Config fromYAML(Reader reader) throws IOException {
ConfigSupport support = new ConfigSupport();
return support.fromYAML(reader, Config.class);
} | [
"public",
"static",
"Config",
"fromYAML",
"(",
"Reader",
"reader",
")",
"throws",
"IOException",
"{",
"ConfigSupport",
"support",
"=",
"new",
"ConfigSupport",
"(",
")",
";",
"return",
"support",
".",
"fromYAML",
"(",
"reader",
",",
"Config",
".",
"class",
")... | Read config object stored in YAML format from <code>Reader</code>
@param reader object
@return config
@throws IOException error | [
"Read",
"config",
"object",
"stored",
"in",
"YAML",
"format",
"from",
"<code",
">",
"Reader<",
"/",
"code",
">"
] | d3acc0249b2d5d658d36d99e2c808ce49332ea44 | https://github.com/redisson/redisson/blob/d3acc0249b2d5d658d36d99e2c808ce49332ea44/redisson/src/main/java/org/redisson/config/Config.java#L691-L694 | train | Creates a Config object from a YAML document. | [
30522,
2270,
10763,
9530,
8873,
2290,
2013,
14852,
2140,
1006,
8068,
8068,
1007,
11618,
22834,
10288,
24422,
1063,
9530,
8873,
5620,
6279,
6442,
2490,
1027,
2047,
9530,
8873,
5620,
6279,
6442,
1006,
1007,
1025,
2709,
2490,
1012,
2013,
14852... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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.setNumFields | public void setNumFields(final int numFields) {
final int oldNumFields = this.numFields;
// check whether we increase or decrease the fields
if (numFields > oldNumFields) {
makeSpace(numFields);
for (int i = oldNumFields; i < numFields; i++) {
this.offsets[i] = NULL_INDICATOR_OFFSET;
}
markModifi... | java | public void setNumFields(final int numFields) {
final int oldNumFields = this.numFields;
// check whether we increase or decrease the fields
if (numFields > oldNumFields) {
makeSpace(numFields);
for (int i = oldNumFields; i < numFields; i++) {
this.offsets[i] = NULL_INDICATOR_OFFSET;
}
markModifi... | [
"public",
"void",
"setNumFields",
"(",
"final",
"int",
"numFields",
")",
"{",
"final",
"int",
"oldNumFields",
"=",
"this",
".",
"numFields",
";",
"// check whether we increase or decrease the fields ",
"if",
"(",
"numFields",
">",
"oldNumFields",
")",
"{",
"makeSpac... | Sets the number of fields in the record. If the new number of fields is longer than the current number of
fields, then null fields are appended. If the new number of fields is smaller than the current number of
fields, then the last fields are truncated.
@param numFields The new number of fields. | [
"Sets",
"the",
"number",
"of",
"fields",
"in",
"the",
"record",
".",
"If",
"the",
"new",
"number",
"of",
"fields",
"is",
"longer",
"than",
"the",
"current",
"number",
"of",
"fields",
"then",
"null",
"fields",
"are",
"appended",
".",
"If",
"the",
"new",
... | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-core/src/main/java/org/apache/flink/types/Record.java#L144-L161 | train | Sets the number of fields in the record. | [
30522,
2270,
11675,
2275,
19172,
15155,
1006,
2345,
20014,
16371,
2213,
15155,
1007,
1063,
2345,
20014,
2214,
19172,
15155,
1027,
2023,
1012,
16371,
2213,
15155,
1025,
1013,
1013,
4638,
3251,
2057,
3623,
2030,
9885,
1996,
4249,
2065,
1006,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
apache/flink | flink-libraries/flink-gelly/src/main/java/org/apache/flink/graph/gsa/GatherSumApplyIteration.java | GatherSumApplyIteration.withEdges | public static <K, VV, EV, M> GatherSumApplyIteration<K, VV, EV, M>
withEdges(DataSet<Edge<K, EV>> edges, GatherFunction<VV, EV, M> gather,
SumFunction<VV, EV, M> sum, ApplyFunction<K, VV, M> apply, int maximumNumberOfIterations) {
return new GatherSumApplyIteration<>(gather, sum, apply, edges, maximumNumberOfIte... | java | public static <K, VV, EV, M> GatherSumApplyIteration<K, VV, EV, M>
withEdges(DataSet<Edge<K, EV>> edges, GatherFunction<VV, EV, M> gather,
SumFunction<VV, EV, M> sum, ApplyFunction<K, VV, M> apply, int maximumNumberOfIterations) {
return new GatherSumApplyIteration<>(gather, sum, apply, edges, maximumNumberOfIte... | [
"public",
"static",
"<",
"K",
",",
"VV",
",",
"EV",
",",
"M",
">",
"GatherSumApplyIteration",
"<",
"K",
",",
"VV",
",",
"EV",
",",
"M",
">",
"withEdges",
"(",
"DataSet",
"<",
"Edge",
"<",
"K",
",",
"EV",
">",
">",
"edges",
",",
"GatherFunction",
... | Creates a new gather-sum-apply iteration operator for graphs.
@param edges The edge DataSet
@param gather The gather function of the GSA iteration
@param sum The sum function of the GSA iteration
@param apply The apply function of the GSA iteration
@param maximumNumberOfIterations The maximum number of iterations ex... | [
"Creates",
"a",
"new",
"gather",
"-",
"sum",
"-",
"apply",
"iteration",
"operator",
"for",
"graphs",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-libraries/flink-gelly/src/main/java/org/apache/flink/graph/gsa/GatherSumApplyIteration.java#L266-L271 | train | Create a GatherSumApplyIteration instance with edges. | [
30522,
2270,
10763,
1026,
1047,
1010,
1058,
2615,
1010,
23408,
1010,
1049,
1028,
29438,
12248,
9397,
2135,
21646,
3370,
1026,
1047,
1010,
1058,
2615,
1010,
23408,
1010,
1049,
1028,
2007,
24225,
2015,
1006,
2951,
13462,
1026,
3341,
1026,
104... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
looly/hutool | hutool-core/src/main/java/cn/hutool/core/io/file/FileCopier.java | FileCopier.copy | @Override
public File copy() throws IORuntimeException{
final File src = this.src;
final File dest = this.dest;
// check
Assert.notNull(src, "Source File is null !");
if (false == src.exists()) {
throw new IORuntimeException("File not exist: " + src);
}
Assert.notNull(dest, "Destination File ... | java | @Override
public File copy() throws IORuntimeException{
final File src = this.src;
final File dest = this.dest;
// check
Assert.notNull(src, "Source File is null !");
if (false == src.exists()) {
throw new IORuntimeException("File not exist: " + src);
}
Assert.notNull(dest, "Destination File ... | [
"@",
"Override",
"public",
"File",
"copy",
"(",
")",
"throws",
"IORuntimeException",
"{",
"final",
"File",
"src",
"=",
"this",
".",
"src",
";",
"final",
"File",
"dest",
"=",
"this",
".",
"dest",
";",
"// check\r",
"Assert",
".",
"notNull",
"(",
"src",
... | 执行拷贝<br>
拷贝规则为:
<pre>
1、源为文件,目标为已存在目录,则拷贝到目录下,文件名不变
2、源为文件,目标为不存在路径,则目标以文件对待(自动创建父级目录)比如:/dest/aaa,如果aaa不存在,则aaa被当作文件名
3、源为文件,目标是一个已存在的文件,则当{@link #setOverride(boolean)}设为true时会被覆盖,默认不覆盖
4、源为目录,目标为已存在目录,当{@link #setCopyContentIfDir(boolean)}为true时,只拷贝目录中的内容到目标目录中,否则整个源目录连同其目录拷贝到目标目录中
5、源为目录,目标为不存在路径,则自动创建目标为新目录,然后按照规则4... | [
"执行拷贝<br",
">",
"拷贝规则为:",
"<pre",
">",
"1、源为文件,目标为已存在目录,则拷贝到目录下,文件名不变",
"2、源为文件,目标为不存在路径,则目标以文件对待(自动创建父级目录)比如:",
"/",
"dest",
"/",
"aaa,如果aaa不存在,则aaa被当作文件名",
"3、源为文件,目标是一个已存在的文件,则当",
"{",
"@link",
"#setOverride",
"(",
"boolean",
")",
"}",
"设为true时会被覆盖,默认不覆盖",
"4、源为目录,目标为已存在目录... | bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/io/file/FileCopier.java#L165-L190 | train | Copy the contents of the source file to the destination file. | [
30522,
1030,
2058,
15637,
2270,
5371,
6100,
1006,
1007,
11618,
22834,
15532,
7292,
10288,
24422,
1063,
2345,
5371,
5034,
2278,
1027,
2023,
1012,
5034,
2278,
1025,
2345,
5371,
4078,
2102,
1027,
2023,
1012,
4078,
2102,
1025,
1013,
1013,
4638,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
looly/hutool | hutool-log/src/main/java/cn/hutool/log/LogFactory.java | LogFactory.getLog | public Log getLog(Class<?> clazz) {
Log log = logCache.get(clazz);
if (null == log) {
log = createLog(clazz);
logCache.put(clazz, log);
}
return log;
} | java | public Log getLog(Class<?> clazz) {
Log log = logCache.get(clazz);
if (null == log) {
log = createLog(clazz);
logCache.put(clazz, log);
}
return log;
} | [
"public",
"Log",
"getLog",
"(",
"Class",
"<",
"?",
">",
"clazz",
")",
"{",
"Log",
"log",
"=",
"logCache",
".",
"get",
"(",
"clazz",
")",
";",
"if",
"(",
"null",
"==",
"log",
")",
"{",
"log",
"=",
"createLog",
"(",
"clazz",
")",
";",
"logCache",
... | 获得日志对象
@param clazz 日志对应类
@return 日志对象 | [
"获得日志对象"
] | bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-log/src/main/java/cn/hutool/log/LogFactory.java#L81-L88 | train | Gets the log for the specified class. | [
30522,
2270,
8833,
2131,
21197,
1006,
2465,
1026,
1029,
1028,
18856,
10936,
2480,
1007,
1063,
8833,
8833,
1027,
8833,
3540,
5403,
1012,
2131,
1006,
18856,
10936,
2480,
1007,
1025,
2065,
1006,
19701,
1027,
1027,
8833,
1007,
1063,
8833,
1027,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
networknt/light-4j | utility/src/main/java/com/networknt/utility/CharUtils.java | CharUtils.toIntValue | public static int toIntValue(final Character ch, final int defaultValue) {
if (ch == null) {
return defaultValue;
}
return toIntValue(ch.charValue(), defaultValue);
} | java | public static int toIntValue(final Character ch, final int defaultValue) {
if (ch == null) {
return defaultValue;
}
return toIntValue(ch.charValue(), defaultValue);
} | [
"public",
"static",
"int",
"toIntValue",
"(",
"final",
"Character",
"ch",
",",
"final",
"int",
"defaultValue",
")",
"{",
"if",
"(",
"ch",
"==",
"null",
")",
"{",
"return",
"defaultValue",
";",
"}",
"return",
"toIntValue",
"(",
"ch",
".",
"charValue",
"("... | <p>Converts the character to the Integer it represents, throwing an
exception if the character is not numeric.</p>
<p>This method converts the char '1' to the int 1 and so on.</p>
<pre>
CharUtils.toIntValue(null, -1) = -1
CharUtils.toIntValue('3', -1) = 3
CharUtils.toIntValue('A', -1) = -1
</pre>
@param ch the ch... | [
"<p",
">",
"Converts",
"the",
"character",
"to",
"the",
"Integer",
"it",
"represents",
"throwing",
"an",
"exception",
"if",
"the",
"character",
"is",
"not",
"numeric",
".",
"<",
"/",
"p",
">"
] | 2a60257c60663684c8f6dc8b5ea3cf184e534db6 | https://github.com/networknt/light-4j/blob/2a60257c60663684c8f6dc8b5ea3cf184e534db6/utility/src/main/java/com/networknt/utility/CharUtils.java#L227-L232 | train | Gets the int value from a char. | [
30522,
2270,
10763,
20014,
2000,
18447,
10175,
5657,
1006,
2345,
2839,
10381,
1010,
2345,
20014,
12398,
10175,
5657,
1007,
1063,
2065,
1006,
10381,
1027,
1027,
19701,
1007,
1063,
2709,
12398,
10175,
5657,
1025,
1065,
2709,
2000,
18447,
10175,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
apache/flink | flink-runtime/src/main/java/org/apache/flink/runtime/util/ZooKeeperUtils.java | ZooKeeperUtils.createLeaderElectionService | public static ZooKeeperLeaderElectionService createLeaderElectionService(
CuratorFramework client,
Configuration configuration) throws Exception {
return createLeaderElectionService(client, configuration, "");
} | java | public static ZooKeeperLeaderElectionService createLeaderElectionService(
CuratorFramework client,
Configuration configuration) throws Exception {
return createLeaderElectionService(client, configuration, "");
} | [
"public",
"static",
"ZooKeeperLeaderElectionService",
"createLeaderElectionService",
"(",
"CuratorFramework",
"client",
",",
"Configuration",
"configuration",
")",
"throws",
"Exception",
"{",
"return",
"createLeaderElectionService",
"(",
"client",
",",
"configuration",
",",
... | Creates a {@link ZooKeeperLeaderElectionService} instance.
@param client The {@link CuratorFramework} ZooKeeper client to use
@param configuration {@link Configuration} object containing the configuration values
@return {@link ZooKeeperLeaderElectionService} instance. | [
"Creates",
"a",
"{",
"@link",
"ZooKeeperLeaderElectionService",
"}",
"instance",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/util/ZooKeeperUtils.java#L202-L207 | train | Create a LeaderElectionService with the given configuration. | [
30522,
2270,
10763,
9201,
13106,
19000,
12260,
22014,
2121,
7903,
2063,
3443,
19000,
12260,
22014,
2121,
7903,
2063,
1006,
13023,
15643,
6198,
7396,
1010,
9563,
9563,
1007,
11618,
6453,
1063,
2709,
3443,
19000,
12260,
22014,
2121,
7903,
2063,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/DefaultDnsRecordDecoder.java | DefaultDnsRecordDecoder.decodeRecord | protected DnsRecord decodeRecord(
String name, DnsRecordType type, int dnsClass, long timeToLive,
ByteBuf in, int offset, int length) throws Exception {
// DNS message compression means that domain names may contain "pointers" to other positions in the packet
// to build a full ... | java | protected DnsRecord decodeRecord(
String name, DnsRecordType type, int dnsClass, long timeToLive,
ByteBuf in, int offset, int length) throws Exception {
// DNS message compression means that domain names may contain "pointers" to other positions in the packet
// to build a full ... | [
"protected",
"DnsRecord",
"decodeRecord",
"(",
"String",
"name",
",",
"DnsRecordType",
"type",
",",
"int",
"dnsClass",
",",
"long",
"timeToLive",
",",
"ByteBuf",
"in",
",",
"int",
"offset",
",",
"int",
"length",
")",
"throws",
"Exception",
"{",
"// DNS message... | Decodes a record from the information decoded so far by {@link #decodeRecord(ByteBuf)}.
@param name the domain name of the record
@param type the type of the record
@param dnsClass the class of the record
@param timeToLive the TTL of the record
@param in the {@link ByteBuf} that contains the RDATA
@param offset the st... | [
"Decodes",
"a",
"record",
"from",
"the",
"information",
"decoded",
"so",
"far",
"by",
"{",
"@link",
"#decodeRecord",
"(",
"ByteBuf",
")",
"}",
"."
] | ba06eafa1c1824bd154f1a380019e7ea2edf3c4c | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/codec-dns/src/main/java/io/netty/handler/codec/dns/DefaultDnsRecordDecoder.java#L89-L103 | train | Decode a DNS record from the specified bytes. | [
30522,
5123,
1040,
3619,
2890,
27108,
2094,
21933,
4063,
8586,
8551,
1006,
5164,
2171,
1010,
1040,
3619,
2890,
27108,
11927,
18863,
2828,
1010,
20014,
1040,
3619,
26266,
1010,
2146,
2051,
3406,
3669,
3726,
1010,
24880,
8569,
2546,
1999,
101... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
apache/flink | flink-streaming-java/src/main/java/org/apache/flink/streaming/runtime/operators/windowing/KeyMap.java | KeyMap.putOrAggregate | public final V putOrAggregate(K key, V value, ReduceFunction<V> aggregator) throws Exception {
final int hash = hash(key);
final int slot = indexOf(hash);
// search the chain from the slot
for (Entry<K, V> entry = table[slot]; entry != null; entry = entry.next) {
if (entry.hashCode == hash && entry.key.equa... | java | public final V putOrAggregate(K key, V value, ReduceFunction<V> aggregator) throws Exception {
final int hash = hash(key);
final int slot = indexOf(hash);
// search the chain from the slot
for (Entry<K, V> entry = table[slot]; entry != null; entry = entry.next) {
if (entry.hashCode == hash && entry.key.equa... | [
"public",
"final",
"V",
"putOrAggregate",
"(",
"K",
"key",
",",
"V",
"value",
",",
"ReduceFunction",
"<",
"V",
">",
"aggregator",
")",
"throws",
"Exception",
"{",
"final",
"int",
"hash",
"=",
"hash",
"(",
"key",
")",
";",
"final",
"int",
"slot",
"=",
... | Inserts or aggregates a value into the hash map. If the hash map does not yet contain the key,
this method inserts the value. If the table already contains the key (and a value) this
method will use the given ReduceFunction function to combine the existing value and the
given value to a new value, and store that value ... | [
"Inserts",
"or",
"aggregates",
"a",
"value",
"into",
"the",
"hash",
"map",
".",
"If",
"the",
"hash",
"map",
"does",
"not",
"yet",
"contain",
"the",
"key",
"this",
"method",
"inserts",
"the",
"value",
".",
"If",
"the",
"table",
"already",
"contains",
"the... | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-streaming-java/src/main/java/org/apache/flink/streaming/runtime/operators/windowing/KeyMap.java#L192-L209 | train | Put or aggregate the value of the specified key. | [
30522,
2270,
2345,
1058,
2404,
6525,
13871,
2890,
5867,
1006,
1047,
3145,
1010,
1058,
3643,
1010,
5547,
11263,
27989,
1026,
1058,
1028,
24089,
1007,
11618,
6453,
1063,
2345,
20014,
23325,
1027,
23325,
1006,
3145,
1007,
1025,
2345,
20014,
10... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
looly/hutool | hutool-core/src/main/java/cn/hutool/core/util/ZipUtil.java | ZipUtil.gzip | public static byte[] gzip(InputStream in, int length) throws UtilException {
final ByteArrayOutputStream bos = new ByteArrayOutputStream(length);
GZIPOutputStream gos = null;
try {
gos = new GZIPOutputStream(bos);
IoUtil.copy(in, gos);
} catch (IOException e) {
throw new UtilException(e);
} f... | java | public static byte[] gzip(InputStream in, int length) throws UtilException {
final ByteArrayOutputStream bos = new ByteArrayOutputStream(length);
GZIPOutputStream gos = null;
try {
gos = new GZIPOutputStream(bos);
IoUtil.copy(in, gos);
} catch (IOException e) {
throw new UtilException(e);
} f... | [
"public",
"static",
"byte",
"[",
"]",
"gzip",
"(",
"InputStream",
"in",
",",
"int",
"length",
")",
"throws",
"UtilException",
"{",
"final",
"ByteArrayOutputStream",
"bos",
"=",
"new",
"ByteArrayOutputStream",
"(",
"length",
")",
";",
"GZIPOutputStream",
"gos",
... | Gzip压缩文件
@param in 被压缩的流
@param length 预估长度
@return 压缩后的字节流
@throws UtilException IO异常
@since 4.1.18 | [
"Gzip压缩文件"
] | bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/util/ZipUtil.java#L544-L557 | train | GZIP input stream to byte array | [
30522,
2270,
10763,
24880,
1031,
1033,
1043,
5831,
2361,
1006,
20407,
25379,
1999,
1010,
20014,
3091,
1007,
11618,
21183,
9463,
2595,
24422,
1063,
2345,
24880,
2906,
9447,
5833,
18780,
21422,
8945,
2015,
1027,
2047,
24880,
2906,
9447,
5833,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
spring-projects/spring-boot | spring-boot-project/spring-boot-tools/spring-boot-configuration-processor/src/json-shade/java/org/springframework/boot/configurationprocessor/json/JSONObject.java | JSONObject.optLong | public long optLong(String name, long fallback) {
Object object = opt(name);
Long result = JSON.toLong(object);
return result != null ? result : fallback;
} | java | public long optLong(String name, long fallback) {
Object object = opt(name);
Long result = JSON.toLong(object);
return result != null ? result : fallback;
} | [
"public",
"long",
"optLong",
"(",
"String",
"name",
",",
"long",
"fallback",
")",
"{",
"Object",
"object",
"=",
"opt",
"(",
"name",
")",
";",
"Long",
"result",
"=",
"JSON",
".",
"toLong",
"(",
"object",
")",
";",
"return",
"result",
"!=",
"null",
"?"... | Returns the value mapped by {@code name} if it exists and is a long or can be
coerced to a long. Returns {@code fallback} otherwise. Note that JSON represents
numbers as doubles, so this is <a href="#lossy">lossy</a>; use strings to transfer
numbers via JSON.
@param name the name of the property
@param fallback a fallb... | [
"Returns",
"the",
"value",
"mapped",
"by",
"{"
] | 0b27f7c70e164b2b1a96477f1d9c1acba56790c1 | https://github.com/spring-projects/spring-boot/blob/0b27f7c70e164b2b1a96477f1d9c1acba56790c1/spring-boot-project/spring-boot-tools/spring-boot-configuration-processor/src/json-shade/java/org/springframework/boot/configurationprocessor/json/JSONObject.java#L548-L552 | train | Get the optional long value associated with a name. | [
30522,
2270,
2146,
23569,
10052,
1006,
5164,
2171,
1010,
2146,
2991,
5963,
1007,
1063,
4874,
4874,
1027,
23569,
1006,
2171,
1007,
1025,
2146,
2765,
1027,
1046,
3385,
1012,
2000,
10052,
1006,
4874,
1007,
1025,
2709,
2765,
999,
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... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.