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-streaming-java/src/main/java/org/apache/flink/streaming/api/datastream/DataStream.java
DataStream.partitionCustom
public <K> DataStream<T> partitionCustom(Partitioner<K> partitioner, int field) { Keys.ExpressionKeys<T> outExpressionKeys = new Keys.ExpressionKeys<>(new int[]{field}, getType()); return partitionCustom(partitioner, outExpressionKeys); }
java
public <K> DataStream<T> partitionCustom(Partitioner<K> partitioner, int field) { Keys.ExpressionKeys<T> outExpressionKeys = new Keys.ExpressionKeys<>(new int[]{field}, getType()); return partitionCustom(partitioner, outExpressionKeys); }
[ "public", "<", "K", ">", "DataStream", "<", "T", ">", "partitionCustom", "(", "Partitioner", "<", "K", ">", "partitioner", ",", "int", "field", ")", "{", "Keys", ".", "ExpressionKeys", "<", "T", ">", "outExpressionKeys", "=", "new", "Keys", ".", "Express...
Partitions a tuple DataStream on the specified key fields using a custom partitioner. This method takes the key position to partition on, and a partitioner that accepts the key type. <p>Note: This method works only on single field keys. @param partitioner The partitioner to assign partitions to keys. @param field The field index on which the DataStream is partitioned. @return The partitioned DataStream.
[ "Partitions", "a", "tuple", "DataStream", "on", "the", "specified", "key", "fields", "using", "a", "custom", "partitioner", ".", "This", "method", "takes", "the", "key", "position", "to", "partition", "on", "and", "a", "partitioner", "that", "accepts", "the", ...
b62db93bf63cb3bb34dd03d611a779d9e3fc61ac
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-streaming-java/src/main/java/org/apache/flink/streaming/api/datastream/DataStream.java#L355-L358
train
Partition a DataStream by using a custom partitioner.
[ 30522, 2270, 1026, 1047, 1028, 2951, 21422, 1026, 1056, 1028, 13571, 7874, 20389, 1006, 13571, 2121, 1026, 1047, 1028, 13571, 2121, 1010, 20014, 2492, 1007, 1063, 6309, 1012, 3670, 14839, 2015, 1026, 1056, 1028, 2041, 10288, 20110, 3258, 14...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
apache/incubator-shardingsphere
sharding-core/sharding-core-parse/sharding-core-parse-common/src/main/java/org/apache/shardingsphere/core/parse/antlr/filler/SQLStatementFillerEngine.java
SQLStatementFillerEngine.fill
@SneakyThrows public SQLStatement fill(final Collection<SQLSegment> sqlSegments, final SQLStatementRule rule) { SQLStatement result = rule.getSqlStatementClass().newInstance(); result.setLogicSQL(sql); for (SQLSegment each : sqlSegments) { Optional<SQLSegmentFiller> filler = parsingRuleRegistry.findSQLSegmentFiller(databaseType, each.getClass()); if (filler.isPresent()) { doFill(each, result, filler.get()); } } return result; }
java
@SneakyThrows public SQLStatement fill(final Collection<SQLSegment> sqlSegments, final SQLStatementRule rule) { SQLStatement result = rule.getSqlStatementClass().newInstance(); result.setLogicSQL(sql); for (SQLSegment each : sqlSegments) { Optional<SQLSegmentFiller> filler = parsingRuleRegistry.findSQLSegmentFiller(databaseType, each.getClass()); if (filler.isPresent()) { doFill(each, result, filler.get()); } } return result; }
[ "@", "SneakyThrows", "public", "SQLStatement", "fill", "(", "final", "Collection", "<", "SQLSegment", ">", "sqlSegments", ",", "final", "SQLStatementRule", "rule", ")", "{", "SQLStatement", "result", "=", "rule", ".", "getSqlStatementClass", "(", ")", ".", "newI...
Fill SQL statement. @param sqlSegments SQL segments @param rule SQL statement rule @return SQL statement
[ "Fill", "SQL", "statement", "." ]
f88fd29fc345dfb31fdce12e9e96cbfa0fd2402d
https://github.com/apache/incubator-shardingsphere/blob/f88fd29fc345dfb31fdce12e9e96cbfa0fd2402d/sharding-core/sharding-core-parse/sharding-core-parse-common/src/main/java/org/apache/shardingsphere/core/parse/antlr/filler/SQLStatementFillerEngine.java#L73-L84
train
Fill SQL statement with SQL segments.
[ 30522, 1030, 13583, 22123, 8093, 15568, 2270, 29296, 9153, 18532, 4765, 6039, 1006, 2345, 3074, 1026, 29296, 3366, 21693, 4765, 1028, 29296, 3366, 21693, 11187, 1010, 2345, 29296, 9153, 18532, 4765, 6820, 2571, 3627, 1007, 1063, 29296, 9153, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -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
security/src/main/java/com/networknt/security/JwtIssuer.java
JwtIssuer.getJwtClaimsWithExpiresIn
public static JwtClaims getJwtClaimsWithExpiresIn(int expiresIn) { JwtClaims claims = new JwtClaims(); claims.setIssuer(jwtConfig.getIssuer()); claims.setAudience(jwtConfig.getAudience()); claims.setExpirationTimeMinutesInTheFuture(expiresIn/60); claims.setGeneratedJwtId(); // a unique identifier for the token claims.setIssuedAtToNow(); // when the token was issued/created (now) claims.setNotBeforeMinutesInThePast(2); // time before which the token is not yet valid (2 minutes ago) claims.setClaim("version", jwtConfig.getVersion()); return claims; }
java
public static JwtClaims getJwtClaimsWithExpiresIn(int expiresIn) { JwtClaims claims = new JwtClaims(); claims.setIssuer(jwtConfig.getIssuer()); claims.setAudience(jwtConfig.getAudience()); claims.setExpirationTimeMinutesInTheFuture(expiresIn/60); claims.setGeneratedJwtId(); // a unique identifier for the token claims.setIssuedAtToNow(); // when the token was issued/created (now) claims.setNotBeforeMinutesInThePast(2); // time before which the token is not yet valid (2 minutes ago) claims.setClaim("version", jwtConfig.getVersion()); return claims; }
[ "public", "static", "JwtClaims", "getJwtClaimsWithExpiresIn", "(", "int", "expiresIn", ")", "{", "JwtClaims", "claims", "=", "new", "JwtClaims", "(", ")", ";", "claims", ".", "setIssuer", "(", "jwtConfig", ".", "getIssuer", "(", ")", ")", ";", "claims", ".",...
Construct a default JwtClaims @param expiresIn expires in @return JwtClaims
[ "Construct", "a", "default", "JwtClaims" ]
2a60257c60663684c8f6dc8b5ea3cf184e534db6
https://github.com/networknt/light-4j/blob/2a60257c60663684c8f6dc8b5ea3cf184e534db6/security/src/main/java/com/networknt/security/JwtIssuer.java#L119-L131
train
Returns a JwtClaims object with the specified expiration time in minutes.
[ 30522, 2270, 10763, 1046, 26677, 25154, 2015, 2131, 3501, 26677, 25154, 26760, 8939, 10288, 20781, 11493, 1006, 20014, 4654, 20781, 11493, 1007, 1063, 1046, 26677, 25154, 2015, 4447, 1027, 2047, 1046, 26677, 25154, 2015, 1006, 1007, 1025, 444...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -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/dataformat/BinaryString.java
BinaryString.compareTo
@Override public int compareTo(BinaryString other) { if (javaObject != null && other.javaObject != null) { return javaObject.compareTo(other.javaObject); } ensureMaterialized(); other.ensureMaterialized(); if (segments.length == 1 && other.segments.length == 1) { int len = Math.min(sizeInBytes, other.sizeInBytes); MemorySegment seg1 = segments[0]; MemorySegment seg2 = other.segments[0]; for (int i = 0; i < len; i++) { int res = (seg1.get(offset + i) & 0xFF) - (seg2.get(other.offset + i) & 0xFF); if (res != 0) { return res; } } return sizeInBytes - other.sizeInBytes; } // if there are multi segments. return compareMultiSegments(other); }
java
@Override public int compareTo(BinaryString other) { if (javaObject != null && other.javaObject != null) { return javaObject.compareTo(other.javaObject); } ensureMaterialized(); other.ensureMaterialized(); if (segments.length == 1 && other.segments.length == 1) { int len = Math.min(sizeInBytes, other.sizeInBytes); MemorySegment seg1 = segments[0]; MemorySegment seg2 = other.segments[0]; for (int i = 0; i < len; i++) { int res = (seg1.get(offset + i) & 0xFF) - (seg2.get(other.offset + i) & 0xFF); if (res != 0) { return res; } } return sizeInBytes - other.sizeInBytes; } // if there are multi segments. return compareMultiSegments(other); }
[ "@", "Override", "public", "int", "compareTo", "(", "BinaryString", "other", ")", "{", "if", "(", "javaObject", "!=", "null", "&&", "other", ".", "javaObject", "!=", "null", ")", "{", "return", "javaObject", ".", "compareTo", "(", "other", ".", "javaObject...
UTF-8 supports bytes comparison.
[ "UTF", "-", "8", "supports", "bytes", "comparison", "." ]
b62db93bf63cb3bb34dd03d611a779d9e3fc61ac
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-table/flink-table-runtime-blink/src/main/java/org/apache/flink/table/dataformat/BinaryString.java#L229-L255
train
Compare two binary strings.
[ 30522, 1030, 2058, 15637, 2270, 20014, 12826, 3406, 1006, 12441, 3367, 4892, 2060, 1007, 1063, 2065, 1006, 9262, 16429, 20614, 999, 1027, 19701, 1004, 1004, 2060, 1012, 9262, 16429, 20614, 999, 1027, 19701, 1007, 1063, 2709, 9262, 16429, 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-extra/src/main/java/cn/hutool/extra/ssh/JschUtil.java
JschUtil.close
public static void close(Session session) { if (session != null && session.isConnected()) { session.disconnect(); } JschSessionPool.INSTANCE.remove(session); }
java
public static void close(Session session) { if (session != null && session.isConnected()) { session.disconnect(); } JschSessionPool.INSTANCE.remove(session); }
[ "public", "static", "void", "close", "(", "Session", "session", ")", "{", "if", "(", "session", "!=", "null", "&&", "session", ".", "isConnected", "(", ")", ")", "{", "session", ".", "disconnect", "(", ")", ";", "}", "JschSessionPool", ".", "INSTANCE", ...
关闭SSH连接会话 @param session SSH会话
[ "关闭SSH连接会话" ]
bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a
https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-extra/src/main/java/cn/hutool/extra/ssh/JschUtil.java#L297-L302
train
Closes the session.
[ 30522, 2270, 10763, 11675, 2485, 1006, 5219, 5219, 1007, 1063, 2065, 1006, 5219, 999, 1027, 19701, 1004, 1004, 5219, 1012, 2003, 24230, 1006, 1007, 1007, 1063, 5219, 1012, 12532, 10087, 6593, 1006, 1007, 1025, 1065, 1046, 11624, 8583, 10992...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
looly/hutool
hutool-core/src/main/java/cn/hutool/core/io/FileUtil.java
FileUtil.readLines
public static void readLines(RandomAccessFile file, Charset charset, LineHandler lineHandler) { String line = null; try { while ((line = file.readLine()) != null) { lineHandler.handle(CharsetUtil.convert(line, CharsetUtil.CHARSET_ISO_8859_1, charset)); } } catch (IOException e) { throw new IORuntimeException(e); } }
java
public static void readLines(RandomAccessFile file, Charset charset, LineHandler lineHandler) { String line = null; try { while ((line = file.readLine()) != null) { lineHandler.handle(CharsetUtil.convert(line, CharsetUtil.CHARSET_ISO_8859_1, charset)); } } catch (IOException e) { throw new IORuntimeException(e); } }
[ "public", "static", "void", "readLines", "(", "RandomAccessFile", "file", ",", "Charset", "charset", ",", "LineHandler", "lineHandler", ")", "{", "String", "line", "=", "null", ";", "try", "{", "while", "(", "(", "line", "=", "file", ".", "readLine", "(", ...
按行处理文件内容 @param file {@link RandomAccessFile}文件 @param charset 编码 @param lineHandler {@link LineHandler}行处理器 @throws IORuntimeException IO异常 @since 4.5.2
[ "按行处理文件内容" ]
bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a
https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/io/FileUtil.java#L2428-L2437
train
Reads a sequence of bytes from a RandomAccessFile and invokes the LineHandler for each line.
[ 30522, 2270, 10763, 11675, 3191, 12735, 1006, 6721, 6305, 9623, 22747, 9463, 5371, 1010, 25869, 13462, 25869, 13462, 1010, 2240, 11774, 3917, 2240, 11774, 3917, 1007, 1063, 5164, 2240, 1027, 19701, 1025, 3046, 1063, 2096, 1006, 1006, 2240, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
looly/hutool
hutool-core/src/main/java/cn/hutool/core/io/FileUtil.java
FileUtil.getInputStream
public static BufferedInputStream getInputStream(Path path) throws IORuntimeException { try { return new BufferedInputStream(Files.newInputStream(path)); } catch (IOException e) { throw new IORuntimeException(e); } }
java
public static BufferedInputStream getInputStream(Path path) throws IORuntimeException { try { return new BufferedInputStream(Files.newInputStream(path)); } catch (IOException e) { throw new IORuntimeException(e); } }
[ "public", "static", "BufferedInputStream", "getInputStream", "(", "Path", "path", ")", "throws", "IORuntimeException", "{", "try", "{", "return", "new", "BufferedInputStream", "(", "Files", ".", "newInputStream", "(", "path", ")", ")", ";", "}", "catch", "(", ...
获得输入流 @param path Path @return 输入流 @throws IORuntimeException 文件未找到 @since 4.0.0
[ "获得输入流" ]
bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a
https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/io/FileUtil.java#L1893-L1899
train
Returns a buffered input stream for the specified file.
[ 30522, 2270, 10763, 17698, 2098, 2378, 18780, 21422, 2131, 2378, 18780, 21422, 1006, 4130, 4130, 1007, 11618, 22834, 15532, 7292, 10288, 24422, 1063, 3046, 1063, 2709, 2047, 17698, 2098, 2378, 18780, 21422, 1006, 6764, 1012, 2047, 2378, 18780...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
apache/spark
common/network-shuffle/src/main/java/org/apache/spark/network/shuffle/ExternalShuffleBlockHandler.java
ExternalShuffleBlockHandler.reregisterExecutor
public void reregisterExecutor(AppExecId appExecId, ExecutorShuffleInfo executorInfo) { blockManager.registerExecutor(appExecId.appId, appExecId.execId, executorInfo); }
java
public void reregisterExecutor(AppExecId appExecId, ExecutorShuffleInfo executorInfo) { blockManager.registerExecutor(appExecId.appId, appExecId.execId, executorInfo); }
[ "public", "void", "reregisterExecutor", "(", "AppExecId", "appExecId", ",", "ExecutorShuffleInfo", "executorInfo", ")", "{", "blockManager", ".", "registerExecutor", "(", "appExecId", ".", "appId", ",", "appExecId", ".", "execId", ",", "executorInfo", ")", ";", "}...
Register an (application, executor) with the given shuffle info. The "re-" is meant to highlight the intended use of this method -- when this service is restarted, this is used to restore the state of executors from before the restart. Normal registration will happen via a message handled in receive() @param appExecId @param executorInfo
[ "Register", "an", "(", "application", "executor", ")", "with", "the", "given", "shuffle", "info", "." ]
25ee0474f47d9c30d6f553a7892d9549f91071cf
https://github.com/apache/spark/blob/25ee0474f47d9c30d6f553a7892d9549f91071cf/common/network-shuffle/src/main/java/org/apache/spark/network/shuffle/ExternalShuffleBlockHandler.java#L164-L166
train
Registers an executor with the block manager.
[ 30522, 2270, 11675, 2128, 2890, 24063, 7869, 2595, 8586, 16161, 2099, 1006, 10439, 10288, 8586, 3593, 10439, 10288, 8586, 3593, 1010, 4654, 8586, 16161, 2869, 6979, 18142, 2378, 14876, 4654, 8586, 16161, 6657, 14876, 1007, 1063, 3796, 24805, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
apache/flink
flink-core/src/main/java/org/apache/flink/api/common/io/FileInputFormat.java
FileInputFormat.initDefaultsFromConfiguration
private static void initDefaultsFromConfiguration(Configuration configuration) { final long to = configuration.getLong(ConfigConstants.FS_STREAM_OPENING_TIMEOUT_KEY, ConfigConstants.DEFAULT_FS_STREAM_OPENING_TIMEOUT); if (to < 0) { LOG.error("Invalid timeout value for filesystem stream opening: " + to + ". Using default value of " + ConfigConstants.DEFAULT_FS_STREAM_OPENING_TIMEOUT); DEFAULT_OPENING_TIMEOUT = ConfigConstants.DEFAULT_FS_STREAM_OPENING_TIMEOUT; } else if (to == 0) { DEFAULT_OPENING_TIMEOUT = 300000; // 5 minutes } else { DEFAULT_OPENING_TIMEOUT = to; } }
java
private static void initDefaultsFromConfiguration(Configuration configuration) { final long to = configuration.getLong(ConfigConstants.FS_STREAM_OPENING_TIMEOUT_KEY, ConfigConstants.DEFAULT_FS_STREAM_OPENING_TIMEOUT); if (to < 0) { LOG.error("Invalid timeout value for filesystem stream opening: " + to + ". Using default value of " + ConfigConstants.DEFAULT_FS_STREAM_OPENING_TIMEOUT); DEFAULT_OPENING_TIMEOUT = ConfigConstants.DEFAULT_FS_STREAM_OPENING_TIMEOUT; } else if (to == 0) { DEFAULT_OPENING_TIMEOUT = 300000; // 5 minutes } else { DEFAULT_OPENING_TIMEOUT = to; } }
[ "private", "static", "void", "initDefaultsFromConfiguration", "(", "Configuration", "configuration", ")", "{", "final", "long", "to", "=", "configuration", ".", "getLong", "(", "ConfigConstants", ".", "FS_STREAM_OPENING_TIMEOUT_KEY", ",", "ConfigConstants", ".", "DEFAUL...
Initialize defaults for input format. Needs to be a static method because it is configured for local cluster execution. @param configuration The configuration to load defaults from
[ "Initialize", "defaults", "for", "input", "format", ".", "Needs", "to", "be", "a", "static", "method", "because", "it", "is", "configured", "for", "local", "cluster", "execution", "." ]
b62db93bf63cb3bb34dd03d611a779d9e3fc61ac
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-core/src/main/java/org/apache/flink/api/common/io/FileInputFormat.java#L104-L116
train
Initialize the defaults from the configuration.
[ 30522, 2797, 10763, 11675, 1999, 4183, 3207, 7011, 11314, 22747, 21716, 8663, 8873, 27390, 3370, 1006, 9563, 9563, 1007, 1063, 2345, 2146, 2000, 1027, 9563, 1012, 2131, 10052, 1006, 9530, 8873, 18195, 5644, 5794, 3215, 1012, 1042, 2015, 103...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
apache/flink
flink-table/flink-table-common/src/main/java/org/apache/flink/table/descriptors/Statistics.java
Statistics.toProperties
@Override public final Map<String, String> toProperties() { final DescriptorProperties properties = new DescriptorProperties(); properties.putProperties(internalProperties); properties.putInt(STATISTICS_PROPERTY_VERSION, 1); List<Map<String, String>> namedStats = new ArrayList<>(); for (Map.Entry<String, Map<String, String>> entry : columnStats.entrySet()) { Map<String, String> columnStat = entry.getValue(); columnStat.put(NAME, entry.getKey()); namedStats.add(columnStat); } properties.putIndexedVariableProperties(STATISTICS_COLUMNS, namedStats); return properties.asMap(); }
java
@Override public final Map<String, String> toProperties() { final DescriptorProperties properties = new DescriptorProperties(); properties.putProperties(internalProperties); properties.putInt(STATISTICS_PROPERTY_VERSION, 1); List<Map<String, String>> namedStats = new ArrayList<>(); for (Map.Entry<String, Map<String, String>> entry : columnStats.entrySet()) { Map<String, String> columnStat = entry.getValue(); columnStat.put(NAME, entry.getKey()); namedStats.add(columnStat); } properties.putIndexedVariableProperties(STATISTICS_COLUMNS, namedStats); return properties.asMap(); }
[ "@", "Override", "public", "final", "Map", "<", "String", ",", "String", ">", "toProperties", "(", ")", "{", "final", "DescriptorProperties", "properties", "=", "new", "DescriptorProperties", "(", ")", ";", "properties", ".", "putProperties", "(", "internalPrope...
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-common/src/main/java/org/apache/flink/table/descriptors/Statistics.java#L151-L167
train
Returns a map of properties that can be used to write the descriptor to the output stream.
[ 30522, 1030, 2058, 15637, 2270, 2345, 4949, 1026, 5164, 1010, 5164, 1028, 2327, 18981, 8743, 3111, 1006, 1007, 1063, 2345, 4078, 23235, 2953, 21572, 4842, 7368, 5144, 1027, 2047, 4078, 23235, 2953, 21572, 4842, 7368, 1006, 1007, 1025, 5144,...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
apache/flink
flink-table/flink-table-runtime-blink/src/main/java/org/apache/flink/table/runtime/rank/AbstractTopNFunction.java
AbstractTopNFunction.delete
protected void delete(Collector<BaseRow> out, BaseRow inputRow, long rank) { if (isInRankRange(rank)) { out.collect(createOutputRow(inputRow, rank, BaseRowUtil.RETRACT_MSG)); } }
java
protected void delete(Collector<BaseRow> out, BaseRow inputRow, long rank) { if (isInRankRange(rank)) { out.collect(createOutputRow(inputRow, rank, BaseRowUtil.RETRACT_MSG)); } }
[ "protected", "void", "delete", "(", "Collector", "<", "BaseRow", ">", "out", ",", "BaseRow", "inputRow", ",", "long", "rank", ")", "{", "if", "(", "isInRankRange", "(", "rank", ")", ")", "{", "out", ".", "collect", "(", "createOutputRow", "(", "inputRow"...
This is with-row-number version of above delete() method.
[ "This", "is", "with", "-", "row", "-", "number", "version", "of", "above", "delete", "()", "method", "." ]
b62db93bf63cb3bb34dd03d611a779d9e3fc61ac
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-table/flink-table-runtime-blink/src/main/java/org/apache/flink/table/runtime/rank/AbstractTopNFunction.java#L260-L264
train
Delete the row.
[ 30522, 5123, 11675, 3972, 12870, 1006, 10018, 1026, 2918, 10524, 1028, 2041, 1010, 2918, 10524, 7953, 10524, 1010, 2146, 4635, 1007, 1063, 2065, 1006, 2003, 2378, 26763, 24388, 2063, 1006, 4635, 1007, 1007, 1063, 2041, 1012, 8145, 1006, 344...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -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/HashUtil.java
HashUtil.rsHash
public static int rsHash(String str) { int b = 378551; int a = 63689; int hash = 0; for (int i = 0; i < str.length(); i++) { hash = hash * a + str.charAt(i); a = a * b; } return hash & 0x7FFFFFFF; }
java
public static int rsHash(String str) { int b = 378551; int a = 63689; int hash = 0; for (int i = 0; i < str.length(); i++) { hash = hash * a + str.charAt(i); a = a * b; } return hash & 0x7FFFFFFF; }
[ "public", "static", "int", "rsHash", "(", "String", "str", ")", "{", "int", "b", "=", "378551", ";", "int", "a", "=", "63689", ";", "int", "hash", "=", "0", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "str", ".", "length", "(", ")",...
RS算法hash @param str 字符串 @return hash值
[ "RS算法hash" ]
bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a
https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/util/HashUtil.java#L200-L211
train
Returns the hash code of the specified string.
[ 30522, 2270, 10763, 20014, 12667, 14949, 2232, 1006, 5164, 2358, 2099, 1007, 1063, 20014, 1038, 1027, 4261, 27531, 22203, 1025, 20014, 1037, 1027, 6191, 2575, 2620, 2683, 1025, 20014, 23325, 1027, 1014, 1025, 2005, 1006, 20014, 1045, 1027, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
looly/hutool
hutool-core/src/main/java/cn/hutool/core/io/FileUtil.java
FileUtil.getWriter
public static BufferedWriter getWriter(String path, Charset charset, boolean isAppend) throws IORuntimeException { return getWriter(touch(path), charset, isAppend); }
java
public static BufferedWriter getWriter(String path, Charset charset, boolean isAppend) throws IORuntimeException { return getWriter(touch(path), charset, isAppend); }
[ "public", "static", "BufferedWriter", "getWriter", "(", "String", "path", ",", "Charset", "charset", ",", "boolean", "isAppend", ")", "throws", "IORuntimeException", "{", "return", "getWriter", "(", "touch", "(", "path", ")", ",", "charset", ",", "isAppend", "...
获得一个带缓存的写入对象 @param path 输出路径,绝对路径 @param charset 字符集 @param isAppend 是否追加 @return BufferedReader对象 @throws IORuntimeException IO异常
[ "获得一个带缓存的写入对象" ]
bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a
https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/io/FileUtil.java#L2598-L2600
train
Returns a BufferedWriter for writing to a file.
[ 30522, 2270, 10763, 17698, 2098, 15994, 2131, 15994, 1006, 5164, 4130, 1010, 25869, 13462, 25869, 13462, 1010, 22017, 20898, 18061, 21512, 4859, 1007, 11618, 22834, 15532, 7292, 10288, 24422, 1063, 2709, 2131, 15994, 1006, 3543, 1006, 4130, 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/checkpoint/CheckpointStatsTracker.java
CheckpointStatsTracker.reportCompletedCheckpoint
private void reportCompletedCheckpoint(CompletedCheckpointStats completed) { statsReadWriteLock.lock(); try { latestCompletedCheckpoint = completed; counts.incrementCompletedCheckpoints(); history.replacePendingCheckpointById(completed); summary.updateSummary(completed); dirty = true; } finally { statsReadWriteLock.unlock(); } }
java
private void reportCompletedCheckpoint(CompletedCheckpointStats completed) { statsReadWriteLock.lock(); try { latestCompletedCheckpoint = completed; counts.incrementCompletedCheckpoints(); history.replacePendingCheckpointById(completed); summary.updateSummary(completed); dirty = true; } finally { statsReadWriteLock.unlock(); } }
[ "private", "void", "reportCompletedCheckpoint", "(", "CompletedCheckpointStats", "completed", ")", "{", "statsReadWriteLock", ".", "lock", "(", ")", ";", "try", "{", "latestCompletedCheckpoint", "=", "completed", ";", "counts", ".", "incrementCompletedCheckpoints", "(",...
Callback when a checkpoint completes. @param completed The completed checkpoint stats.
[ "Callback", "when", "a", "checkpoint", "completes", "." ]
b62db93bf63cb3bb34dd03d611a779d9e3fc61ac
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/checkpoint/CheckpointStatsTracker.java#L246-L260
train
Reports a completed checkpoint.
[ 30522, 2797, 11675, 3189, 9006, 10814, 3064, 5403, 3600, 8400, 1006, 2949, 5403, 3600, 26521, 29336, 2015, 2949, 1007, 1063, 26319, 16416, 2094, 26373, 30524, 1025, 2381, 1012, 5672, 11837, 4667, 5403, 3600, 8400, 3762, 3593, 1006, 2949, 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
common/src/main/java/io/netty/util/internal/SystemPropertyUtil.java
SystemPropertyUtil.get
public static String get(final String key, String def) { if (key == null) { throw new NullPointerException("key"); } if (key.isEmpty()) { throw new IllegalArgumentException("key must not be empty."); } String value = null; try { if (System.getSecurityManager() == null) { value = System.getProperty(key); } else { value = AccessController.doPrivileged(new PrivilegedAction<String>() { @Override public String run() { return System.getProperty(key); } }); } } catch (SecurityException e) { logger.warn("Unable to retrieve a system property '{}'; default values will be used.", key, e); } if (value == null) { return def; } return value; }
java
public static String get(final String key, String def) { if (key == null) { throw new NullPointerException("key"); } if (key.isEmpty()) { throw new IllegalArgumentException("key must not be empty."); } String value = null; try { if (System.getSecurityManager() == null) { value = System.getProperty(key); } else { value = AccessController.doPrivileged(new PrivilegedAction<String>() { @Override public String run() { return System.getProperty(key); } }); } } catch (SecurityException e) { logger.warn("Unable to retrieve a system property '{}'; default values will be used.", key, e); } if (value == null) { return def; } return value; }
[ "public", "static", "String", "get", "(", "final", "String", "key", ",", "String", "def", ")", "{", "if", "(", "key", "==", "null", ")", "{", "throw", "new", "NullPointerException", "(", "\"key\"", ")", ";", "}", "if", "(", "key", ".", "isEmpty", "("...
Returns the value of the Java system property with the specified {@code key}, while falling back to the specified default value if the property access fails. @return the property value. {@code def} if there's no such property or if an access to the specified property is not allowed.
[ "Returns", "the", "value", "of", "the", "Java", "system", "property", "with", "the", "specified", "{", "@code", "key", "}", "while", "falling", "back", "to", "the", "specified", "default", "value", "if", "the", "property", "access", "fails", "." ]
ba06eafa1c1824bd154f1a380019e7ea2edf3c4c
https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/common/src/main/java/io/netty/util/internal/SystemPropertyUtil.java#L58-L87
train
Get a system property value.
[ 30522, 2270, 10763, 5164, 2131, 1006, 2345, 5164, 3145, 1010, 5164, 13366, 1007, 1063, 2065, 1006, 3145, 1027, 1027, 19701, 1007, 1063, 5466, 2047, 19701, 8400, 7869, 2595, 24422, 1006, 1000, 3145, 1000, 1007, 1025, 1065, 2065, 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...
hankcs/HanLP
src/main/java/com/hankcs/hanlp/model/perceptron/model/LinearModel.java
LinearModel.save
public void save(String modelFile, final double ratio) throws IOException { save(modelFile, featureMap.entrySet(), ratio); }
java
public void save(String modelFile, final double ratio) throws IOException { save(modelFile, featureMap.entrySet(), ratio); }
[ "public", "void", "save", "(", "String", "modelFile", ",", "final", "double", "ratio", ")", "throws", "IOException", "{", "save", "(", "modelFile", ",", "featureMap", ".", "entrySet", "(", ")", ",", "ratio", ")", ";", "}" ]
压缩并保存 @param modelFile 路径 @param ratio 压缩比c(压缩掉的体积,压缩后体积变为1-c) @throws IOException
[ "压缩并保存" ]
a538d0722ab2e4980a9dcd9ea40324fc3ddba7ce
https://github.com/hankcs/HanLP/blob/a538d0722ab2e4980a9dcd9ea40324fc3ddba7ce/src/main/java/com/hankcs/hanlp/model/perceptron/model/LinearModel.java#L174-L177
train
Saves the sequence of features to a file.
[ 30522, 2270, 11675, 3828, 1006, 5164, 2944, 8873, 2571, 1010, 2345, 3313, 6463, 1007, 11618, 22834, 10288, 24422, 1063, 3828, 1006, 2944, 8873, 2571, 1010, 3444, 2863, 2361, 1012, 4443, 13462, 1006, 1007, 1010, 6463, 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...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
hankcs/HanLP
src/main/java/com/hankcs/hanlp/dependency/nnparser/Matrix.java
Matrix.setMatrix
public void setMatrix(int i0, int i1, int j0, int j1, Matrix X) { try { for (int i = i0; i <= i1; i++) { for (int j = j0; j <= j1; j++) { A[i][j] = X.get(i - i0, j - j0); } } } catch (ArrayIndexOutOfBoundsException e) { throw new ArrayIndexOutOfBoundsException("Submatrix indices"); } }
java
public void setMatrix(int i0, int i1, int j0, int j1, Matrix X) { try { for (int i = i0; i <= i1; i++) { for (int j = j0; j <= j1; j++) { A[i][j] = X.get(i - i0, j - j0); } } } catch (ArrayIndexOutOfBoundsException e) { throw new ArrayIndexOutOfBoundsException("Submatrix indices"); } }
[ "public", "void", "setMatrix", "(", "int", "i0", ",", "int", "i1", ",", "int", "j0", ",", "int", "j1", ",", "Matrix", "X", ")", "{", "try", "{", "for", "(", "int", "i", "=", "i0", ";", "i", "<=", "i1", ";", "i", "++", ")", "{", "for", "(", ...
Set a submatrix. @param i0 Initial row index @param i1 Final row index @param j0 Initial column index @param j1 Final column index @param X A(i0:i1,j0:j1) @throws ArrayIndexOutOfBoundsException Submatrix indices
[ "Set", "a", "submatrix", "." ]
a538d0722ab2e4980a9dcd9ea40324fc3ddba7ce
https://github.com/hankcs/HanLP/blob/a538d0722ab2e4980a9dcd9ea40324fc3ddba7ce/src/main/java/com/hankcs/hanlp/dependency/nnparser/Matrix.java#L500-L516
train
Sets the matrix of the A.
[ 30522, 2270, 11675, 2275, 18900, 17682, 1006, 20014, 1045, 2692, 1010, 20014, 1045, 2487, 1010, 20014, 1046, 2692, 1010, 20014, 1046, 2487, 1010, 8185, 1060, 1007, 1063, 3046, 1063, 2005, 1006, 20014, 1045, 1027, 1045, 2692, 1025, 1045, 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-streaming-java/src/main/java/org/apache/flink/streaming/api/datastream/StreamProjection.java
StreamProjection.projectTuple6
public <T0, T1, T2, T3, T4, T5> SingleOutputStreamOperator<Tuple6<T0, T1, T2, T3, T4, T5>> projectTuple6() { TypeInformation<?>[] fTypes = extractFieldTypes(fieldIndexes, dataStream.getType()); TupleTypeInfo<Tuple6<T0, T1, T2, T3, T4, T5>> tType = new TupleTypeInfo<Tuple6<T0, T1, T2, T3, T4, T5>>(fTypes); return dataStream.transform("Projection", tType, new StreamProject<IN, Tuple6<T0, T1, T2, T3, T4, T5>>(fieldIndexes, tType.createSerializer(dataStream.getExecutionConfig()))); }
java
public <T0, T1, T2, T3, T4, T5> SingleOutputStreamOperator<Tuple6<T0, T1, T2, T3, T4, T5>> projectTuple6() { TypeInformation<?>[] fTypes = extractFieldTypes(fieldIndexes, dataStream.getType()); TupleTypeInfo<Tuple6<T0, T1, T2, T3, T4, T5>> tType = new TupleTypeInfo<Tuple6<T0, T1, T2, T3, T4, T5>>(fTypes); return dataStream.transform("Projection", tType, new StreamProject<IN, Tuple6<T0, T1, T2, T3, T4, T5>>(fieldIndexes, tType.createSerializer(dataStream.getExecutionConfig()))); }
[ "public", "<", "T0", ",", "T1", ",", "T2", ",", "T3", ",", "T4", ",", "T5", ">", "SingleOutputStreamOperator", "<", "Tuple6", "<", "T0", ",", "T1", ",", "T2", ",", "T3", ",", "T4", ",", "T5", ">", ">", "projectTuple6", "(", ")", "{", "TypeInforma...
Projects a {@link Tuple} {@link DataStream} to the previously selected fields. @return The projected DataStream. @see Tuple @see DataStream
[ "Projects", "a", "{", "@link", "Tuple", "}", "{", "@link", "DataStream", "}", "to", "the", "previously", "selected", "fields", "." ]
b62db93bf63cb3bb34dd03d611a779d9e3fc61ac
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-streaming-java/src/main/java/org/apache/flink/streaming/api/datastream/StreamProjection.java#L204-L209
train
Project a tuple of data stream to a single output stream.
[ 30522, 2270, 1026, 1056, 2692, 1010, 1056, 2487, 1010, 1056, 2475, 1010, 1056, 2509, 1010, 1056, 2549, 1010, 1056, 2629, 1028, 2309, 5833, 18780, 21422, 25918, 8844, 1026, 10722, 10814, 2575, 1026, 1056, 2692, 1010, 1056, 2487, 1010, 1056, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
looly/hutool
hutool-core/src/main/java/cn/hutool/core/lang/Validator.java
Validator.validateMac
public static <T extends CharSequence> T validateMac(T value, String errorMsg) throws ValidateException { if (false == isMac(value)) { throw new ValidateException(errorMsg); } return value; }
java
public static <T extends CharSequence> T validateMac(T value, String errorMsg) throws ValidateException { if (false == isMac(value)) { throw new ValidateException(errorMsg); } return value; }
[ "public", "static", "<", "T", "extends", "CharSequence", ">", "T", "validateMac", "(", "T", "value", ",", "String", "errorMsg", ")", "throws", "ValidateException", "{", "if", "(", "false", "==", "isMac", "(", "value", ")", ")", "{", "throw", "new", "Vali...
验证是否为MAC地址 @param <T> 字符串类型 @param value 值 @param errorMsg 验证错误的信息 @return 验证后的值 @throws ValidateException 验证异常 @since 4.1.3
[ "验证是否为MAC地址" ]
bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a
https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/lang/Validator.java#L863-L868
train
Validate MAC.
[ 30522, 2270, 10763, 1026, 1056, 8908, 25869, 3366, 4226, 5897, 1028, 1056, 9398, 3686, 22911, 1006, 1056, 3643, 1010, 5164, 7561, 5244, 2290, 1007, 11618, 9398, 3686, 10288, 24422, 1063, 2065, 1006, 6270, 1027, 1027, 2003, 22911, 1006, 3643...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -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/security/servlet/StaticResourceRequest.java
StaticResourceRequest.at
public StaticResourceRequestMatcher at(Set<StaticResourceLocation> locations) { Assert.notNull(locations, "Locations must not be null"); return new StaticResourceRequestMatcher(new LinkedHashSet<>(locations)); }
java
public StaticResourceRequestMatcher at(Set<StaticResourceLocation> locations) { Assert.notNull(locations, "Locations must not be null"); return new StaticResourceRequestMatcher(new LinkedHashSet<>(locations)); }
[ "public", "StaticResourceRequestMatcher", "at", "(", "Set", "<", "StaticResourceLocation", ">", "locations", ")", "{", "Assert", ".", "notNull", "(", "locations", ",", "\"Locations must not be null\"", ")", ";", "return", "new", "StaticResourceRequestMatcher", "(", "n...
Returns a matcher that includes the specified {@link StaticResourceLocation Locations}. For example: <pre class="code"> PathRequest.toStaticResources().at(locations) </pre> @param locations the locations to include @return the configured {@link RequestMatcher}
[ "Returns", "a", "matcher", "that", "includes", "the", "specified", "{" ]
0b27f7c70e164b2b1a96477f1d9c1acba56790c1
https://github.com/spring-projects/spring-boot/blob/0b27f7c70e164b2b1a96477f1d9c1acba56790c1/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/security/servlet/StaticResourceRequest.java#L89-L92
train
Returns a new matcher that matches static resource resources at the given locations.
[ 30522, 2270, 10763, 6072, 8162, 17119, 2063, 15500, 18900, 7474, 2012, 1006, 2275, 1026, 10763, 6072, 8162, 29109, 23909, 1028, 5269, 1007, 1063, 20865, 1012, 2025, 11231, 3363, 1006, 5269, 1010, 1000, 5269, 2442, 2025, 2022, 19701, 1000, 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...
networknt/light-4j
security/src/main/java/com/networknt/security/JwtHelper.java
JwtHelper.verifyJwt
@Deprecated public static JwtClaims verifyJwt(String jwt, boolean ignoreExpiry) throws InvalidJwtException, ExpiredTokenException { return verifyJwt(jwt, ignoreExpiry, true); }
java
@Deprecated public static JwtClaims verifyJwt(String jwt, boolean ignoreExpiry) throws InvalidJwtException, ExpiredTokenException { return verifyJwt(jwt, ignoreExpiry, true); }
[ "@", "Deprecated", "public", "static", "JwtClaims", "verifyJwt", "(", "String", "jwt", ",", "boolean", "ignoreExpiry", ")", "throws", "InvalidJwtException", ",", "ExpiredTokenException", "{", "return", "verifyJwt", "(", "jwt", ",", "ignoreExpiry", ",", "true", ")"...
Verify JWT token format and signature. If ignoreExpiry is true, skip expiry verification, otherwise verify the expiry before signature verification. In most cases, we need to verify the expiry of the jwt token. The only time we need to ignore expiry verification is in SPA middleware handlers which need to verify csrf token in jwt against the csrf token in the request header to renew the expired token. @param jwt String of Json web token @param ignoreExpiry If true, don't verify if the token is expired. @return JwtClaims object @throws InvalidJwtException InvalidJwtException @throws ExpiredTokenException ExpiredTokenException @deprecated Use verifyToken instead.
[ "Verify", "JWT", "token", "format", "and", "signature", ".", "If", "ignoreExpiry", "is", "true", "skip", "expiry", "verification", "otherwise", "verify", "the", "expiry", "before", "signature", "verification", "." ]
2a60257c60663684c8f6dc8b5ea3cf184e534db6
https://github.com/networknt/light-4j/blob/2a60257c60663684c8f6dc8b5ea3cf184e534db6/security/src/main/java/com/networknt/security/JwtHelper.java#L176-L179
train
Verify a JWT.
[ 30522, 1030, 2139, 28139, 12921, 2270, 10763, 1046, 26677, 25154, 2015, 20410, 3501, 26677, 1006, 5164, 1046, 26677, 1010, 22017, 20898, 8568, 10288, 8197, 2854, 1007, 11618, 19528, 3501, 26677, 10288, 24422, 1010, 13735, 18715, 8625, 2595, 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/convert/Convert.java
Convert.toEnum
public static <E extends Enum<E>> E toEnum(Class<E> clazz, Object value) { return toEnum(clazz, value, null); }
java
public static <E extends Enum<E>> E toEnum(Class<E> clazz, Object value) { return toEnum(clazz, value, null); }
[ "public", "static", "<", "E", "extends", "Enum", "<", "E", ">", ">", "E", "toEnum", "(", "Class", "<", "E", ">", "clazz", ",", "Object", "value", ")", "{", "return", "toEnum", "(", "clazz", ",", "value", ",", "null", ")", ";", "}" ]
转换为Enum对象<br> 如果给定的值为空,或者转换失败,返回默认值<code>null</code><br> @param <E> 枚举类型 @param clazz Enum的Class @param value 值 @return Enum
[ "转换为Enum对象<br", ">", "如果给定的值为空,或者转换失败,返回默认值<code", ">", "null<", "/", "code", ">", "<br", ">" ]
bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a
https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/convert/Convert.java#L487-L489
train
Converts an object to an enum.
[ 30522, 2270, 10763, 1026, 1041, 8908, 4372, 2819, 1026, 1041, 1028, 1028, 1041, 11756, 19172, 1006, 2465, 1026, 1041, 1028, 18856, 10936, 2480, 1010, 4874, 3643, 1007, 1063, 2709, 11756, 19172, 1006, 18856, 10936, 2480, 1010, 3643, 1010, 30...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
apache/flink
flink-core/src/main/java/org/apache/flink/api/common/functions/util/AbstractRuntimeUDFContext.java
AbstractRuntimeUDFContext.getAccumulator
@SuppressWarnings("unchecked") private <V, A extends Serializable> Accumulator<V, A> getAccumulator(String name, Class<? extends Accumulator<V, A>> accumulatorClass) { Accumulator<?, ?> accumulator = accumulators.get(name); if (accumulator != null) { AccumulatorHelper.compareAccumulatorTypes(name, accumulator.getClass(), accumulatorClass); } else { // Create new accumulator try { accumulator = accumulatorClass.newInstance(); } catch (Exception e) { throw new RuntimeException("Cannot create accumulator " + accumulatorClass.getName()); } accumulators.put(name, accumulator); } return (Accumulator<V, A>) accumulator; }
java
@SuppressWarnings("unchecked") private <V, A extends Serializable> Accumulator<V, A> getAccumulator(String name, Class<? extends Accumulator<V, A>> accumulatorClass) { Accumulator<?, ?> accumulator = accumulators.get(name); if (accumulator != null) { AccumulatorHelper.compareAccumulatorTypes(name, accumulator.getClass(), accumulatorClass); } else { // Create new accumulator try { accumulator = accumulatorClass.newInstance(); } catch (Exception e) { throw new RuntimeException("Cannot create accumulator " + accumulatorClass.getName()); } accumulators.put(name, accumulator); } return (Accumulator<V, A>) accumulator; }
[ "@", "SuppressWarnings", "(", "\"unchecked\"", ")", "private", "<", "V", ",", "A", "extends", "Serializable", ">", "Accumulator", "<", "V", ",", "A", ">", "getAccumulator", "(", "String", "name", ",", "Class", "<", "?", "extends", "Accumulator", "<", "V", ...
--------------------------------------------------------------------------------------------
[ "--------------------------------------------------------------------------------------------" ]
b62db93bf63cb3bb34dd03d611a779d9e3fc61ac
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-core/src/main/java/org/apache/flink/api/common/functions/util/AbstractRuntimeUDFContext.java#L180-L199
train
Gets an accumulator by name.
[ 30522, 1030, 16081, 9028, 5582, 2015, 1006, 1000, 4895, 5403, 18141, 1000, 1007, 2797, 1026, 1058, 1010, 1037, 8908, 7642, 21335, 3468, 1028, 16222, 2819, 20350, 1026, 1058, 1010, 1037, 1028, 2131, 6305, 24894, 20350, 1006, 5164, 2171, 1010...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
apache/flink
flink-runtime/src/main/java/org/apache/flink/runtime/state/StateBackendLoader.java
StateBackendLoader.loadStateBackendFromConfig
public static StateBackend loadStateBackendFromConfig( Configuration config, ClassLoader classLoader, @Nullable Logger logger) throws IllegalConfigurationException, DynamicCodeLoadingException, IOException { checkNotNull(config, "config"); checkNotNull(classLoader, "classLoader"); final String backendName = config.getString(CheckpointingOptions.STATE_BACKEND); if (backendName == null) { return null; } // by default the factory class is the backend name String factoryClassName = backendName; switch (backendName.toLowerCase()) { case MEMORY_STATE_BACKEND_NAME: MemoryStateBackend memBackend = new MemoryStateBackendFactory().createFromConfig(config, classLoader); if (logger != null) { Path memExternalized = memBackend.getCheckpointPath(); String extern = memExternalized == null ? "" : " (externalized to " + memExternalized + ')'; logger.info("State backend is set to heap memory (checkpoint to JobManager) {}", extern); } return memBackend; case FS_STATE_BACKEND_NAME: FsStateBackend fsBackend = new FsStateBackendFactory().createFromConfig(config, classLoader); if (logger != null) { logger.info("State backend is set to heap memory (checkpoints to filesystem \"{}\")", fsBackend.getCheckpointPath()); } return fsBackend; case ROCKSDB_STATE_BACKEND_NAME: factoryClassName = "org.apache.flink.contrib.streaming.state.RocksDBStateBackendFactory"; // fall through to the 'default' case that uses reflection to load the backend // that way we can keep RocksDB in a separate module default: if (logger != null) { logger.info("Loading state backend via factory {}", factoryClassName); } StateBackendFactory<?> factory; try { @SuppressWarnings("rawtypes") Class<? extends StateBackendFactory> clazz = Class.forName(factoryClassName, false, classLoader) .asSubclass(StateBackendFactory.class); factory = clazz.newInstance(); } catch (ClassNotFoundException e) { throw new DynamicCodeLoadingException( "Cannot find configured state backend factory class: " + backendName, e); } catch (ClassCastException | InstantiationException | IllegalAccessException e) { throw new DynamicCodeLoadingException("The class configured under '" + CheckpointingOptions.STATE_BACKEND.key() + "' is not a valid state backend factory (" + backendName + ')', e); } return factory.createFromConfig(config, classLoader); } }
java
public static StateBackend loadStateBackendFromConfig( Configuration config, ClassLoader classLoader, @Nullable Logger logger) throws IllegalConfigurationException, DynamicCodeLoadingException, IOException { checkNotNull(config, "config"); checkNotNull(classLoader, "classLoader"); final String backendName = config.getString(CheckpointingOptions.STATE_BACKEND); if (backendName == null) { return null; } // by default the factory class is the backend name String factoryClassName = backendName; switch (backendName.toLowerCase()) { case MEMORY_STATE_BACKEND_NAME: MemoryStateBackend memBackend = new MemoryStateBackendFactory().createFromConfig(config, classLoader); if (logger != null) { Path memExternalized = memBackend.getCheckpointPath(); String extern = memExternalized == null ? "" : " (externalized to " + memExternalized + ')'; logger.info("State backend is set to heap memory (checkpoint to JobManager) {}", extern); } return memBackend; case FS_STATE_BACKEND_NAME: FsStateBackend fsBackend = new FsStateBackendFactory().createFromConfig(config, classLoader); if (logger != null) { logger.info("State backend is set to heap memory (checkpoints to filesystem \"{}\")", fsBackend.getCheckpointPath()); } return fsBackend; case ROCKSDB_STATE_BACKEND_NAME: factoryClassName = "org.apache.flink.contrib.streaming.state.RocksDBStateBackendFactory"; // fall through to the 'default' case that uses reflection to load the backend // that way we can keep RocksDB in a separate module default: if (logger != null) { logger.info("Loading state backend via factory {}", factoryClassName); } StateBackendFactory<?> factory; try { @SuppressWarnings("rawtypes") Class<? extends StateBackendFactory> clazz = Class.forName(factoryClassName, false, classLoader) .asSubclass(StateBackendFactory.class); factory = clazz.newInstance(); } catch (ClassNotFoundException e) { throw new DynamicCodeLoadingException( "Cannot find configured state backend factory class: " + backendName, e); } catch (ClassCastException | InstantiationException | IllegalAccessException e) { throw new DynamicCodeLoadingException("The class configured under '" + CheckpointingOptions.STATE_BACKEND.key() + "' is not a valid state backend factory (" + backendName + ')', e); } return factory.createFromConfig(config, classLoader); } }
[ "public", "static", "StateBackend", "loadStateBackendFromConfig", "(", "Configuration", "config", ",", "ClassLoader", "classLoader", ",", "@", "Nullable", "Logger", "logger", ")", "throws", "IllegalConfigurationException", ",", "DynamicCodeLoadingException", ",", "IOExcepti...
Loads the state backend from the configuration, from the parameter 'state.backend', as defined in {@link CheckpointingOptions#STATE_BACKEND}. <p>The state backends can be specified either via their shortcut name, or via the class name of a {@link StateBackendFactory}. If a StateBackendFactory class name is specified, the factory is instantiated (via its zero-argument constructor) and its {@link StateBackendFactory#createFromConfig(Configuration, ClassLoader)} method is called. <p>Recognized shortcut names are '{@value StateBackendLoader#MEMORY_STATE_BACKEND_NAME}', '{@value StateBackendLoader#FS_STATE_BACKEND_NAME}', and '{@value StateBackendLoader#ROCKSDB_STATE_BACKEND_NAME}'. @param config The configuration to load the state backend from @param classLoader The class loader that should be used to load the state backend @param logger Optionally, a logger to log actions to (may be null) @return The instantiated state backend. @throws DynamicCodeLoadingException Thrown if a state backend factory is configured and the factory class was not found or the factory could not be instantiated @throws IllegalConfigurationException May be thrown by the StateBackendFactory when creating / configuring the state backend in the factory @throws IOException May be thrown by the StateBackendFactory when instantiating the state backend
[ "Loads", "the", "state", "backend", "from", "the", "configuration", "from", "the", "parameter", "state", ".", "backend", "as", "defined", "in", "{", "@link", "CheckpointingOptions#STATE_BACKEND", "}", "." ]
b62db93bf63cb3bb34dd03d611a779d9e3fc61ac
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/state/StateBackendLoader.java#L92-L159
train
Load the state backend from the configuration.
[ 30522, 2270, 10763, 2110, 5963, 10497, 15665, 12259, 5963, 10497, 19699, 5358, 8663, 8873, 2290, 1006, 9563, 9530, 8873, 2290, 1010, 2465, 11066, 2121, 2465, 11066, 2121, 1010, 1030, 19701, 3085, 8833, 4590, 8833, 4590, 1007, 11618, 6206, 8...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
hankcs/HanLP
src/main/java/com/hankcs/hanlp/corpus/io/IOUtil.java
IOUtil.loadDictionary
public static void loadDictionary(BufferedReader br, TreeMap<String, CoreDictionary.Attribute> storage, boolean isCSV, Nature defaultNature) throws IOException { String splitter = "\\s"; if (isCSV) { splitter = ","; } String line; boolean firstLine = true; while ((line = br.readLine()) != null) { if (firstLine) { line = IOUtil.removeUTF8BOM(line); firstLine = false; } String param[] = line.split(splitter); int natureCount = (param.length - 1) / 2; CoreDictionary.Attribute attribute; if (natureCount == 0) { attribute = new CoreDictionary.Attribute(defaultNature); } else { attribute = new CoreDictionary.Attribute(natureCount); for (int i = 0; i < natureCount; ++i) { attribute.nature[i] = LexiconUtility.convertStringToNature(param[1 + 2 * i]); attribute.frequency[i] = Integer.parseInt(param[2 + 2 * i]); attribute.totalFrequency += attribute.frequency[i]; } } storage.put(param[0], attribute); } br.close(); }
java
public static void loadDictionary(BufferedReader br, TreeMap<String, CoreDictionary.Attribute> storage, boolean isCSV, Nature defaultNature) throws IOException { String splitter = "\\s"; if (isCSV) { splitter = ","; } String line; boolean firstLine = true; while ((line = br.readLine()) != null) { if (firstLine) { line = IOUtil.removeUTF8BOM(line); firstLine = false; } String param[] = line.split(splitter); int natureCount = (param.length - 1) / 2; CoreDictionary.Attribute attribute; if (natureCount == 0) { attribute = new CoreDictionary.Attribute(defaultNature); } else { attribute = new CoreDictionary.Attribute(natureCount); for (int i = 0; i < natureCount; ++i) { attribute.nature[i] = LexiconUtility.convertStringToNature(param[1 + 2 * i]); attribute.frequency[i] = Integer.parseInt(param[2 + 2 * i]); attribute.totalFrequency += attribute.frequency[i]; } } storage.put(param[0], attribute); } br.close(); }
[ "public", "static", "void", "loadDictionary", "(", "BufferedReader", "br", ",", "TreeMap", "<", "String", ",", "CoreDictionary", ".", "Attribute", ">", "storage", ",", "boolean", "isCSV", ",", "Nature", "defaultNature", ")", "throws", "IOException", "{", "String...
将一个BufferedReader中的词条加载到词典 @param br 源 @param storage 储存位置 @throws IOException 异常表示加载失败
[ "将一个BufferedReader中的词条加载到词典" ]
a538d0722ab2e4980a9dcd9ea40324fc3ddba7ce
https://github.com/hankcs/HanLP/blob/a538d0722ab2e4980a9dcd9ea40324fc3ddba7ce/src/main/java/com/hankcs/hanlp/corpus/io/IOUtil.java#L705-L742
train
Load a dictionary from a buffered reader.
[ 30522, 2270, 10763, 11675, 7170, 29201, 3258, 5649, 1006, 17698, 2098, 16416, 4063, 7987, 1010, 3392, 2863, 2361, 1026, 5164, 1010, 4563, 29201, 3258, 5649, 1012, 17961, 1028, 5527, 1010, 22017, 20898, 2003, 6169, 2615, 1010, 3267, 12398, 1...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
hankcs/HanLP
src/main/java/com/hankcs/hanlp/tokenizer/lexical/AbstractLexicalAnalyzer.java
AbstractLexicalAnalyzer.segment
public List<String> segment(String sentence) { return segment(sentence, CharTable.convert(sentence)); }
java
public List<String> segment(String sentence) { return segment(sentence, CharTable.convert(sentence)); }
[ "public", "List", "<", "String", ">", "segment", "(", "String", "sentence", ")", "{", "return", "segment", "(", "sentence", ",", "CharTable", ".", "convert", "(", "sentence", ")", ")", ";", "}" ]
中文分词 @param sentence @return
[ "中文分词" ]
a538d0722ab2e4980a9dcd9ea40324fc3ddba7ce
https://github.com/hankcs/HanLP/blob/a538d0722ab2e4980a9dcd9ea40324fc3ddba7ce/src/main/java/com/hankcs/hanlp/tokenizer/lexical/AbstractLexicalAnalyzer.java#L178-L181
train
segment a sentence into a sequence of tokens.
[ 30522, 2270, 2862, 1026, 5164, 1028, 6903, 1006, 5164, 6251, 1007, 1063, 2709, 6903, 1006, 6251, 1010, 3673, 3085, 1012, 10463, 1006, 6251, 1007, 1007, 1025, 1065, 102, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -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/ReferenceCountUtil.java
ReferenceCountUtil.retain
@SuppressWarnings("unchecked") public static <T> T retain(T msg) { if (msg instanceof ReferenceCounted) { return (T) ((ReferenceCounted) msg).retain(); } return msg; }
java
@SuppressWarnings("unchecked") public static <T> T retain(T msg) { if (msg instanceof ReferenceCounted) { return (T) ((ReferenceCounted) msg).retain(); } return msg; }
[ "@", "SuppressWarnings", "(", "\"unchecked\"", ")", "public", "static", "<", "T", ">", "T", "retain", "(", "T", "msg", ")", "{", "if", "(", "msg", "instanceof", "ReferenceCounted", ")", "{", "return", "(", "T", ")", "(", "(", "ReferenceCounted", ")", "...
Try to call {@link ReferenceCounted#retain()} if the specified message implements {@link ReferenceCounted}. If the specified message doesn't implement {@link ReferenceCounted}, this method does nothing.
[ "Try", "to", "call", "{" ]
ba06eafa1c1824bd154f1a380019e7ea2edf3c4c
https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/common/src/main/java/io/netty/util/ReferenceCountUtil.java#L37-L43
train
Retains a reference counted object.
[ 30522, 1030, 16081, 9028, 5582, 2015, 1006, 1000, 4895, 5403, 18141, 1000, 1007, 2270, 10763, 1026, 1056, 1028, 1056, 9279, 1006, 1056, 5796, 2290, 1007, 1063, 2065, 1006, 5796, 2290, 6013, 11253, 4431, 3597, 16671, 2098, 1007, 1063, 2709, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
networknt/light-4j
client/src/main/java/com/networknt/client/Http2Client.java
Http2Client.addCcTokenTrace
public Result addCcTokenTrace(ClientRequest request, String traceabilityId) { Result<Jwt> result = tokenManager.getJwt(request); if(result.isFailure()) { return Failure.of(result.getError()); } request.getRequestHeaders().put(Headers.AUTHORIZATION, "Bearer " + result.getResult().getJwt()); request.getRequestHeaders().put(HttpStringConstants.TRACEABILITY_ID, traceabilityId); return result; }
java
public Result addCcTokenTrace(ClientRequest request, String traceabilityId) { Result<Jwt> result = tokenManager.getJwt(request); if(result.isFailure()) { return Failure.of(result.getError()); } request.getRequestHeaders().put(Headers.AUTHORIZATION, "Bearer " + result.getResult().getJwt()); request.getRequestHeaders().put(HttpStringConstants.TRACEABILITY_ID, traceabilityId); return result; }
[ "public", "Result", "addCcTokenTrace", "(", "ClientRequest", "request", ",", "String", "traceabilityId", ")", "{", "Result", "<", "Jwt", ">", "result", "=", "tokenManager", ".", "getJwt", "(", "request", ")", ";", "if", "(", "result", ".", "isFailure", "(", ...
Add Client Credentials token cached in the client for standalone application This is the method called from standalone application like enterprise scheduler for batch jobs or mobile apps. @param request the http request @param traceabilityId the traceability id @return Result when fail to get jwt, it will return a Status.
[ "Add", "Client", "Credentials", "token", "cached", "in", "the", "client", "for", "standalone", "application" ]
2a60257c60663684c8f6dc8b5ea3cf184e534db6
https://github.com/networknt/light-4j/blob/2a60257c60663684c8f6dc8b5ea3cf184e534db6/client/src/main/java/com/networknt/client/Http2Client.java#L333-L339
train
Add the cc token trace to the request
[ 30522, 2270, 2765, 5587, 9468, 18715, 4765, 22903, 1006, 7396, 2890, 15500, 5227, 1010, 5164, 7637, 8010, 3593, 1007, 1063, 2765, 1026, 1046, 26677, 1028, 2765, 1027, 19204, 24805, 4590, 1012, 2131, 3501, 26677, 1006, 5227, 1007, 1025, 2065...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
apache/flink
flink-core/src/main/java/org/apache/flink/api/common/ExecutionConfig.java
ExecutionConfig.registerPojoType
public void registerPojoType(Class<?> type) { if (type == null) { throw new NullPointerException("Cannot register null type class."); } if (!registeredPojoTypes.contains(type)) { registeredPojoTypes.add(type); } }
java
public void registerPojoType(Class<?> type) { if (type == null) { throw new NullPointerException("Cannot register null type class."); } if (!registeredPojoTypes.contains(type)) { registeredPojoTypes.add(type); } }
[ "public", "void", "registerPojoType", "(", "Class", "<", "?", ">", "type", ")", "{", "if", "(", "type", "==", "null", ")", "{", "throw", "new", "NullPointerException", "(", "\"Cannot register null type class.\"", ")", ";", "}", "if", "(", "!", "registeredPoj...
Registers the given type with the serialization stack. If the type is eventually serialized as a POJO, then the type is registered with the POJO serializer. If the type ends up being serialized with Kryo, then it will be registered at Kryo to make sure that only tags are written. @param type The class of the type to register.
[ "Registers", "the", "given", "type", "with", "the", "serialization", "stack", ".", "If", "the", "type", "is", "eventually", "serialized", "as", "a", "POJO", "then", "the", "type", "is", "registered", "with", "the", "POJO", "serializer", ".", "If", "the", "...
b62db93bf63cb3bb34dd03d611a779d9e3fc61ac
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-core/src/main/java/org/apache/flink/api/common/ExecutionConfig.java#L831-L838
train
Registers a POJO type.
[ 30522, 2270, 11675, 4236, 6873, 5558, 13874, 1006, 2465, 1026, 1029, 1028, 2828, 1007, 1063, 2065, 1006, 2828, 1027, 1027, 19701, 1007, 1063, 5466, 2047, 19701, 8400, 7869, 2595, 24422, 1006, 1000, 3685, 4236, 19701, 2828, 2465, 1012, 1000,...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -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.read
@Override public Excel03SaxReader read(File file, int sheetIndex) throws POIException { try { return read(new POIFSFileSystem(file), sheetIndex); } catch (IOException e) { throw new POIException(e); } }
java
@Override public Excel03SaxReader read(File file, int sheetIndex) throws POIException { try { return read(new POIFSFileSystem(file), sheetIndex); } catch (IOException e) { throw new POIException(e); } }
[ "@", "Override", "public", "Excel03SaxReader", "read", "(", "File", "file", ",", "int", "sheetIndex", ")", "throws", "POIException", "{", "try", "{", "return", "read", "(", "new", "POIFSFileSystem", "(", "file", ")", ",", "sheetIndex", ")", ";", "}", "catc...
------------------------------------------------------------------------------ Read start
[ "------------------------------------------------------------------------------", "Read", "start" ]
bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a
https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-poi/src/main/java/cn/hutool/poi/excel/sax/Excel03SaxReader.java#L83-L90
train
Reads an Excel file from a file on the specified sheet.
[ 30522, 1030, 2058, 15637, 2270, 24970, 2692, 2509, 3736, 2595, 16416, 4063, 3191, 1006, 5371, 5371, 1010, 20014, 7123, 22254, 10288, 1007, 11618, 13433, 2666, 2595, 24422, 1063, 3046, 1063, 2709, 3191, 1006, 2047, 13433, 10128, 22747, 9463, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -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/exceptions/ExceptionUtil.java
ExceptionUtil.wrap
@SuppressWarnings("unchecked") public static <T extends Throwable> T wrap(Throwable throwable, Class<T> wrapThrowable) { if (wrapThrowable.isInstance(throwable)) { return (T) throwable; } return ReflectUtil.newInstance(wrapThrowable, throwable); }
java
@SuppressWarnings("unchecked") public static <T extends Throwable> T wrap(Throwable throwable, Class<T> wrapThrowable) { if (wrapThrowable.isInstance(throwable)) { return (T) throwable; } return ReflectUtil.newInstance(wrapThrowable, throwable); }
[ "@", "SuppressWarnings", "(", "\"unchecked\"", ")", "public", "static", "<", "T", "extends", "Throwable", ">", "T", "wrap", "(", "Throwable", "throwable", ",", "Class", "<", "T", ">", "wrapThrowable", ")", "{", "if", "(", "wrapThrowable", ".", "isInstance", ...
包装一个异常 @param throwable 异常 @param wrapThrowable 包装后的异常类 @return 包装后的异常 @since 3.3.0
[ "包装一个异常" ]
bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a
https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/exceptions/ExceptionUtil.java#L72-L78
train
Wrap a throwable with a given class.
[ 30522, 1030, 16081, 9028, 5582, 2015, 1006, 1000, 4895, 5403, 18141, 1000, 1007, 2270, 10763, 1026, 1056, 8908, 5466, 3085, 1028, 1056, 10236, 1006, 5466, 3085, 5466, 3085, 1010, 2465, 1026, 1056, 1028, 10236, 2705, 10524, 3085, 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...
spring-projects/spring-boot
spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/web/jersey/JerseyEndpointResourceFactory.java
JerseyEndpointResourceFactory.createEndpointResources
public Collection<Resource> createEndpointResources(EndpointMapping endpointMapping, Collection<ExposableWebEndpoint> endpoints, EndpointMediaTypes endpointMediaTypes, EndpointLinksResolver linksResolver) { List<Resource> resources = new ArrayList<>(); endpoints.stream().flatMap((endpoint) -> endpoint.getOperations().stream()) .map((operation) -> createResource(endpointMapping, operation)) .forEach(resources::add); if (StringUtils.hasText(endpointMapping.getPath())) { Resource resource = createEndpointLinksResource(endpointMapping.getPath(), endpointMediaTypes, linksResolver); resources.add(resource); } return resources; }
java
public Collection<Resource> createEndpointResources(EndpointMapping endpointMapping, Collection<ExposableWebEndpoint> endpoints, EndpointMediaTypes endpointMediaTypes, EndpointLinksResolver linksResolver) { List<Resource> resources = new ArrayList<>(); endpoints.stream().flatMap((endpoint) -> endpoint.getOperations().stream()) .map((operation) -> createResource(endpointMapping, operation)) .forEach(resources::add); if (StringUtils.hasText(endpointMapping.getPath())) { Resource resource = createEndpointLinksResource(endpointMapping.getPath(), endpointMediaTypes, linksResolver); resources.add(resource); } return resources; }
[ "public", "Collection", "<", "Resource", ">", "createEndpointResources", "(", "EndpointMapping", "endpointMapping", ",", "Collection", "<", "ExposableWebEndpoint", ">", "endpoints", ",", "EndpointMediaTypes", "endpointMediaTypes", ",", "EndpointLinksResolver", "linksResolver"...
Creates {@link Resource Resources} for the operations of the given {@code webEndpoints}. @param endpointMapping the base mapping for all endpoints @param endpoints the web endpoints @param endpointMediaTypes media types consumed and produced by the endpoints @param linksResolver resolver for determining links to available endpoints @return the resources for the operations
[ "Creates", "{" ]
0b27f7c70e164b2b1a96477f1d9c1acba56790c1
https://github.com/spring-projects/spring-boot/blob/0b27f7c70e164b2b1a96477f1d9c1acba56790c1/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/web/jersey/JerseyEndpointResourceFactory.java#L76-L89
train
Creates all the endpoint resources.
[ 30522, 2270, 3074, 1026, 7692, 1028, 3443, 10497, 8400, 6072, 8162, 9623, 1006, 2203, 8400, 2863, 14853, 2203, 8400, 2863, 14853, 1010, 3074, 1026, 16258, 19150, 8545, 10609, 18927, 25785, 1028, 2203, 26521, 1010, 2203, 8400, 16969, 13874, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
hankcs/HanLP
src/main/java/com/hankcs/hanlp/corpus/dictionary/StringDictionaryMaker.java
StringDictionaryMaker.combine
public static StringDictionary combine(StringDictionary... args) { StringDictionary[] dictionaries = args.clone(); StringDictionary mainDictionary = dictionaries[0]; for (int i = 1; i < dictionaries.length; ++i) { mainDictionary.combine(dictionaries[i]); } return mainDictionary; }
java
public static StringDictionary combine(StringDictionary... args) { StringDictionary[] dictionaries = args.clone(); StringDictionary mainDictionary = dictionaries[0]; for (int i = 1; i < dictionaries.length; ++i) { mainDictionary.combine(dictionaries[i]); } return mainDictionary; }
[ "public", "static", "StringDictionary", "combine", "(", "StringDictionary", "...", "args", ")", "{", "StringDictionary", "[", "]", "dictionaries", "=", "args", ".", "clone", "(", ")", ";", "StringDictionary", "mainDictionary", "=", "dictionaries", "[", "0", "]",...
合并词典,第一个为主词典 @param args @return
[ "合并词典,第一个为主词典" ]
a538d0722ab2e4980a9dcd9ea40324fc3ddba7ce
https://github.com/hankcs/HanLP/blob/a538d0722ab2e4980a9dcd9ea40324fc3ddba7ce/src/main/java/com/hankcs/hanlp/corpus/dictionary/StringDictionaryMaker.java#L51-L61
train
Combine the specified StringDictionary objects into one.
[ 30522, 2270, 10763, 5164, 29201, 3258, 5649, 11506, 1006, 5164, 29201, 3258, 5649, 1012, 1012, 1012, 12098, 5620, 1007, 1063, 5164, 29201, 3258, 5649, 1031, 1033, 4487, 7542, 12086, 1027, 12098, 5620, 1012, 17598, 1006, 1007, 1025, 5164, 29...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -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/TGetColumnsReq.java
TGetColumnsReq.isSet
public boolean isSet(_Fields field) { if (field == null) { throw new IllegalArgumentException(); } switch (field) { case SESSION_HANDLE: return isSetSessionHandle(); case CATALOG_NAME: return isSetCatalogName(); case SCHEMA_NAME: return isSetSchemaName(); case TABLE_NAME: return isSetTableName(); case COLUMN_NAME: return isSetColumnName(); } throw new IllegalStateException(); }
java
public boolean isSet(_Fields field) { if (field == null) { throw new IllegalArgumentException(); } switch (field) { case SESSION_HANDLE: return isSetSessionHandle(); case CATALOG_NAME: return isSetCatalogName(); case SCHEMA_NAME: return isSetSchemaName(); case TABLE_NAME: return isSetTableName(); case COLUMN_NAME: return isSetColumnName(); } throw new IllegalStateException(); }
[ "public", "boolean", "isSet", "(", "_Fields", "field", ")", "{", "if", "(", "field", "==", "null", ")", "{", "throw", "new", "IllegalArgumentException", "(", ")", ";", "}", "switch", "(", "field", ")", "{", "case", "SESSION_HANDLE", ":", "return", "isSet...
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/TGetColumnsReq.java#L370-L388
train
Checks if the specified field is set to a value of a 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, 5219...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -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/SimpleSlot.java
SimpleSlot.releaseSlot
@Override public CompletableFuture<?> releaseSlot(@Nullable Throwable cause) { if (!isCanceled()) { final CompletableFuture<?> terminationFuture; if (payload != null) { // trigger the failure of the slot payload payload.fail(cause != null ? cause : new FlinkException("TaskManager was lost/killed: " + getTaskManagerLocation())); // wait for the termination of the payload before releasing the slot terminationFuture = payload.getTerminalStateFuture(); } else { terminationFuture = CompletableFuture.completedFuture(null); } terminationFuture.whenComplete( (Object ignored, Throwable throwable) -> { // release directly (if we are directly allocated), // otherwise release through the parent shared slot if (getParent() == null) { // we have to give back the slot to the owning instance if (markCancelled()) { try { getOwner().returnLogicalSlot(this); releaseFuture.complete(null); } catch (Exception e) { releaseFuture.completeExceptionally(e); } } } else { // we have to ask our parent to dispose us getParent().releaseChild(this); releaseFuture.complete(null); } }); } return releaseFuture; }
java
@Override public CompletableFuture<?> releaseSlot(@Nullable Throwable cause) { if (!isCanceled()) { final CompletableFuture<?> terminationFuture; if (payload != null) { // trigger the failure of the slot payload payload.fail(cause != null ? cause : new FlinkException("TaskManager was lost/killed: " + getTaskManagerLocation())); // wait for the termination of the payload before releasing the slot terminationFuture = payload.getTerminalStateFuture(); } else { terminationFuture = CompletableFuture.completedFuture(null); } terminationFuture.whenComplete( (Object ignored, Throwable throwable) -> { // release directly (if we are directly allocated), // otherwise release through the parent shared slot if (getParent() == null) { // we have to give back the slot to the owning instance if (markCancelled()) { try { getOwner().returnLogicalSlot(this); releaseFuture.complete(null); } catch (Exception e) { releaseFuture.completeExceptionally(e); } } } else { // we have to ask our parent to dispose us getParent().releaseChild(this); releaseFuture.complete(null); } }); } return releaseFuture; }
[ "@", "Override", "public", "CompletableFuture", "<", "?", ">", "releaseSlot", "(", "@", "Nullable", "Throwable", "cause", ")", "{", "if", "(", "!", "isCanceled", "(", ")", ")", "{", "final", "CompletableFuture", "<", "?", ">", "terminationFuture", ";", "if...
------------------------------------------------------------------------
[ "------------------------------------------------------------------------" ]
b62db93bf63cb3bb34dd03d611a779d9e3fc61ac
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/instance/SimpleSlot.java#L220-L259
train
Releases the slot.
[ 30522, 1030, 2058, 15637, 2270, 4012, 10814, 10880, 11263, 11244, 1026, 1029, 1028, 7085, 10994, 1006, 1030, 19701, 3085, 5466, 3085, 3426, 1007, 1063, 2065, 1006, 999, 2003, 9336, 29109, 2098, 1006, 1007, 1007, 1063, 2345, 4012, 10814, 108...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -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.createSourceSelectForUpdate
protected SqlSelect createSourceSelectForUpdate(SqlUpdate call) { final SqlNodeList selectList = new SqlNodeList(SqlParserPos.ZERO); selectList.add(SqlIdentifier.star(SqlParserPos.ZERO)); int ordinal = 0; for (SqlNode exp : call.getSourceExpressionList()) { // Force unique aliases to avoid a duplicate for Y with // SET X=Y String alias = SqlUtil.deriveAliasFromOrdinal(ordinal); selectList.add(SqlValidatorUtil.addAlias(exp, alias)); ++ordinal; } SqlNode sourceTable = call.getTargetTable(); if (call.getAlias() != null) { sourceTable = SqlValidatorUtil.addAlias( sourceTable, call.getAlias().getSimple()); } return new SqlSelect(SqlParserPos.ZERO, null, selectList, sourceTable, call.getCondition(), null, null, null, null, null, null); }
java
protected SqlSelect createSourceSelectForUpdate(SqlUpdate call) { final SqlNodeList selectList = new SqlNodeList(SqlParserPos.ZERO); selectList.add(SqlIdentifier.star(SqlParserPos.ZERO)); int ordinal = 0; for (SqlNode exp : call.getSourceExpressionList()) { // Force unique aliases to avoid a duplicate for Y with // SET X=Y String alias = SqlUtil.deriveAliasFromOrdinal(ordinal); selectList.add(SqlValidatorUtil.addAlias(exp, alias)); ++ordinal; } SqlNode sourceTable = call.getTargetTable(); if (call.getAlias() != null) { sourceTable = SqlValidatorUtil.addAlias( sourceTable, call.getAlias().getSimple()); } return new SqlSelect(SqlParserPos.ZERO, null, selectList, sourceTable, call.getCondition(), null, null, null, null, null, null); }
[ "protected", "SqlSelect", "createSourceSelectForUpdate", "(", "SqlUpdate", "call", ")", "{", "final", "SqlNodeList", "selectList", "=", "new", "SqlNodeList", "(", "SqlParserPos", ".", "ZERO", ")", ";", "selectList", ".", "add", "(", "SqlIdentifier", ".", "star", ...
Creates the SELECT statement that putatively feeds rows into an UPDATE statement to be updated. @param call Call to the UPDATE operator @return select statement
[ "Creates", "the", "SELECT", "statement", "that", "putatively", "feeds", "rows", "into", "an", "UPDATE", "statement", "to", "be", "updated", "." ]
b62db93bf63cb3bb34dd03d611a779d9e3fc61ac
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-table/flink-table-planner/src/main/java/org/apache/calcite/sql/validate/SqlValidatorImpl.java#L1484-L1504
train
Create a source select for an update.
[ 30522, 5123, 29296, 11246, 22471, 9005, 8162, 9623, 12260, 6593, 29278, 6279, 13701, 1006, 29296, 6279, 13701, 2655, 1007, 1063, 2345, 29296, 3630, 9247, 2923, 7276, 9863, 1027, 2047, 29296, 3630, 9247, 2923, 1006, 29296, 19362, 8043, 6873, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
netty/netty
transport-native-epoll/src/main/java/io/netty/channel/epoll/EpollEventLoop.java
EpollEventLoop.modify
void modify(AbstractEpollChannel ch) throws IOException { assert inEventLoop(); Native.epollCtlMod(epollFd.intValue(), ch.socket.intValue(), ch.flags); }
java
void modify(AbstractEpollChannel ch) throws IOException { assert inEventLoop(); Native.epollCtlMod(epollFd.intValue(), ch.socket.intValue(), ch.flags); }
[ "void", "modify", "(", "AbstractEpollChannel", "ch", ")", "throws", "IOException", "{", "assert", "inEventLoop", "(", ")", ";", "Native", ".", "epollCtlMod", "(", "epollFd", ".", "intValue", "(", ")", ",", "ch", ".", "socket", ".", "intValue", "(", ")", ...
The flags of the given epoll was modified so update the registration
[ "The", "flags", "of", "the", "given", "epoll", "was", "modified", "so", "update", "the", "registration" ]
ba06eafa1c1824bd154f1a380019e7ea2edf3c4c
https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/transport-native-epoll/src/main/java/io/netty/channel/epoll/EpollEventLoop.java#L184-L187
train
Modify the EpollChannel.
[ 30522, 11675, 19933, 1006, 10061, 13699, 14511, 26058, 10381, 1007, 11618, 22834, 10288, 24422, 1063, 20865, 1999, 18697, 3372, 4135, 7361, 1006, 1007, 1025, 3128, 1012, 4958, 14511, 6593, 13728, 7716, 1006, 4958, 14511, 2546, 2094, 1012, 200...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -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/map/MapUtil.java
MapUtil.getFloat
public static Float getFloat(Map<?, ?> map, Object key) { return get(map, key, Float.class); }
java
public static Float getFloat(Map<?, ?> map, Object key) { return get(map, key, Float.class); }
[ "public", "static", "Float", "getFloat", "(", "Map", "<", "?", ",", "?", ">", "map", ",", "Object", "key", ")", "{", "return", "get", "(", "map", ",", "key", ",", "Float", ".", "class", ")", ";", "}" ]
获取Map指定key的值,并转换为Float @param map Map @param key 键 @return 值 @since 4.0.6
[ "获取Map指定key的值,并转换为Float" ]
bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a
https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/map/MapUtil.java#L792-L794
train
Gets the Float value from the map.
[ 30522, 2270, 10763, 14257, 2131, 10258, 16503, 1006, 4949, 1026, 1029, 1010, 1029, 1028, 4949, 1010, 4874, 3145, 1007, 1063, 2709, 2131, 1006, 4949, 1010, 3145, 1010, 14257, 1012, 2465, 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...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
looly/hutool
hutool-extra/src/main/java/cn/hutool/extra/template/engine/velocity/VelocityUtil.java
VelocityUtil.newEngine
public static VelocityEngine newEngine(String templateDir, String charset) { final VelocityEngine ve = new VelocityEngine(); ve.setProperty(Velocity.FILE_RESOURCE_LOADER_CACHE, true); // 使用缓存 ve.init(_newInitedProp(templateDir, charset)); return ve; }
java
public static VelocityEngine newEngine(String templateDir, String charset) { final VelocityEngine ve = new VelocityEngine(); ve.setProperty(Velocity.FILE_RESOURCE_LOADER_CACHE, true); // 使用缓存 ve.init(_newInitedProp(templateDir, charset)); return ve; }
[ "public", "static", "VelocityEngine", "newEngine", "(", "String", "templateDir", ",", "String", "charset", ")", "{", "final", "VelocityEngine", "ve", "=", "new", "VelocityEngine", "(", ")", ";", "ve", ".", "setProperty", "(", "Velocity", ".", "FILE_RESOURCE_LOAD...
新建Velocity模板引擎 @param templateDir 模板所在目录,绝对路径 @param charset 编码 @return VelocityEngine
[ "新建Velocity模板引擎" ]
bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a
https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-extra/src/main/java/cn/hutool/extra/template/engine/velocity/VelocityUtil.java#L81-L88
train
Creates a new instance of the VelocityEngine class.
[ 30522, 2270, 10763, 10146, 13159, 3170, 2047, 13159, 3170, 1006, 5164, 23561, 4305, 2099, 1010, 5164, 25869, 13462, 1007, 1063, 2345, 10146, 13159, 3170, 2310, 1027, 2047, 10146, 13159, 3170, 1006, 1007, 1025, 2310, 1012, 2275, 21572, 4842, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -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.fieldValueAsMap
@SuppressWarnings("unchecked") public static <K, V> Map<K, V> fieldValueAsMap(Iterator<?> iter, String fieldNameForKey, String fieldNameForValue) { final Map<K, V> result = new HashMap<>(); if (null != iter) { Object value; while (iter.hasNext()) { value = iter.next(); result.put((K) ReflectUtil.getFieldValue(value, fieldNameForKey), (V) ReflectUtil.getFieldValue(value, fieldNameForValue)); } } return result; }
java
@SuppressWarnings("unchecked") public static <K, V> Map<K, V> fieldValueAsMap(Iterator<?> iter, String fieldNameForKey, String fieldNameForValue) { final Map<K, V> result = new HashMap<>(); if (null != iter) { Object value; while (iter.hasNext()) { value = iter.next(); result.put((K) ReflectUtil.getFieldValue(value, fieldNameForKey), (V) ReflectUtil.getFieldValue(value, fieldNameForValue)); } } return result; }
[ "@", "SuppressWarnings", "(", "\"unchecked\"", ")", "public", "static", "<", "K", ",", "V", ">", "Map", "<", "K", ",", "V", ">", "fieldValueAsMap", "(", "Iterator", "<", "?", ">", "iter", ",", "String", "fieldNameForKey", ",", "String", "fieldNameForValue"...
两个字段值组成新的Map @param <K> 字段名对应值得类型,不确定请使用Object @param <V> 值类型,不确定使用Object @param iter 对象列表 @param fieldNameForKey 做为键的字段名(会通过反射获取其值) @param fieldNameForValue 做为值的字段名(会通过反射获取其值) @return 某个字段值与对象对应Map @since 4.0.10
[ "两个字段值组成新的Map" ]
bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a
https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/collection/IterUtil.java#L220-L231
train
Returns a map of the values of the specified field in the specified iterator.
[ 30522, 1030, 16081, 9028, 5582, 2015, 1006, 1000, 4895, 5403, 18141, 1000, 1007, 2270, 10763, 1026, 1047, 1010, 1058, 1028, 4949, 1026, 1047, 1010, 1058, 1028, 2492, 10175, 5657, 3022, 2863, 2361, 30524, 1010, 5164, 2492, 18442, 29278, 1483...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -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-kinesis/src/main/java/org/apache/flink/streaming/connectors/kinesis/FlinkKinesisConsumer.java
FlinkKinesisConsumer.run
@Override public void run(SourceContext<T> sourceContext) throws Exception { // all subtasks will run a fetcher, regardless of whether or not the subtask will initially have // shards to subscribe to; fetchers will continuously poll for changes in the shard list, so all subtasks // can potentially have new shards to subscribe to later on KinesisDataFetcher<T> fetcher = createFetcher(streams, sourceContext, getRuntimeContext(), configProps, deserializer); // initial discovery List<StreamShardHandle> allShards = fetcher.discoverNewShardsToSubscribe(); for (StreamShardHandle shard : allShards) { StreamShardMetadata.EquivalenceWrapper kinesisStreamShard = new StreamShardMetadata.EquivalenceWrapper(KinesisDataFetcher.convertToStreamShardMetadata(shard)); if (sequenceNumsToRestore != null) { if (sequenceNumsToRestore.containsKey(kinesisStreamShard)) { // if the shard was already seen and is contained in the state, // just use the sequence number stored in the state fetcher.registerNewSubscribedShardState( new KinesisStreamShardState(kinesisStreamShard.getShardMetadata(), shard, sequenceNumsToRestore.get(kinesisStreamShard))); if (LOG.isInfoEnabled()) { LOG.info("Subtask {} is seeding the fetcher with restored shard {}," + " starting state set to the restored sequence number {}", getRuntimeContext().getIndexOfThisSubtask(), shard.toString(), sequenceNumsToRestore.get(kinesisStreamShard)); } } else { // the shard wasn't discovered in the previous run, therefore should be consumed from the beginning fetcher.registerNewSubscribedShardState( new KinesisStreamShardState(kinesisStreamShard.getShardMetadata(), shard, SentinelSequenceNumber.SENTINEL_EARLIEST_SEQUENCE_NUM.get())); if (LOG.isInfoEnabled()) { LOG.info("Subtask {} is seeding the fetcher with new discovered shard {}," + " starting state set to the SENTINEL_EARLIEST_SEQUENCE_NUM", getRuntimeContext().getIndexOfThisSubtask(), shard.toString()); } } } else { // we're starting fresh; use the configured start position as initial state SentinelSequenceNumber startingSeqNum = InitialPosition.valueOf(configProps.getProperty( ConsumerConfigConstants.STREAM_INITIAL_POSITION, ConsumerConfigConstants.DEFAULT_STREAM_INITIAL_POSITION)).toSentinelSequenceNumber(); fetcher.registerNewSubscribedShardState( new KinesisStreamShardState(kinesisStreamShard.getShardMetadata(), shard, startingSeqNum.get())); if (LOG.isInfoEnabled()) { LOG.info("Subtask {} will be seeded with initial shard {}, starting state set as sequence number {}", getRuntimeContext().getIndexOfThisSubtask(), shard.toString(), startingSeqNum.get()); } } } // check that we are running before starting the fetcher if (!running) { return; } // expose the fetcher from this point, so that state // snapshots can be taken from the fetcher's state holders this.fetcher = fetcher; // start the fetcher loop. The fetcher will stop running only when cancel() or // close() is called, or an error is thrown by threads created by the fetcher fetcher.runFetcher(); // check that the fetcher has terminated before fully closing fetcher.awaitTermination(); sourceContext.close(); }
java
@Override public void run(SourceContext<T> sourceContext) throws Exception { // all subtasks will run a fetcher, regardless of whether or not the subtask will initially have // shards to subscribe to; fetchers will continuously poll for changes in the shard list, so all subtasks // can potentially have new shards to subscribe to later on KinesisDataFetcher<T> fetcher = createFetcher(streams, sourceContext, getRuntimeContext(), configProps, deserializer); // initial discovery List<StreamShardHandle> allShards = fetcher.discoverNewShardsToSubscribe(); for (StreamShardHandle shard : allShards) { StreamShardMetadata.EquivalenceWrapper kinesisStreamShard = new StreamShardMetadata.EquivalenceWrapper(KinesisDataFetcher.convertToStreamShardMetadata(shard)); if (sequenceNumsToRestore != null) { if (sequenceNumsToRestore.containsKey(kinesisStreamShard)) { // if the shard was already seen and is contained in the state, // just use the sequence number stored in the state fetcher.registerNewSubscribedShardState( new KinesisStreamShardState(kinesisStreamShard.getShardMetadata(), shard, sequenceNumsToRestore.get(kinesisStreamShard))); if (LOG.isInfoEnabled()) { LOG.info("Subtask {} is seeding the fetcher with restored shard {}," + " starting state set to the restored sequence number {}", getRuntimeContext().getIndexOfThisSubtask(), shard.toString(), sequenceNumsToRestore.get(kinesisStreamShard)); } } else { // the shard wasn't discovered in the previous run, therefore should be consumed from the beginning fetcher.registerNewSubscribedShardState( new KinesisStreamShardState(kinesisStreamShard.getShardMetadata(), shard, SentinelSequenceNumber.SENTINEL_EARLIEST_SEQUENCE_NUM.get())); if (LOG.isInfoEnabled()) { LOG.info("Subtask {} is seeding the fetcher with new discovered shard {}," + " starting state set to the SENTINEL_EARLIEST_SEQUENCE_NUM", getRuntimeContext().getIndexOfThisSubtask(), shard.toString()); } } } else { // we're starting fresh; use the configured start position as initial state SentinelSequenceNumber startingSeqNum = InitialPosition.valueOf(configProps.getProperty( ConsumerConfigConstants.STREAM_INITIAL_POSITION, ConsumerConfigConstants.DEFAULT_STREAM_INITIAL_POSITION)).toSentinelSequenceNumber(); fetcher.registerNewSubscribedShardState( new KinesisStreamShardState(kinesisStreamShard.getShardMetadata(), shard, startingSeqNum.get())); if (LOG.isInfoEnabled()) { LOG.info("Subtask {} will be seeded with initial shard {}, starting state set as sequence number {}", getRuntimeContext().getIndexOfThisSubtask(), shard.toString(), startingSeqNum.get()); } } } // check that we are running before starting the fetcher if (!running) { return; } // expose the fetcher from this point, so that state // snapshots can be taken from the fetcher's state holders this.fetcher = fetcher; // start the fetcher loop. The fetcher will stop running only when cancel() or // close() is called, or an error is thrown by threads created by the fetcher fetcher.runFetcher(); // check that the fetcher has terminated before fully closing fetcher.awaitTermination(); sourceContext.close(); }
[ "@", "Override", "public", "void", "run", "(", "SourceContext", "<", "T", ">", "sourceContext", ")", "throws", "Exception", "{", "// all subtasks will run a fetcher, regardless of whether or not the subtask will initially have", "// shards to subscribe to; fetchers will continuously ...
------------------------------------------------------------------------
[ "------------------------------------------------------------------------" ]
b62db93bf63cb3bb34dd03d611a779d9e3fc61ac
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-connectors/flink-connector-kinesis/src/main/java/org/apache/flink/streaming/connectors/kinesis/FlinkKinesisConsumer.java#L261-L333
train
Run the fetcher.
[ 30522, 1030, 2058, 15637, 2270, 11675, 2448, 1006, 3120, 8663, 18209, 1026, 1056, 1028, 3120, 8663, 18209, 1007, 11618, 6453, 1063, 1013, 1013, 2035, 4942, 10230, 5705, 2097, 2448, 1037, 18584, 2121, 1010, 7539, 1997, 3251, 2030, 2025, 1996...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
netty/netty
transport/src/main/java/io/netty/channel/ChannelOutboundBuffer.java
ChannelOutboundBuffer.progress
public void progress(long amount) { Entry e = flushedEntry; assert e != null; ChannelPromise p = e.promise; long progress = e.progress + amount; e.progress = progress; if (p instanceof ChannelProgressivePromise) { ((ChannelProgressivePromise) p).tryProgress(progress, e.total); } }
java
public void progress(long amount) { Entry e = flushedEntry; assert e != null; ChannelPromise p = e.promise; long progress = e.progress + amount; e.progress = progress; if (p instanceof ChannelProgressivePromise) { ((ChannelProgressivePromise) p).tryProgress(progress, e.total); } }
[ "public", "void", "progress", "(", "long", "amount", ")", "{", "Entry", "e", "=", "flushedEntry", ";", "assert", "e", "!=", "null", ";", "ChannelPromise", "p", "=", "e", ".", "promise", ";", "long", "progress", "=", "e", ".", "progress", "+", "amount",...
Notify the {@link ChannelPromise} of the current message about writing progress.
[ "Notify", "the", "{" ]
ba06eafa1c1824bd154f1a380019e7ea2edf3c4c
https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/transport/src/main/java/io/netty/channel/ChannelOutboundBuffer.java#L238-L247
train
Add the amount of bytes to the current entry s progress.
[ 30522, 2270, 11675, 5082, 1006, 2146, 3815, 1007, 1063, 4443, 1041, 1027, 12953, 4765, 2854, 1025, 20865, 1041, 999, 1027, 19701, 1025, 3149, 21572, 28732, 1052, 1027, 1041, 1012, 4872, 1025, 2146, 5082, 1027, 1041, 1012, 5082, 1009, 3815, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
apache/flink
flink-streaming-java/src/main/java/org/apache/flink/streaming/api/graph/StreamGraphGenerator.java
StreamGraphGenerator.transformPartition
private <T> Collection<Integer> transformPartition(PartitionTransformation<T> partition) { StreamTransformation<T> input = partition.getInput(); List<Integer> resultIds = new ArrayList<>(); Collection<Integer> transformedIds = transform(input); for (Integer transformedId: transformedIds) { int virtualId = StreamTransformation.getNewNodeId(); streamGraph.addVirtualPartitionNode(transformedId, virtualId, partition.getPartitioner()); resultIds.add(virtualId); } return resultIds; }
java
private <T> Collection<Integer> transformPartition(PartitionTransformation<T> partition) { StreamTransformation<T> input = partition.getInput(); List<Integer> resultIds = new ArrayList<>(); Collection<Integer> transformedIds = transform(input); for (Integer transformedId: transformedIds) { int virtualId = StreamTransformation.getNewNodeId(); streamGraph.addVirtualPartitionNode(transformedId, virtualId, partition.getPartitioner()); resultIds.add(virtualId); } return resultIds; }
[ "private", "<", "T", ">", "Collection", "<", "Integer", ">", "transformPartition", "(", "PartitionTransformation", "<", "T", ">", "partition", ")", "{", "StreamTransformation", "<", "T", ">", "input", "=", "partition", ".", "getInput", "(", ")", ";", "List",...
Transforms a {@code PartitionTransformation}. <p>For this we create a virtual node in the {@code StreamGraph} that holds the partition property. @see StreamGraphGenerator
[ "Transforms", "a", "{", "@code", "PartitionTransformation", "}", "." ]
b62db93bf63cb3bb34dd03d611a779d9e3fc61ac
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-streaming-java/src/main/java/org/apache/flink/streaming/api/graph/StreamGraphGenerator.java#L244-L256
train
Transform a partition.
[ 30522, 2797, 1026, 1056, 1028, 3074, 1026, 16109, 1028, 10938, 19362, 3775, 3508, 1006, 13571, 6494, 3619, 14192, 3370, 1026, 1056, 1028, 13571, 1007, 1063, 5460, 6494, 3619, 14192, 3370, 1026, 1056, 1028, 7953, 1027, 13571, 1012, 2131, 237...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -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/hash/MutableHashTable.java
MutableHashTable.releaseTable
protected void releaseTable() { // set the counters back this.numBuckets = 0; if (this.buckets != null) { for (MemorySegment bucket : this.buckets) { this.availableMemory.add(bucket); } this.buckets = null; } }
java
protected void releaseTable() { // set the counters back this.numBuckets = 0; if (this.buckets != null) { for (MemorySegment bucket : this.buckets) { this.availableMemory.add(bucket); } this.buckets = null; } }
[ "protected", "void", "releaseTable", "(", ")", "{", "// set the counters back", "this", ".", "numBuckets", "=", "0", ";", "if", "(", "this", ".", "buckets", "!=", "null", ")", "{", "for", "(", "MemorySegment", "bucket", ":", "this", ".", "buckets", ")", ...
Releases the table (the array of buckets) and returns the occupied memory segments to the list of free segments.
[ "Releases", "the", "table", "(", "the", "array", "of", "buckets", ")", "and", "returns", "the", "occupied", "memory", "segments", "to", "the", "list", "of", "free", "segments", "." ]
b62db93bf63cb3bb34dd03d611a779d9e3fc61ac
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/operators/hash/MutableHashTable.java#L1190-L1200
train
Release the table.
[ 30522, 5123, 11675, 2713, 10880, 1006, 1007, 1063, 1013, 1013, 2275, 1996, 24094, 2067, 2023, 1012, 15903, 12722, 8454, 1027, 1014, 1025, 30524, 1027, 19701, 1025, 1065, 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...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -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.join
public static <T> String join(Iterable<T> iterable, CharSequence conjunction) { if (null == iterable) { return null; } return join(iterable.iterator(), conjunction); }
java
public static <T> String join(Iterable<T> iterable, CharSequence conjunction) { if (null == iterable) { return null; } return join(iterable.iterator(), conjunction); }
[ "public", "static", "<", "T", ">", "String", "join", "(", "Iterable", "<", "T", ">", "iterable", ",", "CharSequence", "conjunction", ")", "{", "if", "(", "null", "==", "iterable", ")", "{", "return", "null", ";", "}", "return", "join", "(", "iterable",...
以 conjunction 为分隔符将集合转换为字符串 @param <T> 集合元素类型 @param iterable {@link Iterable} @param conjunction 分隔符 @return 连接后的字符串
[ "以", "conjunction", "为分隔符将集合转换为字符串" ]
bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a
https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/collection/IterUtil.java#L262-L267
train
Joins the elements of an iterable with the specified conjunction character.
[ 30522, 2270, 10763, 1026, 1056, 1028, 5164, 3693, 1006, 2009, 6906, 3468, 1026, 1056, 1028, 2009, 6906, 3468, 1010, 25869, 3366, 4226, 5897, 9595, 1007, 1063, 2065, 1006, 19701, 1027, 1027, 2009, 6906, 3468, 1007, 1063, 30524, 2009, 6906, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
spring-projects/spring-boot
spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/properties/bind/Bindable.java
Bindable.listOf
public static <E> Bindable<List<E>> listOf(Class<E> elementType) { return of(ResolvableType.forClassWithGenerics(List.class, elementType)); }
java
public static <E> Bindable<List<E>> listOf(Class<E> elementType) { return of(ResolvableType.forClassWithGenerics(List.class, elementType)); }
[ "public", "static", "<", "E", ">", "Bindable", "<", "List", "<", "E", ">", ">", "listOf", "(", "Class", "<", "E", ">", "elementType", ")", "{", "return", "of", "(", "ResolvableType", ".", "forClassWithGenerics", "(", "List", ".", "class", ",", "element...
Create a new {@link Bindable} {@link List} of the specified element type. @param <E> the element type @param elementType the list element type @return a {@link Bindable} instance
[ "Create", "a", "new", "{" ]
0b27f7c70e164b2b1a96477f1d9c1acba56790c1
https://github.com/spring-projects/spring-boot/blob/0b27f7c70e164b2b1a96477f1d9c1acba56790c1/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/properties/bind/Bindable.java#L213-L215
train
Create a Bindable instance for a List type.
[ 30522, 2270, 10763, 1026, 1041, 1028, 14187, 3085, 1026, 2862, 1026, 1041, 1028, 1028, 2862, 11253, 1006, 2465, 1026, 1041, 1028, 5783, 13874, 1007, 1063, 2709, 1997, 1006, 24501, 4747, 12423, 13874, 1012, 2005, 26266, 24415, 6914, 22420, 2...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
apache/flink
flink-core/src/main/java/org/apache/flink/util/IOUtils.java
IOUtils.cleanup
public static void cleanup(final Logger log, final AutoCloseable... closeables) { for (AutoCloseable c : closeables) { if (c != null) { try { c.close(); } catch (Exception e) { if (log != null && log.isDebugEnabled()) { log.debug("Exception in closing " + c, e); } } } } }
java
public static void cleanup(final Logger log, final AutoCloseable... closeables) { for (AutoCloseable c : closeables) { if (c != null) { try { c.close(); } catch (Exception e) { if (log != null && log.isDebugEnabled()) { log.debug("Exception in closing " + c, e); } } } } }
[ "public", "static", "void", "cleanup", "(", "final", "Logger", "log", ",", "final", "AutoCloseable", "...", "closeables", ")", "{", "for", "(", "AutoCloseable", "c", ":", "closeables", ")", "{", "if", "(", "c", "!=", "null", ")", "{", "try", "{", "c", ...
Close the AutoCloseable objects and <b>ignore</b> any {@link Exception} or null pointers. Must only be used for cleanup in exception handlers. @param log the log to record problems to at debug level. Can be <code>null</code>. @param closeables the objects to close
[ "Close", "the", "AutoCloseable", "objects", "and", "<b", ">", "ignore<", "/", "b", ">", "any", "{", "@link", "Exception", "}", "or", "null", "pointers", ".", "Must", "only", "be", "used", "for", "cleanup", "in", "exception", "handlers", "." ]
b62db93bf63cb3bb34dd03d611a779d9e3fc61ac
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-core/src/main/java/org/apache/flink/util/IOUtils.java#L175-L187
train
Clean up the AutoCloseables.
[ 30522, 2270, 10763, 11675, 27686, 1006, 2345, 8833, 4590, 8833, 1010, 2345, 8285, 20464, 9232, 3085, 1012, 1012, 1012, 2485, 3085, 2015, 1007, 1063, 2005, 1006, 8285, 20464, 9232, 3085, 1039, 1024, 2485, 3085, 2015, 1007, 1063, 2065, 1006, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
spring-projects/spring-boot
spring-boot-project/spring-boot/src/main/java/org/springframework/boot/webservices/client/WebServiceTemplateBuilder.java
WebServiceTemplateBuilder.additionalMessageSenders
public WebServiceTemplateBuilder additionalMessageSenders( WebServiceMessageSender... messageSenders) { Assert.notNull(messageSenders, "MessageSenders must not be null"); return additionalMessageSenders(Arrays.asList(messageSenders)); }
java
public WebServiceTemplateBuilder additionalMessageSenders( WebServiceMessageSender... messageSenders) { Assert.notNull(messageSenders, "MessageSenders must not be null"); return additionalMessageSenders(Arrays.asList(messageSenders)); }
[ "public", "WebServiceTemplateBuilder", "additionalMessageSenders", "(", "WebServiceMessageSender", "...", "messageSenders", ")", "{", "Assert", ".", "notNull", "(", "messageSenders", ",", "\"MessageSenders must not be null\"", ")", ";", "return", "additionalMessageSenders", "...
Add additional {@link WebServiceMessageSender WebServiceMessageSenders} that should be used with the {@link WebServiceTemplate}. @param messageSenders the message senders to add @return a new builder instance. @see #messageSenders(WebServiceMessageSender...)
[ "Add", "additional", "{" ]
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#L174-L178
train
Add additional message senders to the template.
[ 30522, 2270, 4773, 8043, 7903, 12870, 8737, 13806, 8569, 23891, 2099, 3176, 7834, 3736, 8449, 10497, 2545, 1006, 4773, 8043, 7903, 21382, 11488, 8449, 10497, 2121, 1012, 1012, 1012, 7696, 10497, 2545, 1007, 1063, 20865, 1012, 2025, 11231, 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...
spring-projects/spring-boot
spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/client/RestTemplateBuilder.java
RestTemplateBuilder.uriTemplateHandler
public RestTemplateBuilder uriTemplateHandler(UriTemplateHandler uriTemplateHandler) { Assert.notNull(uriTemplateHandler, "UriTemplateHandler must not be null"); return new RestTemplateBuilder(this.detectRequestFactory, this.rootUri, this.messageConverters, this.requestFactorySupplier, uriTemplateHandler, this.errorHandler, this.basicAuthentication, this.restTemplateCustomizers, this.requestFactoryCustomizer, this.interceptors); }
java
public RestTemplateBuilder uriTemplateHandler(UriTemplateHandler uriTemplateHandler) { Assert.notNull(uriTemplateHandler, "UriTemplateHandler must not be null"); return new RestTemplateBuilder(this.detectRequestFactory, this.rootUri, this.messageConverters, this.requestFactorySupplier, uriTemplateHandler, this.errorHandler, this.basicAuthentication, this.restTemplateCustomizers, this.requestFactoryCustomizer, this.interceptors); }
[ "public", "RestTemplateBuilder", "uriTemplateHandler", "(", "UriTemplateHandler", "uriTemplateHandler", ")", "{", "Assert", ".", "notNull", "(", "uriTemplateHandler", ",", "\"UriTemplateHandler must not be null\"", ")", ";", "return", "new", "RestTemplateBuilder", "(", "thi...
Set the {@link UriTemplateHandler} that should be used with the {@link RestTemplate}. @param uriTemplateHandler the URI template handler to use @return a new builder instance
[ "Set", "the", "{" ]
0b27f7c70e164b2b1a96477f1d9c1acba56790c1
https://github.com/spring-projects/spring-boot/blob/0b27f7c70e164b2b1a96477f1d9c1acba56790c1/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/client/RestTemplateBuilder.java#L350-L356
train
Sets the URI template handler.
[ 30522, 2270, 2717, 18532, 15725, 8569, 23891, 2099, 24471, 4221, 8737, 13806, 11774, 3917, 1006, 24471, 4221, 8737, 13806, 11774, 3917, 24471, 4221, 8737, 13806, 11774, 3917, 1007, 1063, 20865, 1012, 2025, 11231, 3363, 1006, 24471, 4221, 8737...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
looly/hutool
hutool-core/src/main/java/cn/hutool/core/date/DateBetween.java
DateBetween.betweenMonth
public long betweenMonth(boolean isReset) { final Calendar beginCal = DateUtil.calendar(begin); final Calendar endCal = DateUtil.calendar(end); final int betweenYear = endCal.get(Calendar.YEAR) - beginCal.get(Calendar.YEAR); final int betweenMonthOfYear = endCal.get(Calendar.MONTH) - beginCal.get(Calendar.MONTH); int result = betweenYear * 12 + betweenMonthOfYear; if (false == isReset) { endCal.set(Calendar.YEAR, beginCal.get(Calendar.YEAR)); endCal.set(Calendar.MONTH, beginCal.get(Calendar.MONTH)); long between = endCal.getTimeInMillis() - beginCal.getTimeInMillis(); if (between < 0) { return result - 1; } } return result; }
java
public long betweenMonth(boolean isReset) { final Calendar beginCal = DateUtil.calendar(begin); final Calendar endCal = DateUtil.calendar(end); final int betweenYear = endCal.get(Calendar.YEAR) - beginCal.get(Calendar.YEAR); final int betweenMonthOfYear = endCal.get(Calendar.MONTH) - beginCal.get(Calendar.MONTH); int result = betweenYear * 12 + betweenMonthOfYear; if (false == isReset) { endCal.set(Calendar.YEAR, beginCal.get(Calendar.YEAR)); endCal.set(Calendar.MONTH, beginCal.get(Calendar.MONTH)); long between = endCal.getTimeInMillis() - beginCal.getTimeInMillis(); if (between < 0) { return result - 1; } } return result; }
[ "public", "long", "betweenMonth", "(", "boolean", "isReset", ")", "{", "final", "Calendar", "beginCal", "=", "DateUtil", ".", "calendar", "(", "begin", ")", ";", "final", "Calendar", "endCal", "=", "DateUtil", ".", "calendar", "(", "end", ")", ";", "final"...
计算两个日期相差月数<br> 在非重置情况下,如果起始日期的天小于结束日期的天,月数要少算1(不足1个月) @param isReset 是否重置时间为起始时间(重置天时分秒) @return 相差月数 @since 3.0.8
[ "计算两个日期相差月数<br", ">", "在非重置情况下,如果起始日期的天小于结束日期的天,月数要少算1(不足1个月)" ]
bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a
https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/date/DateBetween.java#L102-L119
train
Returns the number of days between the two calendars in the month.
[ 30522, 2270, 2146, 2090, 9629, 2232, 1006, 22017, 20898, 2003, 6072, 3388, 1007, 1063, 2345, 8094, 4088, 9289, 1027, 3058, 21823, 2140, 1012, 8094, 1006, 4088, 1007, 1025, 2345, 8094, 2203, 30524, 29100, 1027, 2203, 9289, 1012, 2131, 1006, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
looly/hutool
hutool-core/src/main/java/cn/hutool/core/util/XmlUtil.java
XmlUtil.xmlToMap
public static Map<String, Object> xmlToMap(String xmlStr, Map<String, Object> result) { final Document doc = parseXml(xmlStr); final Element root = getRootElement(doc); root.normalize(); return xmlToMap(root, result); }
java
public static Map<String, Object> xmlToMap(String xmlStr, Map<String, Object> result) { final Document doc = parseXml(xmlStr); final Element root = getRootElement(doc); root.normalize(); return xmlToMap(root, result); }
[ "public", "static", "Map", "<", "String", ",", "Object", ">", "xmlToMap", "(", "String", "xmlStr", ",", "Map", "<", "String", ",", "Object", ">", "result", ")", "{", "final", "Document", "doc", "=", "parseXml", "(", "xmlStr", ")", ";", "final", "Elemen...
XML格式字符串转换为Map<br> 只支持第一级别的XML,不支持多级XML @param xmlStr XML字符串 @param result 结果Map类型 @return XML数据转换后的Map @since 4.0.8
[ "XML格式字符串转换为Map<br", ">", "只支持第一级别的XML,不支持多级XML" ]
bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a
https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/util/XmlUtil.java#L697-L703
train
Converts an XML string to a map.
[ 30522, 2270, 10763, 4949, 1026, 5164, 1010, 4874, 1028, 20950, 20389, 9331, 1006, 5164, 20950, 3367, 2099, 1010, 4949, 1026, 5164, 1010, 4874, 1028, 2765, 1007, 1063, 2345, 6254, 9986, 1027, 11968, 3366, 2595, 19968, 1006, 20950, 3367, 2099...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -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-transaction/sharding-transaction-core/src/main/java/org/apache/shardingsphere/transaction/ShardingTransactionManagerEngine.java
ShardingTransactionManagerEngine.init
public void init(final DatabaseType databaseType, final Map<String, DataSource> dataSourceMap) { for (Entry<TransactionType, ShardingTransactionManager> entry : transactionManagerMap.entrySet()) { entry.getValue().init(databaseType, getResourceDataSources(dataSourceMap)); } }
java
public void init(final DatabaseType databaseType, final Map<String, DataSource> dataSourceMap) { for (Entry<TransactionType, ShardingTransactionManager> entry : transactionManagerMap.entrySet()) { entry.getValue().init(databaseType, getResourceDataSources(dataSourceMap)); } }
[ "public", "void", "init", "(", "final", "DatabaseType", "databaseType", ",", "final", "Map", "<", "String", ",", "DataSource", ">", "dataSourceMap", ")", "{", "for", "(", "Entry", "<", "TransactionType", ",", "ShardingTransactionManager", ">", "entry", ":", "t...
Initialize sharding transaction managers. @param databaseType database type @param dataSourceMap data source map
[ "Initialize", "sharding", "transaction", "managers", "." ]
f88fd29fc345dfb31fdce12e9e96cbfa0fd2402d
https://github.com/apache/incubator-shardingsphere/blob/f88fd29fc345dfb31fdce12e9e96cbfa0fd2402d/sharding-transaction/sharding-transaction-core/src/main/java/org/apache/shardingsphere/transaction/ShardingTransactionManagerEngine.java#L70-L74
train
Initialize sharding transaction managers.
[ 30522, 2270, 11675, 1999, 4183, 1006, 2345, 7809, 13874, 7809, 13874, 1010, 2345, 4949, 1026, 5164, 1010, 2951, 6499, 3126, 3401, 1028, 2951, 6499, 3126, 3401, 2863, 2361, 1007, 1063, 2005, 1006, 4443, 1026, 12598, 13874, 1010, 21146, 17080...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
apache/flink
flink-state-backends/flink-statebackend-rocksdb/src/main/java/org/apache/flink/contrib/streaming/state/RocksDBIncrementalCheckpointUtils.java
RocksDBIncrementalCheckpointUtils.chooseTheBestStateHandleForInitial
@Nullable public static KeyedStateHandle chooseTheBestStateHandleForInitial( @Nonnull Collection<KeyedStateHandle> restoreStateHandles, @Nonnull KeyGroupRange targetKeyGroupRange) { KeyedStateHandle bestStateHandle = null; double bestScore = 0; for (KeyedStateHandle rawStateHandle : restoreStateHandles) { double handleScore = STATE_HANDLE_EVALUATOR.apply(rawStateHandle, targetKeyGroupRange); if (handleScore > bestScore) { bestStateHandle = rawStateHandle; bestScore = handleScore; } } return bestStateHandle; }
java
@Nullable public static KeyedStateHandle chooseTheBestStateHandleForInitial( @Nonnull Collection<KeyedStateHandle> restoreStateHandles, @Nonnull KeyGroupRange targetKeyGroupRange) { KeyedStateHandle bestStateHandle = null; double bestScore = 0; for (KeyedStateHandle rawStateHandle : restoreStateHandles) { double handleScore = STATE_HANDLE_EVALUATOR.apply(rawStateHandle, targetKeyGroupRange); if (handleScore > bestScore) { bestStateHandle = rawStateHandle; bestScore = handleScore; } } return bestStateHandle; }
[ "@", "Nullable", "public", "static", "KeyedStateHandle", "chooseTheBestStateHandleForInitial", "(", "@", "Nonnull", "Collection", "<", "KeyedStateHandle", ">", "restoreStateHandles", ",", "@", "Nonnull", "KeyGroupRange", "targetKeyGroupRange", ")", "{", "KeyedStateHandle", ...
Choose the best state handle according to the {@link #STATE_HANDLE_EVALUATOR} to init the initial db. @param restoreStateHandles The candidate state handles. @param targetKeyGroupRange The target key group range. @return The best candidate or null if no candidate was a good fit.
[ "Choose", "the", "best", "state", "handle", "according", "to", "the", "{", "@link", "#STATE_HANDLE_EVALUATOR", "}", "to", "init", "the", "initial", "db", "." ]
b62db93bf63cb3bb34dd03d611a779d9e3fc61ac
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-state-backends/flink-statebackend-rocksdb/src/main/java/org/apache/flink/contrib/streaming/state/RocksDBIncrementalCheckpointUtils.java#L157-L173
train
Returns the best state handle for the initial state.
[ 30522, 1030, 19701, 3085, 2270, 10763, 3145, 2098, 9153, 2618, 11774, 2571, 5454, 10760, 12681, 3215, 12259, 11774, 2571, 29278, 5498, 20925, 1006, 1030, 2512, 11231, 3363, 3074, 1026, 3145, 2098, 9153, 2618, 11774, 2571, 1028, 9239, 9153, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
hankcs/HanLP
src/main/java/com/hankcs/hanlp/corpus/io/IOUtil.java
IOUtil.newBufferedReader
public static BufferedReader newBufferedReader(String path) throws IOException { return new BufferedReader(new InputStreamReader(IOUtil.newInputStream(path), "UTF-8")); }
java
public static BufferedReader newBufferedReader(String path) throws IOException { return new BufferedReader(new InputStreamReader(IOUtil.newInputStream(path), "UTF-8")); }
[ "public", "static", "BufferedReader", "newBufferedReader", "(", "String", "path", ")", "throws", "IOException", "{", "return", "new", "BufferedReader", "(", "new", "InputStreamReader", "(", "IOUtil", ".", "newInputStream", "(", "path", ")", ",", "\"UTF-8\"", ")", ...
创建一个BufferedReader @param path @return @throws FileNotFoundException @throws UnsupportedEncodingException
[ "创建一个BufferedReader" ]
a538d0722ab2e4980a9dcd9ea40324fc3ddba7ce
https://github.com/hankcs/HanLP/blob/a538d0722ab2e4980a9dcd9ea40324fc3ddba7ce/src/main/java/com/hankcs/hanlp/corpus/io/IOUtil.java#L607-L610
train
Create a buffered reader from a file path.
[ 30522, 2270, 10763, 17698, 2098, 16416, 4063, 2047, 8569, 12494, 2098, 16416, 4063, 1006, 5164, 4130, 1007, 11618, 22834, 10288, 24422, 1063, 2709, 2047, 17698, 2098, 16416, 4063, 1006, 2047, 20407, 25379, 16416, 4063, 1006, 22834, 21823, 214...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -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-formats/flink-json/src/main/java/org/apache/flink/table/descriptors/Json.java
Json.schema
public Json schema(TypeInformation<Row> schemaType) { Preconditions.checkNotNull(schemaType); this.schema = TypeStringUtils.writeTypeInfo(schemaType); this.jsonSchema = null; this.deriveSchema = null; return this; }
java
public Json schema(TypeInformation<Row> schemaType) { Preconditions.checkNotNull(schemaType); this.schema = TypeStringUtils.writeTypeInfo(schemaType); this.jsonSchema = null; this.deriveSchema = null; return this; }
[ "public", "Json", "schema", "(", "TypeInformation", "<", "Row", ">", "schemaType", ")", "{", "Preconditions", ".", "checkNotNull", "(", "schemaType", ")", ";", "this", ".", "schema", "=", "TypeStringUtils", ".", "writeTypeInfo", "(", "schemaType", ")", ";", ...
Sets the schema using type information. <p>JSON objects are represented as ROW types. <p>The schema might be nested. @param schemaType type information that describes the schema
[ "Sets", "the", "schema", "using", "type", "information", "." ]
b62db93bf63cb3bb34dd03d611a779d9e3fc61ac
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-formats/flink-json/src/main/java/org/apache/flink/table/descriptors/Json.java#L87-L93
train
Sets the schema of the object.
[ 30522, 2270, 1046, 3385, 8040, 28433, 1006, 2828, 2378, 14192, 3370, 1026, 5216, 1028, 8040, 28433, 13874, 1007, 1063, 3653, 8663, 20562, 2015, 1012, 4638, 17048, 11231, 3363, 1006, 8040, 28433, 13874, 1007, 1025, 2023, 1012, 8040, 28433, 1...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
apache/flink
flink-core/src/main/java/org/apache/flink/api/common/operators/Keys.java
Keys.areCompatible
public boolean areCompatible(Keys<?> other) throws IncompatibleKeysException { TypeInformation<?>[] thisKeyFieldTypes = this.getKeyFieldTypes(); TypeInformation<?>[] otherKeyFieldTypes = other.getKeyFieldTypes(); if (thisKeyFieldTypes.length != otherKeyFieldTypes.length) { throw new IncompatibleKeysException(IncompatibleKeysException.SIZE_MISMATCH_MESSAGE); } else { for (int i = 0; i < thisKeyFieldTypes.length; i++) { if (!thisKeyFieldTypes[i].equals(otherKeyFieldTypes[i])) { throw new IncompatibleKeysException(thisKeyFieldTypes[i], otherKeyFieldTypes[i] ); } } } return true; }
java
public boolean areCompatible(Keys<?> other) throws IncompatibleKeysException { TypeInformation<?>[] thisKeyFieldTypes = this.getKeyFieldTypes(); TypeInformation<?>[] otherKeyFieldTypes = other.getKeyFieldTypes(); if (thisKeyFieldTypes.length != otherKeyFieldTypes.length) { throw new IncompatibleKeysException(IncompatibleKeysException.SIZE_MISMATCH_MESSAGE); } else { for (int i = 0; i < thisKeyFieldTypes.length; i++) { if (!thisKeyFieldTypes[i].equals(otherKeyFieldTypes[i])) { throw new IncompatibleKeysException(thisKeyFieldTypes[i], otherKeyFieldTypes[i] ); } } } return true; }
[ "public", "boolean", "areCompatible", "(", "Keys", "<", "?", ">", "other", ")", "throws", "IncompatibleKeysException", "{", "TypeInformation", "<", "?", ">", "[", "]", "thisKeyFieldTypes", "=", "this", ".", "getKeyFieldTypes", "(", ")", ";", "TypeInformation", ...
Check if two sets of keys are compatible to each other (matching types, key counts)
[ "Check", "if", "two", "sets", "of", "keys", "are", "compatible", "to", "each", "other", "(", "matching", "types", "key", "counts", ")" ]
b62db93bf63cb3bb34dd03d611a779d9e3fc61ac
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-core/src/main/java/org/apache/flink/api/common/operators/Keys.java#L60-L75
train
Checks if the two keys are compatible.
[ 30522, 2270, 22017, 20898, 2024, 9006, 24952, 3468, 1006, 6309, 1026, 1029, 1028, 2060, 1007, 11618, 25876, 14839, 3366, 2595, 24422, 1063, 2828, 2378, 14192, 3370, 1026, 1029, 1028, 1031, 1033, 2023, 14839, 3790, 13874, 2015, 1027, 2023, 1...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
apache/flink
flink-runtime/src/main/java/org/apache/flink/runtime/net/SSLUtils.java
SSLUtils.createRestServerSSLContext
@Nullable public static SSLContext createRestServerSSLContext(Configuration config) throws Exception { final RestSSLContextConfigMode configMode; if (isRestSSLAuthenticationEnabled(config)) { configMode = RestSSLContextConfigMode.MUTUAL; } else { configMode = RestSSLContextConfigMode.SERVER; } return createRestSSLContext(config, configMode); }
java
@Nullable public static SSLContext createRestServerSSLContext(Configuration config) throws Exception { final RestSSLContextConfigMode configMode; if (isRestSSLAuthenticationEnabled(config)) { configMode = RestSSLContextConfigMode.MUTUAL; } else { configMode = RestSSLContextConfigMode.SERVER; } return createRestSSLContext(config, configMode); }
[ "@", "Nullable", "public", "static", "SSLContext", "createRestServerSSLContext", "(", "Configuration", "config", ")", "throws", "Exception", "{", "final", "RestSSLContextConfigMode", "configMode", ";", "if", "(", "isRestSSLAuthenticationEnabled", "(", "config", ")", ")"...
Creates an SSL context for the external REST endpoint server.
[ "Creates", "an", "SSL", "context", "for", "the", "external", "REST", "endpoint", "server", "." ]
b62db93bf63cb3bb34dd03d611a779d9e3fc61ac
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/net/SSLUtils.java#L328-L338
train
Creates a server SSL context.
[ 30522, 1030, 19701, 3085, 2270, 10763, 7020, 22499, 10111, 18413, 3443, 28533, 8043, 14028, 14540, 8663, 18209, 1006, 9563, 9530, 8873, 2290, 30524, 21693, 10244, 1012, 8203, 1025, 1065, 2842, 1063, 9530, 8873, 21693, 10244, 1027, 16626, 1454...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
apache/flink
flink-runtime/src/main/java/org/apache/flink/runtime/jobmaster/JobManagerRunner.java
JobManagerRunner.start
public void start() throws Exception { try { leaderElectionService.start(this); } catch (Exception e) { log.error("Could not start the JobManager because the leader election service did not start.", e); throw new Exception("Could not start the leader election service.", e); } }
java
public void start() throws Exception { try { leaderElectionService.start(this); } catch (Exception e) { log.error("Could not start the JobManager because the leader election service did not start.", e); throw new Exception("Could not start the leader election service.", e); } }
[ "public", "void", "start", "(", ")", "throws", "Exception", "{", "try", "{", "leaderElectionService", ".", "start", "(", "this", ")", ";", "}", "catch", "(", "Exception", "e", ")", "{", "log", ".", "error", "(", "\"Could not start the JobManager because the le...
----------------------------------------------------------------------------------------------
[ "----------------------------------------------------------------------------------------------" ]
b62db93bf63cb3bb34dd03d611a779d9e3fc61ac
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/jobmaster/JobManagerRunner.java#L176-L183
train
Start the JobManager.
[ 30522, 2270, 11675, 2707, 1006, 1007, 11618, 6453, 1063, 3046, 1063, 3003, 12260, 22014, 2121, 7903, 2063, 1012, 2707, 1006, 2023, 1007, 1025, 1065, 4608, 1006, 6453, 1041, 1007, 1063, 8833, 1012, 7561, 1006, 1000, 2071, 2025, 2707, 1996, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
spring-projects/spring-boot
spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/servlet/DynamicRegistrationBean.java
DynamicRegistrationBean.getOrDeduceName
protected final String getOrDeduceName(Object value) { return (this.name != null) ? this.name : Conventions.getVariableName(value); }
java
protected final String getOrDeduceName(Object value) { return (this.name != null) ? this.name : Conventions.getVariableName(value); }
[ "protected", "final", "String", "getOrDeduceName", "(", "Object", "value", ")", "{", "return", "(", "this", ".", "name", "!=", "null", ")", "?", "this", ".", "name", ":", "Conventions", ".", "getVariableName", "(", "value", ")", ";", "}" ]
Deduces the name for this registration. Will return user specified name or fallback to convention based naming. @param value the object used for convention based names @return the deduced name
[ "Deduces", "the", "name", "for", "this", "registration", ".", "Will", "return", "user", "specified", "name", "or", "fallback", "to", "convention", "based", "naming", "." ]
0b27f7c70e164b2b1a96477f1d9c1acba56790c1
https://github.com/spring-projects/spring-boot/blob/0b27f7c70e164b2b1a96477f1d9c1acba56790c1/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/servlet/DynamicRegistrationBean.java#L134-L136
train
Get the name of the object or deduces it if it is null.
[ 30522, 5123, 2345, 5164, 2131, 8551, 2098, 18796, 18442, 1006, 4874, 3643, 1007, 1063, 2709, 1006, 2023, 1012, 2171, 999, 1027, 19701, 1007, 1029, 2023, 1012, 2171, 1024, 12472, 1012, 2131, 10755, 19210, 18442, 1006, 3643, 1007, 1025, 1065,...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
netty/netty
common/src/main/java/io/netty/util/AsciiString.java
AsciiString.regionMatches
public boolean regionMatches(boolean ignoreCase, int thisStart, CharSequence string, int start, int length) { if (!ignoreCase) { return regionMatches(thisStart, string, start, length); } if (string == null) { throw new NullPointerException("string"); } final int thisLen = length(); if (thisStart < 0 || length > thisLen - thisStart) { return false; } if (start < 0 || length > string.length() - start) { return false; } thisStart += arrayOffset(); final int thisEnd = thisStart + length; while (thisStart < thisEnd) { if (!equalsIgnoreCase(b2c(value[thisStart++]), string.charAt(start++))) { return false; } } return true; }
java
public boolean regionMatches(boolean ignoreCase, int thisStart, CharSequence string, int start, int length) { if (!ignoreCase) { return regionMatches(thisStart, string, start, length); } if (string == null) { throw new NullPointerException("string"); } final int thisLen = length(); if (thisStart < 0 || length > thisLen - thisStart) { return false; } if (start < 0 || length > string.length() - start) { return false; } thisStart += arrayOffset(); final int thisEnd = thisStart + length; while (thisStart < thisEnd) { if (!equalsIgnoreCase(b2c(value[thisStart++]), string.charAt(start++))) { return false; } } return true; }
[ "public", "boolean", "regionMatches", "(", "boolean", "ignoreCase", ",", "int", "thisStart", ",", "CharSequence", "string", ",", "int", "start", ",", "int", "length", ")", "{", "if", "(", "!", "ignoreCase", ")", "{", "return", "regionMatches", "(", "thisStar...
Compares the specified string to this string and compares the specified range of characters to determine if they are the same. When ignoreCase is true, the case of the characters is ignored during the comparison. @param ignoreCase specifies if case should be ignored. @param thisStart the starting offset in this string. @param string the string to compare. @param start the starting offset in the specified string. @param length the number of characters to compare. @return {@code true} if the ranges of characters are equal, {@code false} otherwise. @throws NullPointerException if {@code string} is {@code null}.
[ "Compares", "the", "specified", "string", "to", "this", "string", "and", "compares", "the", "specified", "range", "of", "characters", "to", "determine", "if", "they", "are", "the", "same", ".", "When", "ignoreCase", "is", "true", "the", "case", "of", "the", ...
ba06eafa1c1824bd154f1a380019e7ea2edf3c4c
https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/common/src/main/java/io/netty/util/AsciiString.java#L840-L865
train
regionMatches This method is a convenience method for testing.
[ 30522, 2270, 22017, 20898, 2555, 18900, 8376, 1006, 22017, 20898, 8568, 18382, 1010, 20014, 2023, 14117, 2102, 1010, 25869, 3366, 4226, 5897, 5164, 1010, 20014, 2707, 1010, 20014, 3091, 1007, 1063, 2065, 1006, 999, 8568, 18382, 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-connectors/flink-connector-kafka-base/src/main/java/org/apache/flink/streaming/connectors/kafka/internals/ClosableBlockingQueue.java
ClosableBlockingQueue.peek
public E peek() { lock.lock(); try { if (open) { if (elements.size() > 0) { return elements.getFirst(); } else { return null; } } else { throw new IllegalStateException("queue is closed"); } } finally { lock.unlock(); } }
java
public E peek() { lock.lock(); try { if (open) { if (elements.size() > 0) { return elements.getFirst(); } else { return null; } } else { throw new IllegalStateException("queue is closed"); } } finally { lock.unlock(); } }
[ "public", "E", "peek", "(", ")", "{", "lock", ".", "lock", "(", ")", ";", "try", "{", "if", "(", "open", ")", "{", "if", "(", "elements", ".", "size", "(", ")", ">", "0", ")", "{", "return", "elements", ".", "getFirst", "(", ")", ";", "}", ...
Returns the queue's next element without removing it, if the queue is non-empty. Otherwise, returns null. <p>The method throws an {@code IllegalStateException} if the queue is closed. Checking whether the queue is open and getting the next element is one atomic operation. <p>This method never blocks. @return The queue's next element, or null, if the queue is empty. @throws IllegalStateException Thrown, if the queue is closed.
[ "Returns", "the", "queue", "s", "next", "element", "without", "removing", "it", "if", "the", "queue", "is", "non", "-", "empty", ".", "Otherwise", "returns", "null", "." ]
b62db93bf63cb3bb34dd03d611a779d9e3fc61ac
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-connectors/flink-connector-kafka-base/src/main/java/org/apache/flink/streaming/connectors/kafka/internals/ClosableBlockingQueue.java#L230-L245
train
Returns the next element in the queue.
[ 30522, 2270, 1041, 19043, 1006, 1007, 1063, 5843, 1012, 5843, 1006, 1007, 1025, 3046, 1063, 2065, 1006, 2330, 1007, 1063, 2065, 1006, 3787, 1012, 2946, 1006, 1007, 1028, 1014, 1007, 1063, 2709, 3787, 1012, 2131, 8873, 12096, 1006, 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/history/FsJobArchivist.java
FsJobArchivist.archiveJob
public static Path archiveJob(Path rootPath, JobID jobId, Collection<ArchivedJson> jsonToArchive) throws IOException { try { FileSystem fs = rootPath.getFileSystem(); Path path = new Path(rootPath, jobId.toString()); OutputStream out = fs.create(path, FileSystem.WriteMode.NO_OVERWRITE); try (JsonGenerator gen = jacksonFactory.createGenerator(out, JsonEncoding.UTF8)) { gen.writeStartObject(); gen.writeArrayFieldStart(ARCHIVE); for (ArchivedJson archive : jsonToArchive) { gen.writeStartObject(); gen.writeStringField(PATH, archive.getPath()); gen.writeStringField(JSON, archive.getJson()); gen.writeEndObject(); } gen.writeEndArray(); gen.writeEndObject(); } catch (Exception e) { fs.delete(path, false); throw e; } LOG.info("Job {} has been archived at {}.", jobId, path); return path; } catch (IOException e) { LOG.error("Failed to archive job.", e); throw e; } }
java
public static Path archiveJob(Path rootPath, JobID jobId, Collection<ArchivedJson> jsonToArchive) throws IOException { try { FileSystem fs = rootPath.getFileSystem(); Path path = new Path(rootPath, jobId.toString()); OutputStream out = fs.create(path, FileSystem.WriteMode.NO_OVERWRITE); try (JsonGenerator gen = jacksonFactory.createGenerator(out, JsonEncoding.UTF8)) { gen.writeStartObject(); gen.writeArrayFieldStart(ARCHIVE); for (ArchivedJson archive : jsonToArchive) { gen.writeStartObject(); gen.writeStringField(PATH, archive.getPath()); gen.writeStringField(JSON, archive.getJson()); gen.writeEndObject(); } gen.writeEndArray(); gen.writeEndObject(); } catch (Exception e) { fs.delete(path, false); throw e; } LOG.info("Job {} has been archived at {}.", jobId, path); return path; } catch (IOException e) { LOG.error("Failed to archive job.", e); throw e; } }
[ "public", "static", "Path", "archiveJob", "(", "Path", "rootPath", ",", "JobID", "jobId", ",", "Collection", "<", "ArchivedJson", ">", "jsonToArchive", ")", "throws", "IOException", "{", "try", "{", "FileSystem", "fs", "=", "rootPath", ".", "getFileSystem", "(...
Writes the given {@link AccessExecutionGraph} to the {@link FileSystem} pointed to by {@link JobManagerOptions#ARCHIVE_DIR}. @param rootPath directory to which the archive should be written to @param jobId job id @param jsonToArchive collection of json-path pairs to that should be archived @return path to where the archive was written, or null if no archive was created @throws IOException
[ "Writes", "the", "given", "{", "@link", "AccessExecutionGraph", "}", "to", "the", "{", "@link", "FileSystem", "}", "pointed", "to", "by", "{", "@link", "JobManagerOptions#ARCHIVE_DIR", "}", "." ]
b62db93bf63cb3bb34dd03d611a779d9e3fc61ac
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/history/FsJobArchivist.java#L71-L98
train
Archive a job.
[ 30522, 2270, 10763, 4130, 8756, 5558, 2497, 1006, 4130, 7117, 15069, 1010, 3105, 3593, 3105, 3593, 1010, 3074, 1026, 9749, 22578, 2239, 1028, 1046, 3385, 3406, 2906, 5428, 3726, 1007, 11618, 22834, 10288, 24422, 30524, 1025, 4130, 4130, 102...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
netty/netty
buffer/src/main/java/io/netty/buffer/Unpooled.java
Unpooled.wrappedBuffer
public static ByteBuf wrappedBuffer(long memoryAddress, int size, boolean doFree) { return new WrappedUnpooledUnsafeDirectByteBuf(ALLOC, memoryAddress, size, doFree); }
java
public static ByteBuf wrappedBuffer(long memoryAddress, int size, boolean doFree) { return new WrappedUnpooledUnsafeDirectByteBuf(ALLOC, memoryAddress, size, doFree); }
[ "public", "static", "ByteBuf", "wrappedBuffer", "(", "long", "memoryAddress", ",", "int", "size", ",", "boolean", "doFree", ")", "{", "return", "new", "WrappedUnpooledUnsafeDirectByteBuf", "(", "ALLOC", ",", "memoryAddress", ",", "size", ",", "doFree", ")", ";",...
Creates a new buffer which wraps the specified memory address. If {@code doFree} is true the memoryAddress will automatically be freed once the reference count of the {@link ByteBuf} reaches {@code 0}.
[ "Creates", "a", "new", "buffer", "which", "wraps", "the", "specified", "memory", "address", ".", "If", "{" ]
ba06eafa1c1824bd154f1a380019e7ea2edf3c4c
https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/buffer/src/main/java/io/netty/buffer/Unpooled.java#L214-L216
train
Create a new unsafe buffer that wraps the given memory address.
[ 30522, 2270, 10763, 24880, 8569, 2546, 5058, 8569, 12494, 1006, 2146, 3638, 4215, 16200, 4757, 1010, 20014, 2946, 1010, 22017, 20898, 2079, 23301, 1007, 1063, 2709, 2047, 5058, 4609, 16869, 2098, 4609, 3736, 25031, 7442, 6593, 3762, 2618, 8...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
netty/netty
common/src/main/java/io/netty/util/internal/RecyclableArrayList.java
RecyclableArrayList.newInstance
public static RecyclableArrayList newInstance(int minCapacity) { RecyclableArrayList ret = RECYCLER.get(); ret.ensureCapacity(minCapacity); return ret; }
java
public static RecyclableArrayList newInstance(int minCapacity) { RecyclableArrayList ret = RECYCLER.get(); ret.ensureCapacity(minCapacity); return ret; }
[ "public", "static", "RecyclableArrayList", "newInstance", "(", "int", "minCapacity", ")", "{", "RecyclableArrayList", "ret", "=", "RECYCLER", ".", "get", "(", ")", ";", "ret", ".", "ensureCapacity", "(", "minCapacity", ")", ";", "return", "ret", ";", "}" ]
Create a new empty {@link RecyclableArrayList} instance with the given capacity.
[ "Create", "a", "new", "empty", "{" ]
ba06eafa1c1824bd154f1a380019e7ea2edf3c4c
https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/common/src/main/java/io/netty/util/internal/RecyclableArrayList.java#L55-L59
train
Create a new instance of the class.
[ 30522, 2270, 10763, 28667, 2100, 20464, 3085, 2906, 9447, 9863, 2047, 7076, 26897, 1006, 20014, 8117, 17695, 6305, 3012, 1007, 1063, 28667, 2100, 20464, 3085, 2906, 9447, 9863, 2128, 2102, 1027, 28667, 2100, 14321, 2099, 1012, 2131, 1006, 1...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
looly/hutool
hutool-core/src/main/java/cn/hutool/core/util/ReUtil.java
ReUtil.delPre
public static String delPre(String regex, CharSequence content) { if (null == content || null == regex) { return StrUtil.str(content); } // Pattern pattern = Pattern.compile(regex, Pattern.DOTALL); final Pattern pattern = PatternPool.get(regex, Pattern.DOTALL); Matcher matcher = pattern.matcher(content); if (matcher.find()) { return StrUtil.sub(content, matcher.end(), content.length()); } return StrUtil.str(content); }
java
public static String delPre(String regex, CharSequence content) { if (null == content || null == regex) { return StrUtil.str(content); } // Pattern pattern = Pattern.compile(regex, Pattern.DOTALL); final Pattern pattern = PatternPool.get(regex, Pattern.DOTALL); Matcher matcher = pattern.matcher(content); if (matcher.find()) { return StrUtil.sub(content, matcher.end(), content.length()); } return StrUtil.str(content); }
[ "public", "static", "String", "delPre", "(", "String", "regex", ",", "CharSequence", "content", ")", "{", "if", "(", "null", "==", "content", "||", "null", "==", "regex", ")", "{", "return", "StrUtil", ".", "str", "(", "content", ")", ";", "}", "// Pat...
删除正则匹配到的内容之前的字符 如果没有找到,则返回原文 @param regex 定位正则 @param content 被查找的内容 @return 删除前缀后的新内容
[ "删除正则匹配到的内容之前的字符", "如果没有找到,则返回原文" ]
bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a
https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/util/ReUtil.java#L341-L353
train
Removes the specified regular expression from the specified content.
[ 30522, 2270, 10763, 5164, 3972, 28139, 1006, 5164, 19723, 10288, 1010, 25869, 3366, 4226, 5897, 4180, 1007, 1063, 2065, 1006, 19701, 1027, 1027, 4180, 1064, 1064, 19701, 1027, 1027, 19723, 10288, 1007, 1063, 2709, 2358, 22134, 4014, 1012, 2...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
netty/netty
buffer/src/main/java/io/netty/buffer/CompositeByteBuf.java
CompositeByteBuf.addComponents
public CompositeByteBuf addComponents(int cIndex, ByteBuf... buffers) { checkNotNull(buffers, "buffers"); addComponents0(false, cIndex, buffers, 0); consolidateIfNeeded(); return this; }
java
public CompositeByteBuf addComponents(int cIndex, ByteBuf... buffers) { checkNotNull(buffers, "buffers"); addComponents0(false, cIndex, buffers, 0); consolidateIfNeeded(); return this; }
[ "public", "CompositeByteBuf", "addComponents", "(", "int", "cIndex", ",", "ByteBuf", "...", "buffers", ")", "{", "checkNotNull", "(", "buffers", ",", "\"buffers\"", ")", ";", "addComponents0", "(", "false", ",", "cIndex", ",", "buffers", ",", "0", ")", ";", ...
Add the given {@link ByteBuf}s on the specific index <p> Be aware that this method does not increase the {@code writerIndex} of the {@link CompositeByteBuf}. If you need to have it increased you need to handle it by your own. <p> {@link ByteBuf#release()} ownership of all {@link ByteBuf} objects in {@code buffers} is transferred to this {@link CompositeByteBuf}. @param cIndex the index on which the {@link ByteBuf} will be added. {@link ByteBuf#release()} ownership of all {@link ByteBuf#release()} ownership of all {@link ByteBuf} objects is transferred to this {@link CompositeByteBuf}. @param buffers the {@link ByteBuf}s to add. {@link ByteBuf#release()} ownership of all {@link ByteBuf#release()} ownership of all {@link ByteBuf} objects is transferred to this {@link CompositeByteBuf}.
[ "Add", "the", "given", "{" ]
ba06eafa1c1824bd154f1a380019e7ea2edf3c4c
https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/buffer/src/main/java/io/netty/buffer/CompositeByteBuf.java#L335-L340
train
Add a sequence of components to this composite buffer.
[ 30522, 2270, 12490, 3762, 2618, 8569, 2546, 5587, 9006, 29513, 7666, 1006, 20014, 25022, 13629, 2595, 1010, 24880, 8569, 2546, 1012, 1012, 1012, 17698, 2015, 1007, 1063, 4638, 17048, 11231, 3363, 1006, 17698, 2015, 1010, 1000, 17698, 2015, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
looly/hutool
hutool-poi/src/main/java/cn/hutool/poi/excel/cell/CellUtil.java
CellUtil.setCellValue
public static void setCellValue(Cell cell, Object value, StyleSet styleSet, boolean isHeader) { final CellStyle headCellStyle = styleSet.getHeadCellStyle(); final CellStyle cellStyle = styleSet.getCellStyle(); if (isHeader && null != headCellStyle) { cell.setCellStyle(headCellStyle); } else if (null != cellStyle) { cell.setCellStyle(cellStyle); } if (null == value) { cell.setCellValue(StrUtil.EMPTY); } else if (value instanceof FormulaCellValue) { // 公式 cell.setCellFormula(((FormulaCellValue) value).getValue()); } else if (value instanceof Date) { if (null != styleSet && null != styleSet.getCellStyleForDate()) { cell.setCellStyle(styleSet.getCellStyleForDate()); } cell.setCellValue((Date) value); } else if (value instanceof Calendar) { cell.setCellValue((Calendar) value); } else if (value instanceof Boolean) { cell.setCellValue((Boolean) value); } else if (value instanceof RichTextString) { cell.setCellValue((RichTextString) value); } else if (value instanceof Number) { if ((value instanceof Double || value instanceof Float) && null != styleSet && null != styleSet.getCellStyleForNumber()) { cell.setCellStyle(styleSet.getCellStyleForNumber()); } cell.setCellValue(((Number) value).doubleValue()); } else { cell.setCellValue(value.toString()); } }
java
public static void setCellValue(Cell cell, Object value, StyleSet styleSet, boolean isHeader) { final CellStyle headCellStyle = styleSet.getHeadCellStyle(); final CellStyle cellStyle = styleSet.getCellStyle(); if (isHeader && null != headCellStyle) { cell.setCellStyle(headCellStyle); } else if (null != cellStyle) { cell.setCellStyle(cellStyle); } if (null == value) { cell.setCellValue(StrUtil.EMPTY); } else if (value instanceof FormulaCellValue) { // 公式 cell.setCellFormula(((FormulaCellValue) value).getValue()); } else if (value instanceof Date) { if (null != styleSet && null != styleSet.getCellStyleForDate()) { cell.setCellStyle(styleSet.getCellStyleForDate()); } cell.setCellValue((Date) value); } else if (value instanceof Calendar) { cell.setCellValue((Calendar) value); } else if (value instanceof Boolean) { cell.setCellValue((Boolean) value); } else if (value instanceof RichTextString) { cell.setCellValue((RichTextString) value); } else if (value instanceof Number) { if ((value instanceof Double || value instanceof Float) && null != styleSet && null != styleSet.getCellStyleForNumber()) { cell.setCellStyle(styleSet.getCellStyleForNumber()); } cell.setCellValue(((Number) value).doubleValue()); } else { cell.setCellValue(value.toString()); } }
[ "public", "static", "void", "setCellValue", "(", "Cell", "cell", ",", "Object", "value", ",", "StyleSet", "styleSet", ",", "boolean", "isHeader", ")", "{", "final", "CellStyle", "headCellStyle", "=", "styleSet", ".", "getHeadCellStyle", "(", ")", ";", "final",...
设置单元格值<br> 根据传入的styleSet自动匹配样式<br> 当为头部样式时默认赋值头部样式,但是头部中如果有数字、日期等类型,将按照数字、日期样式设置 @param cell 单元格 @param value 值 @param styleSet 单元格样式集,包括日期等样式 @param isHeader 是否为标题单元格
[ "设置单元格值<br", ">", "根据传入的styleSet自动匹配样式<br", ">", "当为头部样式时默认赋值头部样式,但是头部中如果有数字、日期等类型,将按照数字、日期样式设置" ]
bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a
https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-poi/src/main/java/cn/hutool/poi/excel/cell/CellUtil.java#L122-L155
train
Sets the value of a cell.
[ 30522, 2270, 10763, 11675, 2275, 29109, 22144, 7630, 2063, 1006, 3526, 3526, 1010, 4874, 3643, 1010, 6782, 3388, 6782, 3388, 1010, 22017, 20898, 2003, 4974, 2121, 1007, 1063, 2345, 4442, 27983, 2132, 29109, 4877, 27983, 1027, 6782, 3388, 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-extra/src/main/java/cn/hutool/extra/servlet/ServletUtil.java
ServletUtil.setHeader
public static void setHeader(HttpServletResponse response, String name, Object value) { if (value instanceof String) { response.setHeader(name, (String) value); } else if (Date.class.isAssignableFrom(value.getClass())) { response.setDateHeader(name, ((Date) value).getTime()); } else if (value instanceof Integer || "int".equals(value.getClass().getSimpleName().toLowerCase())) { response.setIntHeader(name, (Integer) value); } else { response.setHeader(name, value.toString()); } }
java
public static void setHeader(HttpServletResponse response, String name, Object value) { if (value instanceof String) { response.setHeader(name, (String) value); } else if (Date.class.isAssignableFrom(value.getClass())) { response.setDateHeader(name, ((Date) value).getTime()); } else if (value instanceof Integer || "int".equals(value.getClass().getSimpleName().toLowerCase())) { response.setIntHeader(name, (Integer) value); } else { response.setHeader(name, value.toString()); } }
[ "public", "static", "void", "setHeader", "(", "HttpServletResponse", "response", ",", "String", "name", ",", "Object", "value", ")", "{", "if", "(", "value", "instanceof", "String", ")", "{", "response", ".", "setHeader", "(", "name", ",", "(", "String", "...
设置响应的Header @param response 响应对象{@link HttpServletResponse} @param name 名 @param value 值,可以是String,Date, int
[ "设置响应的Header" ]
bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a
https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-extra/src/main/java/cn/hutool/extra/servlet/ServletUtil.java#L578-L588
train
Sets the value of the specified header in the specified response.
[ 30522, 2270, 10763, 11675, 6662, 13775, 2121, 1006, 16770, 2121, 2615, 7485, 6072, 26029, 3366, 3433, 1010, 5164, 2171, 1010, 4874, 3643, 1007, 1063, 2065, 1006, 3643, 6013, 11253, 5164, 1007, 1063, 3433, 1012, 6662, 13775, 2121, 1006, 2171...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -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/SpringApplication.java
SpringApplication.refresh
protected void refresh(ApplicationContext applicationContext) { Assert.isInstanceOf(AbstractApplicationContext.class, applicationContext); ((AbstractApplicationContext) applicationContext).refresh(); }
java
protected void refresh(ApplicationContext applicationContext) { Assert.isInstanceOf(AbstractApplicationContext.class, applicationContext); ((AbstractApplicationContext) applicationContext).refresh(); }
[ "protected", "void", "refresh", "(", "ApplicationContext", "applicationContext", ")", "{", "Assert", ".", "isInstanceOf", "(", "AbstractApplicationContext", ".", "class", ",", "applicationContext", ")", ";", "(", "(", "AbstractApplicationContext", ")", "applicationConte...
Refresh the underlying {@link ApplicationContext}. @param applicationContext the application context to refresh
[ "Refresh", "the", "underlying", "{" ]
0b27f7c70e164b2b1a96477f1d9c1acba56790c1
https://github.com/spring-projects/spring-boot/blob/0b27f7c70e164b2b1a96477f1d9c1acba56790c1/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/SpringApplication.java#L780-L783
train
Refresh the application context.
[ 30522, 5123, 11675, 25416, 21898, 1006, 4646, 8663, 18209, 4646, 8663, 18209, 1007, 1063, 20865, 1012, 2003, 7076, 26897, 11253, 1006, 10061, 29098, 19341, 3508, 8663, 18209, 1012, 2465, 1010, 4646, 8663, 18209, 1007, 1025, 1006, 1006, 10061,...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
hankcs/HanLP
src/main/java/com/hankcs/hanlp/seg/common/WordNet.java
WordNet.toGraph
public Graph toGraph() { Graph graph = new Graph(getVertexesLineFirst()); for (int row = 0; row < vertexes.length - 1; ++row) { List<Vertex> vertexListFrom = vertexes[row]; for (Vertex from : vertexListFrom) { assert from.realWord.length() > 0 : "空节点会导致死循环!"; int toIndex = row + from.realWord.length(); for (Vertex to : vertexes[toIndex]) { graph.connect(from.index, to.index, MathUtility.calculateWeight(from, to)); } } } return graph; }
java
public Graph toGraph() { Graph graph = new Graph(getVertexesLineFirst()); for (int row = 0; row < vertexes.length - 1; ++row) { List<Vertex> vertexListFrom = vertexes[row]; for (Vertex from : vertexListFrom) { assert from.realWord.length() > 0 : "空节点会导致死循环!"; int toIndex = row + from.realWord.length(); for (Vertex to : vertexes[toIndex]) { graph.connect(from.index, to.index, MathUtility.calculateWeight(from, to)); } } } return graph; }
[ "public", "Graph", "toGraph", "(", ")", "{", "Graph", "graph", "=", "new", "Graph", "(", "getVertexesLineFirst", "(", ")", ")", ";", "for", "(", "int", "row", "=", "0", ";", "row", "<", "vertexes", ".", "length", "-", "1", ";", "++", "row", ")", ...
词网转词图 @return 词图
[ "词网转词图" ]
a538d0722ab2e4980a9dcd9ea40324fc3ddba7ce
https://github.com/hankcs/HanLP/blob/a538d0722ab2e4980a9dcd9ea40324fc3ddba7ce/src/main/java/com/hankcs/hanlp/seg/common/WordNet.java#L322-L340
train
Returns a graph containing the terms of the terms.
[ 30522, 2270, 10629, 2000, 14413, 1006, 1007, 1063, 10629, 10629, 1027, 2047, 10629, 1006, 2131, 16874, 10288, 2229, 4179, 8873, 12096, 1006, 1007, 1007, 1025, 2005, 1006, 20014, 5216, 1027, 1014, 1025, 5216, 1026, 19449, 2229, 1012, 3091, 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-connectors/flink-connector-kinesis/src/main/java/org/apache/flink/streaming/connectors/kinesis/internals/KinesisDataFetcher.java
KinesisDataFetcher.registerShardMetrics
private static ShardMetricsReporter registerShardMetrics(MetricGroup metricGroup, KinesisStreamShardState shardState) { ShardMetricsReporter shardMetrics = new ShardMetricsReporter(); MetricGroup streamShardMetricGroup = metricGroup .addGroup( KinesisConsumerMetricConstants.STREAM_METRICS_GROUP, shardState.getStreamShardHandle().getStreamName()) .addGroup( KinesisConsumerMetricConstants.SHARD_METRICS_GROUP, shardState.getStreamShardHandle().getShard().getShardId()); streamShardMetricGroup.gauge(KinesisConsumerMetricConstants.MILLIS_BEHIND_LATEST_GAUGE, shardMetrics::getMillisBehindLatest); streamShardMetricGroup.gauge(KinesisConsumerMetricConstants.MAX_RECORDS_PER_FETCH, shardMetrics::getMaxNumberOfRecordsPerFetch); streamShardMetricGroup.gauge(KinesisConsumerMetricConstants.NUM_AGGREGATED_RECORDS_PER_FETCH, shardMetrics::getNumberOfAggregatedRecords); streamShardMetricGroup.gauge(KinesisConsumerMetricConstants.NUM_DEAGGREGATED_RECORDS_PER_FETCH, shardMetrics::getNumberOfDeaggregatedRecords); streamShardMetricGroup.gauge(KinesisConsumerMetricConstants.AVG_RECORD_SIZE_BYTES, shardMetrics::getAverageRecordSizeBytes); streamShardMetricGroup.gauge(KinesisConsumerMetricConstants.BYTES_PER_READ, shardMetrics::getBytesPerRead); streamShardMetricGroup.gauge(KinesisConsumerMetricConstants.RUNTIME_LOOP_NANOS, shardMetrics::getRunLoopTimeNanos); streamShardMetricGroup.gauge(KinesisConsumerMetricConstants.LOOP_FREQUENCY_HZ, shardMetrics::getLoopFrequencyHz); streamShardMetricGroup.gauge(KinesisConsumerMetricConstants.SLEEP_TIME_MILLIS, shardMetrics::getSleepTimeMillis); return shardMetrics; }
java
private static ShardMetricsReporter registerShardMetrics(MetricGroup metricGroup, KinesisStreamShardState shardState) { ShardMetricsReporter shardMetrics = new ShardMetricsReporter(); MetricGroup streamShardMetricGroup = metricGroup .addGroup( KinesisConsumerMetricConstants.STREAM_METRICS_GROUP, shardState.getStreamShardHandle().getStreamName()) .addGroup( KinesisConsumerMetricConstants.SHARD_METRICS_GROUP, shardState.getStreamShardHandle().getShard().getShardId()); streamShardMetricGroup.gauge(KinesisConsumerMetricConstants.MILLIS_BEHIND_LATEST_GAUGE, shardMetrics::getMillisBehindLatest); streamShardMetricGroup.gauge(KinesisConsumerMetricConstants.MAX_RECORDS_PER_FETCH, shardMetrics::getMaxNumberOfRecordsPerFetch); streamShardMetricGroup.gauge(KinesisConsumerMetricConstants.NUM_AGGREGATED_RECORDS_PER_FETCH, shardMetrics::getNumberOfAggregatedRecords); streamShardMetricGroup.gauge(KinesisConsumerMetricConstants.NUM_DEAGGREGATED_RECORDS_PER_FETCH, shardMetrics::getNumberOfDeaggregatedRecords); streamShardMetricGroup.gauge(KinesisConsumerMetricConstants.AVG_RECORD_SIZE_BYTES, shardMetrics::getAverageRecordSizeBytes); streamShardMetricGroup.gauge(KinesisConsumerMetricConstants.BYTES_PER_READ, shardMetrics::getBytesPerRead); streamShardMetricGroup.gauge(KinesisConsumerMetricConstants.RUNTIME_LOOP_NANOS, shardMetrics::getRunLoopTimeNanos); streamShardMetricGroup.gauge(KinesisConsumerMetricConstants.LOOP_FREQUENCY_HZ, shardMetrics::getLoopFrequencyHz); streamShardMetricGroup.gauge(KinesisConsumerMetricConstants.SLEEP_TIME_MILLIS, shardMetrics::getSleepTimeMillis); return shardMetrics; }
[ "private", "static", "ShardMetricsReporter", "registerShardMetrics", "(", "MetricGroup", "metricGroup", ",", "KinesisStreamShardState", "shardState", ")", "{", "ShardMetricsReporter", "shardMetrics", "=", "new", "ShardMetricsReporter", "(", ")", ";", "MetricGroup", "streamS...
Registers a metric group associated with the shard id of the provided {@link KinesisStreamShardState shardState}. @return a {@link ShardMetricsReporter} that can be used to update metric values
[ "Registers", "a", "metric", "group", "associated", "with", "the", "shard", "id", "of", "the", "provided", "{", "@link", "KinesisStreamShardState", "shardState", "}", "." ]
b62db93bf63cb3bb34dd03d611a779d9e3fc61ac
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-connectors/flink-connector-kinesis/src/main/java/org/apache/flink/streaming/connectors/kinesis/internals/KinesisDataFetcher.java#L793-L814
train
Register shard metrics.
[ 30522, 2797, 10763, 21146, 4103, 12589, 21338, 13699, 11589, 2121, 18687, 11783, 12589, 2015, 1006, 12046, 17058, 12046, 17058, 1010, 12631, 19009, 21422, 7377, 17811, 12259, 23327, 12259, 1007, 1063, 21146, 4103, 12589, 21338, 13699, 11589, 21...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
apache/flink
flink-queryable-state/flink-queryable-state-client-java/src/main/java/org/apache/flink/queryablestate/client/QueryableStateClient.java
QueryableStateClient.getKvState
@PublicEvolving public <K, S extends State, V> CompletableFuture<S> getKvState( final JobID jobId, final String queryableStateName, final K key, final TypeHint<K> keyTypeHint, final StateDescriptor<S, V> stateDescriptor) { Preconditions.checkNotNull(keyTypeHint); TypeInformation<K> keyTypeInfo = keyTypeHint.getTypeInfo(); return getKvState(jobId, queryableStateName, key, keyTypeInfo, stateDescriptor); }
java
@PublicEvolving public <K, S extends State, V> CompletableFuture<S> getKvState( final JobID jobId, final String queryableStateName, final K key, final TypeHint<K> keyTypeHint, final StateDescriptor<S, V> stateDescriptor) { Preconditions.checkNotNull(keyTypeHint); TypeInformation<K> keyTypeInfo = keyTypeHint.getTypeInfo(); return getKvState(jobId, queryableStateName, key, keyTypeInfo, stateDescriptor); }
[ "@", "PublicEvolving", "public", "<", "K", ",", "S", "extends", "State", ",", "V", ">", "CompletableFuture", "<", "S", ">", "getKvState", "(", "final", "JobID", "jobId", ",", "final", "String", "queryableStateName", ",", "final", "K", "key", ",", "final", ...
Returns a future holding the request result. @param jobId JobID of the job the queryable state belongs to. @param queryableStateName Name under which the state is queryable. @param key The key we are interested in. @param keyTypeHint A {@link TypeHint} used to extract the type of the key. @param stateDescriptor The {@link StateDescriptor} of the state we want to query. @return Future holding the immutable {@link State} object containing the result.
[ "Returns", "a", "future", "holding", "the", "request", "result", "." ]
b62db93bf63cb3bb34dd03d611a779d9e3fc61ac
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-queryable-state/flink-queryable-state-client-java/src/main/java/org/apache/flink/queryablestate/client/QueryableStateClient.java#L196-L208
train
Gets the state for a specific key.
[ 30522, 1030, 2270, 6777, 4747, 6455, 2270, 1026, 1047, 1010, 1055, 8908, 2110, 1010, 1058, 1028, 4012, 10814, 10880, 11263, 11244, 1026, 1055, 1028, 2131, 2243, 15088, 12259, 1006, 2345, 3105, 3593, 3105, 3593, 1010, 2345, 5164, 23032, 3085...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -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/DaoTemplate.java
DaoTemplate.addForGeneratedKeys
public List<Object> addForGeneratedKeys(Entity entity) throws SQLException { return db.insertForGeneratedKeys(fixEntity(entity)); }
java
public List<Object> addForGeneratedKeys(Entity entity) throws SQLException { return db.insertForGeneratedKeys(fixEntity(entity)); }
[ "public", "List", "<", "Object", ">", "addForGeneratedKeys", "(", "Entity", "entity", ")", "throws", "SQLException", "{", "return", "db", ".", "insertForGeneratedKeys", "(", "fixEntity", "(", "entity", ")", ")", ";", "}" ]
添加 @param entity 实体对象 @return 主键列表 @throws SQLException SQL执行异常
[ "添加" ]
bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a
https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-db/src/main/java/cn/hutool/db/DaoTemplate.java#L96-L98
train
Add the entity for generated keys.
[ 30522, 2270, 2862, 1026, 4874, 1028, 5587, 29278, 6914, 16848, 14839, 2015, 1006, 9178, 9178, 1007, 11618, 29296, 10288, 24422, 1063, 2709, 16962, 1012, 19274, 29278, 6914, 16848, 14839, 2015, 1006, 8081, 4765, 3012, 1006, 9178, 1007, 1007, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
hankcs/HanLP
src/main/java/com/hankcs/hanlp/dependency/perceptron/transition/trainer/ArcEagerBeamTrainer.java
ArcEagerBeamTrainer.trainOnOneSample
private void trainOnOneSample(Instance instance, int partialTreeIter, int i, int dataCount, CompletionService<ArrayList<BeamElement>> pool) throws InterruptedException, ExecutionException { boolean isPartial = instance.isPartial(options.rootFirst); if (partialTreeIter > i && isPartial) return; Configuration initialConfiguration = new Configuration(instance.getSentence(), options.rootFirst); Configuration firstOracle = initialConfiguration.clone(); ArrayList<Configuration> beam = new ArrayList<Configuration>(options.beamWidth); beam.add(initialConfiguration); /** * The float is the oracle's cost * For more information see: * Yoav Goldberg and Joakim Nivre. "Training Deterministic Parsers with Non-Deterministic Oracles." * TACL 1 (2013): 403-414. * for the mean while we just use zero-cost oracles */ Collection<Configuration> oracles = new HashSet<Configuration>(); oracles.add(firstOracle); /** * For keeping track of the violations * For more information see: * Liang Huang, Suphan Fayong and Yang Guo. "Structured perceptron with inexact search." * In Proceedings of the 2012 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, * pp. 142-151. Association for Computational Linguistics, 2012. */ float maxViol = Float.NEGATIVE_INFINITY; Pair<Configuration, Configuration> maxViolPair = null; Configuration bestScoringOracle = null; boolean oracleInBeam = false; while (!ArcEager.isTerminal(beam) && beam.size() > 0) { /** * generating new oracles * it keeps the oracles which are in the terminal state */ Collection<Configuration> newOracles = new HashSet<Configuration>(); if (options.useDynamicOracle || isPartial) { bestScoringOracle = zeroCostDynamicOracle(instance, oracles, newOracles); } else { bestScoringOracle = staticOracle(instance, oracles, newOracles); } // try explore non-optimal transitions if (newOracles.size() == 0) { // System.err.println("...no oracle(" + dataCount + ")..."); bestScoringOracle = staticOracle(instance, oracles, newOracles); } oracles = newOracles; TreeSet<BeamElement> beamPreserver = new TreeSet<BeamElement>(); if (options.numOfThreads == 1 || beam.size() == 1) { beamSortOneThread(beam, beamPreserver); } else { for (int b = 0; b < beam.size(); b++) { pool.submit(new BeamScorerThread(false, classifier, beam.get(b), dependencyRelations, featureLength, b, options.rootFirst)); } for (int b = 0; b < beam.size(); b++) { for (BeamElement element : pool.take().get()) { beamPreserver.add(element); if (beamPreserver.size() > options.beamWidth) beamPreserver.pollFirst(); } } } if (beamPreserver.size() == 0 || beam.size() == 0) { break; } else { oracleInBeam = false; ArrayList<Configuration> repBeam = new ArrayList<Configuration>(options.beamWidth); for (BeamElement beamElement : beamPreserver.descendingSet()) { // if (repBeam.size() >= options.beamWidth) // 只要beamWidth个configuration(这句是多余的) // break; int b = beamElement.index; int action = beamElement.action; int label = beamElement.label; float score = beamElement.score; Configuration newConfig = beam.get(b).clone(); ArcEager.commitAction(action, label, score, dependencyRelations, newConfig); repBeam.add(newConfig); if (!oracleInBeam && oracles.contains(newConfig)) oracleInBeam = true; } beam = repBeam; if (beam.size() > 0 && oracles.size() > 0) { Configuration bestConfig = beam.get(0); if (oracles.contains(bestConfig)) // 模型认为的最大分值configuration是zero cost { oracles = new HashSet<Configuration>(); oracles.add(bestConfig); } else // 否则 { if (options.useRandomOracleSelection) // 随机选择一个 oracle { // choosing randomly, otherwise using latent structured Perceptron List<Configuration> keys = new ArrayList<Configuration>(oracles); Configuration randomKey = keys.get(randGen.nextInt(keys.size())); oracles = new HashSet<Configuration>(); oracles.add(randomKey); bestScoringOracle = randomKey; } else // 选择 oracle中被模型认为分值最大的那个 { oracles = new HashSet<Configuration>(); oracles.add(bestScoringOracle); } } // do early update if (!oracleInBeam && updateMode.equals("early")) break; // keep violations if (!oracleInBeam && updateMode.equals("max_violation")) { float violation = bestConfig.getScore(true) - bestScoringOracle.getScore(true);//Math.abs(beam.get(0).getScore(true) - bestScoringOracle.getScore(true)); if (violation > maxViol) { maxViol = violation; maxViolPair = new Pair<Configuration, Configuration>(bestConfig, bestScoringOracle); } } } else break; } } // updating weights if (!oracleInBeam || !bestScoringOracle.equals(beam.get(0)) // 虽然oracle在beam里面,但在最后时刻,它的得分不是最高 ) { updateWeights(initialConfiguration, maxViol, isPartial, bestScoringOracle, maxViolPair, beam); } }
java
private void trainOnOneSample(Instance instance, int partialTreeIter, int i, int dataCount, CompletionService<ArrayList<BeamElement>> pool) throws InterruptedException, ExecutionException { boolean isPartial = instance.isPartial(options.rootFirst); if (partialTreeIter > i && isPartial) return; Configuration initialConfiguration = new Configuration(instance.getSentence(), options.rootFirst); Configuration firstOracle = initialConfiguration.clone(); ArrayList<Configuration> beam = new ArrayList<Configuration>(options.beamWidth); beam.add(initialConfiguration); /** * The float is the oracle's cost * For more information see: * Yoav Goldberg and Joakim Nivre. "Training Deterministic Parsers with Non-Deterministic Oracles." * TACL 1 (2013): 403-414. * for the mean while we just use zero-cost oracles */ Collection<Configuration> oracles = new HashSet<Configuration>(); oracles.add(firstOracle); /** * For keeping track of the violations * For more information see: * Liang Huang, Suphan Fayong and Yang Guo. "Structured perceptron with inexact search." * In Proceedings of the 2012 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, * pp. 142-151. Association for Computational Linguistics, 2012. */ float maxViol = Float.NEGATIVE_INFINITY; Pair<Configuration, Configuration> maxViolPair = null; Configuration bestScoringOracle = null; boolean oracleInBeam = false; while (!ArcEager.isTerminal(beam) && beam.size() > 0) { /** * generating new oracles * it keeps the oracles which are in the terminal state */ Collection<Configuration> newOracles = new HashSet<Configuration>(); if (options.useDynamicOracle || isPartial) { bestScoringOracle = zeroCostDynamicOracle(instance, oracles, newOracles); } else { bestScoringOracle = staticOracle(instance, oracles, newOracles); } // try explore non-optimal transitions if (newOracles.size() == 0) { // System.err.println("...no oracle(" + dataCount + ")..."); bestScoringOracle = staticOracle(instance, oracles, newOracles); } oracles = newOracles; TreeSet<BeamElement> beamPreserver = new TreeSet<BeamElement>(); if (options.numOfThreads == 1 || beam.size() == 1) { beamSortOneThread(beam, beamPreserver); } else { for (int b = 0; b < beam.size(); b++) { pool.submit(new BeamScorerThread(false, classifier, beam.get(b), dependencyRelations, featureLength, b, options.rootFirst)); } for (int b = 0; b < beam.size(); b++) { for (BeamElement element : pool.take().get()) { beamPreserver.add(element); if (beamPreserver.size() > options.beamWidth) beamPreserver.pollFirst(); } } } if (beamPreserver.size() == 0 || beam.size() == 0) { break; } else { oracleInBeam = false; ArrayList<Configuration> repBeam = new ArrayList<Configuration>(options.beamWidth); for (BeamElement beamElement : beamPreserver.descendingSet()) { // if (repBeam.size() >= options.beamWidth) // 只要beamWidth个configuration(这句是多余的) // break; int b = beamElement.index; int action = beamElement.action; int label = beamElement.label; float score = beamElement.score; Configuration newConfig = beam.get(b).clone(); ArcEager.commitAction(action, label, score, dependencyRelations, newConfig); repBeam.add(newConfig); if (!oracleInBeam && oracles.contains(newConfig)) oracleInBeam = true; } beam = repBeam; if (beam.size() > 0 && oracles.size() > 0) { Configuration bestConfig = beam.get(0); if (oracles.contains(bestConfig)) // 模型认为的最大分值configuration是zero cost { oracles = new HashSet<Configuration>(); oracles.add(bestConfig); } else // 否则 { if (options.useRandomOracleSelection) // 随机选择一个 oracle { // choosing randomly, otherwise using latent structured Perceptron List<Configuration> keys = new ArrayList<Configuration>(oracles); Configuration randomKey = keys.get(randGen.nextInt(keys.size())); oracles = new HashSet<Configuration>(); oracles.add(randomKey); bestScoringOracle = randomKey; } else // 选择 oracle中被模型认为分值最大的那个 { oracles = new HashSet<Configuration>(); oracles.add(bestScoringOracle); } } // do early update if (!oracleInBeam && updateMode.equals("early")) break; // keep violations if (!oracleInBeam && updateMode.equals("max_violation")) { float violation = bestConfig.getScore(true) - bestScoringOracle.getScore(true);//Math.abs(beam.get(0).getScore(true) - bestScoringOracle.getScore(true)); if (violation > maxViol) { maxViol = violation; maxViolPair = new Pair<Configuration, Configuration>(bestConfig, bestScoringOracle); } } } else break; } } // updating weights if (!oracleInBeam || !bestScoringOracle.equals(beam.get(0)) // 虽然oracle在beam里面,但在最后时刻,它的得分不是最高 ) { updateWeights(initialConfiguration, maxViol, isPartial, bestScoringOracle, maxViolPair, beam); } }
[ "private", "void", "trainOnOneSample", "(", "Instance", "instance", ",", "int", "partialTreeIter", ",", "int", "i", ",", "int", "dataCount", ",", "CompletionService", "<", "ArrayList", "<", "BeamElement", ">", ">", "pool", ")", "throws", "InterruptedException", ...
在线学习 @param instance 实例 @param partialTreeIter 半标注树的训练迭代数 @param i 当前迭代数 @param dataCount @param pool @throws Exception
[ "在线学习" ]
a538d0722ab2e4980a9dcd9ea40324fc3ddba7ce
https://github.com/hankcs/HanLP/blob/a538d0722ab2e4980a9dcd9ea40324fc3ddba7ce/src/main/java/com/hankcs/hanlp/dependency/perceptron/transition/trainer/ArcEagerBeamTrainer.java#L152-L317
train
Train on one sample of a single instance.
[ 30522, 2797, 11675, 3345, 17175, 5267, 16613, 2571, 1006, 6013, 6013, 1010, 20014, 7704, 13334, 21646, 1010, 20014, 1045, 1010, 20014, 2951, 3597, 16671, 1010, 6503, 8043, 7903, 2063, 1026, 9140, 9863, 1026, 7504, 12260, 3672, 1028, 1028, 4...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
hankcs/HanLP
src/main/java/com/hankcs/hanlp/dictionary/CustomDictionary.java
CustomDictionary.loadDat
public static boolean loadDat(String path, String customDicPath[], DoubleArrayTrie<CoreDictionary.Attribute> dat) { try { if (isDicNeedUpdate(path, customDicPath)) { return false; } ByteArray byteArray = ByteArray.createByteArray(path + Predefine.BIN_EXT); if (byteArray == null) return false; int size = byteArray.nextInt(); if (size < 0) // 一种兼容措施,当size小于零表示文件头部储存了-size个用户词性 { while (++size <= 0) { Nature.create(byteArray.nextString()); } size = byteArray.nextInt(); } CoreDictionary.Attribute[] attributes = new CoreDictionary.Attribute[size]; final Nature[] natureIndexArray = Nature.values(); for (int i = 0; i < size; ++i) { // 第一个是全部频次,第二个是词性个数 int currentTotalFrequency = byteArray.nextInt(); int length = byteArray.nextInt(); attributes[i] = new CoreDictionary.Attribute(length); attributes[i].totalFrequency = currentTotalFrequency; for (int j = 0; j < length; ++j) { attributes[i].nature[j] = natureIndexArray[byteArray.nextInt()]; attributes[i].frequency[j] = byteArray.nextInt(); } } if (!dat.load(byteArray, attributes)) return false; } catch (Exception e) { logger.warning("读取失败,问题发生在" + TextUtility.exceptionToString(e)); return false; } return true; }
java
public static boolean loadDat(String path, String customDicPath[], DoubleArrayTrie<CoreDictionary.Attribute> dat) { try { if (isDicNeedUpdate(path, customDicPath)) { return false; } ByteArray byteArray = ByteArray.createByteArray(path + Predefine.BIN_EXT); if (byteArray == null) return false; int size = byteArray.nextInt(); if (size < 0) // 一种兼容措施,当size小于零表示文件头部储存了-size个用户词性 { while (++size <= 0) { Nature.create(byteArray.nextString()); } size = byteArray.nextInt(); } CoreDictionary.Attribute[] attributes = new CoreDictionary.Attribute[size]; final Nature[] natureIndexArray = Nature.values(); for (int i = 0; i < size; ++i) { // 第一个是全部频次,第二个是词性个数 int currentTotalFrequency = byteArray.nextInt(); int length = byteArray.nextInt(); attributes[i] = new CoreDictionary.Attribute(length); attributes[i].totalFrequency = currentTotalFrequency; for (int j = 0; j < length; ++j) { attributes[i].nature[j] = natureIndexArray[byteArray.nextInt()]; attributes[i].frequency[j] = byteArray.nextInt(); } } if (!dat.load(byteArray, attributes)) return false; } catch (Exception e) { logger.warning("读取失败,问题发生在" + TextUtility.exceptionToString(e)); return false; } return true; }
[ "public", "static", "boolean", "loadDat", "(", "String", "path", ",", "String", "customDicPath", "[", "]", ",", "DoubleArrayTrie", "<", "CoreDictionary", ".", "Attribute", ">", "dat", ")", "{", "try", "{", "if", "(", "isDicNeedUpdate", "(", "path", ",", "c...
从磁盘加载双数组 @param path 主词典路径 @param customDicPath 用户词典路径 @return
[ "从磁盘加载双数组" ]
a538d0722ab2e4980a9dcd9ea40324fc3ddba7ce
https://github.com/hankcs/HanLP/blob/a538d0722ab2e4980a9dcd9ea40324fc3ddba7ce/src/main/java/com/hankcs/hanlp/dictionary/CustomDictionary.java#L329-L371
train
Load the data from a file.
[ 30522, 2270, 10763, 22017, 20898, 7170, 2850, 2102, 1006, 5164, 4130, 1010, 5164, 7661, 14808, 15069, 1031, 1033, 1010, 3313, 2906, 9447, 18886, 2063, 1026, 4563, 29201, 3258, 5649, 1012, 17961, 1028, 23755, 1007, 1063, 3046, 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-runtime/src/main/java/org/apache/flink/runtime/io/network/netty/PartitionRequestClient.java
PartitionRequestClient.sendTaskEvent
public void sendTaskEvent(ResultPartitionID partitionId, TaskEvent event, final RemoteInputChannel inputChannel) throws IOException { checkNotClosed(); tcpChannel.writeAndFlush(new TaskEventRequest(event, partitionId, inputChannel.getInputChannelId())) .addListener( new ChannelFutureListener() { @Override public void operationComplete(ChannelFuture future) throws Exception { if (!future.isSuccess()) { SocketAddress remoteAddr = future.channel().remoteAddress(); inputChannel.onError(new LocalTransportException( String.format("Sending the task event to '%s' failed.", remoteAddr), future.channel().localAddress(), future.cause() )); } } }); }
java
public void sendTaskEvent(ResultPartitionID partitionId, TaskEvent event, final RemoteInputChannel inputChannel) throws IOException { checkNotClosed(); tcpChannel.writeAndFlush(new TaskEventRequest(event, partitionId, inputChannel.getInputChannelId())) .addListener( new ChannelFutureListener() { @Override public void operationComplete(ChannelFuture future) throws Exception { if (!future.isSuccess()) { SocketAddress remoteAddr = future.channel().remoteAddress(); inputChannel.onError(new LocalTransportException( String.format("Sending the task event to '%s' failed.", remoteAddr), future.channel().localAddress(), future.cause() )); } } }); }
[ "public", "void", "sendTaskEvent", "(", "ResultPartitionID", "partitionId", ",", "TaskEvent", "event", ",", "final", "RemoteInputChannel", "inputChannel", ")", "throws", "IOException", "{", "checkNotClosed", "(", ")", ";", "tcpChannel", ".", "writeAndFlush", "(", "n...
Sends a task event backwards to an intermediate result partition producer. <p> Backwards task events flow between readers and writers and therefore will only work when both are running at the same time, which is only guaranteed to be the case when both the respective producer and consumer task run pipelined.
[ "Sends", "a", "task", "event", "backwards", "to", "an", "intermediate", "result", "partition", "producer", ".", "<p", ">", "Backwards", "task", "events", "flow", "between", "readers", "and", "writers", "and", "therefore", "will", "only", "work", "when", "both"...
b62db93bf63cb3bb34dd03d611a779d9e3fc61ac
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/io/network/netty/PartitionRequestClient.java#L154-L171
train
Sends a task event to the remote server.
[ 30522, 2270, 11675, 4604, 10230, 3489, 15338, 1006, 2765, 19362, 3775, 3508, 3593, 13571, 3593, 1010, 4708, 18697, 3372, 2724, 1010, 2345, 6556, 2378, 18780, 26058, 7953, 26058, 1007, 11618, 22834, 10288, 24422, 1063, 4638, 17048, 20464, 2476...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
spring-projects/spring-boot
spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/embedded/tomcat/TomcatServletWebServerFactory.java
TomcatServletWebServerFactory.addAdditionalTomcatConnectors
public void addAdditionalTomcatConnectors(Connector... connectors) { Assert.notNull(connectors, "Connectors must not be null"); this.additionalTomcatConnectors.addAll(Arrays.asList(connectors)); }
java
public void addAdditionalTomcatConnectors(Connector... connectors) { Assert.notNull(connectors, "Connectors must not be null"); this.additionalTomcatConnectors.addAll(Arrays.asList(connectors)); }
[ "public", "void", "addAdditionalTomcatConnectors", "(", "Connector", "...", "connectors", ")", "{", "Assert", ".", "notNull", "(", "connectors", ",", "\"Connectors must not be null\"", ")", ";", "this", ".", "additionalTomcatConnectors", ".", "addAll", "(", "Arrays", ...
Add {@link Connector}s in addition to the default connector, e.g. for SSL or AJP @param connectors the connectors to add
[ "Add", "{" ]
0b27f7c70e164b2b1a96477f1d9c1acba56790c1
https://github.com/spring-projects/spring-boot/blob/0b27f7c70e164b2b1a96477f1d9c1acba56790c1/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/embedded/tomcat/TomcatServletWebServerFactory.java#L678-L681
train
Add additional tomcat connectors to the list of connectors to be used for the connection to the server.
[ 30522, 2270, 11675, 5587, 4215, 27064, 20389, 11266, 8663, 2638, 24817, 1006, 19400, 1012, 1012, 1012, 19400, 2015, 1007, 1063, 20865, 1012, 2025, 11231, 3363, 1006, 19400, 2015, 1010, 1000, 19400, 2015, 2442, 2025, 2022, 19701, 1000, 1007, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
apache/incubator-shardingsphere
sharding-proxy/sharding-proxy-backend/src/main/java/org/apache/shardingsphere/shardingproxy/backend/schema/LogicSchemas.java
LogicSchemas.init
public void init(final Map<String, Map<String, YamlDataSourceParameter>> schemaDataSources, final Map<String, RuleConfiguration> schemaRules) { init(schemaRules.keySet(), schemaDataSources, schemaRules, false); }
java
public void init(final Map<String, Map<String, YamlDataSourceParameter>> schemaDataSources, final Map<String, RuleConfiguration> schemaRules) { init(schemaRules.keySet(), schemaDataSources, schemaRules, false); }
[ "public", "void", "init", "(", "final", "Map", "<", "String", ",", "Map", "<", "String", ",", "YamlDataSourceParameter", ">", ">", "schemaDataSources", ",", "final", "Map", "<", "String", ",", "RuleConfiguration", ">", "schemaRules", ")", "{", "init", "(", ...
Initialize proxy context. @param schemaDataSources data source map @param schemaRules schema rule map
[ "Initialize", "proxy", "context", "." ]
f88fd29fc345dfb31fdce12e9e96cbfa0fd2402d
https://github.com/apache/incubator-shardingsphere/blob/f88fd29fc345dfb31fdce12e9e96cbfa0fd2402d/sharding-proxy/sharding-proxy-backend/src/main/java/org/apache/shardingsphere/shardingproxy/backend/schema/LogicSchemas.java#L78-L80
train
Initialize the class.
[ 30522, 2270, 11675, 1999, 4183, 1006, 2345, 4949, 1026, 5164, 1010, 4949, 1026, 5164, 1010, 8038, 19968, 2850, 10230, 8162, 3401, 28689, 22828, 1028, 1028, 8040, 28433, 2850, 10230, 8162, 9623, 1010, 2345, 4949, 1026, 5164, 1010, 3627, 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...
looly/hutool
hutool-core/src/main/java/cn/hutool/core/util/HashUtil.java
HashUtil.jsHash
public static int jsHash(String str) { int hash = 1315423911; for (int i = 0; i < str.length(); i++) { hash ^= ((hash << 5) + str.charAt(i) + (hash >> 2)); } return hash & 0x7FFFFFFF; }
java
public static int jsHash(String str) { int hash = 1315423911; for (int i = 0; i < str.length(); i++) { hash ^= ((hash << 5) + str.charAt(i) + (hash >> 2)); } return hash & 0x7FFFFFFF; }
[ "public", "static", "int", "jsHash", "(", "String", "str", ")", "{", "int", "hash", "=", "1315423911", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "str", ".", "length", "(", ")", ";", "i", "++", ")", "{", "hash", "^=", "(", "(", "ha...
JS算法 @param str 字符串 @return hash值
[ "JS算法" ]
bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a
https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/util/HashUtil.java#L219-L227
train
Returns a hash code for a given string.
[ 30522, 2270, 10763, 20014, 1046, 7377, 4095, 1006, 5164, 2358, 2099, 1007, 1063, 30524, 1009, 1009, 1007, 1063, 23325, 1034, 1027, 1006, 1006, 23325, 1026, 1026, 1019, 1007, 1009, 2358, 2099, 1012, 25869, 4017, 1006, 1045, 1007, 1009, 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-connectors/flink-connector-kafka-0.10/src/main/java/org/apache/flink/streaming/connectors/kafka/FlinkKafkaProducer010.java
FlinkKafkaProducer010.writeToKafkaWithTimestamps
@Deprecated public static <T> FlinkKafkaProducer010Configuration<T> writeToKafkaWithTimestamps(DataStream<T> inStream, String topicId, KeyedSerializationSchema<T> serializationSchema, Properties producerConfig) { return writeToKafkaWithTimestamps(inStream, topicId, serializationSchema, producerConfig, new FlinkFixedPartitioner<T>()); }
java
@Deprecated public static <T> FlinkKafkaProducer010Configuration<T> writeToKafkaWithTimestamps(DataStream<T> inStream, String topicId, KeyedSerializationSchema<T> serializationSchema, Properties producerConfig) { return writeToKafkaWithTimestamps(inStream, topicId, serializationSchema, producerConfig, new FlinkFixedPartitioner<T>()); }
[ "@", "Deprecated", "public", "static", "<", "T", ">", "FlinkKafkaProducer010Configuration", "<", "T", ">", "writeToKafkaWithTimestamps", "(", "DataStream", "<", "T", ">", "inStream", ",", "String", "topicId", ",", "KeyedSerializationSchema", "<", "T", ">", "serial...
Creates a FlinkKafkaProducer for a given topic. The sink produces a DataStream to the topic. <p>This constructor allows writing timestamps to Kafka, it follow approach (b) (see above) @param inStream The stream to write to Kafka @param topicId ID of the Kafka topic. @param serializationSchema User defined serialization schema supporting key/value messages @param producerConfig Properties with the producer configuration. @deprecated Use {@link #FlinkKafkaProducer010(String, KeyedSerializationSchema, Properties)} and call {@link #setWriteTimestampToKafka(boolean)}.
[ "Creates", "a", "FlinkKafkaProducer", "for", "a", "given", "topic", ".", "The", "sink", "produces", "a", "DataStream", "to", "the", "topic", "." ]
b62db93bf63cb3bb34dd03d611a779d9e3fc61ac
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-connectors/flink-connector-kafka-0.10/src/main/java/org/apache/flink/streaming/connectors/kafka/FlinkKafkaProducer010.java#L228-L234
train
Write to Kafka with timestamps
[ 30522, 1030, 2139, 28139, 12921, 2270, 10763, 1026, 1056, 1028, 13109, 19839, 2912, 24316, 9331, 14127, 18796, 2099, 24096, 2692, 8663, 8873, 27390, 3370, 1026, 1056, 1028, 4339, 18715, 10354, 2912, 24415, 7292, 9153, 25370, 1006, 2951, 21422...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -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/cell/CellUtil.java
CellUtil.getCellValue
public static Object getCellValue(Cell cell, boolean isTrimCellValue) { if (null == cell) { return null; } return getCellValue(cell, cell.getCellTypeEnum(), isTrimCellValue); }
java
public static Object getCellValue(Cell cell, boolean isTrimCellValue) { if (null == cell) { return null; } return getCellValue(cell, cell.getCellTypeEnum(), isTrimCellValue); }
[ "public", "static", "Object", "getCellValue", "(", "Cell", "cell", ",", "boolean", "isTrimCellValue", ")", "{", "if", "(", "null", "==", "cell", ")", "{", "return", "null", ";", "}", "return", "getCellValue", "(", "cell", ",", "cell", ".", "getCellTypeEnum...
获取单元格值 @param cell {@link Cell}单元格 @param isTrimCellValue 如果单元格类型为字符串,是否去掉两边空白符 @return 值,类型可能为:Date、Double、Boolean、String
[ "获取单元格值" ]
bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a
https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-poi/src/main/java/cn/hutool/poi/excel/cell/CellUtil.java#L36-L41
train
Gets the value of a cell.
[ 30522, 2270, 10763, 4874, 2131, 29109, 22144, 7630, 2063, 1006, 3526, 3526, 1010, 22017, 20898, 21541, 20026, 29109, 22144, 7630, 2063, 1007, 1063, 2065, 1006, 19701, 1027, 1027, 3526, 1007, 1063, 2709, 19701, 1025, 1065, 2709, 2131, 29109, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -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/resourcemanager/ResourceManager.java
ResourceManager.registerTaskExecutorInternal
private RegistrationResponse registerTaskExecutorInternal( TaskExecutorGateway taskExecutorGateway, String taskExecutorAddress, ResourceID taskExecutorResourceId, int dataPort, HardwareDescription hardwareDescription) { WorkerRegistration<WorkerType> oldRegistration = taskExecutors.remove(taskExecutorResourceId); if (oldRegistration != null) { // TODO :: suggest old taskExecutor to stop itself log.debug("Replacing old registration of TaskExecutor {}.", taskExecutorResourceId); // remove old task manager registration from slot manager slotManager.unregisterTaskManager(oldRegistration.getInstanceID()); } final WorkerType newWorker = workerStarted(taskExecutorResourceId); if (newWorker == null) { log.warn("Discard registration from TaskExecutor {} at ({}) because the framework did " + "not recognize it", taskExecutorResourceId, taskExecutorAddress); return new RegistrationResponse.Decline("unrecognized TaskExecutor"); } else { WorkerRegistration<WorkerType> registration = new WorkerRegistration<>(taskExecutorGateway, newWorker, dataPort, hardwareDescription); log.info("Registering TaskManager with ResourceID {} ({}) at ResourceManager", taskExecutorResourceId, taskExecutorAddress); taskExecutors.put(taskExecutorResourceId, registration); taskManagerHeartbeatManager.monitorTarget(taskExecutorResourceId, new HeartbeatTarget<Void>() { @Override public void receiveHeartbeat(ResourceID resourceID, Void payload) { // the ResourceManager will always send heartbeat requests to the // TaskManager } @Override public void requestHeartbeat(ResourceID resourceID, Void payload) { taskExecutorGateway.heartbeatFromResourceManager(resourceID); } }); return new TaskExecutorRegistrationSuccess( registration.getInstanceID(), resourceId, clusterInformation); } }
java
private RegistrationResponse registerTaskExecutorInternal( TaskExecutorGateway taskExecutorGateway, String taskExecutorAddress, ResourceID taskExecutorResourceId, int dataPort, HardwareDescription hardwareDescription) { WorkerRegistration<WorkerType> oldRegistration = taskExecutors.remove(taskExecutorResourceId); if (oldRegistration != null) { // TODO :: suggest old taskExecutor to stop itself log.debug("Replacing old registration of TaskExecutor {}.", taskExecutorResourceId); // remove old task manager registration from slot manager slotManager.unregisterTaskManager(oldRegistration.getInstanceID()); } final WorkerType newWorker = workerStarted(taskExecutorResourceId); if (newWorker == null) { log.warn("Discard registration from TaskExecutor {} at ({}) because the framework did " + "not recognize it", taskExecutorResourceId, taskExecutorAddress); return new RegistrationResponse.Decline("unrecognized TaskExecutor"); } else { WorkerRegistration<WorkerType> registration = new WorkerRegistration<>(taskExecutorGateway, newWorker, dataPort, hardwareDescription); log.info("Registering TaskManager with ResourceID {} ({}) at ResourceManager", taskExecutorResourceId, taskExecutorAddress); taskExecutors.put(taskExecutorResourceId, registration); taskManagerHeartbeatManager.monitorTarget(taskExecutorResourceId, new HeartbeatTarget<Void>() { @Override public void receiveHeartbeat(ResourceID resourceID, Void payload) { // the ResourceManager will always send heartbeat requests to the // TaskManager } @Override public void requestHeartbeat(ResourceID resourceID, Void payload) { taskExecutorGateway.heartbeatFromResourceManager(resourceID); } }); return new TaskExecutorRegistrationSuccess( registration.getInstanceID(), resourceId, clusterInformation); } }
[ "private", "RegistrationResponse", "registerTaskExecutorInternal", "(", "TaskExecutorGateway", "taskExecutorGateway", ",", "String", "taskExecutorAddress", ",", "ResourceID", "taskExecutorResourceId", ",", "int", "dataPort", ",", "HardwareDescription", "hardwareDescription", ")",...
Registers a new TaskExecutor. @param taskExecutorGateway to communicate with the registering TaskExecutor @param taskExecutorAddress address of the TaskExecutor @param taskExecutorResourceId ResourceID of the TaskExecutor @param dataPort port used for data transfer @param hardwareDescription of the registering TaskExecutor @return RegistrationResponse
[ "Registers", "a", "new", "TaskExecutor", "." ]
b62db93bf63cb3bb34dd03d611a779d9e3fc61ac
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/resourcemanager/ResourceManager.java#L683-L729
train
Register the TaskExecutor with the TaskManager.
[ 30522, 2797, 8819, 6072, 26029, 3366, 4236, 10230, 3489, 2595, 8586, 16161, 6657, 16451, 2389, 1006, 4708, 10288, 8586, 16161, 28921, 2618, 4576, 4708, 10288, 8586, 16161, 28921, 2618, 4576, 1010, 5164, 30524, 2890, 24063, 8156, 1026, 7309, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -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.decodeName
public static String decodeName(ByteBuf in) { int position = -1; int checked = 0; final int end = in.writerIndex(); final int readable = in.readableBytes(); // Looking at the spec we should always have at least enough readable bytes to read a byte here but it seems // some servers do not respect this for empty names. So just workaround this and return an empty name in this // case. // // See: // - https://github.com/netty/netty/issues/5014 // - https://www.ietf.org/rfc/rfc1035.txt , Section 3.1 if (readable == 0) { return ROOT; } final StringBuilder name = new StringBuilder(readable << 1); while (in.isReadable()) { final int len = in.readUnsignedByte(); final boolean pointer = (len & 0xc0) == 0xc0; if (pointer) { if (position == -1) { position = in.readerIndex() + 1; } if (!in.isReadable()) { throw new CorruptedFrameException("truncated pointer in a name"); } final int next = (len & 0x3f) << 8 | in.readUnsignedByte(); if (next >= end) { throw new CorruptedFrameException("name has an out-of-range pointer"); } in.readerIndex(next); // check for loops checked += 2; if (checked >= end) { throw new CorruptedFrameException("name contains a loop."); } } else if (len != 0) { if (!in.isReadable(len)) { throw new CorruptedFrameException("truncated label in a name"); } name.append(in.toString(in.readerIndex(), len, CharsetUtil.UTF_8)).append('.'); in.skipBytes(len); } else { // len == 0 break; } } if (position != -1) { in.readerIndex(position); } if (name.length() == 0) { return ROOT; } if (name.charAt(name.length() - 1) != '.') { name.append('.'); } return name.toString(); }
java
public static String decodeName(ByteBuf in) { int position = -1; int checked = 0; final int end = in.writerIndex(); final int readable = in.readableBytes(); // Looking at the spec we should always have at least enough readable bytes to read a byte here but it seems // some servers do not respect this for empty names. So just workaround this and return an empty name in this // case. // // See: // - https://github.com/netty/netty/issues/5014 // - https://www.ietf.org/rfc/rfc1035.txt , Section 3.1 if (readable == 0) { return ROOT; } final StringBuilder name = new StringBuilder(readable << 1); while (in.isReadable()) { final int len = in.readUnsignedByte(); final boolean pointer = (len & 0xc0) == 0xc0; if (pointer) { if (position == -1) { position = in.readerIndex() + 1; } if (!in.isReadable()) { throw new CorruptedFrameException("truncated pointer in a name"); } final int next = (len & 0x3f) << 8 | in.readUnsignedByte(); if (next >= end) { throw new CorruptedFrameException("name has an out-of-range pointer"); } in.readerIndex(next); // check for loops checked += 2; if (checked >= end) { throw new CorruptedFrameException("name contains a loop."); } } else if (len != 0) { if (!in.isReadable(len)) { throw new CorruptedFrameException("truncated label in a name"); } name.append(in.toString(in.readerIndex(), len, CharsetUtil.UTF_8)).append('.'); in.skipBytes(len); } else { // len == 0 break; } } if (position != -1) { in.readerIndex(position); } if (name.length() == 0) { return ROOT; } if (name.charAt(name.length() - 1) != '.') { name.append('.'); } return name.toString(); }
[ "public", "static", "String", "decodeName", "(", "ByteBuf", "in", ")", "{", "int", "position", "=", "-", "1", ";", "int", "checked", "=", "0", ";", "final", "int", "end", "=", "in", ".", "writerIndex", "(", ")", ";", "final", "int", "readable", "=", ...
Retrieves a domain name given a buffer containing a DNS packet. If the name contains a pointer, the position of the buffer will be set to directly after the pointer's index after the name has been read. @param in the byte buffer containing the DNS packet @return the domain name for an entry
[ "Retrieves", "a", "domain", "name", "given", "a", "buffer", "containing", "a", "DNS", "packet", ".", "If", "the", "name", "contains", "a", "pointer", "the", "position", "of", "the", "buffer", "will", "be", "set", "to", "directly", "after", "the", "pointer"...
ba06eafa1c1824bd154f1a380019e7ea2edf3c4c
https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/codec-dns/src/main/java/io/netty/handler/codec/dns/DefaultDnsRecordDecoder.java#L125-L190
train
Decodes a name from a byte buffer.
[ 30522, 2270, 10763, 5164, 21933, 4181, 14074, 1006, 24880, 8569, 2546, 1999, 1007, 1063, 20014, 2597, 1027, 1011, 1015, 1025, 20014, 7039, 1027, 1014, 1025, 2345, 20014, 2203, 1027, 1999, 1012, 3213, 22254, 10288, 1006, 1007, 1025, 2345, 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...
spring-projects/spring-boot
spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/main/java/org/springframework/boot/maven/AbstractRunMojo.java
AbstractRunMojo.logDisabledFork
protected void logDisabledFork() { if (getLog().isWarnEnabled()) { if (hasAgent()) { getLog().warn("Fork mode disabled, ignoring agent"); } if (hasJvmArgs()) { RunArguments runArguments = resolveJvmArguments(); getLog().warn("Fork mode disabled, ignoring JVM argument(s) [" + Arrays .stream(runArguments.asArray()).collect(Collectors.joining(" ")) + "]"); } if (hasWorkingDirectorySet()) { getLog().warn( "Fork mode disabled, ignoring working directory configuration"); } } }
java
protected void logDisabledFork() { if (getLog().isWarnEnabled()) { if (hasAgent()) { getLog().warn("Fork mode disabled, ignoring agent"); } if (hasJvmArgs()) { RunArguments runArguments = resolveJvmArguments(); getLog().warn("Fork mode disabled, ignoring JVM argument(s) [" + Arrays .stream(runArguments.asArray()).collect(Collectors.joining(" ")) + "]"); } if (hasWorkingDirectorySet()) { getLog().warn( "Fork mode disabled, ignoring working directory configuration"); } } }
[ "protected", "void", "logDisabledFork", "(", ")", "{", "if", "(", "getLog", "(", ")", ".", "isWarnEnabled", "(", ")", ")", "{", "if", "(", "hasAgent", "(", ")", ")", "{", "getLog", "(", ")", ".", "warn", "(", "\"Fork mode disabled, ignoring agent\"", ")"...
Log a warning indicating that fork mode has been explicitly disabled while some conditions are present that require to enable it. @see #enableForkByDefault()
[ "Log", "a", "warning", "indicating", "that", "fork", "mode", "has", "been", "explicitly", "disabled", "while", "some", "conditions", "are", "present", "that", "require", "to", "enable", "it", "." ]
0b27f7c70e164b2b1a96477f1d9c1acba56790c1
https://github.com/spring-projects/spring-boot/blob/0b27f7c70e164b2b1a96477f1d9c1acba56790c1/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/main/java/org/springframework/boot/maven/AbstractRunMojo.java#L269-L285
train
Logs a warning message if the fork mode is disabled.
[ 30522, 5123, 11675, 8833, 10521, 3085, 20952, 2953, 2243, 1006, 1007, 1063, 2065, 1006, 2131, 21197, 1006, 1007, 1012, 2003, 9028, 10224, 3085, 2094, 1006, 1007, 1007, 1063, 2065, 1006, 2038, 4270, 3372, 1006, 1007, 1007, 1063, 2131, 21197,...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
apache/flink
flink-connectors/flink-hadoop-compatibility/src/main/java/org/apache/flink/api/java/hadoop/common/HadoopInputFormatCommonBase.java
HadoopInputFormatCommonBase.getCredentialsFromUGI
public static Credentials getCredentialsFromUGI(UserGroupInformation ugi) { Method getCredentialsMethod = null; for (Method m : ugi.getClass().getMethods()) { if (m.getName().equals("getCredentials")) { getCredentialsMethod = m; break; } } if (getCredentialsMethod == null) { return null; } else { try { return (Credentials) getCredentialsMethod.invoke(ugi); } catch (InvocationTargetException | IllegalAccessException e) { throw new RuntimeException("Unable to get credentials from UserGroupInformation. This is only supported by Hadoop 2.2.0+"); } } }
java
public static Credentials getCredentialsFromUGI(UserGroupInformation ugi) { Method getCredentialsMethod = null; for (Method m : ugi.getClass().getMethods()) { if (m.getName().equals("getCredentials")) { getCredentialsMethod = m; break; } } if (getCredentialsMethod == null) { return null; } else { try { return (Credentials) getCredentialsMethod.invoke(ugi); } catch (InvocationTargetException | IllegalAccessException e) { throw new RuntimeException("Unable to get credentials from UserGroupInformation. This is only supported by Hadoop 2.2.0+"); } } }
[ "public", "static", "Credentials", "getCredentialsFromUGI", "(", "UserGroupInformation", "ugi", ")", "{", "Method", "getCredentialsMethod", "=", "null", ";", "for", "(", "Method", "m", ":", "ugi", ".", "getClass", "(", ")", ".", "getMethods", "(", ")", ")", ...
This method only exists because there is no UserGroupInformation.getCredentials() method in Hadoop 1.x <p>Note that this method returns "null" in Hadoop 1.x environments. @param ugi The user information @return new credentials object from the user information. MAY RETURN NULL!
[ "This", "method", "only", "exists", "because", "there", "is", "no", "UserGroupInformation", ".", "getCredentials", "()", "method", "in", "Hadoop", "1", ".", "x" ]
b62db93bf63cb3bb34dd03d611a779d9e3fc61ac
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-connectors/flink-hadoop-compatibility/src/main/java/org/apache/flink/api/java/hadoop/common/HadoopInputFormatCommonBase.java#L63-L80
train
Get the credentials from the UserGroupInformation object.
[ 30522, 2270, 10763, 22496, 2131, 16748, 16454, 26340, 19699, 5358, 15916, 2072, 1006, 5310, 17058, 2378, 14192, 3370, 1057, 5856, 1007, 1063, 4118, 2131, 16748, 16454, 26340, 11368, 6806, 2094, 1027, 19701, 1025, 2005, 1006, 4118, 1049, 1024,...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -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/GroupedSet.java
GroupedSet.contains
public boolean contains(String group, String value, String... otherValues) { if (ArrayUtil.isNotEmpty(otherValues)) { // 需要测试多个值的情况 final List<String> valueList = Arrays.asList(otherValues); valueList.add(value); return contains(group, valueList); } else { // 测试单个值 final LinkedHashSet<String> valueSet = getValues(group); if (CollectionUtil.isEmpty(valueSet)) { return false; } return valueSet.contains(value); } }
java
public boolean contains(String group, String value, String... otherValues) { if (ArrayUtil.isNotEmpty(otherValues)) { // 需要测试多个值的情况 final List<String> valueList = Arrays.asList(otherValues); valueList.add(value); return contains(group, valueList); } else { // 测试单个值 final LinkedHashSet<String> valueSet = getValues(group); if (CollectionUtil.isEmpty(valueSet)) { return false; } return valueSet.contains(value); } }
[ "public", "boolean", "contains", "(", "String", "group", ",", "String", "value", ",", "String", "...", "otherValues", ")", "{", "if", "(", "ArrayUtil", ".", "isNotEmpty", "(", "otherValues", ")", ")", "{", "// 需要测试多个值的情况\r", "final", "List", "<", "String", ...
是否在给定分组的集合中包含指定值<br> 如果给定分组对应集合不存在,则返回false @param group 分组名 @param value 测试的值 @param otherValues 其他值 @return 是否包含
[ "是否在给定分组的集合中包含指定值<br", ">", "如果给定分组对应集合不存在,则返回false" ]
bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a
https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-setting/src/main/java/cn/hutool/setting/GroupedSet.java#L282-L297
train
Checks if the specified group contains the specified value.
[ 30522, 2270, 22017, 20898, 3397, 1006, 5164, 2177, 1010, 5164, 3643, 1010, 5164, 1012, 1012, 1012, 2060, 10175, 15808, 1007, 1063, 2065, 1006, 9140, 21823, 2140, 1012, 3475, 12184, 27718, 2100, 1006, 2060, 10175, 15808, 1007, 1007, 30524, 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...
netty/netty
buffer/src/main/java/io/netty/buffer/PoolThreadCache.java
PoolThreadCache.allocateNormal
boolean allocateNormal(PoolArena<?> area, PooledByteBuf<?> buf, int reqCapacity, int normCapacity) { return allocate(cacheForNormal(area, normCapacity), buf, reqCapacity); }
java
boolean allocateNormal(PoolArena<?> area, PooledByteBuf<?> buf, int reqCapacity, int normCapacity) { return allocate(cacheForNormal(area, normCapacity), buf, reqCapacity); }
[ "boolean", "allocateNormal", "(", "PoolArena", "<", "?", ">", "area", ",", "PooledByteBuf", "<", "?", ">", "buf", ",", "int", "reqCapacity", ",", "int", "normCapacity", ")", "{", "return", "allocate", "(", "cacheForNormal", "(", "area", ",", "normCapacity", ...
Try to allocate a small buffer out of the cache. Returns {@code true} if successful {@code false} otherwise
[ "Try", "to", "allocate", "a", "small", "buffer", "out", "of", "the", "cache", ".", "Returns", "{" ]
ba06eafa1c1824bd154f1a380019e7ea2edf3c4c
https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/buffer/src/main/java/io/netty/buffer/PoolThreadCache.java#L179-L181
train
Allocate a normal pool.
[ 30522, 22017, 20898, 2035, 24755, 6528, 2953, 9067, 1006, 4770, 12069, 2532, 1026, 1029, 1028, 2181, 1010, 19107, 18939, 17250, 8569, 2546, 1026, 1029, 1028, 20934, 2546, 1010, 20014, 2128, 4160, 17695, 6305, 3012, 1010, 20014, 13373, 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...
looly/hutool
hutool-core/src/main/java/cn/hutool/core/util/ReflectUtil.java
ReflectUtil.getPublicMethods
public static List<Method> getPublicMethods(Class<?> clazz, Method... excludeMethods) { final HashSet<Method> excludeMethodSet = CollectionUtil.newHashSet(excludeMethods); return getPublicMethods(clazz, new Filter<Method>() { @Override public boolean accept(Method method) { return false == excludeMethodSet.contains(method); } }); }
java
public static List<Method> getPublicMethods(Class<?> clazz, Method... excludeMethods) { final HashSet<Method> excludeMethodSet = CollectionUtil.newHashSet(excludeMethods); return getPublicMethods(clazz, new Filter<Method>() { @Override public boolean accept(Method method) { return false == excludeMethodSet.contains(method); } }); }
[ "public", "static", "List", "<", "Method", ">", "getPublicMethods", "(", "Class", "<", "?", ">", "clazz", ",", "Method", "...", "excludeMethods", ")", "{", "final", "HashSet", "<", "Method", ">", "excludeMethodSet", "=", "CollectionUtil", ".", "newHashSet", ...
获得指定类过滤后的Public方法列表 @param clazz 查找方法的类 @param excludeMethods 不包括的方法 @return 过滤后的方法列表
[ "获得指定类过滤后的Public方法列表" ]
bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a
https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/util/ReflectUtil.java#L336-L344
train
Returns a list of public methods of the given class including those that are not included in the excludeMethods parameter.
[ 30522, 2270, 10763, 2862, 1026, 4118, 1028, 2131, 14289, 16558, 2594, 11368, 6806, 5104, 1006, 2465, 1026, 1029, 1028, 18856, 10936, 2480, 1010, 4118, 1012, 1012, 1012, 23329, 11368, 6806, 5104, 1007, 1063, 2345, 23325, 13462, 1026, 4118, 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/support/ui/FluentWait.java
FluentWait.ignoreAll
public <K extends Throwable> FluentWait<T> ignoreAll(Collection<Class<? extends K>> types) { ignoredExceptions.addAll(types); return this; }
java
public <K extends Throwable> FluentWait<T> ignoreAll(Collection<Class<? extends K>> types) { ignoredExceptions.addAll(types); return this; }
[ "public", "<", "K", "extends", "Throwable", ">", "FluentWait", "<", "T", ">", "ignoreAll", "(", "Collection", "<", "Class", "<", "?", "extends", "K", ">", ">", "types", ")", "{", "ignoredExceptions", ".", "addAll", "(", "types", ")", ";", "return", "th...
Configures this instance to ignore specific types of exceptions while waiting for a condition. Any exceptions not whitelisted will be allowed to propagate, terminating the wait. @param types The types of exceptions to ignore. @param <K> an Exception that extends Throwable @return A self reference.
[ "Configures", "this", "instance", "to", "ignore", "specific", "types", "of", "exceptions", "while", "waiting", "for", "a", "condition", ".", "Any", "exceptions", "not", "whitelisted", "will", "be", "allowed", "to", "propagate", "terminating", "the", "wait", "." ...
7af172729f17b20269c8ca4ea6f788db48616535
https://github.com/SeleniumHQ/selenium/blob/7af172729f17b20269c8ca4ea6f788db48616535/java/client/src/org/openqa/selenium/support/ui/FluentWait.java#L162-L165
train
Ignore all exceptions in the given collection.
[ 30522, 2270, 1026, 1047, 8908, 5466, 3085, 1028, 19376, 21547, 2102, 1026, 1056, 1028, 8568, 8095, 1006, 3074, 1026, 2465, 1026, 1029, 8908, 1047, 1028, 1028, 4127, 1007, 1063, 6439, 10288, 24422, 2015, 1012, 5587, 8095, 1006, 4127, 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/incubator-shardingsphere
sharding-orchestration/sharding-orchestration-core/src/main/java/org/apache/shardingsphere/orchestration/internal/registry/state/schema/OrchestrationShardingSchemaGroup.java
OrchestrationShardingSchemaGroup.getDataSourceNames
public Collection<String> getDataSourceNames(final String shardingSchemaName) { return schemaGroup.containsKey(shardingSchemaName) ? schemaGroup.get(shardingSchemaName) : Collections.<String>emptyList(); }
java
public Collection<String> getDataSourceNames(final String shardingSchemaName) { return schemaGroup.containsKey(shardingSchemaName) ? schemaGroup.get(shardingSchemaName) : Collections.<String>emptyList(); }
[ "public", "Collection", "<", "String", ">", "getDataSourceNames", "(", "final", "String", "shardingSchemaName", ")", "{", "return", "schemaGroup", ".", "containsKey", "(", "shardingSchemaName", ")", "?", "schemaGroup", ".", "get", "(", "shardingSchemaName", ")", "...
Get data source names. @param shardingSchemaName sharding schema name @return data source names
[ "Get", "data", "source", "names", "." ]
f88fd29fc345dfb31fdce12e9e96cbfa0fd2402d
https://github.com/apache/incubator-shardingsphere/blob/f88fd29fc345dfb31fdce12e9e96cbfa0fd2402d/sharding-orchestration/sharding-orchestration-core/src/main/java/org/apache/shardingsphere/orchestration/internal/registry/state/schema/OrchestrationShardingSchemaGroup.java#L64-L66
train
Get DataSource names.
[ 30522, 2270, 3074, 1026, 5164, 1028, 2131, 2850, 10230, 8162, 27524, 14074, 2015, 1006, 2345, 5164, 21146, 17080, 3070, 22842, 24805, 4168, 1007, 1063, 2709, 8040, 28433, 17058, 1012, 3397, 14839, 1006, 21146, 17080, 3070, 22842, 24805, 4168,...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -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/WindowedStream.java
WindowedStream.aggregate
@PublicEvolving public <ACC, R> SingleOutputStreamOperator<R> aggregate( AggregateFunction<T, ACC, R> function, TypeInformation<ACC> accumulatorType, TypeInformation<R> resultType) { checkNotNull(function, "function"); checkNotNull(accumulatorType, "accumulatorType"); checkNotNull(resultType, "resultType"); if (function instanceof RichFunction) { throw new UnsupportedOperationException("This aggregation function cannot be a RichFunction."); } return aggregate(function, new PassThroughWindowFunction<K, W, R>(), accumulatorType, resultType); }
java
@PublicEvolving public <ACC, R> SingleOutputStreamOperator<R> aggregate( AggregateFunction<T, ACC, R> function, TypeInformation<ACC> accumulatorType, TypeInformation<R> resultType) { checkNotNull(function, "function"); checkNotNull(accumulatorType, "accumulatorType"); checkNotNull(resultType, "resultType"); if (function instanceof RichFunction) { throw new UnsupportedOperationException("This aggregation function cannot be a RichFunction."); } return aggregate(function, new PassThroughWindowFunction<K, W, R>(), accumulatorType, resultType); }
[ "@", "PublicEvolving", "public", "<", "ACC", ",", "R", ">", "SingleOutputStreamOperator", "<", "R", ">", "aggregate", "(", "AggregateFunction", "<", "T", ",", "ACC", ",", "R", ">", "function", ",", "TypeInformation", "<", "ACC", ">", "accumulatorType", ",", ...
Applies the given aggregation function to each window. The aggregation function is called for each element, aggregating values incrementally and keeping the state to one accumulator per key and window. @param function The aggregation function. @return The data stream that is the result of applying the aggregation function to the window. @param <ACC> The type of the AggregateFunction's accumulator @param <R> The type of the elements in the resulting stream, equal to the AggregateFunction's result type
[ "Applies", "the", "given", "aggregation", "function", "to", "each", "window", ".", "The", "aggregation", "function", "is", "called", "for", "each", "element", "aggregating", "values", "incrementally", "and", "keeping", "the", "state", "to", "one", "accumulator", ...
b62db93bf63cb3bb34dd03d611a779d9e3fc61ac
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-streaming-java/src/main/java/org/apache/flink/streaming/api/datastream/WindowedStream.java#L716-L732
train
Returns a new stream aggregation function that performs a pass through window aggregation.
[ 30522, 1030, 2270, 6777, 4747, 6455, 2270, 1026, 16222, 1010, 1054, 1028, 2309, 5833, 18780, 21422, 25918, 8844, 1026, 1054, 1028, 9572, 1006, 9572, 11263, 27989, 1026, 1056, 1010, 16222, 1010, 1054, 1028, 3853, 1010, 2828, 2378, 14192, 337...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -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/utils/RequiredParameters.java
RequiredParameters.getHelp
public String getHelp() { StringBuilder sb = new StringBuilder(data.size() * HELP_TEXT_LENGTH_PER_PARAM); sb.append("Required Parameters:"); sb.append(HELP_TEXT_LINE_DELIMITER); for (Option o : data.values()) { sb.append(this.helpText(o)); } sb.append(HELP_TEXT_LINE_DELIMITER); return sb.toString(); }
java
public String getHelp() { StringBuilder sb = new StringBuilder(data.size() * HELP_TEXT_LENGTH_PER_PARAM); sb.append("Required Parameters:"); sb.append(HELP_TEXT_LINE_DELIMITER); for (Option o : data.values()) { sb.append(this.helpText(o)); } sb.append(HELP_TEXT_LINE_DELIMITER); return sb.toString(); }
[ "public", "String", "getHelp", "(", ")", "{", "StringBuilder", "sb", "=", "new", "StringBuilder", "(", "data", ".", "size", "(", ")", "*", "HELP_TEXT_LENGTH_PER_PARAM", ")", ";", "sb", ".", "append", "(", "\"Required Parameters:\"", ")", ";", "sb", ".", "a...
Build a help text for the defined parameters. <p>The format of the help text will be: Required Parameters: \t -:shortName:, --:name: \t :helpText: \t default: :defaultValue: \t choices: :choices: \n @return a formatted help String.
[ "Build", "a", "help", "text", "for", "the", "defined", "parameters", "." ]
b62db93bf63cb3bb34dd03d611a779d9e3fc61ac
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-java/src/main/java/org/apache/flink/api/java/utils/RequiredParameters.java#L182-L194
train
Returns a help text for this option.
[ 30522, 2270, 5164, 2131, 16001, 2361, 1006, 1007, 1063, 5164, 8569, 23891, 2099, 24829, 1027, 2047, 5164, 8569, 23891, 2099, 1006, 2951, 1012, 2946, 1006, 1007, 1008, 2393, 1035, 3793, 1035, 3091, 1035, 2566, 1035, 11498, 2213, 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...
netty/netty
buffer/src/main/java/io/netty/buffer/Unpooled.java
Unpooled.copyFloat
public static ByteBuf copyFloat(float... values) { if (values == null || values.length == 0) { return EMPTY_BUFFER; } ByteBuf buffer = buffer(values.length * 4); for (float v: values) { buffer.writeFloat(v); } return buffer; }
java
public static ByteBuf copyFloat(float... values) { if (values == null || values.length == 0) { return EMPTY_BUFFER; } ByteBuf buffer = buffer(values.length * 4); for (float v: values) { buffer.writeFloat(v); } return buffer; }
[ "public", "static", "ByteBuf", "copyFloat", "(", "float", "...", "values", ")", "{", "if", "(", "values", "==", "null", "||", "values", ".", "length", "==", "0", ")", "{", "return", "EMPTY_BUFFER", ";", "}", "ByteBuf", "buffer", "=", "buffer", "(", "va...
Create a new big-endian buffer that holds a sequence of the specified 32-bit floating point numbers.
[ "Create", "a", "new", "big", "-", "endian", "buffer", "that", "holds", "a", "sequence", "of", "the", "specified", "32", "-", "bit", "floating", "point", "numbers", "." ]
ba06eafa1c1824bd154f1a380019e7ea2edf3c4c
https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/buffer/src/main/java/io/netty/buffer/Unpooled.java#L814-L823
train
Create a new big - endian buffer that holds a sequence of the specified 32 - bit floating point values.
[ 30522, 2270, 10763, 24880, 8569, 2546, 6100, 10258, 16503, 1006, 14257, 1012, 1012, 1012, 5300, 1007, 1063, 2065, 1006, 5300, 1027, 1027, 19701, 1064, 1064, 5300, 1012, 3091, 1027, 1027, 1014, 1007, 1063, 2709, 4064, 1035, 17698, 1025, 1065...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
apache/flink
flink-table/flink-table-planner/src/main/java/org/apache/flink/table/descriptors/ConnectTableDescriptor.java
ConnectTableDescriptor.withSchema
@Override public D withSchema(Schema schema) { schemaDescriptor = Optional.of(Preconditions.checkNotNull(schema)); return (D) this; }
java
@Override public D withSchema(Schema schema) { schemaDescriptor = Optional.of(Preconditions.checkNotNull(schema)); return (D) this; }
[ "@", "Override", "public", "D", "withSchema", "(", "Schema", "schema", ")", "{", "schemaDescriptor", "=", "Optional", ".", "of", "(", "Preconditions", ".", "checkNotNull", "(", "schema", ")", ")", ";", "return", "(", "D", ")", "this", ";", "}" ]
Specifies the resulting table schema.
[ "Specifies", "the", "resulting", "table", "schema", "." ]
b62db93bf63cb3bb34dd03d611a779d9e3fc61ac
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-table/flink-table-planner/src/main/java/org/apache/flink/table/descriptors/ConnectTableDescriptor.java#L101-L105
train
Sets the schema descriptor.
[ 30522, 1030, 2058, 15637, 2270, 1040, 2007, 22842, 2863, 1006, 8040, 28433, 8040, 28433, 1007, 1063, 8040, 28433, 6155, 23235, 2953, 1027, 11887, 1012, 1997, 1006, 3653, 8663, 20562, 2015, 1012, 4638, 17048, 11231, 3363, 1006, 8040, 28433, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -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-python/src/main/java/org/apache/flink/python/api/util/SetCache.java
SetCache.getDataSet
@SuppressWarnings("unchecked") public <T> DataSet<T> getDataSet(int id) { return verifyType(id, dataSets.get(id), SetType.DATA_SET); }
java
@SuppressWarnings("unchecked") public <T> DataSet<T> getDataSet(int id) { return verifyType(id, dataSets.get(id), SetType.DATA_SET); }
[ "@", "SuppressWarnings", "(", "\"unchecked\"", ")", "public", "<", "T", ">", "DataSet", "<", "T", ">", "getDataSet", "(", "int", "id", ")", "{", "return", "verifyType", "(", "id", ",", "dataSets", ".", "get", "(", "id", ")", ",", "SetType", ".", "DAT...
Returns the cached {@link DataSet} for the given ID. @param id Set ID @param <T> DataSet type @return Cached DataSet @throws IllegalStateException if the cached set is not a DataSet
[ "Returns", "the", "cached", "{", "@link", "DataSet", "}", "for", "the", "given", "ID", "." ]
b62db93bf63cb3bb34dd03d611a779d9e3fc61ac
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-libraries/flink-python/src/main/java/org/apache/flink/python/api/util/SetCache.java#L156-L159
train
Gets the DataSet for the given id.
[ 30522, 1030, 16081, 9028, 5582, 2015, 1006, 1000, 4895, 5403, 18141, 1000, 1007, 2270, 1026, 1056, 1028, 2951, 13462, 1026, 1056, 1028, 2131, 2850, 18260, 2102, 1006, 20014, 8909, 1007, 1063, 2709, 20410, 13874, 1006, 8909, 1010, 2951, 1346...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -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/SslUtils.java
SslUtils.isValidHostNameForSNI
static boolean isValidHostNameForSNI(String hostname) { return hostname != null && hostname.indexOf('.') > 0 && !hostname.endsWith(".") && !NetUtil.isValidIpV4Address(hostname) && !NetUtil.isValidIpV6Address(hostname); }
java
static boolean isValidHostNameForSNI(String hostname) { return hostname != null && hostname.indexOf('.') > 0 && !hostname.endsWith(".") && !NetUtil.isValidIpV4Address(hostname) && !NetUtil.isValidIpV6Address(hostname); }
[ "static", "boolean", "isValidHostNameForSNI", "(", "String", "hostname", ")", "{", "return", "hostname", "!=", "null", "&&", "hostname", ".", "indexOf", "(", "'", "'", ")", ">", "0", "&&", "!", "hostname", ".", "endsWith", "(", "\".\"", ")", "&&", "!", ...
Validate that the given hostname can be used in SNI extension.
[ "Validate", "that", "the", "given", "hostname", "can", "be", "used", "in", "SNI", "extension", "." ]
ba06eafa1c1824bd154f1a380019e7ea2edf3c4c
https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/handler/src/main/java/io/netty/handler/ssl/SslUtils.java#L385-L391
train
Check if the hostname is a valid SNI hostname.
[ 30522, 10763, 22017, 20898, 2003, 10175, 3593, 15006, 2102, 18442, 29278, 2015, 3490, 1006, 5164, 3677, 18442, 1007, 1063, 2709, 3677, 18442, 999, 1027, 19701, 1004, 1004, 3677, 18442, 1012, 5950, 11253, 1006, 1005, 1012, 1005, 1007, 1028, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
looly/hutool
hutool-extra/src/main/java/cn/hutool/extra/mail/MailAccount.java
MailAccount.defaultIfEmpty
public MailAccount defaultIfEmpty() { // 去掉发件人的姓名部分 final String fromAddress = InternalMailUtil.parseFirstAddress(this.from, this.charset).getAddress(); if (StrUtil.isBlank(this.host)) { // 如果SMTP地址为空,默认使用smtp.<发件人邮箱后缀> this.host = StrUtil.format("smtp.{}", StrUtil.subSuf(fromAddress, fromAddress.indexOf('@') + 1)); } if (StrUtil.isBlank(user)) { // 如果用户名为空,默认为发件人邮箱前缀 this.user = StrUtil.subPre(fromAddress, fromAddress.indexOf('@')); } if (null == this.auth) { // 如果密码非空白,则使用认证模式 this.auth = (false == StrUtil.isBlank(this.pass)); } if (null == this.port) { // 端口在SSL状态下默认与socketFactoryPort一致,非SSL状态下默认为25 this.port = (null != this.sslEnable && this.sslEnable) ? this.socketFactoryPort : 25; } if (null == this.charset) { // 默认UTF-8编码 this.charset = CharsetUtil.CHARSET_UTF_8; } return this; }
java
public MailAccount defaultIfEmpty() { // 去掉发件人的姓名部分 final String fromAddress = InternalMailUtil.parseFirstAddress(this.from, this.charset).getAddress(); if (StrUtil.isBlank(this.host)) { // 如果SMTP地址为空,默认使用smtp.<发件人邮箱后缀> this.host = StrUtil.format("smtp.{}", StrUtil.subSuf(fromAddress, fromAddress.indexOf('@') + 1)); } if (StrUtil.isBlank(user)) { // 如果用户名为空,默认为发件人邮箱前缀 this.user = StrUtil.subPre(fromAddress, fromAddress.indexOf('@')); } if (null == this.auth) { // 如果密码非空白,则使用认证模式 this.auth = (false == StrUtil.isBlank(this.pass)); } if (null == this.port) { // 端口在SSL状态下默认与socketFactoryPort一致,非SSL状态下默认为25 this.port = (null != this.sslEnable && this.sslEnable) ? this.socketFactoryPort : 25; } if (null == this.charset) { // 默认UTF-8编码 this.charset = CharsetUtil.CHARSET_UTF_8; } return this; }
[ "public", "MailAccount", "defaultIfEmpty", "(", ")", "{", "// 去掉发件人的姓名部分\r", "final", "String", "fromAddress", "=", "InternalMailUtil", ".", "parseFirstAddress", "(", "this", ".", "from", ",", "this", ".", "charset", ")", ".", "getAddress", "(", ")", ";", "if"...
如果某些值为null,使用默认值 @return this
[ "如果某些值为null,使用默认值" ]
bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a
https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-extra/src/main/java/cn/hutool/extra/mail/MailAccount.java#L456-L482
train
Default implementation of .
[ 30522, 2270, 5653, 6305, 3597, 16671, 12398, 29323, 27718, 2100, 1006, 1007, 1063, 1013, 1013, 100, 100, 100, 100, 1756, 1916, 100, 1795, 1960, 1775, 2345, 5164, 2013, 4215, 16200, 4757, 1027, 4722, 21397, 21823, 2140, 1012, 11968, 20106, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
looly/hutool
hutool-extra/src/main/java/cn/hutool/extra/template/engine/velocity/VelocityUtil.java
VelocityUtil.parseSession
public static VelocityContext parseSession(VelocityContext context, javax.servlet.http.HttpSession session) { if (null != session) { final Enumeration<String> sessionAttrs = session.getAttributeNames(); if (sessionAttrs != null) { String attrName = null; while (sessionAttrs.hasMoreElements()) { attrName = sessionAttrs.nextElement(); context.put(attrName, session.getAttribute(attrName)); } } } return context; }
java
public static VelocityContext parseSession(VelocityContext context, javax.servlet.http.HttpSession session) { if (null != session) { final Enumeration<String> sessionAttrs = session.getAttributeNames(); if (sessionAttrs != null) { String attrName = null; while (sessionAttrs.hasMoreElements()) { attrName = sessionAttrs.nextElement(); context.put(attrName, session.getAttribute(attrName)); } } } return context; }
[ "public", "static", "VelocityContext", "parseSession", "(", "VelocityContext", "context", ",", "javax", ".", "servlet", ".", "http", ".", "HttpSession", "session", ")", "{", "if", "(", "null", "!=", "session", ")", "{", "final", "Enumeration", "<", "String", ...
将Session中的值放入模板上下文 @param context 模板上下文 @param session Session @return VelocityContext
[ "将Session中的值放入模板上下文" ]
bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a
https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-extra/src/main/java/cn/hutool/extra/template/engine/velocity/VelocityUtil.java#L297-L309
train
Parses a session.
[ 30522, 2270, 10763, 10146, 8663, 18209, 11968, 8583, 7971, 3258, 1006, 10146, 8663, 18209, 6123, 1010, 9262, 2595, 1012, 14262, 2615, 7485, 1012, 8299, 1012, 16770, 7971, 3258, 5219, 1007, 1063, 2065, 1006, 19701, 999, 1027, 5219, 1007, 106...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
looly/hutool
hutool-crypto/src/main/java/cn/hutool/crypto/SmUtil.java
SmUtil.rsPlainToAsn1
public static byte[] rsPlainToAsn1(byte[] sign) { if (sign.length != RS_LEN * 2) { throw new CryptoException("err rs. "); } BigInteger r = new BigInteger(1, Arrays.copyOfRange(sign, 0, RS_LEN)); BigInteger s = new BigInteger(1, Arrays.copyOfRange(sign, RS_LEN, RS_LEN * 2)); ASN1EncodableVector v = new ASN1EncodableVector(); v.add(new ASN1Integer(r)); v.add(new ASN1Integer(s)); try { return new DERSequence(v).getEncoded("DER"); } catch (IOException e) { throw new IORuntimeException(e); } }
java
public static byte[] rsPlainToAsn1(byte[] sign) { if (sign.length != RS_LEN * 2) { throw new CryptoException("err rs. "); } BigInteger r = new BigInteger(1, Arrays.copyOfRange(sign, 0, RS_LEN)); BigInteger s = new BigInteger(1, Arrays.copyOfRange(sign, RS_LEN, RS_LEN * 2)); ASN1EncodableVector v = new ASN1EncodableVector(); v.add(new ASN1Integer(r)); v.add(new ASN1Integer(s)); try { return new DERSequence(v).getEncoded("DER"); } catch (IOException e) { throw new IORuntimeException(e); } }
[ "public", "static", "byte", "[", "]", "rsPlainToAsn1", "(", "byte", "[", "]", "sign", ")", "{", "if", "(", "sign", ".", "length", "!=", "RS_LEN", "*", "2", ")", "{", "throw", "new", "CryptoException", "(", "\"err rs. \"", ")", ";", "}", "BigInteger", ...
BC的SM3withSM2验签需要的rs是asn1格式的,这个方法将直接拼接r||s的字节数组转化成asn1格式<br> 来自:https://blog.csdn.net/pridas/article/details/86118774 @param sign in plain byte array @return rs result in asn1 format @since 4.5.0
[ "BC的SM3withSM2验签需要的rs是asn1格式的,这个方法将直接拼接r||s的字节数组转化成asn1格式<br", ">", "来自:https", ":", "//", "blog", ".", "csdn", ".", "net", "/", "pridas", "/", "article", "/", "details", "/", "86118774" ]
bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a
https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-crypto/src/main/java/cn/hutool/crypto/SmUtil.java#L206-L220
train
Converts a plain byte array to ASN. 1 encoded byte array.
[ 30522, 2270, 10763, 24880, 1031, 1033, 12667, 24759, 22325, 10441, 2015, 2078, 2487, 1006, 24880, 1031, 1033, 3696, 1007, 1063, 2065, 1006, 3696, 1012, 3091, 999, 1027, 12667, 1035, 18798, 1008, 1016, 1007, 1063, 5466, 2047, 19888, 8913, 25...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
apache/flink
flink-optimizer/src/main/java/org/apache/flink/optimizer/dataproperties/RequestedLocalProperties.java
RequestedLocalProperties.filterBySemanticProperties
public RequestedLocalProperties filterBySemanticProperties(SemanticProperties props, int input) { // no semantic properties, all local properties are filtered if (props == null) { throw new NullPointerException("SemanticProperties may not be null."); } if (this.ordering != null) { Ordering newOrdering = new Ordering(); for (int i = 0; i < this.ordering.getInvolvedIndexes().size(); i++) { int targetField = this.ordering.getInvolvedIndexes().get(i); int sourceField = props.getForwardingSourceField(input, targetField); if (sourceField >= 0) { newOrdering.appendOrdering(sourceField, this.ordering.getType(i), this.ordering.getOrder(i)); } else { return null; } } return new RequestedLocalProperties(newOrdering); } else if (this.groupedFields != null) { FieldSet newGrouping = new FieldSet(); // check, whether the local key grouping is preserved for (Integer targetField : this.groupedFields) { int sourceField = props.getForwardingSourceField(input, targetField); if (sourceField >= 0) { newGrouping = newGrouping.addField(sourceField); } else { return null; } } return new RequestedLocalProperties(newGrouping); } else { return null; } }
java
public RequestedLocalProperties filterBySemanticProperties(SemanticProperties props, int input) { // no semantic properties, all local properties are filtered if (props == null) { throw new NullPointerException("SemanticProperties may not be null."); } if (this.ordering != null) { Ordering newOrdering = new Ordering(); for (int i = 0; i < this.ordering.getInvolvedIndexes().size(); i++) { int targetField = this.ordering.getInvolvedIndexes().get(i); int sourceField = props.getForwardingSourceField(input, targetField); if (sourceField >= 0) { newOrdering.appendOrdering(sourceField, this.ordering.getType(i), this.ordering.getOrder(i)); } else { return null; } } return new RequestedLocalProperties(newOrdering); } else if (this.groupedFields != null) { FieldSet newGrouping = new FieldSet(); // check, whether the local key grouping is preserved for (Integer targetField : this.groupedFields) { int sourceField = props.getForwardingSourceField(input, targetField); if (sourceField >= 0) { newGrouping = newGrouping.addField(sourceField); } else { return null; } } return new RequestedLocalProperties(newGrouping); } else { return null; } }
[ "public", "RequestedLocalProperties", "filterBySemanticProperties", "(", "SemanticProperties", "props", ",", "int", "input", ")", "{", "// no semantic properties, all local properties are filtered", "if", "(", "props", "==", "null", ")", "{", "throw", "new", "NullPointerExc...
Filters these properties by what can be preserved by the given SemanticProperties when propagated down to the given input. @param props The SemanticProperties which define which fields are preserved. @param input The index of the operator's input. @return The filtered RequestedLocalProperties
[ "Filters", "these", "properties", "by", "what", "can", "be", "preserved", "by", "the", "given", "SemanticProperties", "when", "propagated", "down", "to", "the", "given", "input", "." ]
b62db93bf63cb3bb34dd03d611a779d9e3fc61ac
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-optimizer/src/main/java/org/apache/flink/optimizer/dataproperties/RequestedLocalProperties.java#L146-L183
train
Filter by semantic properties.
[ 30522, 2270, 7303, 4135, 9289, 21572, 4842, 7368, 11307, 3762, 3366, 2386, 4588, 21572, 4842, 7368, 1006, 21641, 21572, 4842, 7368, 24387, 1010, 20014, 7953, 1007, 1063, 1013, 1013, 2053, 21641, 5144, 1010, 2035, 2334, 5144, 2024, 21839, 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...