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 = (Enumeration<ZipEntry>) zipFileObj.entries(); ZipEntry zipEntry = null; File outItemFile = null; while (em.hasMoreElements()) { zipEntry = em.nextElement(); //FileUtil.file会检查slip漏洞,漏洞说明见http://blog.nsfocus.net/zip-slip-2/ outItemFile = FileUtil.file(outFile, zipEntry.getName()); if (zipEntry.isDirectory()) { outItemFile.mkdirs(); } else { FileUtil.touch(outItemFile); copy(zipFileObj, zipEntry, outItemFile); } } } catch (IOException e) { throw new UtilException(e); } finally { IoUtil.close(zipFileObj); } return outFile; }
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 = (Enumeration<ZipEntry>) zipFileObj.entries(); ZipEntry zipEntry = null; File outItemFile = null; while (em.hasMoreElements()) { zipEntry = em.nextElement(); //FileUtil.file会检查slip漏洞,漏洞说明见http://blog.nsfocus.net/zip-slip-2/ outItemFile = FileUtil.file(outFile, zipEntry.getName()); if (zipEntry.isDirectory()) { outItemFile.mkdirs(); } else { FileUtil.touch(outItemFile); copy(zipFileObj, zipEntry, outItemFile); } } } catch (IOException e) { throw new UtilException(e); } finally { IoUtil.close(zipFileObj); } return outFile; }
[ "@", "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 customizers the customizers to set @return a new builder instance @see #additionalCustomizers(WebServiceTemplateCustomizer...)
[ "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, sessionId, trace::setSessionId); setIfIncluded(Include.PRINCIPAL, principal, trace::setPrincipal); trace.setResponse( new HttpTrace.Response(new FilteredTraceableResponse(response))); }
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, sessionId, trace::setSessionId); setIfIncluded(Include.PRINCIPAL, principal, trace::setPrincipal); trace.setResponse( new HttpTrace.Response(new FilteredTraceableResponse(response))); }
[ "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()).intValue(); } catch (SQLException e) { throw e; } finally { DbUtil.close(ps); } }
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()).intValue(); } catch (SQLException e) { throw e; } finally { DbUtil.close(ps); } }
[ "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 toCopy; }
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 toCopy; }
[ "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); binaryStatements.putIfAbsent(result, new MySQLBinaryStatement(sql, parametersCount)); return result; }
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); binaryStatements.putIfAbsent(result, new MySQLBinaryStatement(sql, parametersCount)); return result; }
[ "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) { PermanentBlobKey jobInfoKey = ((Offloaded<JobInformation>) serializedJobInformation).serializedValueKey; Preconditions.checkNotNull(blobService); final File dataFile = blobService.getFile(jobId, jobInfoKey); // NOTE: Do not delete the job info BLOB since it may be needed again during recovery. // (it is deleted automatically on the BLOB server and cache when the job // enters a terminal state) SerializedValue<JobInformation> serializedValue = SerializedValue.fromBytes(FileUtils.readAllBytes(dataFile.toPath())); serializedJobInformation = new NonOffloaded<>(serializedValue); } // re-integrate offloaded task info from blob if (serializedTaskInformation instanceof Offloaded) { PermanentBlobKey taskInfoKey = ((Offloaded<TaskInformation>) serializedTaskInformation).serializedValueKey; Preconditions.checkNotNull(blobService); final File dataFile = blobService.getFile(jobId, taskInfoKey); // NOTE: Do not delete the task info BLOB since it may be needed again during recovery. // (it is deleted automatically on the BLOB server and cache when the job // enters a terminal state) SerializedValue<TaskInformation> serializedValue = SerializedValue.fromBytes(FileUtils.readAllBytes(dataFile.toPath())); serializedTaskInformation = new NonOffloaded<>(serializedValue); } // make sure that the serialized job and task information fields are filled Preconditions.checkNotNull(serializedJobInformation); Preconditions.checkNotNull(serializedTaskInformation); }
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) { PermanentBlobKey jobInfoKey = ((Offloaded<JobInformation>) serializedJobInformation).serializedValueKey; Preconditions.checkNotNull(blobService); final File dataFile = blobService.getFile(jobId, jobInfoKey); // NOTE: Do not delete the job info BLOB since it may be needed again during recovery. // (it is deleted automatically on the BLOB server and cache when the job // enters a terminal state) SerializedValue<JobInformation> serializedValue = SerializedValue.fromBytes(FileUtils.readAllBytes(dataFile.toPath())); serializedJobInformation = new NonOffloaded<>(serializedValue); } // re-integrate offloaded task info from blob if (serializedTaskInformation instanceof Offloaded) { PermanentBlobKey taskInfoKey = ((Offloaded<TaskInformation>) serializedTaskInformation).serializedValueKey; Preconditions.checkNotNull(blobService); final File dataFile = blobService.getFile(jobId, taskInfoKey); // NOTE: Do not delete the task info BLOB since it may be needed again during recovery. // (it is deleted automatically on the BLOB server and cache when the job // enters a terminal state) SerializedValue<TaskInformation> serializedValue = SerializedValue.fromBytes(FileUtils.readAllBytes(dataFile.toPath())); serializedTaskInformation = new NonOffloaded<>(serializedValue); } // make sure that the serialized job and task information fields are filled Preconditions.checkNotNull(serializedJobInformation); Preconditions.checkNotNull(serializedTaskInformation); }
[ "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 ClassNotFoundException Class of a serialized object cannot be found.
[ "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; } constructors = getConstructorsDirectly(beanClass); return (Constructor<T>[]) CONSTRUCTORS_CACHE.put(beanClass, constructors); }
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; } constructors = getConstructorsDirectly(beanClass); return (Constructor<T>[]) CONSTRUCTORS_CACHE.put(beanClass, constructors); }
[ "@", "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 { columnVectors = OnHeapColumnVector.allocateColumns(capacity, schema); } int n = 0; while (row.hasNext()) { Row r = row.next(); for (int i = 0; i < schema.fields().length; i++) { appendValue(columnVectors[i], schema.fields()[i].dataType(), r, i); } n++; } ColumnarBatch batch = new ColumnarBatch(columnVectors); batch.setNumRows(n); return batch; }
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 { columnVectors = OnHeapColumnVector.allocateColumns(capacity, schema); } int n = 0; while (row.hasNext()) { Row r = row.next(); for (int i = 0; i < schema.fields().length; i++) { appendValue(columnVectors[i], schema.fields()[i].dataType(), r, i); } n++; } ColumnarBatch batch = new ColumnarBatch(columnVectors); batch.setNumRows(n); return batch; }
[ "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, this.keys, field, order); sg.customPartitioner = getCustomPartitioner(); return sg; }
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, this.keys, field, order); sg.customPartitioner = getCustomPartitioner(); return sg; }
[ "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 field on which the group is sorted. @param order The Order in which the specified Tuple field is sorted. @return A SortedGrouping with specified order of group element. @see org.apache.flink.api.java.tuple.Tuple @see Order
[ "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 (finishedBlockingPartitions == null) { finishedBlockingPartitions = new LinkedList<IntermediateResultPartition>(); } finishedBlockingPartitions.add(partition); } } if (finishedBlockingPartitions == null) { return Collections.emptyList(); } else { return finishedBlockingPartitions; } }
java
List<IntermediateResultPartition> finishAllBlockingPartitions() { List<IntermediateResultPartition> finishedBlockingPartitions = null; for (IntermediateResultPartition partition : resultPartitions.values()) { if (partition.getResultType().isBlocking() && partition.markFinished()) { if (finishedBlockingPartitions == null) { finishedBlockingPartitions = new LinkedList<IntermediateResultPartition>(); } finishedBlockingPartitions.add(partition); } } if (finishedBlockingPartitions == null) { return Collections.emptyList(); } else { return finishedBlockingPartitions; } }
[ "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(configuration)); }
java
public static ActorSystem startActorSystem( Configuration configuration, String listeningAddress, String portRangeDefinition, Logger logger) throws Exception { return startActorSystem( configuration, listeningAddress, portRangeDefinition, logger, ForkJoinExecutorConfiguration.fromConfiguration(configuration)); }
[ "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 which has been started @throws Exception Thrown when actor system cannot be started in specified port range
[ "Starts", "an", "ActorSystem", "with", "the", "given", "configuration", "listening", "at", "the", "address", "/", "ports", "." ]
b62db93bf63cb3bb34dd03d611a779d9e3fc61ac
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/clusterframework/BootstrapTools.java#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 = canalInstance.getMetaManager().hasSubscribe(clientIdentity); if (!hasSubscribe) { return; } synchronized (canalInstance) { // 清除batch信息 canalInstance.getMetaManager().clearAllBatchs(clientIdentity); // rollback eventStore中的状态信息 canalInstance.getEventStore().rollback(); logger.info("rollback successfully, clientId:{}", new Object[] { clientIdentity.getClientId() }); } }
java
@Override public void rollback(ClientIdentity clientIdentity) throws CanalServerException { checkStart(clientIdentity.getDestination()); CanalInstance canalInstance = canalInstances.get(clientIdentity.getDestination()); // 因为存在第一次链接时自动rollback的情况,所以需要忽略未订阅 boolean hasSubscribe = canalInstance.getMetaManager().hasSubscribe(clientIdentity); if (!hasSubscribe) { return; } synchronized (canalInstance) { // 清除batch信息 canalInstance.getMetaManager().clearAllBatchs(clientIdentity); // rollback eventStore中的状态信息 canalInstance.getEventStore().rollback(); logger.info("rollback successfully, clientId:{}", new Object[] { clientIdentity.getClientId() }); } }
[ "@", "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; } this.hasNewDdl = false; schemaDdls = memoryTableMeta.snapshot(); } finally { lock.readLock().unlock(); } MemoryTableMeta tmpMemoryTableMeta = new MemoryTableMeta(); for (Map.Entry<String, String> entry : schemaDdls.entrySet()) { tmpMemoryTableMeta.apply(position, entry.getKey(), entry.getValue(), null); } // 基于临时内存对象进行对比 boolean compareAll = true; for (Schema schema : tmpMemoryTableMeta.getRepository().getSchemas()) { for (String table : schema.showTables()) { String fullName = schema + "." + table; if (blackFilter == null || !blackFilter.filter(fullName)) { if (filter == null || filter.filter(fullName)) { // issue : https://github.com/alibaba/canal/issues/1168 // 在生成snapshot时重新过滤一遍 if (!compareTableMetaDbAndMemory(connection, tmpMemoryTableMeta, schema.getName(), table)) { compareAll = false; } } } } } if (compareAll) { Map<String, String> content = new HashMap<String, String>(); content.put("destination", destination); content.put("binlogFile", position.getJournalName()); content.put("binlogOffest", String.valueOf(position.getPosition())); content.put("binlogMasterId", String.valueOf(position.getServerId())); content.put("binlogTimestamp", String.valueOf(position.getTimestamp())); content.put("data", JSON.toJSONString(schemaDdls)); if (content.isEmpty()) { throw new RuntimeException("apply failed caused by content is empty in applySnapshotToDB"); } MetaSnapshotDO snapshotDO = new MetaSnapshotDO(); try { BeanUtils.populate(snapshotDO, content); metaSnapshotDAO.insert(snapshotDO); } catch (Throwable e) { if (isUkDuplicateException(e)) { // 忽略掉重复的位点 logger.info("dup apply snapshot use position : " + position + " , just ignore"); } else { throw new CanalParseException("apply failed caused by : " + e.getMessage(), e); } } return true; } else { logger.error("compare failed , check log"); } 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; } this.hasNewDdl = false; schemaDdls = memoryTableMeta.snapshot(); } finally { lock.readLock().unlock(); } MemoryTableMeta tmpMemoryTableMeta = new MemoryTableMeta(); for (Map.Entry<String, String> entry : schemaDdls.entrySet()) { tmpMemoryTableMeta.apply(position, entry.getKey(), entry.getValue(), null); } // 基于临时内存对象进行对比 boolean compareAll = true; for (Schema schema : tmpMemoryTableMeta.getRepository().getSchemas()) { for (String table : schema.showTables()) { String fullName = schema + "." + table; if (blackFilter == null || !blackFilter.filter(fullName)) { if (filter == null || filter.filter(fullName)) { // issue : https://github.com/alibaba/canal/issues/1168 // 在生成snapshot时重新过滤一遍 if (!compareTableMetaDbAndMemory(connection, tmpMemoryTableMeta, schema.getName(), table)) { compareAll = false; } } } } } if (compareAll) { Map<String, String> content = new HashMap<String, String>(); content.put("destination", destination); content.put("binlogFile", position.getJournalName()); content.put("binlogOffest", String.valueOf(position.getPosition())); content.put("binlogMasterId", String.valueOf(position.getServerId())); content.put("binlogTimestamp", String.valueOf(position.getTimestamp())); content.put("data", JSON.toJSONString(schemaDdls)); if (content.isEmpty()) { throw new RuntimeException("apply failed caused by content is empty in applySnapshotToDB"); } MetaSnapshotDO snapshotDO = new MetaSnapshotDO(); try { BeanUtils.populate(snapshotDO, content); metaSnapshotDAO.insert(snapshotDO); } catch (Throwable e) { if (isUkDuplicateException(e)) { // 忽略掉重复的位点 logger.info("dup apply snapshot use position : " + position + " , just ignore"); } else { throw new CanalParseException("apply failed caused by : " + e.getMessage(), e); } } return true; } else { logger.error("compare failed , check log"); } 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 BufferedReader(fr); String line; while ((line = br.readLine()) != null) { if (localDomain == null && line.startsWith(DOMAIN_ROW_LABEL)) { int i = indexOfNonWhiteSpace(line, DOMAIN_ROW_LABEL.length()); if (i >= 0) { localDomain = line.substring(i); } } else if (line.startsWith(SEARCH_ROW_LABEL)) { int i = indexOfNonWhiteSpace(line, SEARCH_ROW_LABEL.length()); if (i >= 0) { // May contain more then one entry, either seperated by whitespace or tab. // See https://linux.die.net/man/5/resolver String[] domains = SEARCH_DOMAIN_PATTERN.split(line.substring(i)); Collections.addAll(searchDomains, domains); } } } } finally { if (br == null) { fr.close(); } else { br.close(); } } // return what was on the 'domain' line only if there were no 'search' lines return localDomain != null && searchDomains.isEmpty() ? Collections.singletonList(localDomain) : searchDomains; }
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 BufferedReader(fr); String line; while ((line = br.readLine()) != null) { if (localDomain == null && line.startsWith(DOMAIN_ROW_LABEL)) { int i = indexOfNonWhiteSpace(line, DOMAIN_ROW_LABEL.length()); if (i >= 0) { localDomain = line.substring(i); } } else if (line.startsWith(SEARCH_ROW_LABEL)) { int i = indexOfNonWhiteSpace(line, SEARCH_ROW_LABEL.length()); if (i >= 0) { // May contain more then one entry, either seperated by whitespace or tab. // See https://linux.die.net/man/5/resolver String[] domains = SEARCH_DOMAIN_PATTERN.split(line.substring(i)); Collections.addAll(searchDomains, domains); } } } } finally { if (br == null) { fr.close(); } else { br.close(); } } // return what was on the 'domain' line only if there were no 'search' lines return localDomain != null && searchDomains.isEmpty() ? Collections.singletonList(localDomain) : searchDomains; }
[ "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. @throws IOException If a failure occurs parsing the file.
[ "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.info("Trying to get topic metadata from broker {} in try {}/{}", seedBrokerAddresses[currentContactSeedBrokerIndex], retry, numRetries); try { // clear in case we have an incomplete list from previous tries partitions.clear(); for (TopicMetadata item : consumer.send(new TopicMetadataRequest(topics)).topicsMetadata()) { if (item.errorCode() != ErrorMapping.NoError()) { // warn and try more brokers LOG.warn("Error while getting metadata from broker {} to find partitions for {}. Error: {}.", seedBrokerAddresses[currentContactSeedBrokerIndex], topics.toString(), ErrorMapping.exceptionFor(item.errorCode()).getMessage()); useNextAddressAsNewContactSeedBroker(); continue brokersLoop; } if (!topics.contains(item.topic())) { LOG.warn("Received metadata from topic " + item.topic() + " even though it was not requested. Skipping ..."); useNextAddressAsNewContactSeedBroker(); continue brokersLoop; } for (PartitionMetadata part : item.partitionsMetadata()) { Node leader = brokerToNode(part.leader()); KafkaTopicPartition ktp = new KafkaTopicPartition(item.topic(), part.partitionId()); KafkaTopicPartitionLeader pInfo = new KafkaTopicPartitionLeader(ktp, leader); partitions.add(pInfo); } } break retryLoop; // leave the loop through the brokers } catch (Exception e) { //validates seed brokers in case of a ClosedChannelException validateSeedBrokers(seedBrokerAddresses, e); LOG.warn("Error communicating with broker {} to find partitions for {}. {} Message: {}", seedBrokerAddresses[currentContactSeedBrokerIndex], topics, e.getClass().getName(), e.getMessage()); LOG.debug("Detailed trace", e); // we sleep a bit. Retrying immediately doesn't make sense in cases where Kafka is reorganizing the leader metadata try { Thread.sleep(500); } catch (InterruptedException e1) { // sleep shorter. } useNextAddressAsNewContactSeedBroker(); } } // brokers loop } // retries loop return partitions; }
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.info("Trying to get topic metadata from broker {} in try {}/{}", seedBrokerAddresses[currentContactSeedBrokerIndex], retry, numRetries); try { // clear in case we have an incomplete list from previous tries partitions.clear(); for (TopicMetadata item : consumer.send(new TopicMetadataRequest(topics)).topicsMetadata()) { if (item.errorCode() != ErrorMapping.NoError()) { // warn and try more brokers LOG.warn("Error while getting metadata from broker {} to find partitions for {}. Error: {}.", seedBrokerAddresses[currentContactSeedBrokerIndex], topics.toString(), ErrorMapping.exceptionFor(item.errorCode()).getMessage()); useNextAddressAsNewContactSeedBroker(); continue brokersLoop; } if (!topics.contains(item.topic())) { LOG.warn("Received metadata from topic " + item.topic() + " even though it was not requested. Skipping ..."); useNextAddressAsNewContactSeedBroker(); continue brokersLoop; } for (PartitionMetadata part : item.partitionsMetadata()) { Node leader = brokerToNode(part.leader()); KafkaTopicPartition ktp = new KafkaTopicPartition(item.topic(), part.partitionId()); KafkaTopicPartitionLeader pInfo = new KafkaTopicPartitionLeader(ktp, leader); partitions.add(pInfo); } } break retryLoop; // leave the loop through the brokers } catch (Exception e) { //validates seed brokers in case of a ClosedChannelException validateSeedBrokers(seedBrokerAddresses, e); LOG.warn("Error communicating with broker {} to find partitions for {}. {} Message: {}", seedBrokerAddresses[currentContactSeedBrokerIndex], topics, e.getClass().getName(), e.getMessage()); LOG.debug("Detailed trace", e); // we sleep a bit. Retrying immediately doesn't make sense in cases where Kafka is reorganizing the leader metadata try { Thread.sleep(500); } catch (InterruptedException e1) { // sleep shorter. } useNextAddressAsNewContactSeedBroker(); } } // brokers loop } // retries loop return partitions; }
[ "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, new ClusterNodeAccessStrategy(destination, ZkClientx.getZkClient(zkServers))); canalConnector.setSoTimeout(60 * 1000); canalConnector.setIdleTimeout(60 * 60 * 1000); return canalConnector; }
java
public static CanalConnector newClusterConnector(String zkServers, String destination, String username, String password) { ClusterCanalConnector canalConnector = new ClusterCanalConnector(username, password, destination, new ClusterNodeAccessStrategy(destination, ZkClientx.getZkClient(zkServers))); canalConnector.setSoTimeout(60 * 1000); canalConnector.setIdleTimeout(60 * 60 * 1000); return canalConnector; }
[ "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); } Element conf = doc.createElement("configuration"); doc.appendChild(conf); conf.appendChild(doc.createTextNode("\n")); handleDeprecation(); //ensure properties is set and deprecation is handled if(!Strings.isNullOrEmpty(propertyName)) { if (!properties.containsKey(propertyName)) { // given property not found, illegal argument throw new IllegalArgumentException("Property " + propertyName + " not found"); } else { // given property is found, write single property appendXMLProperty(doc, conf, propertyName); conf.appendChild(doc.createTextNode("\n")); } } else { // append all elements for (Enumeration<Object> e = properties.keys(); e.hasMoreElements();) { appendXMLProperty(doc, conf, (String)e.nextElement()); conf.appendChild(doc.createTextNode("\n")); } } return doc; }
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); } Element conf = doc.createElement("configuration"); doc.appendChild(conf); conf.appendChild(doc.createTextNode("\n")); handleDeprecation(); //ensure properties is set and deprecation is handled if(!Strings.isNullOrEmpty(propertyName)) { if (!properties.containsKey(propertyName)) { // given property not found, illegal argument throw new IllegalArgumentException("Property " + propertyName + " not found"); } else { // given property is found, write single property appendXMLProperty(doc, conf, propertyName); conf.appendChild(doc.createTextNode("\n")); } } else { // append all elements for (Enumeration<Object> e = properties.keys(); e.hasMoreElements();) { appendXMLProperty(doc, conf, (String)e.nextElement()); conf.appendChild(doc.createTextNode("\n")); } } return doc; }
[ "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 for (int i = bodyListHttpDataRank; i < bodyListHttpData.size(); i++) { bodyListHttpData.get(i).release(); } }
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 for (int i = bodyListHttpDataRank; i < bodyListHttpData.size(); i++) { bodyListHttpData.get(i).release(); } }
[ "@", "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 { String elementText = driver.findElement(locator).getAttribute("value"); if (elementText != null) { return elementText.contains(text); } return false; } catch (StaleElementReferenceException e) { return null; } } @Override public String toString() { return String.format("text ('%s') to be the value of element located by %s", text, locator); } }; }
java
public static ExpectedCondition<Boolean> textToBePresentInElementValue(final By locator, final String text) { return new ExpectedCondition<Boolean>() { @Override public Boolean apply(WebDriver driver) { try { String elementText = driver.findElement(locator).getAttribute("value"); if (elementText != null) { return elementText.contains(text); } return false; } catch (StaleElementReferenceException e) { return null; } } @Override public String toString() { return String.format("text ('%s') to be the value of element located by %s", text, locator); } }; }
[ "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 given text
[ "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 as the offset clockwise from the start index return (startIndex + partition.getPartition()) % numParallelSubtasks; }
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 as the offset clockwise from the start index return (startIndex + partition.getPartition()) % numParallelSubtasks; }
[ "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. ascending subtask indices) by using the partition id as the offset from a starting index (i.e., the index of the subtask which partition 0 of the topic will be assigned to, determined using the topic name).</li> </ul> <p>The above contract is crucial and cannot be broken. Consumer subtasks rely on this contract to locally filter out partitions that it should not subscribe to, guaranteeing that all partitions of a single topic will always be assigned to some subtask in a uniformly distributed manner. @param partition the Kafka partition @param numParallelSubtasks total number of parallel subtasks @return index of the target subtask that the Kafka partition should be assigned to.
[ "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); } } return resultMap; }
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); } } return resultMap; }
[ "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, EV>>) (Class<? extends Edge>) Edge.class; TypeInformation<OLD> oldType = ((TupleTypeInfo<Edge<OLD, EV>>) edges.getType()).getTypeAt(0); TypeInformation<NEW> newType = TypeExtractor.getUnaryOperatorReturnType( translator, TranslateFunction.class, 0, 1, new int[] {1}, oldType, null, false); TypeInformation<EV> edgeValueType = ((TupleTypeInfo<Edge<OLD, EV>>) edges.getType()).getTypeAt(2); TupleTypeInfo<Edge<NEW, EV>> returnType = new TupleTypeInfo<>(edgeClass, newType, newType, edgeValueType); return edges .map(new TranslateEdgeId<>(translator)) .returns(returnType) .setParallelism(parallelism) .name("Translate edge IDs"); }
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, EV>>) (Class<? extends Edge>) Edge.class; TypeInformation<OLD> oldType = ((TupleTypeInfo<Edge<OLD, EV>>) edges.getType()).getTypeAt(0); TypeInformation<NEW> newType = TypeExtractor.getUnaryOperatorReturnType( translator, TranslateFunction.class, 0, 1, new int[] {1}, oldType, null, false); TypeInformation<EV> edgeValueType = ((TupleTypeInfo<Edge<OLD, EV>>) edges.getType()).getTypeAt(2); TupleTypeInfo<Edge<NEW, EV>> returnType = new TupleTypeInfo<>(edgeClass, newType, newType, edgeValueType); return edges .map(new TranslateEdgeId<>(translator)) .returns(returnType) .setParallelism(parallelism) .name("Translate edge IDs"); }
[ "@", "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<?>, TypeSerializerSnapshot<?>> registeredSubclassSerializerSnapshots, LinkedOptionalMap<Class<?>, TypeSerializerSnapshot<?>> nonRegisteredSubclassSerializerSnapshots) { return newPojoHasDifferentSubclassRegistrationOrder(registeredSubclassSerializerSnapshots, newPojoSerializer) || previousSerializerHasNonRegisteredSubclasses(nonRegisteredSubclassSerializerSnapshots) || fieldSerializerCompatibility.isCompatibleWithReconfiguredSerializer() || preExistingRegistrationsCompatibility.isCompatibleWithReconfiguredSerializer(); }
java
private static <T> boolean newPojoSerializerIsCompatibleWithReconfiguredSerializer( PojoSerializer<T> newPojoSerializer, IntermediateCompatibilityResult<T> fieldSerializerCompatibility, IntermediateCompatibilityResult<T> preExistingRegistrationsCompatibility, LinkedOptionalMap<Class<?>, TypeSerializerSnapshot<?>> registeredSubclassSerializerSnapshots, LinkedOptionalMap<Class<?>, TypeSerializerSnapshot<?>> nonRegisteredSubclassSerializerSnapshots) { return newPojoHasDifferentSubclassRegistrationOrder(registeredSubclassSerializerSnapshots, newPojoSerializer) || previousSerializerHasNonRegisteredSubclasses(nonRegisteredSubclassSerializerSnapshots) || fieldSerializerCompatibility.isCompatibleWithReconfiguredSerializer() || preExistingRegistrationsCompatibility.isCompatibleWithReconfiguredSerializer(); }
[ "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 Class<?> lhsClass = lhs.getClass(); if (!lhsClass.isArray()) { // The simple case, not an array, just test the element isEquals = lhs.equals(rhs); } else if (lhs.getClass() != rhs.getClass()) { // Here when we compare different dimensions, for example: a boolean[][] to a boolean[] this.setEquals(false); } // 'Switch' on type of array, to dispatch to the correct handler // This handles multi dimensional arrays of the same depth else if (lhs instanceof long[]) { append((long[]) lhs, (long[]) rhs); }
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 Class<?> lhsClass = lhs.getClass(); if (!lhsClass.isArray()) { // The simple case, not an array, just test the element isEquals = lhs.equals(rhs); } else if (lhs.getClass() != rhs.getClass()) { // Here when we compare different dimensions, for example: a boolean[][] to a boolean[] this.setEquals(false); } // 'Switch' on type of array, to dispatch to the correct handler // This handles multi dimensional arrays of the same depth else if (lhs instanceof long[]) { append((long[]) lhs, (long[]) rhs); }
[ "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", " &gt; 1"),value也可以传Condition对象,key被忽略 @param <T> 需要处理成的结果对象类型 @param where 条件实体类(包含表名) @param rsh 结果集处理对象 @param fields 字段列表,可变长参数如果无值表示查询全部字段 @return 结果对象 @throws SQLException SQL执行异常
[ "查询,返回所有字段<br", ">", "查询条件为多个key", "value对表示,默认key", "=", "value,如果使用其它条件可以使用:where", ".", "put", "(", "key", "&gt", ";", "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 IllegalStateException(); }
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 IllegalStateException(); }
[ "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 array; }
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 array; }
[ "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 (record instanceof SSTRecord) { // 静态字符串表 sstRecord = (SSTRecord) record; } else if (record instanceof BOFRecord) { BOFRecord bofRecord = (BOFRecord) record; if (bofRecord.getType() == BOFRecord.TYPE_WORKSHEET) { // 如果有需要,则建立子工作薄 if (workbookBuildingListener != null && stubWorkbook == null) { stubWorkbook = workbookBuildingListener.getStubHSSFWorkbook(); } curSheetIndex++; } } else if (isProcessCurrentSheet()) { if (record instanceof MissingCellDummyRecord) { // 空值的操作 MissingCellDummyRecord mc = (MissingCellDummyRecord) record; rowCellList.add(mc.getColumn(), StrUtil.EMPTY); } else if (record instanceof LastCellOfRowDummyRecord) { // 行结束 processLastCell((LastCellOfRowDummyRecord) record); } else { // 处理单元格值 processCellValue(record); } } }
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 (record instanceof SSTRecord) { // 静态字符串表 sstRecord = (SSTRecord) record; } else if (record instanceof BOFRecord) { BOFRecord bofRecord = (BOFRecord) record; if (bofRecord.getType() == BOFRecord.TYPE_WORKSHEET) { // 如果有需要,则建立子工作薄 if (workbookBuildingListener != null && stubWorkbook == null) { stubWorkbook = workbookBuildingListener.getStubHSSFWorkbook(); } curSheetIndex++; } } else if (isProcessCurrentSheet()) { if (record instanceof MissingCellDummyRecord) { // 空值的操作 MissingCellDummyRecord mc = (MissingCellDummyRecord) record; rowCellList.add(mc.getColumn(), StrUtil.EMPTY); } else if (record instanceof LastCellOfRowDummyRecord) { // 行结束 processLastCell((LastCellOfRowDummyRecord) record); } else { // 处理单元格值 processCellValue(record); } } }
[ "@", "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) { result = result.subtract(new BigDecimal(value.toString())); } } return result; }
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) { result = result.subtract(new BigDecimal(value.toString())); } } return result; }
[ "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().<AddressedEnvelope<? extends DnsResponse, InetSocketAddress>>newPromise()); }
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().<AddressedEnvelope<? extends DnsResponse, InetSocketAddress>>newPromise()); }
[ "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; int last = lastDay(y0, m0); if (d0 > last) { d0 = 1; if (++m0 > 12) { m0 = 1; ++y0; } } return DateTimeUtils.ymdToUnixDate(y0, m0, d0); }
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; int last = lastDay(y0, m0); if (d0 > last) { d0 = 1; if (++m0 > 12) { m0 = 1; ++y0; } } return DateTimeUtils.ymdToUnixDate(y0, m0, d0); }
[ "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, EstablishedConnection> conn : establishedConnections.entrySet()) { if (establishedConnections.remove(conn.getKey(), conn.getValue())) { connectionFutures.add(conn.getValue().close()); } } for (Map.Entry<InetSocketAddress, PendingConnection> conn : pendingConnections.entrySet()) { if (pendingConnections.remove(conn.getKey()) != null) { connectionFutures.add(conn.getValue().close()); } } CompletableFuture.allOf( connectionFutures.toArray(new CompletableFuture<?>[connectionFutures.size()]) ).whenComplete((result, throwable) -> { if (throwable != null) { LOG.warn("Problem while shutting down the connections at the {}: {}", clientName, throwable); } if (bootstrap != null) { EventLoopGroup group = bootstrap.group(); if (group != null && !group.isShutdown()) { group.shutdownGracefully(0L, 0L, TimeUnit.MILLISECONDS) .addListener(finished -> { if (finished.isSuccess()) { newShutdownFuture.complete(null); } else { newShutdownFuture.completeExceptionally(finished.cause()); } }); } else { newShutdownFuture.complete(null); } } else { newShutdownFuture.complete(null); } }); return newShutdownFuture; } return clientShutdownFuture.get(); }
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, EstablishedConnection> conn : establishedConnections.entrySet()) { if (establishedConnections.remove(conn.getKey(), conn.getValue())) { connectionFutures.add(conn.getValue().close()); } } for (Map.Entry<InetSocketAddress, PendingConnection> conn : pendingConnections.entrySet()) { if (pendingConnections.remove(conn.getKey()) != null) { connectionFutures.add(conn.getValue().close()); } } CompletableFuture.allOf( connectionFutures.toArray(new CompletableFuture<?>[connectionFutures.size()]) ).whenComplete((result, throwable) -> { if (throwable != null) { LOG.warn("Problem while shutting down the connections at the {}: {}", clientName, throwable); } if (bootstrap != null) { EventLoopGroup group = bootstrap.group(); if (group != null && !group.isShutdown()) { group.shutdownGracefully(0L, 0L, TimeUnit.MILLISECONDS) .addListener(finished -> { if (finished.isSuccess()) { newShutdownFuture.complete(null); } else { newShutdownFuture.completeExceptionally(finished.cause()); } }); } else { newShutdownFuture.complete(null); } } else { newShutdownFuture.complete(null); } }); return newShutdownFuture; } return clientShutdownFuture.get(); }
[ "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 != null) { LOG.debug("Fetching metrics failed.", t); } else { metrics.addAll(deserializer.deserialize(result)); } }, executor); }
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 != null) { LOG.debug("Fetching metrics failed.", t); } else { metrics.addAll(deserializer.deserialize(result)); } }, executor); }
[ "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) { return (SafariOptions) cap; } else if (cap instanceof Map) { return new SafariOptions(new MutableCapabilities(((Map<String, ?>) cap))); } else { return new 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) { return (SafariOptions) cap; } else if (cap instanceof Map) { return new SafariOptions(new MutableCapabilities(((Map<String, ?>) cap))); } else { return new 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 reconstruction of the options
[ "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( "Checkpointing is currently not supported by default for iterative jobs, as we cannot guarantee exactly once semantics. " + "State checkpoints happen normally, but records in-transit during the snapshot will be lost upon failure. " + "\nThe user can force enable state checkpoints with the reduced guarantees by calling: env.enableCheckpointing(interval,true)"); } return StreamingJobGraphGenerator.createJobGraph(this, jobID); }
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( "Checkpointing is currently not supported by default for iterative jobs, as we cannot guarantee exactly once semantics. " + "State checkpoints happen normally, but records in-transit during the snapshot will be lost upon failure. " + "\nThe user can force enable state checkpoints with the reduced guarantees by calling: env.enableCheckpointing(interval,true)"); } return StreamingJobGraphGenerator.createJobGraph(this, jobID); }
[ "@", "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.getDestination() + "." + dml.getDatabase() + "." + dml.getTable()); return false; } else { // DML String destination = StringUtils.trimToEmpty(dml.getDestination()); String groupId = StringUtils.trimToEmpty(dml.getGroupId()); String database = dml.getDatabase(); String table = dml.getTable(); Map<String, MappingConfig> configMap; if (envProperties != null && !"tcp".equalsIgnoreCase(envProperties.getProperty("canal.conf.mode"))) { configMap = mappingConfig.get(destination + "-" + groupId + "_" + database + "-" + table); } else { configMap = mappingConfig.get(destination + "_" + database + "-" + table); } if (configMap == null) { return false; } if (configMap.values().isEmpty()) { return false; } for (MappingConfig config : configMap.values()) { if (config.getConcurrent()) { List<SingleDml> singleDmls = SingleDml.dml2SingleDmls(dml); singleDmls.forEach(singleDml -> { int hash = pkHash(config.getDbMapping(), singleDml.getData()); SyncItem syncItem = new SyncItem(config, singleDml); dmlsPartition[hash].add(syncItem); }); } else { int hash = 0; List<SingleDml> singleDmls = SingleDml.dml2SingleDmls(dml); singleDmls.forEach(singleDml -> { SyncItem syncItem = new SyncItem(config, singleDml); dmlsPartition[hash].add(syncItem); }); } } return true; } } ); }
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.getDestination() + "." + dml.getDatabase() + "." + dml.getTable()); return false; } else { // DML String destination = StringUtils.trimToEmpty(dml.getDestination()); String groupId = StringUtils.trimToEmpty(dml.getGroupId()); String database = dml.getDatabase(); String table = dml.getTable(); Map<String, MappingConfig> configMap; if (envProperties != null && !"tcp".equalsIgnoreCase(envProperties.getProperty("canal.conf.mode"))) { configMap = mappingConfig.get(destination + "-" + groupId + "_" + database + "-" + table); } else { configMap = mappingConfig.get(destination + "_" + database + "-" + table); } if (configMap == null) { return false; } if (configMap.values().isEmpty()) { return false; } for (MappingConfig config : configMap.values()) { if (config.getConcurrent()) { List<SingleDml> singleDmls = SingleDml.dml2SingleDmls(dml); singleDmls.forEach(singleDml -> { int hash = pkHash(config.getDbMapping(), singleDml.getData()); SyncItem syncItem = new SyncItem(config, singleDml); dmlsPartition[hash].add(syncItem); }); } else { int hash = 0; List<SingleDml> singleDmls = SingleDml.dml2SingleDmls(dml); singleDmls.forEach(singleDml -> { SyncItem syncItem = new SyncItem(config, singleDml); dmlsPartition[hash].add(syncItem); }); } } return true; } } ); }
[ "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 Environment
[ "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 distance from min to max declared as // // dist = max - min // // satisfies the following // // min + dist = max // // taking into account // // 0 <= fraction * dist <= dist // // we've got // // min <= min + fraction * dist <= max return (int) (minimum + fraction * (maximum - minimum)); }
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 distance from min to max declared as // // dist = max - min // // satisfies the following // // min + dist = max // // taking into account // // 0 <= fraction * dist <= dist // // we've got // // min <= min + fraction * dist <= max return (int) (minimum + fraction * (maximum - minimum)); }
[ "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) { charset = Charset.forName(dataBoundary[1]); } } else { multipartDataBoundary = null; } currentStatus = MultiPartStatus.HEADERDELIMITER; }
java
private void setMultipart(String contentType) { String[] dataBoundary = HttpPostRequestDecoder.getMultipartDataBoundary(contentType); if (dataBoundary != null) { multipartDataBoundary = dataBoundary[0]; if (dataBoundary.length > 1 && dataBoundary[1] != null) { charset = Charset.forName(dataBoundary[1]); } } else { multipartDataBoundary = null; } currentStatus = MultiPartStatus.HEADERDELIMITER; }
[ "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(proxyAddress) .append(" => ") .append(destinationAddress); if (!msg.isEmpty()) { buf.append(", ").append(msg); } return buf.toString(); }
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(proxyAddress) .append(" => ") .append(destinationAddress); if (!msg.isEmpty()) { buf.append(", ").append(msg); } return buf.toString(); }
[ "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.split(sentence_separator)) // [,,。::“”??!!;;] { sent = sent.trim(); if (sent.length() == 0) continue; sentences.add(sent); } } return sentences; }
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.split(sentence_separator)) // [,,。::“”??!!;;] { sent = sent.trim(); if (sent.length() == 0) continue; sentences.add(sent); } } return sentences; }
[ "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 stream
[ "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), it suffices to know that the byte order in which the value is written is the same as the one in which it is read, and {@link #putShort(int, short)} is the preferable choice. @param index The position at which the value will be written. @param value The short value to be written. @throws IndexOutOfBoundsException Thrown, if the index is negative, or larger than the segment size minus 2.
[ "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 new IllegalArgumentException("Can't parse more than 64 chars," + "looks like a user error or a malformed header"); } return formatter().parse0(checkNotNull(txt, "txt"), start, end); }
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 new IllegalArgumentException("Can't parse more than 64 chars," + "looks like a user error or a malformed header"); } return formatter().parse0(checkNotNull(txt, "txt"), start, end); }
[ "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(), t); } }
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(), t); } }
[ "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 parameters The parameters supplied to the user code. @throws Exception Thrown, if the user code's open method produces an exception.
[ "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 _transition path of the substring of prevStr from this point will need to be submitted for minimization processing. //The substring before this point, however, does not, since currStr will simply be extending the right languages of the //nodes on its _transition path. int shortestStringLength = Math.min(prevStr.length(), currStr.length()); for (mpsIndex = 0; mpsIndex < shortestStringLength && prevStr.charAt(mpsIndex) == currStr.charAt(mpsIndex); mpsIndex++) { } ; ///// } else mpsIndex = -1; //If the prevStr is a prefix of currStr, then currStr simply extends the right language of the _transition path of prevStr. return mpsIndex; }
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 _transition path of the substring of prevStr from this point will need to be submitted for minimization processing. //The substring before this point, however, does not, since currStr will simply be extending the right languages of the //nodes on its _transition path. int shortestStringLength = Math.min(prevStr.length(), currStr.length()); for (mpsIndex = 0; mpsIndex < shortestStringLength && prevStr.charAt(mpsIndex) == currStr.charAt(mpsIndex); mpsIndex++) { } ; ///// } else mpsIndex = -1; //If the prevStr is a prefix of currStr, then currStr simply extends the right language of the _transition path of prevStr. return mpsIndex; }
[ "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 starts the substring corresponding to the _transition path that doesn't have its right language extended by {@code currStr}. The _transition path of the substring before this point is not considered for minimization in order to limit the amount of times the equivalence classes of its nodes will need to be reassigned during the processing of Strings which share prefixes. @param prevStr the String most recently added to the MDAG @param currStr the String next to be added to the MDAG @return an int of the index in {@code prevStr} that starts the substring corresponding to the _transition path next up for minimization processing
[ "计算最小化的执行位置,其实是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."); } if (this.keySerializer != null || this.namespaceSerializer != null || this.triggerTarget != null) { throw new IllegalStateException("The TimerService has already been initialized."); } // the following is the case where we restore if (restoredTimersSnapshot != null) { TypeSerializerSchemaCompatibility<K> keySerializerCompatibility = restoredTimersSnapshot.getKeySerializerSnapshot().resolveSchemaCompatibility(keySerializer); if (keySerializerCompatibility.isIncompatible() || keySerializerCompatibility.isCompatibleAfterMigration()) { throw new IllegalStateException( "Tried to initialize restored TimerService with new key serializer that requires migration or is incompatible."); } TypeSerializerSchemaCompatibility<N> namespaceSerializerCompatibility = restoredTimersSnapshot.getNamespaceSerializerSnapshot().resolveSchemaCompatibility(namespaceSerializer); if (namespaceSerializerCompatibility.isIncompatible() || namespaceSerializerCompatibility.isCompatibleAfterMigration()) { throw new IllegalStateException( "Tried to initialize restored TimerService with new namespace serializer that requires migration or is incompatible."); } this.keySerializer = keySerializerCompatibility.isCompatibleAsIs() ? keySerializer : keySerializerCompatibility.getReconfiguredSerializer(); this.namespaceSerializer = namespaceSerializerCompatibility.isCompatibleAsIs() ? namespaceSerializer : namespaceSerializerCompatibility.getReconfiguredSerializer(); } else { this.keySerializer = keySerializer; this.namespaceSerializer = namespaceSerializer; } this.keyDeserializer = null; this.namespaceDeserializer = null; this.triggerTarget = Preconditions.checkNotNull(triggerTarget); // re-register the restored timers (if any) final InternalTimer<K, N> headTimer = processingTimeTimersQueue.peek(); if (headTimer != null) { nextTimer = processingTimeService.registerTimer(headTimer.getTimestamp(), this); } this.isInitialized = true; } else { if (!(this.keySerializer.equals(keySerializer) && this.namespaceSerializer.equals(namespaceSerializer))) { throw new IllegalArgumentException("Already initialized Timer Service " + "tried to be initialized with different key and namespace serializers."); } } }
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."); } if (this.keySerializer != null || this.namespaceSerializer != null || this.triggerTarget != null) { throw new IllegalStateException("The TimerService has already been initialized."); } // the following is the case where we restore if (restoredTimersSnapshot != null) { TypeSerializerSchemaCompatibility<K> keySerializerCompatibility = restoredTimersSnapshot.getKeySerializerSnapshot().resolveSchemaCompatibility(keySerializer); if (keySerializerCompatibility.isIncompatible() || keySerializerCompatibility.isCompatibleAfterMigration()) { throw new IllegalStateException( "Tried to initialize restored TimerService with new key serializer that requires migration or is incompatible."); } TypeSerializerSchemaCompatibility<N> namespaceSerializerCompatibility = restoredTimersSnapshot.getNamespaceSerializerSnapshot().resolveSchemaCompatibility(namespaceSerializer); if (namespaceSerializerCompatibility.isIncompatible() || namespaceSerializerCompatibility.isCompatibleAfterMigration()) { throw new IllegalStateException( "Tried to initialize restored TimerService with new namespace serializer that requires migration or is incompatible."); } this.keySerializer = keySerializerCompatibility.isCompatibleAsIs() ? keySerializer : keySerializerCompatibility.getReconfiguredSerializer(); this.namespaceSerializer = namespaceSerializerCompatibility.isCompatibleAsIs() ? namespaceSerializer : namespaceSerializerCompatibility.getReconfiguredSerializer(); } else { this.keySerializer = keySerializer; this.namespaceSerializer = namespaceSerializer; } this.keyDeserializer = null; this.namespaceDeserializer = null; this.triggerTarget = Preconditions.checkNotNull(triggerTarget); // re-register the restored timers (if any) final InternalTimer<K, N> headTimer = processingTimeTimersQueue.peek(); if (headTimer != null) { nextTimer = processingTimeService.registerTimer(headTimer.getTimestamp(), this); } this.isInitialized = true; } else { if (!(this.keySerializer.equals(keySerializer) && this.namespaceSerializer.equals(namespaceSerializer))) { throw new IllegalArgumentException("Already initialized Timer Service " + "tried to be initialized with different key and namespace serializers."); } } }
[ "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 after recovering from a node failure, if any.</li> </ol> This method can be called multiple times, as long as it is called with the same serializers.
[ "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.getSharedSlot(); SimpleSlot subslot = shared.allocateSubSlot(null); subslot.setLocality(Locality.LOCAL); return subslot; } else if (constraint.isAssigned()) { // we had an assignment before. SharedSlot previous = constraint.getSharedSlot(); if (previous == null) { throw new IllegalStateException("Bug: Found assigned co-location constraint without a slot."); } TaskManagerLocation location = previous.getTaskManagerLocation(); Tuple2<SharedSlot, Locality> p = getSharedSlotForTask( constraint.getGroupId(), Collections.singleton(location), true); if (p == null) { return null; } else { SharedSlot newSharedSlot = p.f0; // allocate the co-location group slot inside the shared slot SharedSlot constraintGroupSlot = newSharedSlot.allocateSharedSlot(constraint.getGroupId()); if (constraintGroupSlot != null) { constraint.setSharedSlot(constraintGroupSlot); // the sub slots in the co location constraint slot have no group that they belong to // (other than the co-location-constraint slot) SimpleSlot subSlot = constraintGroupSlot.allocateSubSlot(null); subSlot.setLocality(Locality.LOCAL); return subSlot; } else { // could not allocate the co-location-constraint shared slot return null; } } } else { // the location constraint has not been associated with a shared slot, yet. // grab a new slot and initialize the constraint with that one. // preferred locations are defined by the vertex Tuple2<SharedSlot, Locality> p = getSharedSlotForTask(constraint.getGroupId(), locationPreferences, false); if (p == null) { // could not get a shared slot for this co-location-group return null; } else { final SharedSlot availableShared = p.f0; final Locality l = p.f1; // allocate the co-location group slot inside the shared slot SharedSlot constraintGroupSlot = availableShared.allocateSharedSlot(constraint.getGroupId()); // IMPORTANT: We do not lock the location, yet, since we cannot be sure that the // caller really sticks with the slot we picked! constraint.setSharedSlot(constraintGroupSlot); // the sub slots in the co location constraint slot have no group that they belong to // (other than the co-location-constraint slot) SimpleSlot sub = constraintGroupSlot.allocateSubSlot(null); sub.setLocality(l); return sub; } } } }
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.getSharedSlot(); SimpleSlot subslot = shared.allocateSubSlot(null); subslot.setLocality(Locality.LOCAL); return subslot; } else if (constraint.isAssigned()) { // we had an assignment before. SharedSlot previous = constraint.getSharedSlot(); if (previous == null) { throw new IllegalStateException("Bug: Found assigned co-location constraint without a slot."); } TaskManagerLocation location = previous.getTaskManagerLocation(); Tuple2<SharedSlot, Locality> p = getSharedSlotForTask( constraint.getGroupId(), Collections.singleton(location), true); if (p == null) { return null; } else { SharedSlot newSharedSlot = p.f0; // allocate the co-location group slot inside the shared slot SharedSlot constraintGroupSlot = newSharedSlot.allocateSharedSlot(constraint.getGroupId()); if (constraintGroupSlot != null) { constraint.setSharedSlot(constraintGroupSlot); // the sub slots in the co location constraint slot have no group that they belong to // (other than the co-location-constraint slot) SimpleSlot subSlot = constraintGroupSlot.allocateSubSlot(null); subSlot.setLocality(Locality.LOCAL); return subSlot; } else { // could not allocate the co-location-constraint shared slot return null; } } } else { // the location constraint has not been associated with a shared slot, yet. // grab a new slot and initialize the constraint with that one. // preferred locations are defined by the vertex Tuple2<SharedSlot, Locality> p = getSharedSlotForTask(constraint.getGroupId(), locationPreferences, false); if (p == null) { // could not get a shared slot for this co-location-group return null; } else { final SharedSlot availableShared = p.f0; final Locality l = p.f1; // allocate the co-location group slot inside the shared slot SharedSlot constraintGroupSlot = availableShared.allocateSharedSlot(constraint.getGroupId()); // IMPORTANT: We do not lock the location, yet, since we cannot be sure that the // caller really sticks with the slot we picked! constraint.setSharedSlot(constraintGroupSlot); // the sub slots in the co location constraint slot have no group that they belong to // (other than the co-location-constraint slot) SimpleSlot sub = constraintGroupSlot.allocateSubSlot(null); sub.setLocality(l); return sub; } } } }
[ "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 not yet been initialized with a slot, or where that slot has been disposed in the meantime, this method tries to allocate a shared slot for the co-location constraint (inside on of the other available slots).</p> <p>If a suitable shared slot is available, this method allocates a simple slot within that shared slot and returns it. If no suitable shared slot could be found, this method returns null.</p> @param constraint The co-location constraint for the placement of the execution vertex. @param locationPreferences location preferences @return A simple slot allocate within a suitable shared slot, or {@code null}, if no suitable shared slot is available.
[ "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."); } // The second part of the condition is a workaround for the situation that can arise from eg. // "env.fromElements((),(),())" // In this situation, UnitTypeInfo.getTypeClass returns void.class (when we are in the Java world), but // the actual objects that we will be working with, will be BoxedUnits. // Note: TypeInformationGenTest.testUnit tests this condition. if (!viewedAs.isAssignableFrom(elem.getClass()) && !(elem.getClass().toString().equals("class scala.runtime.BoxedUnit") && viewedAs.equals(void.class))) { throw new IllegalArgumentException("The elements in the collection are not all subclasses of " + viewedAs.getCanonicalName()); } } }
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."); } // The second part of the condition is a workaround for the situation that can arise from eg. // "env.fromElements((),(),())" // In this situation, UnitTypeInfo.getTypeClass returns void.class (when we are in the Java world), but // the actual objects that we will be working with, will be BoxedUnits. // Note: TypeInformationGenTest.testUnit tests this condition. if (!viewedAs.isAssignableFrom(elem.getClass()) && !(elem.getClass().toString().equals("class scala.runtime.BoxedUnit") && viewedAs.equals(void.class))) { throw new IllegalArgumentException("The elements in the collection are not all subclasses of " + viewedAs.getCanonicalName()); } } }
[ "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, "Unable to fetch token keys from UAA.")); return this.uaaUrl; }
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, "Unable to fetch token keys from UAA.")); return this.uaaUrl; }
[ "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; @SuppressWarnings("unchecked") O returnType = (O) this; return returnType; }
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; @SuppressWarnings("unchecked") O returnType = (O) this; return returnType; }
[ "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 ValidationException(String.format("The connector %s requires a format description.", connectorDescriptor.toString())); } else if (!connectorDescriptor.isFormatNeeded() && formatDescriptor.isPresent()) { throw new ValidationException( String.format("The connector %s does not require a format description " + "but %s found.", connectorDescriptor.toString(), formatDescriptor.get().toString())); } properties.putProperties(connectorDescriptor.toProperties()); formatDescriptor.ifPresent(s -> properties.putProperties(s.toProperties())); schemaDescriptor.ifPresent(s -> properties.putProperties(s.toProperties())); return properties.asMap(); }
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 ValidationException(String.format("The connector %s requires a format description.", connectorDescriptor.toString())); } else if (!connectorDescriptor.isFormatNeeded() && formatDescriptor.isPresent()) { throw new ValidationException( String.format("The connector %s does not require a format description " + "but %s found.", connectorDescriptor.toString(), formatDescriptor.get().toString())); } properties.putProperties(connectorDescriptor.toProperties()); formatDescriptor.ifPresent(s -> properties.putProperties(s.toProperties())); schemaDescriptor.ifPresent(s -> properties.putProperties(s.toProperties())); return properties.asMap(); }
[ "@", "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); return false; }
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); return false; }
[ "@", "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); if (connectionStream == null) { onHttp2UnknownStreamError(ctx, cause, streamException); // Write a RST_STREAM super.onStreamError(ctx, outbound, cause, streamException); return; } Http2FrameStream stream = connectionStream.getProperty(streamKey); if (stream == null) { LOG.warn("Stream exception thrown without stream object attached.", cause); // Write a RST_STREAM super.onStreamError(ctx, outbound, cause, streamException); return; } if (!outbound) { // We only forward non outbound errors as outbound errors will already be reflected by failing the promise. onHttp2FrameStreamException(ctx, new Http2FrameStreamException(stream, streamException.error(), cause)); } }
java
@Override protected final void onStreamError(ChannelHandlerContext ctx, boolean outbound, Throwable cause, Http2Exception.StreamException streamException) { int streamId = streamException.streamId(); Http2Stream connectionStream = connection().stream(streamId); if (connectionStream == null) { onHttp2UnknownStreamError(ctx, cause, streamException); // Write a RST_STREAM super.onStreamError(ctx, outbound, cause, streamException); return; } Http2FrameStream stream = connectionStream.getProperty(streamKey); if (stream == null) { LOG.warn("Stream exception thrown without stream object attached.", cause); // Write a RST_STREAM super.onStreamError(ctx, outbound, cause, streamException); return; } if (!outbound) { // We only forward non outbound errors as outbound errors will already be reflected by failing the promise. onHttp2FrameStreamException(ctx, new Http2FrameStreamException(stream, streamException.error(), cause)); } }
[ "@", "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); } return bytes; }
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); } return bytes; }
[ "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 [arrayObj] is not array !"); } if (null == type) { return (Object[]) arrayObj; } final Class<?> componentType = type.isArray() ? type.getComponentType() : type; final Object[] array = (Object[]) arrayObj; final Object[] result = ArrayUtil.newArray(componentType, array.length); System.arraycopy(array, 0, result, 0, array.length); return result; }
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 [arrayObj] is not array !"); } if (null == type) { return (Object[]) arrayObj; } final Class<?> componentType = type.isArray() ? type.getComponentType() : type; final Object[] array = (Object[]) arrayObj; final Object[] result = ArrayUtil.newArray(componentType, array.length); System.arraycopy(array, 0, result, 0, array.length); return result; }
[ "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(); currentData = null; } else { try { buffer = ((HttpData) currentData).getChunk(sizeleft); } catch (IOException e) { throw new ErrorDataEncoderException(e); } if (buffer.capacity() == 0) { // end for current InterfaceHttpData, need more data currentData = null; return null; } } if (currentBuffer == null) { currentBuffer = buffer; } else { currentBuffer = wrappedBuffer(currentBuffer, buffer); } if (currentBuffer.readableBytes() < HttpPostBodyUtil.chunkSize) { currentData = null; return null; } buffer = fillByteBuf(); return new DefaultHttpContent(buffer); }
java
private HttpContent encodeNextChunkMultipart(int sizeleft) throws ErrorDataEncoderException { if (currentData == null) { return null; } ByteBuf buffer; if (currentData instanceof InternalAttribute) { buffer = ((InternalAttribute) currentData).toByteBuf(); currentData = null; } else { try { buffer = ((HttpData) currentData).getChunk(sizeleft); } catch (IOException e) { throw new ErrorDataEncoderException(e); } if (buffer.capacity() == 0) { // end for current InterfaceHttpData, need more data currentData = null; return null; } } if (currentBuffer == null) { currentBuffer = buffer; } else { currentBuffer = wrappedBuffer(currentBuffer, buffer); } if (currentBuffer.readableBytes() < HttpPostBodyUtil.chunkSize) { currentData = null; return null; } buffer = fillByteBuf(); return new DefaultHttpContent(buffer); }
[ "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 found @throws ErrorDataEncoderException if the encoding is in error
[ "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. Each list has zero or more // PoolChunk<ByteBuffer> instances. // Chunk list of arena Field chunkListField = arena.getClass().getSuperclass() .getDeclaredField(chunkListFieldName); chunkListField.setAccessible(true); Object chunkList = chunkListField.get(arena); // Count the chunks in the list Field headChunkField = chunkList.getClass().getDeclaredField("head"); headChunkField.setAccessible(true); Object headChunk = headChunkField.get(chunkList); if (headChunk == null) { return 0; } else { int numChunks = 0; Object current = headChunk; while (current != null) { Field nextChunkField = headChunk.getClass().getDeclaredField("next"); nextChunkField.setAccessible(true); current = nextChunkField.get(current); numChunks++; } return numChunks; } }
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. Each list has zero or more // PoolChunk<ByteBuffer> instances. // Chunk list of arena Field chunkListField = arena.getClass().getSuperclass() .getDeclaredField(chunkListFieldName); chunkListField.setAccessible(true); Object chunkList = chunkListField.get(arena); // Count the chunks in the list Field headChunkField = chunkList.getClass().getDeclaredField("head"); headChunkField.setAccessible(true); Object headChunk = headChunkField.get(chunkList); if (headChunk == null) { return 0; } else { int numChunks = 0; Object current = headChunk; while (current != null) { Field nextChunkField = headChunk.getClass().getDeclaredField("next"); nextChunkField.setAccessible(true); current = nextChunkField.get(current); numChunks++; } return numChunks; } }
[ "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 when the Netty version stays the same). @throws IllegalAccessException Error getting the statistics (should not happen when the Netty version stays the same).
[ "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( null, certChainFile, trustManagerFactory, ciphers, nextProtocols, sessionCacheSize, sessionTimeout); }
java
@Deprecated public static SslContext newClientContext( File certChainFile, TrustManagerFactory trustManagerFactory, Iterable<String> ciphers, Iterable<String> nextProtocols, long sessionCacheSize, long sessionTimeout) throws SSLException { return newClientContext( null, certChainFile, trustManagerFactory, ciphers, nextProtocols, sessionCacheSize, sessionTimeout); }
[ "@", "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 use the default. @param ciphers the cipher suites to enable, in the order of preference. {@code null} to use the default cipher suites. @param nextProtocols the application layer protocols to accept, in the order of preference. {@code null} to disable TLS NPN/ALPN extension. @param sessionCacheSize the size of the cache used for storing SSL session objects. {@code 0} to use the default value. @param sessionTimeout the timeout for the cached SSL session objects, in seconds. {@code 0} to use the default value. @return a new client-side {@link SslContext} @deprecated Replaced by {@link SslContextBuilder}
[ "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/rfc2616/rfc2616-sec3.html#sec3.3.1">RFC2616</a>. @param name The name of the header being added @param value The value of the header being added @return {@code this}
[ "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} before sending a query to the name servers. If a match is found in the {@link HostsFileEntries}, a synthetic {@code A} or {@code AAAA} record will be returned. @param question the question @param additionals additional records ({@code OPT}) @return the list of the {@link DnsRecord}s as the result of the resolution
[ "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 { // 直接使用条件值 conditionStrBuilder.append(CharUtil.SPACE).append(this.value); } // 处理 AND y conditionStrBuilder.append(StrUtil.SPACE).append(LogicalOperator.AND.toString()); if (isPlaceHolder()) { // 使用条件表达式占位符 conditionStrBuilder.append(" ?"); if(null != paramValues) { paramValues.add(this.secondValue); } } else { // 直接使用条件值 conditionStrBuilder.append(CharUtil.SPACE).append(this.secondValue); } }
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 { // 直接使用条件值 conditionStrBuilder.append(CharUtil.SPACE).append(this.value); } // 处理 AND y conditionStrBuilder.append(StrUtil.SPACE).append(LogicalOperator.AND.toString()); if (isPlaceHolder()) { // 使用条件表达式占位符 conditionStrBuilder.append(" ?"); if(null != paramValues) { paramValues.add(this.secondValue); } } else { // 直接使用条件值 conditionStrBuilder.append(CharUtil.SPACE).append(this.secondValue); } }
[ "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 = rawRange.trim(); int dashIdx = range.indexOf('-'); if (dashIdx == -1) { // only one port in range: final int port = Integer.valueOf(range); if (port < 0 || port > 65535) { throw new IllegalConfigurationException("Invalid port configuration. Port must be between 0" + "and 65535, but was " + port + "."); } rangeIterator = Collections.singleton(Integer.valueOf(range)).iterator(); } else { // evaluate range final int start = Integer.valueOf(range.substring(0, dashIdx)); if (start < 0 || start > 65535) { throw new IllegalConfigurationException("Invalid port configuration. Port must be between 0" + "and 65535, but was " + start + "."); } final int end = Integer.valueOf(range.substring(dashIdx + 1, range.length())); if (end < 0 || end > 65535) { throw new IllegalConfigurationException("Invalid port configuration. Port must be between 0" + "and 65535, but was " + end + "."); } rangeIterator = new Iterator<Integer>() { int i = start; @Override public boolean hasNext() { return i <= end; } @Override public Integer next() { return i++; } @Override public void remove() { throw new UnsupportedOperationException("Remove not supported"); } }; } iterators.add(rangeIterator); } return iterators; }
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 = rawRange.trim(); int dashIdx = range.indexOf('-'); if (dashIdx == -1) { // only one port in range: final int port = Integer.valueOf(range); if (port < 0 || port > 65535) { throw new IllegalConfigurationException("Invalid port configuration. Port must be between 0" + "and 65535, but was " + port + "."); } rangeIterator = Collections.singleton(Integer.valueOf(range)).iterator(); } else { // evaluate range final int start = Integer.valueOf(range.substring(0, dashIdx)); if (start < 0 || start > 65535) { throw new IllegalConfigurationException("Invalid port configuration. Port must be between 0" + "and 65535, but was " + start + "."); } final int end = Integer.valueOf(range.substring(dashIdx + 1, range.length())); if (end < 0 || end > 65535) { throw new IllegalConfigurationException("Invalid port configuration. Port must be between 0" + "and 65535, but was " + end + "."); } rangeIterator = new Iterator<Integer>() { int i = start; @Override public boolean hasNext() { return i <= end; } @Override public Integer next() { return i++; } @Override public void remove() { throw new UnsupportedOperationException("Remove not supported"); } }; } iterators.add(rangeIterator); } return iterators; }
[ "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() > 1 ? new HashMap<String, Integer>() : null; int i = 0; boolean hasDupdName = false; for (Cookie c : cookies) { encoded.add(encode(c)); if (nameToIndex != null) { hasDupdName |= nameToIndex.put(c.name(), i++) != null; } } return hasDupdName ? dedup(encoded, nameToIndex) : encoded; }
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() > 1 ? new HashMap<String, Integer>() : null; int i = 0; boolean hasDupdName = false; for (Cookie c : cookies) { encoded.add(encode(c)); if (nameToIndex != null) { hasDupdName |= nameToIndex.put(c.name(), i++) != null; } } return hasDupdName ? dedup(encoded, nameToIndex) : encoded; }
[ "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 + ", " + (keyGroupOffset + state.length) + ")."); } }
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 + ", " + (keyGroupOffset + state.length) + ")."); } }
[ "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", role); json.put("timeout", timeout); serializeFields(json); return json.entrySet().stream() .filter(entry -> entry.getValue() != null) .collect(toImmutableSortedMap(natural(), Map.Entry::getKey, Map.Entry::getValue)); }
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", role); json.put("timeout", timeout); serializeFields(json); return json.entrySet().stream() .filter(entry -> entry.getValue() != null) .collect(toImmutableSortedMap(natural(), Map.Entry::getKey, Map.Entry::getValue)); }
[ "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 (cause instanceof InterruptedException) { Thread.currentThread().interrupt(); } else { throw new RegistryCenterException(cause); } }
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 (cause instanceof InterruptedException) { Thread.currentThread().interrupt(); } else { throw new RegistryCenterException(cause); } }
[ "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; } markModified(oldNumFields); } else { // decrease the number of fields // we do not remove the values from the cache, as the objects (if they are there) will most likely // be reused when the record is re-filled markModified(numFields); } this.numFields = numFields; }
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; } markModified(oldNumFields); } else { // decrease the number of fields // we do not remove the values from the cache, as the objects (if they are there) will most likely // be reused when the record is re-filled markModified(numFields); } this.numFields = numFields; }
[ "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, maximumNumberOfIterations); }
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, maximumNumberOfIterations); }
[ "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 executed @param <K> The type of the vertex key in the graph @param <VV> The type of the vertex value in the graph @param <EV> The type of the edge value in the graph @param <M> The intermediate type used by the gather, sum and apply functions @return An in stance of the gather-sum-apply graph computation operator.
[ "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 or directiory is null !"); if (FileUtil.equals(src, dest)) { throw new IORuntimeException("Files '{}' and '{}' are equal", src, dest); } if (src.isDirectory()) {// 复制目录 if(dest.exists() && false == dest.isDirectory()) { //源为目录,目标为文件,抛出IO异常 throw new IORuntimeException("Src is a directory but dest is a file!"); } final File subDest = isCopyContentIfDir ? dest : FileUtil.mkdir(FileUtil.file(dest, src.getName())); internalCopyDirContent(src, subDest); } else {// 复制文件 internalCopyFile(src, dest); } return dest; }
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 or directiory is null !"); if (FileUtil.equals(src, dest)) { throw new IORuntimeException("Files '{}' and '{}' are equal", src, dest); } if (src.isDirectory()) {// 复制目录 if(dest.exists() && false == dest.isDirectory()) { //源为目录,目标为文件,抛出IO异常 throw new IORuntimeException("Src is a directory but dest is a file!"); } final File subDest = isCopyContentIfDir ? dest : FileUtil.mkdir(FileUtil.file(dest, src.getName())); internalCopyDirContent(src, subDest); } else {// 复制文件 internalCopyFile(src, dest); } return dest; }
[ "@", "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复制 6、源为目录,目标为文件,抛出IO异常 7、源路径和目标路径相同时,抛出IO异常 </pre> @return 拷贝后目标的文件或目录 @throws IORuntimeException IO异常
[ "执行拷贝<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 character to convert @param defaultValue the default value to use if the character is not numeric @return the int value of the character
[ "<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 message. This means the indexes are meaningful and we need the ability to reference the // indexes un-obstructed, and thus we cannot use a slice here. // See https://www.ietf.org/rfc/rfc1035 [4.1.4. Message compression] if (type == DnsRecordType.PTR) { return new DefaultDnsPtrRecord( name, dnsClass, timeToLive, decodeName0(in.duplicate().setIndex(offset, offset + length))); } return new DefaultDnsRawRecord( name, type, dnsClass, timeToLive, in.retainedDuplicate().setIndex(offset, offset + length)); }
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 message. This means the indexes are meaningful and we need the ability to reference the // indexes un-obstructed, and thus we cannot use a slice here. // See https://www.ietf.org/rfc/rfc1035 [4.1.4. Message compression] if (type == DnsRecordType.PTR) { return new DefaultDnsPtrRecord( name, dnsClass, timeToLive, decodeName0(in.duplicate().setIndex(offset, offset + length))); } return new DefaultDnsRawRecord( name, type, dnsClass, timeToLive, in.retainedDuplicate().setIndex(offset, offset + length)); }
[ "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 start offset of the RDATA in {@code in} @param length the length of the RDATA @return a {@link DnsRawRecord}. Override this method to decode RDATA and return other record implementation.
[ "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.equals(key)) { // found match entry.value = aggregator.reduce(entry.value, value); return entry.value; } } // no match, insert a new value insertNewEntry(hash, key, value, slot); // return the original value return value; }
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.equals(key)) { // found match entry.value = aggregator.reduce(entry.value, value); return entry.value; } } // no match, insert a new value insertNewEntry(hash, key, value, slot); // return the original value return value; }
[ "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 for the key. @param key The key to map the value. @param value The new value to insert, or aggregate with the existing value. @param aggregator The aggregator to use if a value is already contained. @return The value in the map after this operation: Either the given value, or the aggregated value. @throws java.lang.NullPointerException Thrown, if the key is null. @throws Exception The method forwards exceptions from the aggregation function.
[ "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); } finally { IoUtil.close(gos); } //返回必须在关闭gos后进行,因为关闭时会自动执行finish()方法,保证数据全部写出 return bos.toByteArray(); }
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); } finally { IoUtil.close(gos); } //返回必须在关闭gos后进行,因为关闭时会自动执行finish()方法,保证数据全部写出 return bos.toByteArray(); }
[ "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 fallback value @return the value or {@code fallback}
[ "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...