repo
stringclasses
11 values
path
stringlengths
41
234
func_name
stringlengths
5
78
original_string
stringlengths
71
14.1k
language
stringclasses
1 value
code
stringlengths
71
14.1k
code_tokens
listlengths
22
2.65k
docstring
stringlengths
2
5.35k
docstring_tokens
listlengths
1
369
sha
stringclasses
11 values
url
stringlengths
129
339
partition
stringclasses
1 value
summary
stringlengths
7
175
input_ids
listlengths
502
502
token_type_ids
listlengths
502
502
attention_mask
listlengths
502
502
labels
listlengths
502
502
netty/netty
handler/src/main/java/io/netty/handler/ssl/SslContextBuilder.java
SslContextBuilder.forServer
public static SslContextBuilder forServer(File keyCertChainFile, File keyFile) { return new SslContextBuilder(true).keyManager(keyCertChainFile, keyFile); }
java
public static SslContextBuilder forServer(File keyCertChainFile, File keyFile) { return new SslContextBuilder(true).keyManager(keyCertChainFile, keyFile); }
[ "public", "static", "SslContextBuilder", "forServer", "(", "File", "keyCertChainFile", ",", "File", "keyFile", ")", "{", "return", "new", "SslContextBuilder", "(", "true", ")", ".", "keyManager", "(", "keyCertChainFile", ",", "keyFile", ")", ";", "}" ]
Creates a builder for new server-side {@link SslContext}. @param keyCertChainFile an X.509 certificate chain file in PEM format @param keyFile a PKCS#8 private key file in PEM format @see #keyManager(File, File)
[ "Creates", "a", "builder", "for", "new", "server", "-", "side", "{", "@link", "SslContext", "}", "." ]
ba06eafa1c1824bd154f1a380019e7ea2edf3c4c
https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/handler/src/main/java/io/netty/handler/ssl/SslContextBuilder.java#L53-L55
train
Create a SslContextBuilder for a server using the specified key certificates.
[ 30522, 2270, 10763, 7020, 22499, 10111, 18413, 8569, 23891, 2099, 2005, 8043, 6299, 1006, 5371, 3145, 17119, 10649, 8113, 8873, 2571, 1010, 5371, 3145, 8873, 2571, 1007, 1063, 2709, 2047, 7020, 22499, 10111, 18413, 8569, 23891, 2099, 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-java/src/main/java/org/apache/flink/api/java/utils/DataSetUtils.java
DataSetUtils.sampleWithSize
public static <T> DataSet<T> sampleWithSize( DataSet <T> input, final boolean withReplacement, final int numSamples, final long seed) { SampleInPartition<T> sampleInPartition = new SampleInPartition<>(withReplacement, numSamples, seed); MapPartitionOperator mapPartitionOperator = input.mapPartition(sampleInPartition); // There is no previous group, so the parallelism of GroupReduceOperator is always 1. String callLocation = Utils.getCallLocationName(); SampleInCoordinator<T> sampleInCoordinator = new SampleInCoordinator<>(withReplacement, numSamples, seed); return new GroupReduceOperator<>(mapPartitionOperator, input.getType(), sampleInCoordinator, callLocation); }
java
public static <T> DataSet<T> sampleWithSize( DataSet <T> input, final boolean withReplacement, final int numSamples, final long seed) { SampleInPartition<T> sampleInPartition = new SampleInPartition<>(withReplacement, numSamples, seed); MapPartitionOperator mapPartitionOperator = input.mapPartition(sampleInPartition); // There is no previous group, so the parallelism of GroupReduceOperator is always 1. String callLocation = Utils.getCallLocationName(); SampleInCoordinator<T> sampleInCoordinator = new SampleInCoordinator<>(withReplacement, numSamples, seed); return new GroupReduceOperator<>(mapPartitionOperator, input.getType(), sampleInCoordinator, callLocation); }
[ "public", "static", "<", "T", ">", "DataSet", "<", "T", ">", "sampleWithSize", "(", "DataSet", "<", "T", ">", "input", ",", "final", "boolean", "withReplacement", ",", "final", "int", "numSamples", ",", "final", "long", "seed", ")", "{", "SampleInPartition...
Generate a sample of DataSet which contains fixed size elements. <p><strong>NOTE:</strong> Sample with fixed size is not as efficient as sample with fraction, use sample with fraction unless you need exact precision. @param withReplacement Whether element can be selected more than once. @param numSamples The expected sample size. @param seed Random number generator seed. @return The sampled DataSet
[ "Generate", "a", "sample", "of", "DataSet", "which", "contains", "fixed", "size", "elements", "." ]
b62db93bf63cb3bb34dd03d611a779d9e3fc61ac
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-java/src/main/java/org/apache/flink/api/java/utils/DataSetUtils.java#L251-L264
train
Samples a DataSet of type T with a given number of samples.
[ 30522, 2270, 10763, 1026, 1056, 1028, 2951, 13462, 1026, 1056, 1028, 7099, 24415, 5332, 4371, 1006, 2951, 13462, 1026, 1056, 1028, 7953, 1010, 2345, 22017, 20898, 2007, 2890, 24759, 10732, 3672, 1010, 2345, 20014, 16371, 5244, 16613, 4244, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -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/health/HealthWebEndpointResponseMapper.java
HealthWebEndpointResponseMapper.mapDetails
public WebEndpointResponse<Health> mapDetails(Supplier<Health> health, SecurityContext securityContext) { if (canSeeDetails(securityContext, this.showDetails)) { Health healthDetails = health.get(); if (healthDetails != null) { return createWebEndpointResponse(healthDetails); } } return new WebEndpointResponse<>(WebEndpointResponse.STATUS_NOT_FOUND); }
java
public WebEndpointResponse<Health> mapDetails(Supplier<Health> health, SecurityContext securityContext) { if (canSeeDetails(securityContext, this.showDetails)) { Health healthDetails = health.get(); if (healthDetails != null) { return createWebEndpointResponse(healthDetails); } } return new WebEndpointResponse<>(WebEndpointResponse.STATUS_NOT_FOUND); }
[ "public", "WebEndpointResponse", "<", "Health", ">", "mapDetails", "(", "Supplier", "<", "Health", ">", "health", ",", "SecurityContext", "securityContext", ")", "{", "if", "(", "canSeeDetails", "(", "securityContext", ",", "this", ".", "showDetails", ")", ")", ...
Maps the given {@code health} details to a {@link WebEndpointResponse}, honouring the mapper's default {@link ShowDetails} using the given {@code securityContext}. <p> If the current user does not have the right to see the details, the {@link Supplier} is not invoked and a 404 response is returned instead. @param health the provider of health details, invoked if the current user has the right to see them @param securityContext the security context @return the mapped response
[ "Maps", "the", "given", "{" ]
0b27f7c70e164b2b1a96477f1d9c1acba56790c1
https://github.com/spring-projects/spring-boot/blob/0b27f7c70e164b2b1a96477f1d9c1acba56790c1/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/health/HealthWebEndpointResponseMapper.java#L58-L67
train
Map the health to details.
[ 30522, 2270, 4773, 10497, 8400, 6072, 26029, 3366, 1026, 2740, 1028, 4949, 3207, 22081, 1006, 17024, 1026, 2740, 1028, 2740, 1010, 3036, 8663, 18209, 3036, 8663, 18209, 1007, 1063, 2065, 1006, 18484, 13089, 12928, 12146, 1006, 3036, 8663, 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/mining/word/TermFrequencyCounter.java
TermFrequencyCounter.getKeywords
@Override public List<String> getKeywords(List<Term> termList, int size) { clear(); add(termList); Collection<TermFrequency> topN = top(size); List<String> r = new ArrayList<String>(topN.size()); for (TermFrequency termFrequency : topN) { r.add(termFrequency.getTerm()); } return r; }
java
@Override public List<String> getKeywords(List<Term> termList, int size) { clear(); add(termList); Collection<TermFrequency> topN = top(size); List<String> r = new ArrayList<String>(topN.size()); for (TermFrequency termFrequency : topN) { r.add(termFrequency.getTerm()); } return r; }
[ "@", "Override", "public", "List", "<", "String", ">", "getKeywords", "(", "List", "<", "Term", ">", "termList", ",", "int", "size", ")", "{", "clear", "(", ")", ";", "add", "(", "termList", ")", ";", "Collection", "<", "TermFrequency", ">", "topN", ...
提取关键词(非线程安全) @param termList @param size @return
[ "提取关键词(非线程安全)" ]
a538d0722ab2e4980a9dcd9ea40324fc3ddba7ce
https://github.com/hankcs/HanLP/blob/a538d0722ab2e4980a9dcd9ea40324fc3ddba7ce/src/main/java/com/hankcs/hanlp/mining/word/TermFrequencyCounter.java#L219-L231
train
Get a list of words from a list of terms.
[ 30522, 1030, 2058, 15637, 2270, 2862, 1026, 5164, 1028, 2131, 14839, 22104, 1006, 2862, 1026, 2744, 1028, 2744, 9863, 1010, 20014, 2946, 1007, 1063, 3154, 1006, 1007, 1025, 5587, 1006, 2744, 9863, 1007, 1025, 3074, 1026, 2744, 19699, 2063, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
spring-projects/spring-boot
spring-boot-project/spring-boot/src/main/java/org/springframework/boot/logging/LogFile.java
LogFile.applyTo
public void applyTo(Properties properties) { put(properties, LoggingSystemProperties.LOG_PATH, this.path); put(properties, LoggingSystemProperties.LOG_FILE, toString()); }
java
public void applyTo(Properties properties) { put(properties, LoggingSystemProperties.LOG_PATH, this.path); put(properties, LoggingSystemProperties.LOG_FILE, toString()); }
[ "public", "void", "applyTo", "(", "Properties", "properties", ")", "{", "put", "(", "properties", ",", "LoggingSystemProperties", ".", "LOG_PATH", ",", "this", ".", "path", ")", ";", "put", "(", "properties", ",", "LoggingSystemProperties", ".", "LOG_FILE", ",...
Apply log file details to {@code LOG_PATH} and {@code LOG_FILE} map entries. @param properties the properties to apply to
[ "Apply", "log", "file", "details", "to", "{" ]
0b27f7c70e164b2b1a96477f1d9c1acba56790c1
https://github.com/spring-projects/spring-boot/blob/0b27f7c70e164b2b1a96477f1d9c1acba56790c1/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/logging/LogFile.java#L105-L108
train
Set the logging properties to the given properties object.
[ 30522, 2270, 11675, 6611, 3406, 1006, 5144, 5144, 1007, 1063, 2404, 1006, 5144, 1010, 15899, 6508, 13473, 8737, 18981, 8743, 3111, 1012, 8833, 1035, 4130, 1010, 2023, 1012, 4130, 1007, 1025, 2404, 1006, 5144, 1010, 15899, 6508, 13473, 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/DateUtil.java
DateUtil.parse
public static DateTime parse(String dateStr) { if (null == dateStr) { return null; } // 去掉两边空格并去掉中文日期中的“日”,以规范长度 dateStr = dateStr.trim().replace("日", ""); int length = dateStr.length(); if (Validator.isNumber(dateStr)) { // 纯数字形式 if (length == DatePattern.PURE_DATETIME_PATTERN.length()) { return parse(dateStr, DatePattern.PURE_DATETIME_FORMAT); } else if (length == DatePattern.PURE_DATETIME_MS_PATTERN.length()) { return parse(dateStr, DatePattern.PURE_DATETIME_MS_FORMAT); } else if (length == DatePattern.PURE_DATE_PATTERN.length()) { return parse(dateStr, DatePattern.PURE_DATE_FORMAT); } else if (length == DatePattern.PURE_TIME_PATTERN.length()) { return parse(dateStr, DatePattern.PURE_TIME_FORMAT); } } if (length == DatePattern.NORM_DATETIME_PATTERN.length() || length == DatePattern.NORM_DATETIME_PATTERN.length() + 1) { if (dateStr.contains("T")) { // UTC时间格式:类似2018-09-13T05:34:31 return parseUTC(dateStr); } return parseDateTime(dateStr); } else if (length == DatePattern.NORM_DATE_PATTERN.length()) { return parseDate(dateStr); } else if (length == DatePattern.NORM_TIME_PATTERN.length() || length == DatePattern.NORM_TIME_PATTERN.length() + 1) { return parseTimeToday(dateStr); } else if (length == DatePattern.NORM_DATETIME_MINUTE_PATTERN.length() || length == DatePattern.NORM_DATETIME_MINUTE_PATTERN.length() + 1) { return parse(normalize(dateStr), DatePattern.NORM_DATETIME_MINUTE_FORMAT); } else if (length >= DatePattern.NORM_DATETIME_MS_PATTERN.length() - 2) { return parse(normalize(dateStr), DatePattern.NORM_DATETIME_MS_FORMAT); } // 没有更多匹配的时间格式 throw new DateException("No format fit for date String [{}] !", dateStr); }
java
public static DateTime parse(String dateStr) { if (null == dateStr) { return null; } // 去掉两边空格并去掉中文日期中的“日”,以规范长度 dateStr = dateStr.trim().replace("日", ""); int length = dateStr.length(); if (Validator.isNumber(dateStr)) { // 纯数字形式 if (length == DatePattern.PURE_DATETIME_PATTERN.length()) { return parse(dateStr, DatePattern.PURE_DATETIME_FORMAT); } else if (length == DatePattern.PURE_DATETIME_MS_PATTERN.length()) { return parse(dateStr, DatePattern.PURE_DATETIME_MS_FORMAT); } else if (length == DatePattern.PURE_DATE_PATTERN.length()) { return parse(dateStr, DatePattern.PURE_DATE_FORMAT); } else if (length == DatePattern.PURE_TIME_PATTERN.length()) { return parse(dateStr, DatePattern.PURE_TIME_FORMAT); } } if (length == DatePattern.NORM_DATETIME_PATTERN.length() || length == DatePattern.NORM_DATETIME_PATTERN.length() + 1) { if (dateStr.contains("T")) { // UTC时间格式:类似2018-09-13T05:34:31 return parseUTC(dateStr); } return parseDateTime(dateStr); } else if (length == DatePattern.NORM_DATE_PATTERN.length()) { return parseDate(dateStr); } else if (length == DatePattern.NORM_TIME_PATTERN.length() || length == DatePattern.NORM_TIME_PATTERN.length() + 1) { return parseTimeToday(dateStr); } else if (length == DatePattern.NORM_DATETIME_MINUTE_PATTERN.length() || length == DatePattern.NORM_DATETIME_MINUTE_PATTERN.length() + 1) { return parse(normalize(dateStr), DatePattern.NORM_DATETIME_MINUTE_FORMAT); } else if (length >= DatePattern.NORM_DATETIME_MS_PATTERN.length() - 2) { return parse(normalize(dateStr), DatePattern.NORM_DATETIME_MS_FORMAT); } // 没有更多匹配的时间格式 throw new DateException("No format fit for date String [{}] !", dateStr); }
[ "public", "static", "DateTime", "parse", "(", "String", "dateStr", ")", "{", "if", "(", "null", "==", "dateStr", ")", "{", "return", "null", ";", "}", "// 去掉两边空格并去掉中文日期中的“日”,以规范长度\r", "dateStr", "=", "dateStr", ".", "trim", "(", ")", ".", "replace", "(", ...
将日期字符串转换为{@link DateTime}对象,格式:<br> <ol> <li>yyyy-MM-dd HH:mm:ss</li> <li>yyyy/MM/dd HH:mm:ss</li> <li>yyyy.MM.dd HH:mm:ss</li> <li>yyyy年MM月dd日 HH时mm分ss秒</li> <li>yyyy-MM-dd</li> <li>yyyy/MM/dd</li> <li>yyyy.MM.dd</li> <li>HH:mm:ss</li> <li>HH时mm分ss秒</li> <li>yyyy-MM-dd HH:mm</li> <li>yyyy-MM-dd HH:mm:ss.SSS</li> <li>yyyyMMddHHmmss</li> <li>yyyyMMddHHmmssSSS</li> <li>yyyyMMdd</li> <li>EEE, dd MMM yyyy HH:mm:ss z</li> <li>EEE MMM dd HH:mm:ss zzz yyyy</li> </ol> @param dateStr 日期字符串 @return 日期
[ "将日期字符串转换为", "{", "@link", "DateTime", "}", "对象,格式:<br", ">", "<ol", ">", "<li", ">", "yyyy", "-", "MM", "-", "dd", "HH", ":", "mm", ":", "ss<", "/", "li", ">", "<li", ">", "yyyy", "/", "MM", "/", "dd", "HH", ":", "mm", ":", "ss<", "/", "li",...
bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a
https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/date/DateUtil.java#L703-L742
train
Parses a string containing a date and returns the corresponding DateTime object.
[ 30522, 2270, 10763, 3058, 7292, 11968, 3366, 1006, 5164, 5246, 16344, 1007, 1063, 2065, 1006, 19701, 1027, 1027, 5246, 16344, 1007, 1063, 2709, 19701, 1025, 1065, 1013, 1013, 100, 100, 100, 100, 1930, 100, 100, 100, 100, 1746, 1861, 1864,...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -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/ServletListenerRegistrationBean.java
ServletListenerRegistrationBean.setListener
public void setListener(T listener) { Assert.notNull(listener, "Listener must not be null"); Assert.isTrue(isSupportedType(listener), "Listener is not of a supported type"); this.listener = listener; }
java
public void setListener(T listener) { Assert.notNull(listener, "Listener must not be null"); Assert.isTrue(isSupportedType(listener), "Listener is not of a supported type"); this.listener = listener; }
[ "public", "void", "setListener", "(", "T", "listener", ")", "{", "Assert", ".", "notNull", "(", "listener", ",", "\"Listener must not be null\"", ")", ";", "Assert", ".", "isTrue", "(", "isSupportedType", "(", "listener", ")", ",", "\"Listener is not of a supporte...
Set the listener that will be registered. @param listener the listener to register
[ "Set", "the", "listener", "that", "will", "be", "registered", "." ]
0b27f7c70e164b2b1a96477f1d9c1acba56790c1
https://github.com/spring-projects/spring-boot/blob/0b27f7c70e164b2b1a96477f1d9c1acba56790c1/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/servlet/ServletListenerRegistrationBean.java#L94-L98
train
Sets the listener.
[ 30522, 2270, 11675, 2275, 9863, 24454, 1006, 1056, 19373, 1007, 1063, 20865, 1012, 2025, 11231, 3363, 1006, 19373, 1010, 1000, 19373, 2442, 2025, 2022, 19701, 1000, 1007, 1025, 20865, 1012, 21541, 6820, 2063, 1006, 26354, 6279, 6442, 2098, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -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/DataSetUtils.java
DataSetUtils.countElementsPerPartition
public static <T> DataSet<Tuple2<Integer, Long>> countElementsPerPartition(DataSet<T> input) { return input.mapPartition(new RichMapPartitionFunction<T, Tuple2<Integer, Long>>() { @Override public void mapPartition(Iterable<T> values, Collector<Tuple2<Integer, Long>> out) throws Exception { long counter = 0; for (T value : values) { counter++; } out.collect(new Tuple2<>(getRuntimeContext().getIndexOfThisSubtask(), counter)); } }); }
java
public static <T> DataSet<Tuple2<Integer, Long>> countElementsPerPartition(DataSet<T> input) { return input.mapPartition(new RichMapPartitionFunction<T, Tuple2<Integer, Long>>() { @Override public void mapPartition(Iterable<T> values, Collector<Tuple2<Integer, Long>> out) throws Exception { long counter = 0; for (T value : values) { counter++; } out.collect(new Tuple2<>(getRuntimeContext().getIndexOfThisSubtask(), counter)); } }); }
[ "public", "static", "<", "T", ">", "DataSet", "<", "Tuple2", "<", "Integer", ",", "Long", ">", ">", "countElementsPerPartition", "(", "DataSet", "<", "T", ">", "input", ")", "{", "return", "input", ".", "mapPartition", "(", "new", "RichMapPartitionFunction",...
Method that goes over all the elements in each partition in order to retrieve the total number of elements. @param input the DataSet received as input @return a data set containing tuples of subtask index, number of elements mappings.
[ "Method", "that", "goes", "over", "all", "the", "elements", "in", "each", "partition", "in", "order", "to", "retrieve", "the", "total", "number", "of", "elements", "." ]
b62db93bf63cb3bb34dd03d611a779d9e3fc61ac
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-java/src/main/java/org/apache/flink/api/java/utils/DataSetUtils.java#L69-L80
train
Counts the number of elements in each partition.
[ 30522, 2270, 10763, 1026, 1056, 1028, 2951, 13462, 1026, 10722, 10814, 2475, 1026, 16109, 1010, 2146, 1028, 1028, 4175, 12260, 8163, 4842, 19362, 3775, 3508, 1006, 2951, 13462, 1026, 1056, 1028, 7953, 1007, 1063, 2709, 7953, 1012, 4949, 193...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -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/common/dml/OrderItemBuilder.java
OrderItemBuilder.createOrderItem
public OrderItem createOrderItem() { if (orderByItemSegment instanceof IndexOrderByItemSegment) { return createOrderItem((IndexOrderByItemSegment) orderByItemSegment); } if (orderByItemSegment instanceof ColumnOrderByItemSegment) { return createOrderItem(selectStatement, (ColumnOrderByItemSegment) orderByItemSegment); } if (orderByItemSegment instanceof ExpressionOrderByItemSegment) { return createOrderItem(selectStatement, (ExpressionOrderByItemSegment) orderByItemSegment); } throw new UnsupportedOperationException(); }
java
public OrderItem createOrderItem() { if (orderByItemSegment instanceof IndexOrderByItemSegment) { return createOrderItem((IndexOrderByItemSegment) orderByItemSegment); } if (orderByItemSegment instanceof ColumnOrderByItemSegment) { return createOrderItem(selectStatement, (ColumnOrderByItemSegment) orderByItemSegment); } if (orderByItemSegment instanceof ExpressionOrderByItemSegment) { return createOrderItem(selectStatement, (ExpressionOrderByItemSegment) orderByItemSegment); } throw new UnsupportedOperationException(); }
[ "public", "OrderItem", "createOrderItem", "(", ")", "{", "if", "(", "orderByItemSegment", "instanceof", "IndexOrderByItemSegment", ")", "{", "return", "createOrderItem", "(", "(", "IndexOrderByItemSegment", ")", "orderByItemSegment", ")", ";", "}", "if", "(", "order...
Create order item. @return order item
[ "Create", "order", "item", "." ]
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/common/dml/OrderItemBuilder.java#L46-L57
train
Create an OrderItem object from the given order item segment.
[ 30522, 2270, 2344, 4221, 2213, 3443, 30524, 4221, 5244, 13910, 3672, 6013, 11253, 5950, 8551, 2121, 3762, 4221, 5244, 13910, 3672, 1007, 1063, 2709, 3443, 8551, 11124, 18532, 1006, 1006, 5950, 8551, 2121, 3762, 4221, 5244, 13910, 3672, 1007...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
looly/hutool
hutool-log/src/main/java/cn/hutool/log/dialect/log4j/Log4jLog.java
Log4jLog.log
@Override public void log(cn.hutool.log.level.Level level, String format, Object... arguments) { log(level, null, format, arguments); }
java
@Override public void log(cn.hutool.log.level.Level level, String format, Object... arguments) { log(level, null, format, arguments); }
[ "@", "Override", "public", "void", "log", "(", "cn", ".", "hutool", ".", "log", ".", "level", ".", "Level", "level", ",", "String", "format", ",", "Object", "...", "arguments", ")", "{", "log", "(", "level", ",", "null", ",", "format", ",", "argument...
------------------------------------------------------------------------- Log
[ "-------------------------------------------------------------------------", "Log" ]
bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a
https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-log/src/main/java/cn/hutool/log/dialect/log4j/Log4jLog.java#L120-L123
train
Override this method to log a message at the specified level.
[ 30522, 1030, 2058, 15637, 2270, 11675, 8833, 1006, 27166, 1012, 12570, 13669, 1012, 8833, 1012, 2504, 1012, 2504, 2504, 1010, 5164, 4289, 1010, 4874, 1012, 1012, 1012, 9918, 1007, 1063, 8833, 1006, 2504, 1010, 19701, 1010, 4289, 1010, 9918,...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -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-csv/src/main/java/org/apache/flink/table/descriptors/Csv.java
Csv.arrayElementDelimiter
public Csv arrayElementDelimiter(String delimiter) { Preconditions.checkNotNull(delimiter); internalProperties.putString(FORMAT_ARRAY_ELEMENT_DELIMITER, delimiter); return this; }
java
public Csv arrayElementDelimiter(String delimiter) { Preconditions.checkNotNull(delimiter); internalProperties.putString(FORMAT_ARRAY_ELEMENT_DELIMITER, delimiter); return this; }
[ "public", "Csv", "arrayElementDelimiter", "(", "String", "delimiter", ")", "{", "Preconditions", ".", "checkNotNull", "(", "delimiter", ")", ";", "internalProperties", ".", "putString", "(", "FORMAT_ARRAY_ELEMENT_DELIMITER", ",", "delimiter", ")", ";", "return", "th...
Sets the array element delimiter string for separating array or row element values (";" by default). @param delimiter the array element delimiter
[ "Sets", "the", "array", "element", "delimiter", "string", "for", "separating", "array", "or", "row", "element", "values", "(", ";", "by", "default", ")", "." ]
b62db93bf63cb3bb34dd03d611a779d9e3fc61ac
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-formats/flink-csv/src/main/java/org/apache/flink/table/descriptors/Csv.java#L122-L126
train
Sets the delimiter used to separate the array elements in the CSV file.
[ 30522, 2270, 20116, 2615, 9140, 12260, 3672, 9247, 27605, 3334, 1006, 5164, 3972, 27605, 3334, 1007, 1063, 3653, 8663, 20562, 2015, 1012, 4638, 17048, 11231, 3363, 1006, 3972, 27605, 3334, 1007, 1025, 4722, 21572, 4842, 7368, 1012, 8509, 18...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -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/typeutils/BinaryRowSerializer.java
BinaryRowSerializer.pointTo
public void pointTo(int length, BinaryRow reuse, AbstractPagedInputView headerLessView) throws IOException { checkArgument(headerLessView.getHeaderLength() == 0); if (length < 0) { throw new IOException(String.format( "Read unexpected bytes in source of positionInSegment[%d] and limitInSegment[%d]", headerLessView.getCurrentPositionInSegment(), headerLessView.getCurrentSegmentLimit() )); } int remainInSegment = headerLessView.getCurrentSegmentLimit() - headerLessView.getCurrentPositionInSegment(); MemorySegment currSeg = headerLessView.getCurrentSegment(); int currPosInSeg = headerLessView.getCurrentPositionInSegment(); if (remainInSegment >= length) { // all in one segment, that's good. reuse.pointTo(currSeg, currPosInSeg, length); headerLessView.skipBytesToRead(length); } else { pointToMultiSegments( reuse, headerLessView, length, length - remainInSegment, currSeg, currPosInSeg ); } }
java
public void pointTo(int length, BinaryRow reuse, AbstractPagedInputView headerLessView) throws IOException { checkArgument(headerLessView.getHeaderLength() == 0); if (length < 0) { throw new IOException(String.format( "Read unexpected bytes in source of positionInSegment[%d] and limitInSegment[%d]", headerLessView.getCurrentPositionInSegment(), headerLessView.getCurrentSegmentLimit() )); } int remainInSegment = headerLessView.getCurrentSegmentLimit() - headerLessView.getCurrentPositionInSegment(); MemorySegment currSeg = headerLessView.getCurrentSegment(); int currPosInSeg = headerLessView.getCurrentPositionInSegment(); if (remainInSegment >= length) { // all in one segment, that's good. reuse.pointTo(currSeg, currPosInSeg, length); headerLessView.skipBytesToRead(length); } else { pointToMultiSegments( reuse, headerLessView, length, length - remainInSegment, currSeg, currPosInSeg ); } }
[ "public", "void", "pointTo", "(", "int", "length", ",", "BinaryRow", "reuse", ",", "AbstractPagedInputView", "headerLessView", ")", "throws", "IOException", "{", "checkArgument", "(", "headerLessView", ".", "getHeaderLength", "(", ")", "==", "0", ")", ";", "if",...
Point row to memory segments with offset(in the AbstractPagedInputView) and length. @param length row length. @param reuse reuse BinaryRow object. @param headerLessView source memory segments container.
[ "Point", "row", "to", "memory", "segments", "with", "offset", "(", "in", "the", "AbstractPagedInputView", ")", "and", "length", "." ]
b62db93bf63cb3bb34dd03d611a779d9e3fc61ac
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-table/flink-table-runtime-blink/src/main/java/org/apache/flink/table/typeutils/BinaryRowSerializer.java#L224-L253
train
This method points to the given length of the input.
[ 30522, 2270, 11675, 2391, 3406, 1006, 30524, 1063, 4638, 2906, 22850, 4765, 1006, 20346, 3238, 8584, 1012, 2131, 4974, 2121, 7770, 13512, 2232, 1006, 1007, 1027, 1027, 1014, 1007, 1025, 2065, 1006, 3091, 1026, 1014, 1007, 1063, 5466, 2047, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -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/format/FastDateParser.java
FastDateParser.simpleQuote
private static StringBuilder simpleQuote(final StringBuilder sb, final String value) { for (int i = 0; i < value.length(); ++i) { final char c = value.charAt(i); switch (c) { case '\\': case '^': case '$': case '.': case '|': case '?': case '*': case '+': case '(': case ')': case '[': case '{': sb.append('\\'); default: sb.append(c); } } return sb; }
java
private static StringBuilder simpleQuote(final StringBuilder sb, final String value) { for (int i = 0; i < value.length(); ++i) { final char c = value.charAt(i); switch (c) { case '\\': case '^': case '$': case '.': case '|': case '?': case '*': case '+': case '(': case ')': case '[': case '{': sb.append('\\'); default: sb.append(c); } } return sb; }
[ "private", "static", "StringBuilder", "simpleQuote", "(", "final", "StringBuilder", "sb", ",", "final", "String", "value", ")", "{", "for", "(", "int", "i", "=", "0", ";", "i", "<", "value", ".", "length", "(", ")", ";", "++", "i", ")", "{", "final",...
-----------------------------------------------------------------------
[ "-----------------------------------------------------------------------" ]
bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a
https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/date/format/FastDateParser.java#L272-L294
train
Simple quote.
[ 30522, 2797, 10763, 5164, 8569, 23891, 2099, 3722, 28940, 12184, 1006, 2345, 5164, 8569, 23891, 2099, 24829, 1010, 2345, 5164, 3643, 1007, 1063, 2005, 1006, 20014, 1045, 1027, 1014, 1025, 1045, 1026, 3643, 1012, 3091, 1006, 1007, 1025, 3052...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
apache/flink
flink-runtime/src/main/java/org/apache/flink/runtime/clusterframework/types/ResourceProfile.java
ResourceProfile.isMatching
public boolean isMatching(ResourceProfile required) { if (required == UNKNOWN) { return true; } if (cpuCores >= required.getCpuCores() && heapMemoryInMB >= required.getHeapMemoryInMB() && directMemoryInMB >= required.getDirectMemoryInMB() && nativeMemoryInMB >= required.getNativeMemoryInMB() && networkMemoryInMB >= required.getNetworkMemoryInMB()) { for (Map.Entry<String, Resource> resource : required.extendedResources.entrySet()) { if (!extendedResources.containsKey(resource.getKey()) || !extendedResources.get(resource.getKey()).getResourceAggregateType().equals(resource.getValue().getResourceAggregateType()) || extendedResources.get(resource.getKey()).getValue() < resource.getValue().getValue()) { return false; } } return true; } return false; }
java
public boolean isMatching(ResourceProfile required) { if (required == UNKNOWN) { return true; } if (cpuCores >= required.getCpuCores() && heapMemoryInMB >= required.getHeapMemoryInMB() && directMemoryInMB >= required.getDirectMemoryInMB() && nativeMemoryInMB >= required.getNativeMemoryInMB() && networkMemoryInMB >= required.getNetworkMemoryInMB()) { for (Map.Entry<String, Resource> resource : required.extendedResources.entrySet()) { if (!extendedResources.containsKey(resource.getKey()) || !extendedResources.get(resource.getKey()).getResourceAggregateType().equals(resource.getValue().getResourceAggregateType()) || extendedResources.get(resource.getKey()).getValue() < resource.getValue().getValue()) { return false; } } return true; } return false; }
[ "public", "boolean", "isMatching", "(", "ResourceProfile", "required", ")", "{", "if", "(", "required", "==", "UNKNOWN", ")", "{", "return", "true", ";", "}", "if", "(", "cpuCores", ">=", "required", ".", "getCpuCores", "(", ")", "&&", "heapMemoryInMB", ">...
Check whether required resource profile can be matched. @param required the required resource profile @return true if the requirement is matched, otherwise false
[ "Check", "whether", "required", "resource", "profile", "can", "be", "matched", "." ]
b62db93bf63cb3bb34dd03d611a779d9e3fc61ac
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/clusterframework/types/ResourceProfile.java#L208-L229
train
Checks if the resource profile is matching the specified resource profile.
[ 30522, 2270, 22017, 20898, 2003, 18900, 8450, 1006, 7692, 21572, 8873, 2571, 3223, 1007, 1063, 2065, 1006, 3223, 1027, 1027, 4242, 1007, 1063, 2709, 2995, 1025, 1065, 2065, 1006, 17368, 17345, 2015, 1028, 1027, 3223, 1012, 2131, 21906, 1419...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
apache/spark
common/network-common/src/main/java/org/apache/spark/network/TransportContext.java
TransportContext.createChunkFetchHandler
private ChunkFetchRequestHandler createChunkFetchHandler(TransportChannelHandler channelHandler, RpcHandler rpcHandler) { return new ChunkFetchRequestHandler(channelHandler.getClient(), rpcHandler.getStreamManager(), conf.maxChunksBeingTransferred()); }
java
private ChunkFetchRequestHandler createChunkFetchHandler(TransportChannelHandler channelHandler, RpcHandler rpcHandler) { return new ChunkFetchRequestHandler(channelHandler.getClient(), rpcHandler.getStreamManager(), conf.maxChunksBeingTransferred()); }
[ "private", "ChunkFetchRequestHandler", "createChunkFetchHandler", "(", "TransportChannelHandler", "channelHandler", ",", "RpcHandler", "rpcHandler", ")", "{", "return", "new", "ChunkFetchRequestHandler", "(", "channelHandler", ".", "getClient", "(", ")", ",", "rpcHandler", ...
Creates the dedicated ChannelHandler for ChunkFetchRequest messages.
[ "Creates", "the", "dedicated", "ChannelHandler", "for", "ChunkFetchRequest", "messages", "." ]
25ee0474f47d9c30d6f553a7892d9549f91071cf
https://github.com/apache/spark/blob/25ee0474f47d9c30d6f553a7892d9549f91071cf/common/network-common/src/main/java/org/apache/spark/network/TransportContext.java#L229-L233
train
Create a ChunkFetchRequestHandler
[ 30522, 2797, 20000, 7959, 10649, 2890, 15500, 11774, 3917, 3443, 20760, 8950, 7959, 10649, 11774, 3917, 1006, 3665, 26058, 11774, 3917, 3149, 11774, 3917, 1010, 1054, 15042, 11774, 3917, 1054, 15042, 11774, 3917, 1007, 1063, 2709, 2047, 20000...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
looly/hutool
hutool-core/src/main/java/cn/hutool/core/text/Simhash.java
Simhash.hash
public long hash(Collection<? extends CharSequence> segList) { final int bitNum = this.bitNum; // 按照词语的hash值,计算simHashWeight(低位对齐) final int[] weight = new int[bitNum]; long wordHash; for (CharSequence seg : segList) { wordHash = MurmurHash.hash64(seg); for (int i = 0; i < bitNum; i++) { if (((wordHash >> i) & 1) == 1) weight[i] += 1; else weight[i] -= 1; } } // 计算得到Simhash值 final StringBuilder sb = new StringBuilder(); for (int i = 0; i < bitNum; i++) { sb.append((weight[i] > 0) ? 1 : 0); } return new BigInteger(sb.toString(), 2).longValue(); }
java
public long hash(Collection<? extends CharSequence> segList) { final int bitNum = this.bitNum; // 按照词语的hash值,计算simHashWeight(低位对齐) final int[] weight = new int[bitNum]; long wordHash; for (CharSequence seg : segList) { wordHash = MurmurHash.hash64(seg); for (int i = 0; i < bitNum; i++) { if (((wordHash >> i) & 1) == 1) weight[i] += 1; else weight[i] -= 1; } } // 计算得到Simhash值 final StringBuilder sb = new StringBuilder(); for (int i = 0; i < bitNum; i++) { sb.append((weight[i] > 0) ? 1 : 0); } return new BigInteger(sb.toString(), 2).longValue(); }
[ "public", "long", "hash", "(", "Collection", "<", "?", "extends", "CharSequence", ">", "segList", ")", "{", "final", "int", "bitNum", "=", "this", ".", "bitNum", ";", "// 按照词语的hash值,计算simHashWeight(低位对齐)\r", "final", "int", "[", "]", "weight", "=", "new", "i...
指定文本计算simhash值 @param segList 分词的词列表 @return Hash值
[ "指定文本计算simhash值" ]
bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a
https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/text/Simhash.java#L70-L92
train
hash a list of CharSequences
[ 30522, 2270, 2146, 23325, 1006, 3074, 1026, 1029, 8908, 25869, 3366, 4226, 5897, 1028, 7367, 25394, 3367, 1007, 1063, 2345, 30524, 100, 1916, 23325, 100, 1989, 100, 100, 21934, 14949, 2232, 11179, 1006, 100, 100, 100, 100, 1007, 2345, 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...
apache/incubator-shardingsphere
sharding-core/sharding-core-parse/sharding-core-parse-common/src/main/java/org/apache/shardingsphere/core/parse/antlr/filler/common/dml/PredicateUtils.java
PredicateUtils.createBetweenCondition
public static Optional<Condition> createBetweenCondition(final PredicateBetweenRightValue betweenRightValue, final Column column) { return betweenRightValue.getBetweenExpression() instanceof SimpleExpressionSegment && betweenRightValue.getAndExpression() instanceof SimpleExpressionSegment ? Optional.of(new Condition(column, ((SimpleExpressionSegment) betweenRightValue.getBetweenExpression()).getSQLExpression(), ((SimpleExpressionSegment) betweenRightValue.getAndExpression()).getSQLExpression())) : Optional.<Condition>absent(); }
java
public static Optional<Condition> createBetweenCondition(final PredicateBetweenRightValue betweenRightValue, final Column column) { return betweenRightValue.getBetweenExpression() instanceof SimpleExpressionSegment && betweenRightValue.getAndExpression() instanceof SimpleExpressionSegment ? Optional.of(new Condition(column, ((SimpleExpressionSegment) betweenRightValue.getBetweenExpression()).getSQLExpression(), ((SimpleExpressionSegment) betweenRightValue.getAndExpression()).getSQLExpression())) : Optional.<Condition>absent(); }
[ "public", "static", "Optional", "<", "Condition", ">", "createBetweenCondition", "(", "final", "PredicateBetweenRightValue", "betweenRightValue", ",", "final", "Column", "column", ")", "{", "return", "betweenRightValue", ".", "getBetweenExpression", "(", ")", "instanceo...
Create condition of BETWEEN ... AND ... operator. @param betweenRightValue right value of BETWEEN operator @param column column @return condition
[ "Create", "condition", "of", "BETWEEN", "...", "AND", "...", "operator", "." ]
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/common/dml/PredicateUtils.java#L132-L137
train
Create between condition Optional.
[ 30522, 2270, 10763, 11887, 1026, 4650, 1028, 3443, 20915, 28394, 15305, 16089, 3508, 1006, 2345, 3653, 16467, 20915, 28394, 16118, 18743, 10175, 5657, 2090, 15950, 10175, 5657, 1010, 2345, 5930, 5930, 1007, 1063, 2709, 2090, 15950, 10175, 565...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
apache/flink
flink-libraries/flink-cep/src/main/java/org/apache/flink/cep/nfa/sharedbuffer/SharedBufferAccessor.java
SharedBufferAccessor.put
public NodeId put( final String stateName, final EventId eventId, @Nullable final NodeId previousNodeId, final DeweyNumber version) { if (previousNodeId != null) { lockNode(previousNodeId); } NodeId currentNodeId = new NodeId(eventId, getOriginalNameFromInternal(stateName)); Lockable<SharedBufferNode> currentNode = sharedBuffer.getEntry(currentNodeId); if (currentNode == null) { currentNode = new Lockable<>(new SharedBufferNode(), 0); lockEvent(eventId); } currentNode.getElement().addEdge(new SharedBufferEdge( previousNodeId, version)); sharedBuffer.upsertEntry(currentNodeId, currentNode); return currentNodeId; }
java
public NodeId put( final String stateName, final EventId eventId, @Nullable final NodeId previousNodeId, final DeweyNumber version) { if (previousNodeId != null) { lockNode(previousNodeId); } NodeId currentNodeId = new NodeId(eventId, getOriginalNameFromInternal(stateName)); Lockable<SharedBufferNode> currentNode = sharedBuffer.getEntry(currentNodeId); if (currentNode == null) { currentNode = new Lockable<>(new SharedBufferNode(), 0); lockEvent(eventId); } currentNode.getElement().addEdge(new SharedBufferEdge( previousNodeId, version)); sharedBuffer.upsertEntry(currentNodeId, currentNode); return currentNodeId; }
[ "public", "NodeId", "put", "(", "final", "String", "stateName", ",", "final", "EventId", "eventId", ",", "@", "Nullable", "final", "NodeId", "previousNodeId", ",", "final", "DeweyNumber", "version", ")", "{", "if", "(", "previousNodeId", "!=", "null", ")", "...
Stores given value (value + timestamp) under the given state. It assigns a preceding element relation to the previous entry. @param stateName name of the state that the event should be assigned to @param eventId unique id of event assigned by this SharedBuffer @param previousNodeId id of previous entry (might be null if start of new run) @param version Version of the previous relation @return assigned id of this element
[ "Stores", "given", "value", "(", "value", "+", "timestamp", ")", "under", "the", "given", "state", ".", "It", "assigns", "a", "preceding", "element", "relation", "to", "the", "previous", "entry", "." ]
b62db93bf63cb3bb34dd03d611a779d9e3fc61ac
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-libraries/flink-cep/src/main/java/org/apache/flink/cep/nfa/sharedbuffer/SharedBufferAccessor.java#L87-L110
train
Put a new node in the shared buffer.
[ 30522, 2270, 13045, 3593, 2404, 1006, 2345, 5164, 24161, 14074, 1010, 2345, 2724, 3593, 2724, 3593, 1010, 1030, 19701, 3085, 2345, 13045, 3593, 3025, 3630, 3207, 3593, 1010, 2345, 20309, 19172, 5677, 2544, 1007, 1063, 2065, 1006, 3025, 3630...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -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/typeutils/TypeSerializerSchemaCompatibility.java
TypeSerializerSchemaCompatibility.getReconfiguredSerializer
public TypeSerializer<T> getReconfiguredSerializer() { Preconditions.checkState( isCompatibleWithReconfiguredSerializer(), "It is only possible to get a reconfigured serializer if the compatibility type is %s, but the type is %s", Type.COMPATIBLE_WITH_RECONFIGURED_SERIALIZER, resultType); return reconfiguredNewSerializer; }
java
public TypeSerializer<T> getReconfiguredSerializer() { Preconditions.checkState( isCompatibleWithReconfiguredSerializer(), "It is only possible to get a reconfigured serializer if the compatibility type is %s, but the type is %s", Type.COMPATIBLE_WITH_RECONFIGURED_SERIALIZER, resultType); return reconfiguredNewSerializer; }
[ "public", "TypeSerializer", "<", "T", ">", "getReconfiguredSerializer", "(", ")", "{", "Preconditions", ".", "checkState", "(", "isCompatibleWithReconfiguredSerializer", "(", ")", ",", "\"It is only possible to get a reconfigured serializer if the compatibility type is %s, but the ...
Gets the reconfigured serializer. This throws an exception if {@link #isCompatibleWithReconfiguredSerializer()} is {@code false}.
[ "Gets", "the", "reconfigured", "serializer", ".", "This", "throws", "an", "exception", "if", "{" ]
b62db93bf63cb3bb34dd03d611a779d9e3fc61ac
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-core/src/main/java/org/apache/flink/api/common/typeutils/TypeSerializerSchemaCompatibility.java#L164-L170
train
Gets the reconfigured serializer.
[ 30522, 2270, 4127, 11610, 28863, 1026, 1056, 1028, 2131, 2890, 8663, 8873, 27390, 2098, 8043, 4818, 17629, 1006, 1007, 1063, 3653, 8663, 20562, 2015, 1012, 14148, 12259, 1006, 2003, 9006, 24952, 3468, 24415, 2890, 8663, 8873, 27390, 2098, 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/dictionary/nr/PersonDictionary.java
PersonDictionary.parsePattern
public static void parsePattern(List<NR> nrList, List<Vertex> vertexList, final WordNet wordNetOptimum, final WordNet wordNetAll) { // 拆分UV ListIterator<Vertex> listIterator = vertexList.listIterator(); StringBuilder sbPattern = new StringBuilder(nrList.size()); NR preNR = NR.A; boolean backUp = false; int index = 0; for (NR nr : nrList) { ++index; Vertex current = listIterator.next(); // logger.trace("{}/{}", current.realWord, nr); switch (nr) { case U: if (!backUp) { vertexList = new ArrayList<Vertex>(vertexList); listIterator = vertexList.listIterator(index); backUp = true; } sbPattern.append(NR.K.toString()); sbPattern.append(NR.B.toString()); preNR = B; listIterator.previous(); String nowK = current.realWord.substring(0, current.realWord.length() - 1); String nowB = current.realWord.substring(current.realWord.length() - 1); listIterator.set(new Vertex(nowK)); listIterator.next(); listIterator.add(new Vertex(nowB)); continue; case V: if (!backUp) { vertexList = new ArrayList<Vertex>(vertexList); listIterator = vertexList.listIterator(index); backUp = true; } if (preNR == B) { sbPattern.append(NR.E.toString()); //BE } else { sbPattern.append(NR.D.toString()); //CD } sbPattern.append(NR.L.toString()); // 对串也做一些修改 listIterator.previous(); String EorD = current.realWord.substring(0, 1); String L = current.realWord.substring(1, current.realWord.length()); listIterator.set(new Vertex(EorD)); listIterator.next(); listIterator.add(new Vertex(L)); continue; default: sbPattern.append(nr.toString()); break; } preNR = nr; } String pattern = sbPattern.toString(); // logger.trace("模式串:{}", pattern); // logger.trace("对应串:{}", vertexList); // if (pattern.length() != vertexList.size()) // { // logger.warn("人名识别模式串有bug", pattern, vertexList); // return; // } final Vertex[] wordArray = vertexList.toArray(new Vertex[0]); final int[] offsetArray = new int[wordArray.length]; offsetArray[0] = 0; for (int i = 1; i < wordArray.length; ++i) { offsetArray[i] = offsetArray[i - 1] + wordArray[i - 1].realWord.length(); } trie.parseText(pattern, new AhoCorasickDoubleArrayTrie.IHit<NRPattern>() { @Override public void hit(int begin, int end, NRPattern value) { // logger.trace("匹配到:{}", keyword); StringBuilder sbName = new StringBuilder(); for (int i = begin; i < end; ++i) { sbName.append(wordArray[i].realWord); } String name = sbName.toString(); // logger.trace("识别出:{}", name); // 对一些bad case做出调整 switch (value) { case BCD: if (name.charAt(0) == name.charAt(2)) return; // 姓和最后一个名不可能相等的 // String cd = name.substring(1); // if (CoreDictionary.contains(cd)) // { // EnumItem<NR> item = PersonDictionary.dictionary.get(cd); // if (item == null || !item.containsLabel(Z)) return; // 三字名字但是后两个字不在词典中,有很大可能性是误命中 // } break; } if (isBadCase(name)) return; // 正式算它是一个名字 if (HanLP.Config.DEBUG) { System.out.printf("识别出人名:%s %s\n", name, value); } int offset = offsetArray[begin]; wordNetOptimum.insert(offset, new Vertex(Predefine.TAG_PEOPLE, name, ATTRIBUTE, WORD_ID), wordNetAll); } }); }
java
public static void parsePattern(List<NR> nrList, List<Vertex> vertexList, final WordNet wordNetOptimum, final WordNet wordNetAll) { // 拆分UV ListIterator<Vertex> listIterator = vertexList.listIterator(); StringBuilder sbPattern = new StringBuilder(nrList.size()); NR preNR = NR.A; boolean backUp = false; int index = 0; for (NR nr : nrList) { ++index; Vertex current = listIterator.next(); // logger.trace("{}/{}", current.realWord, nr); switch (nr) { case U: if (!backUp) { vertexList = new ArrayList<Vertex>(vertexList); listIterator = vertexList.listIterator(index); backUp = true; } sbPattern.append(NR.K.toString()); sbPattern.append(NR.B.toString()); preNR = B; listIterator.previous(); String nowK = current.realWord.substring(0, current.realWord.length() - 1); String nowB = current.realWord.substring(current.realWord.length() - 1); listIterator.set(new Vertex(nowK)); listIterator.next(); listIterator.add(new Vertex(nowB)); continue; case V: if (!backUp) { vertexList = new ArrayList<Vertex>(vertexList); listIterator = vertexList.listIterator(index); backUp = true; } if (preNR == B) { sbPattern.append(NR.E.toString()); //BE } else { sbPattern.append(NR.D.toString()); //CD } sbPattern.append(NR.L.toString()); // 对串也做一些修改 listIterator.previous(); String EorD = current.realWord.substring(0, 1); String L = current.realWord.substring(1, current.realWord.length()); listIterator.set(new Vertex(EorD)); listIterator.next(); listIterator.add(new Vertex(L)); continue; default: sbPattern.append(nr.toString()); break; } preNR = nr; } String pattern = sbPattern.toString(); // logger.trace("模式串:{}", pattern); // logger.trace("对应串:{}", vertexList); // if (pattern.length() != vertexList.size()) // { // logger.warn("人名识别模式串有bug", pattern, vertexList); // return; // } final Vertex[] wordArray = vertexList.toArray(new Vertex[0]); final int[] offsetArray = new int[wordArray.length]; offsetArray[0] = 0; for (int i = 1; i < wordArray.length; ++i) { offsetArray[i] = offsetArray[i - 1] + wordArray[i - 1].realWord.length(); } trie.parseText(pattern, new AhoCorasickDoubleArrayTrie.IHit<NRPattern>() { @Override public void hit(int begin, int end, NRPattern value) { // logger.trace("匹配到:{}", keyword); StringBuilder sbName = new StringBuilder(); for (int i = begin; i < end; ++i) { sbName.append(wordArray[i].realWord); } String name = sbName.toString(); // logger.trace("识别出:{}", name); // 对一些bad case做出调整 switch (value) { case BCD: if (name.charAt(0) == name.charAt(2)) return; // 姓和最后一个名不可能相等的 // String cd = name.substring(1); // if (CoreDictionary.contains(cd)) // { // EnumItem<NR> item = PersonDictionary.dictionary.get(cd); // if (item == null || !item.containsLabel(Z)) return; // 三字名字但是后两个字不在词典中,有很大可能性是误命中 // } break; } if (isBadCase(name)) return; // 正式算它是一个名字 if (HanLP.Config.DEBUG) { System.out.printf("识别出人名:%s %s\n", name, value); } int offset = offsetArray[begin]; wordNetOptimum.insert(offset, new Vertex(Predefine.TAG_PEOPLE, name, ATTRIBUTE, WORD_ID), wordNetAll); } }); }
[ "public", "static", "void", "parsePattern", "(", "List", "<", "NR", ">", "nrList", ",", "List", "<", "Vertex", ">", "vertexList", ",", "final", "WordNet", "wordNetOptimum", ",", "final", "WordNet", "wordNetAll", ")", "{", "// 拆分UV", "ListIterator", "<", "Ver...
模式匹配 @param nrList 确定的标注序列 @param vertexList 原始的未加角色标注的序列 @param wordNetOptimum 待优化的图 @param wordNetAll 全词图
[ "模式匹配" ]
a538d0722ab2e4980a9dcd9ea40324fc3ddba7ce
https://github.com/hankcs/HanLP/blob/a538d0722ab2e4980a9dcd9ea40324fc3ddba7ce/src/main/java/com/hankcs/hanlp/dictionary/nr/PersonDictionary.java#L81-L195
train
Parse the pattern.
[ 30522, 2270, 10763, 11675, 11968, 3366, 4502, 12079, 2078, 1006, 2862, 1026, 17212, 1028, 20686, 2923, 1010, 2862, 1026, 19449, 1028, 19449, 9863, 1010, 2345, 2773, 7159, 2773, 7159, 7361, 3775, 27147, 1010, 2345, 2773, 7159, 2773, 7159, 80...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -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
private <K, N, S extends State, V> CompletableFuture<S> getKvState( final JobID jobId, final String queryableStateName, final K key, final N namespace, final TypeInformation<K> keyTypeInfo, final TypeInformation<N> namespaceTypeInfo, final StateDescriptor<S, V> stateDescriptor) { Preconditions.checkNotNull(jobId); Preconditions.checkNotNull(queryableStateName); Preconditions.checkNotNull(key); Preconditions.checkNotNull(namespace); Preconditions.checkNotNull(keyTypeInfo); Preconditions.checkNotNull(namespaceTypeInfo); Preconditions.checkNotNull(stateDescriptor); TypeSerializer<K> keySerializer = keyTypeInfo.createSerializer(executionConfig); TypeSerializer<N> namespaceSerializer = namespaceTypeInfo.createSerializer(executionConfig); stateDescriptor.initializeSerializerUnlessSet(executionConfig); final byte[] serializedKeyAndNamespace; try { serializedKeyAndNamespace = KvStateSerializer .serializeKeyAndNamespace(key, keySerializer, namespace, namespaceSerializer); } catch (IOException e) { return FutureUtils.getFailedFuture(e); } return getKvState(jobId, queryableStateName, key.hashCode(), serializedKeyAndNamespace) .thenApply(stateResponse -> createState(stateResponse, stateDescriptor)); }
java
private <K, N, S extends State, V> CompletableFuture<S> getKvState( final JobID jobId, final String queryableStateName, final K key, final N namespace, final TypeInformation<K> keyTypeInfo, final TypeInformation<N> namespaceTypeInfo, final StateDescriptor<S, V> stateDescriptor) { Preconditions.checkNotNull(jobId); Preconditions.checkNotNull(queryableStateName); Preconditions.checkNotNull(key); Preconditions.checkNotNull(namespace); Preconditions.checkNotNull(keyTypeInfo); Preconditions.checkNotNull(namespaceTypeInfo); Preconditions.checkNotNull(stateDescriptor); TypeSerializer<K> keySerializer = keyTypeInfo.createSerializer(executionConfig); TypeSerializer<N> namespaceSerializer = namespaceTypeInfo.createSerializer(executionConfig); stateDescriptor.initializeSerializerUnlessSet(executionConfig); final byte[] serializedKeyAndNamespace; try { serializedKeyAndNamespace = KvStateSerializer .serializeKeyAndNamespace(key, keySerializer, namespace, namespaceSerializer); } catch (IOException e) { return FutureUtils.getFailedFuture(e); } return getKvState(jobId, queryableStateName, key.hashCode(), serializedKeyAndNamespace) .thenApply(stateResponse -> createState(stateResponse, stateDescriptor)); }
[ "private", "<", "K", ",", "N", ",", "S", "extends", "State", ",", "V", ">", "CompletableFuture", "<", "S", ">", "getKvState", "(", "final", "JobID", "jobId", ",", "final", "String", "queryableStateName", ",", "final", "K", "key", ",", "final", "N", "na...
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 that the state we request is associated with. @param namespace The namespace of the state. @param keyTypeInfo The {@link TypeInformation} of the keys. @param namespaceTypeInfo The {@link TypeInformation} of the namespace. @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#L242-L275
train
Gets the state for the given key and namespace.
[ 30522, 2797, 1026, 1047, 1010, 1050, 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, 9153, 6528, 1407...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -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.discoverNewShardsToSubscribe
public List<StreamShardHandle> discoverNewShardsToSubscribe() throws InterruptedException { List<StreamShardHandle> newShardsToSubscribe = new LinkedList<>(); GetShardListResult shardListResult = kinesis.getShardList(subscribedStreamsToLastDiscoveredShardIds); if (shardListResult.hasRetrievedShards()) { Set<String> streamsWithNewShards = shardListResult.getStreamsWithRetrievedShards(); for (String stream : streamsWithNewShards) { List<StreamShardHandle> newShardsOfStream = shardListResult.getRetrievedShardListOfStream(stream); for (StreamShardHandle newShard : newShardsOfStream) { int hashCode = shardAssigner.assign(newShard, totalNumberOfConsumerSubtasks); if (isThisSubtaskShouldSubscribeTo(hashCode, totalNumberOfConsumerSubtasks, indexOfThisConsumerSubtask)) { newShardsToSubscribe.add(newShard); } } advanceLastDiscoveredShardOfStream( stream, shardListResult.getLastSeenShardOfStream(stream).getShard().getShardId()); } } return newShardsToSubscribe; }
java
public List<StreamShardHandle> discoverNewShardsToSubscribe() throws InterruptedException { List<StreamShardHandle> newShardsToSubscribe = new LinkedList<>(); GetShardListResult shardListResult = kinesis.getShardList(subscribedStreamsToLastDiscoveredShardIds); if (shardListResult.hasRetrievedShards()) { Set<String> streamsWithNewShards = shardListResult.getStreamsWithRetrievedShards(); for (String stream : streamsWithNewShards) { List<StreamShardHandle> newShardsOfStream = shardListResult.getRetrievedShardListOfStream(stream); for (StreamShardHandle newShard : newShardsOfStream) { int hashCode = shardAssigner.assign(newShard, totalNumberOfConsumerSubtasks); if (isThisSubtaskShouldSubscribeTo(hashCode, totalNumberOfConsumerSubtasks, indexOfThisConsumerSubtask)) { newShardsToSubscribe.add(newShard); } } advanceLastDiscoveredShardOfStream( stream, shardListResult.getLastSeenShardOfStream(stream).getShard().getShardId()); } } return newShardsToSubscribe; }
[ "public", "List", "<", "StreamShardHandle", ">", "discoverNewShardsToSubscribe", "(", ")", "throws", "InterruptedException", "{", "List", "<", "StreamShardHandle", ">", "newShardsToSubscribe", "=", "new", "LinkedList", "<>", "(", ")", ";", "GetShardListResult", "shard...
A utility function that does the following: <p>1. Find new shards for each stream that we haven't seen before 2. For each new shard, determine whether this consumer subtask should subscribe to them; if yes, it is added to the returned list of shards 3. Update the subscribedStreamsToLastDiscoveredShardIds state so that we won't get shards that we have already seen before the next time this function is called
[ "A", "utility", "function", "that", "does", "the", "following", ":" ]
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#L546-L569
train
Discover new shards to subscribe to
[ 30522, 2270, 2862, 1026, 9199, 11783, 11774, 2571, 1028, 7523, 2638, 9333, 11783, 16033, 6342, 5910, 26775, 20755, 1006, 1007, 11618, 7153, 10288, 24422, 1063, 2862, 1026, 9199, 11783, 11774, 2571, 1028, 2739, 11783, 16033, 6342, 5910, 26775,...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
apache/spark
launcher/src/main/java/org/apache/spark/launcher/InProcessLauncher.java
InProcessLauncher.startApplication
@Override public SparkAppHandle startApplication(SparkAppHandle.Listener... listeners) throws IOException { if (builder.isClientMode(builder.getEffectiveConfig())) { LOG.warning("It's not recommended to run client-mode applications using InProcessLauncher."); } Method main = findSparkSubmit(); LauncherServer server = LauncherServer.getOrCreateServer(); InProcessAppHandle handle = new InProcessAppHandle(server); for (SparkAppHandle.Listener l : listeners) { handle.addListener(l); } String secret = server.registerHandle(handle); setConf(LauncherProtocol.CONF_LAUNCHER_PORT, String.valueOf(server.getPort())); setConf(LauncherProtocol.CONF_LAUNCHER_SECRET, secret); List<String> sparkArgs = builder.buildSparkSubmitArgs(); String[] argv = sparkArgs.toArray(new String[sparkArgs.size()]); String appName = CommandBuilderUtils.firstNonEmpty(builder.appName, builder.mainClass, "<unknown>"); handle.start(appName, main, argv); return handle; }
java
@Override public SparkAppHandle startApplication(SparkAppHandle.Listener... listeners) throws IOException { if (builder.isClientMode(builder.getEffectiveConfig())) { LOG.warning("It's not recommended to run client-mode applications using InProcessLauncher."); } Method main = findSparkSubmit(); LauncherServer server = LauncherServer.getOrCreateServer(); InProcessAppHandle handle = new InProcessAppHandle(server); for (SparkAppHandle.Listener l : listeners) { handle.addListener(l); } String secret = server.registerHandle(handle); setConf(LauncherProtocol.CONF_LAUNCHER_PORT, String.valueOf(server.getPort())); setConf(LauncherProtocol.CONF_LAUNCHER_SECRET, secret); List<String> sparkArgs = builder.buildSparkSubmitArgs(); String[] argv = sparkArgs.toArray(new String[sparkArgs.size()]); String appName = CommandBuilderUtils.firstNonEmpty(builder.appName, builder.mainClass, "<unknown>"); handle.start(appName, main, argv); return handle; }
[ "@", "Override", "public", "SparkAppHandle", "startApplication", "(", "SparkAppHandle", ".", "Listener", "...", "listeners", ")", "throws", "IOException", "{", "if", "(", "builder", ".", "isClientMode", "(", "builder", ".", "getEffectiveConfig", "(", ")", ")", "...
Starts a Spark application. @see AbstractLauncher#startApplication(SparkAppHandle.Listener...) @param listeners Listeners to add to the handle before the app is launched. @return A handle for the launched application.
[ "Starts", "a", "Spark", "application", "." ]
25ee0474f47d9c30d6f553a7892d9549f91071cf
https://github.com/apache/spark/blob/25ee0474f47d9c30d6f553a7892d9549f91071cf/launcher/src/main/java/org/apache/spark/launcher/InProcessLauncher.java#L53-L77
train
Start an application.
[ 30522, 1030, 2058, 15637, 2270, 12125, 29098, 11774, 2571, 2707, 29098, 19341, 3508, 1006, 12125, 29098, 11774, 2571, 1012, 19373, 1012, 1012, 1012, 13810, 1007, 11618, 22834, 10288, 24422, 1063, 2065, 1006, 12508, 1012, 2003, 20464, 11638, 5...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
looly/hutool
hutool-core/src/main/java/cn/hutool/core/util/XmlUtil.java
XmlUtil.getElements
public static List<Element> getElements(Element element, String tagName) { final NodeList nodeList = StrUtil.isBlank(tagName) ? element.getChildNodes() : element.getElementsByTagName(tagName); return transElements(element, nodeList); }
java
public static List<Element> getElements(Element element, String tagName) { final NodeList nodeList = StrUtil.isBlank(tagName) ? element.getChildNodes() : element.getElementsByTagName(tagName); return transElements(element, nodeList); }
[ "public", "static", "List", "<", "Element", ">", "getElements", "(", "Element", "element", ",", "String", "tagName", ")", "{", "final", "NodeList", "nodeList", "=", "StrUtil", ".", "isBlank", "(", "tagName", ")", "?", "element", ".", "getChildNodes", "(", ...
根据节点名获得子节点列表 @param element 节点 @param tagName 节点名,如果节点名为空(null或blank),返回所有子节点 @return 节点列表
[ "根据节点名获得子节点列表" ]
bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a
https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/util/XmlUtil.java#L445-L448
train
Gets all elements that have a specific tag with the given name.
[ 30522, 2270, 10763, 2862, 1026, 5783, 1028, 2131, 12260, 8163, 1006, 5783, 5783, 1010, 5164, 6415, 18442, 1007, 1063, 2345, 13045, 9863, 13045, 9863, 1027, 2358, 22134, 4014, 1012, 2003, 28522, 8950, 1006, 6415, 18442, 1007, 1029, 5783, 101...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
apache/flink
flink-libraries/flink-gelly/src/main/java/org/apache/flink/graph/Graph.java
Graph.getUndirected
public Graph<K, VV, EV> getUndirected() { DataSet<Edge<K, EV>> undirectedEdges = edges. flatMap(new RegularAndReversedEdgesMap<>()).name("To undirected graph"); return new Graph<>(vertices, undirectedEdges, this.context); }
java
public Graph<K, VV, EV> getUndirected() { DataSet<Edge<K, EV>> undirectedEdges = edges. flatMap(new RegularAndReversedEdgesMap<>()).name("To undirected graph"); return new Graph<>(vertices, undirectedEdges, this.context); }
[ "public", "Graph", "<", "K", ",", "VV", ",", "EV", ">", "getUndirected", "(", ")", "{", "DataSet", "<", "Edge", "<", "K", ",", "EV", ">", ">", "undirectedEdges", "=", "edges", ".", "flatMap", "(", "new", "RegularAndReversedEdgesMap", "<>", "(", ")", ...
This operation adds all inverse-direction edges to the graph. @return the undirected graph.
[ "This", "operation", "adds", "all", "inverse", "-", "direction", "edges", "to", "the", "graph", "." ]
b62db93bf63cb3bb34dd03d611a779d9e3fc61ac
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-libraries/flink-gelly/src/main/java/org/apache/flink/graph/Graph.java#L985-L990
train
Returns a new undirected graph.
[ 30522, 2270, 10629, 1026, 1047, 1010, 1058, 2615, 1010, 23408, 1028, 2131, 8630, 7442, 10985, 1006, 1007, 1063, 2951, 13462, 1026, 3341, 1026, 1047, 1010, 23408, 1028, 1028, 6151, 7442, 10985, 24225, 2015, 1027, 7926, 1012, 4257, 2863, 2361...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -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/ParameterTool.java
ParameterTool.getDouble
public double getDouble(String key, double defaultValue) { addToDefaults(key, Double.toString(defaultValue)); String value = get(key); if (value == null) { return defaultValue; } else { return Double.valueOf(value); } }
java
public double getDouble(String key, double defaultValue) { addToDefaults(key, Double.toString(defaultValue)); String value = get(key); if (value == null) { return defaultValue; } else { return Double.valueOf(value); } }
[ "public", "double", "getDouble", "(", "String", "key", ",", "double", "defaultValue", ")", "{", "addToDefaults", "(", "key", ",", "Double", ".", "toString", "(", "defaultValue", ")", ")", ";", "String", "value", "=", "get", "(", "key", ")", ";", "if", ...
Returns the Double value for the given key. If the key does not exists it will return the default value given. The method fails if the value is not a Double.
[ "Returns", "the", "Double", "value", "for", "the", "given", "key", ".", "If", "the", "key", "does", "not", "exists", "it", "will", "return", "the", "default", "value", "given", ".", "The", "method", "fails", "if", "the", "value", "is", "not", "a", "Dou...
b62db93bf63cb3bb34dd03d611a779d9e3fc61ac
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-java/src/main/java/org/apache/flink/api/java/utils/ParameterTool.java#L371-L379
train
Gets the double value for the given key. If the key does not exist it will return the default value given.
[ 30522, 2270, 3313, 2131, 26797, 3468, 1006, 5164, 3145, 1010, 3313, 12398, 10175, 5657, 1007, 1063, 5587, 3406, 3207, 7011, 11314, 2015, 1006, 3145, 1010, 3313, 1012, 2000, 3367, 4892, 1006, 12398, 10175, 5657, 1007, 1007, 1025, 5164, 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...
looly/hutool
hutool-core/src/main/java/cn/hutool/core/lang/Assert.java
Assert.isTrue
public static void isTrue(boolean expression, String errorMsgTemplate, Object... params) throws IllegalArgumentException { if (false == expression) { throw new IllegalArgumentException(StrUtil.format(errorMsgTemplate, params)); } }
java
public static void isTrue(boolean expression, String errorMsgTemplate, Object... params) throws IllegalArgumentException { if (false == expression) { throw new IllegalArgumentException(StrUtil.format(errorMsgTemplate, params)); } }
[ "public", "static", "void", "isTrue", "(", "boolean", "expression", ",", "String", "errorMsgTemplate", ",", "Object", "...", "params", ")", "throws", "IllegalArgumentException", "{", "if", "(", "false", "==", "expression", ")", "{", "throw", "new", "IllegalArgum...
断言是否为真,如果为 {@code false} 抛出 {@code IllegalArgumentException} 异常<br> <pre class="code"> Assert.isTrue(i &gt; 0, "The value must be greater than zero"); </pre> @param expression 波尔值 @param errorMsgTemplate 错误抛出异常附带的消息模板,变量用{}代替 @param params 参数列表 @throws IllegalArgumentException if expression is {@code false}
[ "断言是否为真,如果为", "{", "@code", "false", "}", "抛出", "{", "@code", "IllegalArgumentException", "}", "异常<br", ">" ]
bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a
https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/lang/Assert.java#L31-L35
train
Check if the boolean expression is true.
[ 30522, 2270, 10763, 11675, 21541, 6820, 2063, 1006, 22017, 20898, 3670, 1010, 5164, 7561, 5244, 13512, 6633, 15725, 1010, 4874, 1012, 1012, 1012, 11498, 5244, 1007, 11618, 6206, 2906, 22850, 15781, 2595, 24422, 1063, 2065, 1006, 6270, 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...
netty/netty
handler/src/main/java/io/netty/handler/timeout/IdleStateHandler.java
IdleStateHandler.hasOutputChanged
private boolean hasOutputChanged(ChannelHandlerContext ctx, boolean first) { if (observeOutput) { // We can take this shortcut if the ChannelPromises that got passed into write() // appear to complete. It indicates "change" on message level and we simply assume // that there's change happening on byte level. If the user doesn't observe channel // writability events then they'll eventually OOME and there's clearly a different // problem and idleness is least of their concerns. if (lastChangeCheckTimeStamp != lastWriteTime) { lastChangeCheckTimeStamp = lastWriteTime; // But this applies only if it's the non-first call. if (!first) { return true; } } Channel channel = ctx.channel(); Unsafe unsafe = channel.unsafe(); ChannelOutboundBuffer buf = unsafe.outboundBuffer(); if (buf != null) { int messageHashCode = System.identityHashCode(buf.current()); long pendingWriteBytes = buf.totalPendingWriteBytes(); if (messageHashCode != lastMessageHashCode || pendingWriteBytes != lastPendingWriteBytes) { lastMessageHashCode = messageHashCode; lastPendingWriteBytes = pendingWriteBytes; if (!first) { return true; } } long flushProgress = buf.currentProgress(); if (flushProgress != lastFlushProgress) { lastFlushProgress = flushProgress; if (!first) { return true; } } } } return false; }
java
private boolean hasOutputChanged(ChannelHandlerContext ctx, boolean first) { if (observeOutput) { // We can take this shortcut if the ChannelPromises that got passed into write() // appear to complete. It indicates "change" on message level and we simply assume // that there's change happening on byte level. If the user doesn't observe channel // writability events then they'll eventually OOME and there's clearly a different // problem and idleness is least of their concerns. if (lastChangeCheckTimeStamp != lastWriteTime) { lastChangeCheckTimeStamp = lastWriteTime; // But this applies only if it's the non-first call. if (!first) { return true; } } Channel channel = ctx.channel(); Unsafe unsafe = channel.unsafe(); ChannelOutboundBuffer buf = unsafe.outboundBuffer(); if (buf != null) { int messageHashCode = System.identityHashCode(buf.current()); long pendingWriteBytes = buf.totalPendingWriteBytes(); if (messageHashCode != lastMessageHashCode || pendingWriteBytes != lastPendingWriteBytes) { lastMessageHashCode = messageHashCode; lastPendingWriteBytes = pendingWriteBytes; if (!first) { return true; } } long flushProgress = buf.currentProgress(); if (flushProgress != lastFlushProgress) { lastFlushProgress = flushProgress; if (!first) { return true; } } } } return false; }
[ "private", "boolean", "hasOutputChanged", "(", "ChannelHandlerContext", "ctx", ",", "boolean", "first", ")", "{", "if", "(", "observeOutput", ")", "{", "// We can take this shortcut if the ChannelPromises that got passed into write()", "// appear to complete. It indicates \"change\...
Returns {@code true} if and only if the {@link IdleStateHandler} was constructed with {@link #observeOutput} enabled and there has been an observed change in the {@link ChannelOutboundBuffer} between two consecutive calls of this method. https://github.com/netty/netty/issues/6150
[ "Returns", "{", "@code", "true", "}", "if", "and", "only", "if", "the", "{", "@link", "IdleStateHandler", "}", "was", "constructed", "with", "{", "@link", "#observeOutput", "}", "enabled", "and", "there", "has", "been", "an", "observed", "change", "in", "t...
ba06eafa1c1824bd154f1a380019e7ea2edf3c4c
https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/handler/src/main/java/io/netty/handler/timeout/IdleStateHandler.java#L415-L461
train
Checks if the output has changed.
[ 30522, 2797, 22017, 20898, 2038, 5833, 18780, 22305, 2098, 1006, 3149, 11774, 3917, 8663, 18209, 14931, 2595, 1010, 22017, 20898, 2034, 1007, 1063, 2065, 1006, 11949, 5833, 18780, 1007, 1063, 1013, 1013, 2057, 2064, 2202, 2023, 2460, 12690, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
apache/flink
flink-streaming-java/src/main/java/org/apache/flink/streaming/runtime/operators/windowing/WindowOperator.java
WindowOperator.getMergingWindowSet
protected MergingWindowSet<W> getMergingWindowSet() throws Exception { @SuppressWarnings("unchecked") MergingWindowAssigner<? super IN, W> mergingAssigner = (MergingWindowAssigner<? super IN, W>) windowAssigner; return new MergingWindowSet<>(mergingAssigner, mergingSetsState); }
java
protected MergingWindowSet<W> getMergingWindowSet() throws Exception { @SuppressWarnings("unchecked") MergingWindowAssigner<? super IN, W> mergingAssigner = (MergingWindowAssigner<? super IN, W>) windowAssigner; return new MergingWindowSet<>(mergingAssigner, mergingSetsState); }
[ "protected", "MergingWindowSet", "<", "W", ">", "getMergingWindowSet", "(", ")", "throws", "Exception", "{", "@", "SuppressWarnings", "(", "\"unchecked\"", ")", "MergingWindowAssigner", "<", "?", "super", "IN", ",", "W", ">", "mergingAssigner", "=", "(", "Mergin...
Retrieves the {@link MergingWindowSet} for the currently active key. The caller must ensure that the correct key is set in the state backend. <p>The caller must also ensure to properly persist changes to state using {@link MergingWindowSet#persist()}.
[ "Retrieves", "the", "{", "@link", "MergingWindowSet", "}", "for", "the", "currently", "active", "key", ".", "The", "caller", "must", "ensure", "that", "the", "correct", "key", "is", "set", "in", "the", "state", "backend", "." ]
b62db93bf63cb3bb34dd03d611a779d9e3fc61ac
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-streaming-java/src/main/java/org/apache/flink/streaming/runtime/operators/windowing/WindowOperator.java#L565-L569
train
Returns a new instance of the MergingWindowSet interface.
[ 30522, 5123, 16468, 11101, 15568, 3388, 1026, 1059, 1028, 2131, 5017, 4726, 11101, 15568, 3388, 1006, 1007, 11618, 6453, 1063, 1030, 16081, 9028, 5582, 2015, 1006, 1000, 4895, 5403, 18141, 1000, 1007, 16468, 11101, 21293, 18719, 10177, 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/flink
flink-runtime/src/main/java/org/apache/flink/runtime/taskmanager/NetworkEnvironmentConfiguration.java
NetworkEnvironmentConfiguration.hasNewNetworkConfig
@SuppressWarnings("deprecation") @VisibleForTesting public static boolean hasNewNetworkConfig(final Configuration config) { return config.contains(TaskManagerOptions.NETWORK_BUFFERS_MEMORY_FRACTION) || config.contains(TaskManagerOptions.NETWORK_BUFFERS_MEMORY_MIN) || config.contains(TaskManagerOptions.NETWORK_BUFFERS_MEMORY_MAX) || !config.contains(TaskManagerOptions.NETWORK_NUM_BUFFERS); }
java
@SuppressWarnings("deprecation") @VisibleForTesting public static boolean hasNewNetworkConfig(final Configuration config) { return config.contains(TaskManagerOptions.NETWORK_BUFFERS_MEMORY_FRACTION) || config.contains(TaskManagerOptions.NETWORK_BUFFERS_MEMORY_MIN) || config.contains(TaskManagerOptions.NETWORK_BUFFERS_MEMORY_MAX) || !config.contains(TaskManagerOptions.NETWORK_NUM_BUFFERS); }
[ "@", "SuppressWarnings", "(", "\"deprecation\"", ")", "@", "VisibleForTesting", "public", "static", "boolean", "hasNewNetworkConfig", "(", "final", "Configuration", "config", ")", "{", "return", "config", ".", "contains", "(", "TaskManagerOptions", ".", "NETWORK_BUFFE...
Returns whether the new network buffer memory configuration is present in the configuration object, i.e. at least one new parameter is given or the old one is not present. @param config configuration object @return <tt>true</tt> if the new configuration method is used, <tt>false</tt> otherwise
[ "Returns", "whether", "the", "new", "network", "buffer", "memory", "configuration", "is", "present", "in", "the", "configuration", "object", "i", ".", "e", ".", "at", "least", "one", "new", "parameter", "is", "given", "or", "the", "old", "one", "is", "not"...
b62db93bf63cb3bb34dd03d611a779d9e3fc61ac
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/taskmanager/NetworkEnvironmentConfiguration.java#L357-L364
train
Check if the configuration contains a new network configuration.
[ 30522, 1030, 16081, 9028, 5582, 2015, 1006, 1000, 2139, 28139, 10719, 1000, 1007, 1030, 5710, 13028, 4355, 2075, 2270, 10763, 22017, 20898, 8440, 7974, 7159, 6198, 8663, 8873, 2290, 1006, 2345, 9563, 9530, 8873, 2290, 1007, 1063, 2709, 9530...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
apache/flink
flink-connectors/flink-connector-kafka-0.8/src/main/java/org/apache/flink/streaming/connectors/kafka/internals/Kafka08Fetcher.java
Kafka08Fetcher.getInvalidOffsetBehavior
private static long getInvalidOffsetBehavior(Properties config) { final String val = config.getProperty(ConsumerConfig.AUTO_OFFSET_RESET_CONFIG, "largest"); if (val.equals("largest") || val.equals("latest")) { // largest is kafka 0.8, latest is kafka 0.9 return OffsetRequest.LatestTime(); } else { return OffsetRequest.EarliestTime(); } }
java
private static long getInvalidOffsetBehavior(Properties config) { final String val = config.getProperty(ConsumerConfig.AUTO_OFFSET_RESET_CONFIG, "largest"); if (val.equals("largest") || val.equals("latest")) { // largest is kafka 0.8, latest is kafka 0.9 return OffsetRequest.LatestTime(); } else { return OffsetRequest.EarliestTime(); } }
[ "private", "static", "long", "getInvalidOffsetBehavior", "(", "Properties", "config", ")", "{", "final", "String", "val", "=", "config", ".", "getProperty", "(", "ConsumerConfig", ".", "AUTO_OFFSET_RESET_CONFIG", ",", "\"largest\"", ")", ";", "if", "(", "val", "...
Retrieve the behaviour of "auto.offset.reset" from the config properties. A partition needs to fallback to "auto.offset.reset" as default offset when we can't find offsets in ZK to start from in {@link StartupMode#GROUP_OFFSETS} startup mode. @param config kafka consumer properties @return either OffsetRequest.LatestTime() or OffsetRequest.EarliestTime()
[ "Retrieve", "the", "behaviour", "of", "auto", ".", "offset", ".", "reset", "from", "the", "config", "properties", ".", "A", "partition", "needs", "to", "fallback", "to", "auto", ".", "offset", ".", "reset", "as", "default", "offset", "when", "we", "can", ...
b62db93bf63cb3bb34dd03d611a779d9e3fc61ac
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-connectors/flink-connector-kafka-0.8/src/main/java/org/apache/flink/streaming/connectors/kafka/internals/Kafka08Fetcher.java#L504-L511
train
Get invalid offset behavior.
[ 30522, 2797, 10763, 2146, 2131, 2378, 10175, 13820, 21807, 3388, 4783, 3270, 25500, 2099, 1006, 5144, 9530, 8873, 2290, 1007, 1063, 2345, 5164, 11748, 1027, 9530, 8873, 2290, 1012, 2131, 21572, 4842, 3723, 1006, 7325, 8663, 8873, 2290, 1012...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
apache/incubator-shardingsphere
sharding-jdbc/sharding-jdbc-orchestration/src/main/java/org/apache/shardingsphere/shardingjdbc/orchestration/api/yaml/YamlOrchestrationShardingDataSourceFactory.java
YamlOrchestrationShardingDataSourceFactory.createDataSource
public static DataSource createDataSource(final byte[] yamlBytes) throws SQLException, IOException { YamlOrchestrationShardingRuleConfiguration config = unmarshal(yamlBytes); return createDataSource(config.getDataSources(), config.getShardingRule(), config.getProps(), config.getOrchestration()); }
java
public static DataSource createDataSource(final byte[] yamlBytes) throws SQLException, IOException { YamlOrchestrationShardingRuleConfiguration config = unmarshal(yamlBytes); return createDataSource(config.getDataSources(), config.getShardingRule(), config.getProps(), config.getOrchestration()); }
[ "public", "static", "DataSource", "createDataSource", "(", "final", "byte", "[", "]", "yamlBytes", ")", "throws", "SQLException", ",", "IOException", "{", "YamlOrchestrationShardingRuleConfiguration", "config", "=", "unmarshal", "(", "yamlBytes", ")", ";", "return", ...
Create sharding data source. @param yamlBytes YAML bytes for rule configuration of databases and tables sharding with data sources @return sharding data source @throws SQLException SQL exception @throws IOException IO exception
[ "Create", "sharding", "data", "source", "." ]
f88fd29fc345dfb31fdce12e9e96cbfa0fd2402d
https://github.com/apache/incubator-shardingsphere/blob/f88fd29fc345dfb31fdce12e9e96cbfa0fd2402d/sharding-jdbc/sharding-jdbc-orchestration/src/main/java/org/apache/shardingsphere/shardingjdbc/orchestration/api/yaml/YamlOrchestrationShardingDataSourceFactory.java#L87-L90
train
Create a DataSource from a YAML byte array.
[ 30522, 2270, 10763, 2951, 6499, 3126, 3401, 2580, 6790, 6499, 3126, 3401, 1006, 2345, 24880, 1031, 1033, 8038, 19968, 3762, 4570, 1007, 11618, 29296, 10288, 24422, 1010, 22834, 10288, 24422, 1063, 8038, 19968, 2953, 8376, 6494, 9285, 11783, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -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/util/AWSUtil.java
AWSUtil.getCredentialsProvider
private static AWSCredentialsProvider getCredentialsProvider(final Properties configProps, final String configPrefix) { CredentialProvider credentialProviderType; if (!configProps.containsKey(configPrefix)) { if (configProps.containsKey(AWSConfigConstants.accessKeyId(configPrefix)) && configProps.containsKey(AWSConfigConstants.secretKey(configPrefix))) { // if the credential provider type is not specified, but the Access Key ID and Secret Key are given, it will default to BASIC credentialProviderType = CredentialProvider.BASIC; } else { // if the credential provider type is not specified, it will default to AUTO credentialProviderType = CredentialProvider.AUTO; } } else { credentialProviderType = CredentialProvider.valueOf(configProps.getProperty(configPrefix)); } switch (credentialProviderType) { case ENV_VAR: return new EnvironmentVariableCredentialsProvider(); case SYS_PROP: return new SystemPropertiesCredentialsProvider(); case PROFILE: String profileName = configProps.getProperty( AWSConfigConstants.profileName(configPrefix), null); String profileConfigPath = configProps.getProperty( AWSConfigConstants.profilePath(configPrefix), null); return (profileConfigPath == null) ? new ProfileCredentialsProvider(profileName) : new ProfileCredentialsProvider(profileConfigPath, profileName); case BASIC: return new AWSCredentialsProvider() { @Override public AWSCredentials getCredentials() { return new BasicAWSCredentials( configProps.getProperty(AWSConfigConstants.accessKeyId(configPrefix)), configProps.getProperty(AWSConfigConstants.secretKey(configPrefix))); } @Override public void refresh() { // do nothing } }; case ASSUME_ROLE: final AWSSecurityTokenService baseCredentials = AWSSecurityTokenServiceClientBuilder.standard() .withCredentials(getCredentialsProvider(configProps, AWSConfigConstants.roleCredentialsProvider(configPrefix))) .withRegion(configProps.getProperty(AWSConfigConstants.AWS_REGION)) .build(); return new STSAssumeRoleSessionCredentialsProvider.Builder( configProps.getProperty(AWSConfigConstants.roleArn(configPrefix)), configProps.getProperty(AWSConfigConstants.roleSessionName(configPrefix))) .withExternalId(configProps.getProperty(AWSConfigConstants.externalId(configPrefix))) .withStsClient(baseCredentials) .build(); default: case AUTO: return new DefaultAWSCredentialsProviderChain(); } }
java
private static AWSCredentialsProvider getCredentialsProvider(final Properties configProps, final String configPrefix) { CredentialProvider credentialProviderType; if (!configProps.containsKey(configPrefix)) { if (configProps.containsKey(AWSConfigConstants.accessKeyId(configPrefix)) && configProps.containsKey(AWSConfigConstants.secretKey(configPrefix))) { // if the credential provider type is not specified, but the Access Key ID and Secret Key are given, it will default to BASIC credentialProviderType = CredentialProvider.BASIC; } else { // if the credential provider type is not specified, it will default to AUTO credentialProviderType = CredentialProvider.AUTO; } } else { credentialProviderType = CredentialProvider.valueOf(configProps.getProperty(configPrefix)); } switch (credentialProviderType) { case ENV_VAR: return new EnvironmentVariableCredentialsProvider(); case SYS_PROP: return new SystemPropertiesCredentialsProvider(); case PROFILE: String profileName = configProps.getProperty( AWSConfigConstants.profileName(configPrefix), null); String profileConfigPath = configProps.getProperty( AWSConfigConstants.profilePath(configPrefix), null); return (profileConfigPath == null) ? new ProfileCredentialsProvider(profileName) : new ProfileCredentialsProvider(profileConfigPath, profileName); case BASIC: return new AWSCredentialsProvider() { @Override public AWSCredentials getCredentials() { return new BasicAWSCredentials( configProps.getProperty(AWSConfigConstants.accessKeyId(configPrefix)), configProps.getProperty(AWSConfigConstants.secretKey(configPrefix))); } @Override public void refresh() { // do nothing } }; case ASSUME_ROLE: final AWSSecurityTokenService baseCredentials = AWSSecurityTokenServiceClientBuilder.standard() .withCredentials(getCredentialsProvider(configProps, AWSConfigConstants.roleCredentialsProvider(configPrefix))) .withRegion(configProps.getProperty(AWSConfigConstants.AWS_REGION)) .build(); return new STSAssumeRoleSessionCredentialsProvider.Builder( configProps.getProperty(AWSConfigConstants.roleArn(configPrefix)), configProps.getProperty(AWSConfigConstants.roleSessionName(configPrefix))) .withExternalId(configProps.getProperty(AWSConfigConstants.externalId(configPrefix))) .withStsClient(baseCredentials) .build(); default: case AUTO: return new DefaultAWSCredentialsProviderChain(); } }
[ "private", "static", "AWSCredentialsProvider", "getCredentialsProvider", "(", "final", "Properties", "configProps", ",", "final", "String", "configPrefix", ")", "{", "CredentialProvider", "credentialProviderType", ";", "if", "(", "!", "configProps", ".", "containsKey", ...
If the provider is ASSUME_ROLE, then the credentials for assuming this role are determined recursively. @param configProps the configuration properties @param configPrefix the prefix of the config properties for this credentials provider, e.g. aws.credentials.provider for the base credentials provider, aws.credentials.provider.role.provider for the credentials provider for assuming a role, and so on.
[ "If", "the", "provider", "is", "ASSUME_ROLE", "then", "the", "credentials", "for", "assuming", "this", "role", "are", "determined", "recursively", "." ]
b62db93bf63cb3bb34dd03d611a779d9e3fc61ac
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-connectors/flink-connector-kinesis/src/main/java/org/apache/flink/streaming/connectors/kinesis/util/AWSUtil.java#L118-L180
train
Gets the credential provider.
[ 30522, 2797, 10763, 22091, 11020, 5596, 24271, 13102, 12298, 18688, 2131, 16748, 16454, 26340, 21572, 17258, 2121, 1006, 2345, 5144, 9530, 8873, 21600, 18981, 2015, 1010, 2345, 5164, 9530, 8873, 21600, 2890, 8873, 2595, 1007, 1063, 13675, 147...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -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/KafkaTableSourceSinkFactoryBase.java
KafkaTableSourceSinkFactoryBase.getValidatedProperties
private DescriptorProperties getValidatedProperties(Map<String, String> properties) { final DescriptorProperties descriptorProperties = new DescriptorProperties(true); descriptorProperties.putProperties(properties); // allow Kafka timestamps to be used, watermarks can not be received from source new SchemaValidator(true, supportsKafkaTimestamps(), false).validate(descriptorProperties); new KafkaValidator().validate(descriptorProperties); return descriptorProperties; }
java
private DescriptorProperties getValidatedProperties(Map<String, String> properties) { final DescriptorProperties descriptorProperties = new DescriptorProperties(true); descriptorProperties.putProperties(properties); // allow Kafka timestamps to be used, watermarks can not be received from source new SchemaValidator(true, supportsKafkaTimestamps(), false).validate(descriptorProperties); new KafkaValidator().validate(descriptorProperties); return descriptorProperties; }
[ "private", "DescriptorProperties", "getValidatedProperties", "(", "Map", "<", "String", ",", "String", ">", "properties", ")", "{", "final", "DescriptorProperties", "descriptorProperties", "=", "new", "DescriptorProperties", "(", "true", ")", ";", "descriptorProperties"...
--------------------------------------------------------------------------------------------
[ "--------------------------------------------------------------------------------------------" ]
b62db93bf63cb3bb34dd03d611a779d9e3fc61ac
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-connectors/flink-connector-kafka-base/src/main/java/org/apache/flink/streaming/connectors/kafka/KafkaTableSourceSinkFactoryBase.java#L246-L255
train
Validate the given properties.
[ 30522, 2797, 4078, 23235, 2953, 21572, 4842, 7368, 2131, 10175, 8524, 3064, 21572, 4842, 7368, 1006, 4949, 1026, 5164, 1010, 5164, 1028, 5144, 1007, 1063, 2345, 4078, 23235, 2953, 21572, 4842, 7368, 4078, 23235, 2953, 21572, 4842, 7368, 102...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
apache/flink
flink-runtime/src/main/java/org/apache/flink/runtime/memory/AbstractPagedInputView.java
AbstractPagedInputView.seekInput
protected void seekInput(MemorySegment segment, int positionInSegment, int limitInSegment) { this.currentSegment = segment; this.positionInSegment = positionInSegment; this.limitInSegment = limitInSegment; }
java
protected void seekInput(MemorySegment segment, int positionInSegment, int limitInSegment) { this.currentSegment = segment; this.positionInSegment = positionInSegment; this.limitInSegment = limitInSegment; }
[ "protected", "void", "seekInput", "(", "MemorySegment", "segment", ",", "int", "positionInSegment", ",", "int", "limitInSegment", ")", "{", "this", ".", "currentSegment", "=", "segment", ";", "this", ".", "positionInSegment", "=", "positionInSegment", ";", "this",...
Sets the internal state of the view such that the next bytes will be read from the given memory segment, starting at the given position. The memory segment will provide bytes up to the given limit position. @param segment The segment to read the next bytes from. @param positionInSegment The position in the segment to start reading from. @param limitInSegment The limit in the segment. When reached, the view will attempt to switch to the next segment.
[ "Sets", "the", "internal", "state", "of", "the", "view", "such", "that", "the", "next", "bytes", "will", "be", "read", "from", "the", "given", "memory", "segment", "starting", "at", "the", "given", "position", ".", "The", "memory", "segment", "will", "prov...
b62db93bf63cb3bb34dd03d611a779d9e3fc61ac
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/memory/AbstractPagedInputView.java#L183-L187
train
Seeks the input memory segment to the given position.
[ 30522, 5123, 11675, 6148, 2378, 18780, 1006, 3638, 3366, 21693, 4765, 6903, 1010, 20014, 2597, 7076, 13910, 3672, 1010, 20014, 5787, 7076, 13910, 3672, 1007, 1063, 2023, 1012, 14731, 13910, 3672, 1027, 6903, 1025, 2023, 1012, 2597, 7076, 13...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
apache/flink
flink-yarn/src/main/java/org/apache/flink/yarn/AbstractYarnClusterDescriptor.java
AbstractYarnClusterDescriptor.getYarnFilesDir
private Path getYarnFilesDir(final ApplicationId appId) throws IOException { final FileSystem fileSystem = FileSystem.get(yarnConfiguration); final Path homeDir = fileSystem.getHomeDirectory(); return new Path(homeDir, ".flink/" + appId + '/'); }
java
private Path getYarnFilesDir(final ApplicationId appId) throws IOException { final FileSystem fileSystem = FileSystem.get(yarnConfiguration); final Path homeDir = fileSystem.getHomeDirectory(); return new Path(homeDir, ".flink/" + appId + '/'); }
[ "private", "Path", "getYarnFilesDir", "(", "final", "ApplicationId", "appId", ")", "throws", "IOException", "{", "final", "FileSystem", "fileSystem", "=", "FileSystem", ".", "get", "(", "yarnConfiguration", ")", ";", "final", "Path", "homeDir", "=", "fileSystem", ...
Returns the Path where the YARN application files should be uploaded to. @param appId YARN application id
[ "Returns", "the", "Path", "where", "the", "YARN", "application", "files", "should", "be", "uploaded", "to", "." ]
b62db93bf63cb3bb34dd03d611a779d9e3fc61ac
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-yarn/src/main/java/org/apache/flink/yarn/AbstractYarnClusterDescriptor.java#L1059-L1063
train
Gets the YARN files directory.
[ 30522, 2797, 4130, 2131, 13380, 2078, 8873, 4244, 4305, 2099, 1006, 2345, 4646, 3593, 10439, 3593, 1007, 11618, 22834, 10288, 24422, 1063, 2345, 6764, 27268, 6633, 6764, 27268, 6633, 1027, 6764, 27268, 6633, 1012, 2131, 1006, 27158, 8663, 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...
looly/hutool
hutool-core/src/main/java/cn/hutool/core/builder/HashCodeBuilder.java
HashCodeBuilder.reflectionHashCode
public static int reflectionHashCode(final Object object, final boolean testTransients) { return reflectionHashCode(DEFAULT_INITIAL_VALUE, DEFAULT_MULTIPLIER_VALUE, object, testTransients, null); }
java
public static int reflectionHashCode(final Object object, final boolean testTransients) { return reflectionHashCode(DEFAULT_INITIAL_VALUE, DEFAULT_MULTIPLIER_VALUE, object, testTransients, null); }
[ "public", "static", "int", "reflectionHashCode", "(", "final", "Object", "object", ",", "final", "boolean", "testTransients", ")", "{", "return", "reflectionHashCode", "(", "DEFAULT_INITIAL_VALUE", ",", "DEFAULT_MULTIPLIER_VALUE", ",", "object", ",", "testTransients", ...
<p> Uses reflection to build a valid hash code from the fields of {@code object}. </p> <p> This constructor uses two hard coded choices for the constants needed to build a hash code. </p> <p> It uses <code>AccessibleObject.setAccessible</code> to gain access to private fields. This means that it will throw a security exception if run under a security manager, if the permissions are not set up correctly. It is also not as efficient as testing explicitly. </p> <P> If the TestTransients parameter is set to <code>true</code>, transient members will be tested, otherwise they are ignored, as they are likely derived fields, and not part of the value of the <code>Object</code>. </p> <p> Static fields will not be tested. Superclass fields will be included. If no fields are found to include in the hash code, the result of this method will be constant. </p> @param object the Object to create a <code>hashCode</code> for @param testTransients whether to include transient fields @return int hash code @throws IllegalArgumentException if the object is <code>null</code>
[ "<p", ">", "Uses", "reflection", "to", "build", "a", "valid", "hash", "code", "from", "the", "fields", "of", "{", "@code", "object", "}", ".", "<", "/", "p", ">" ]
bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a
https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/builder/HashCodeBuilder.java#L380-L383
train
Get the hashCode of the given object.
[ 30522, 2270, 10763, 20014, 9185, 14949, 16257, 10244, 1006, 2345, 4874, 4874, 1010, 2345, 22017, 20898, 3231, 6494, 3619, 11638, 2015, 1007, 1063, 2709, 9185, 14949, 16257, 10244, 1006, 12398, 1035, 3988, 1035, 3643, 1010, 12398, 1035, 4800, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
alibaba/canal
client-adapter/rdb/src/main/java/com/alibaba/otter/canal/client/adapter/rdb/service/RdbSyncService.java
RdbSyncService.pkHash
public int pkHash(DbMapping dbMapping, Map<String, Object> d) { return pkHash(dbMapping, d, null); }
java
public int pkHash(DbMapping dbMapping, Map<String, Object> d) { return pkHash(dbMapping, d, null); }
[ "public", "int", "pkHash", "(", "DbMapping", "dbMapping", ",", "Map", "<", "String", ",", "Object", ">", "d", ")", "{", "return", "pkHash", "(", "dbMapping", ",", "d", ",", "null", ")", ";", "}" ]
取主键hash
[ "取主键hash" ]
8f088cddc0755f4350c5aaae95c6e4002d90a40f
https://github.com/alibaba/canal/blob/8f088cddc0755f4350c5aaae95c6e4002d90a40f/client-adapter/rdb/src/main/java/com/alibaba/otter/canal/client/adapter/rdb/service/RdbSyncService.java#L475-L477
train
Returns the primary key hash for the given mapping.
[ 30522, 2270, 20014, 1052, 15256, 4095, 1006, 16962, 2863, 14853, 16962, 2863, 14853, 1010, 4949, 1026, 5164, 1010, 4874, 1028, 1040, 1007, 1063, 2709, 1052, 15256, 4095, 1006, 16962, 2863, 14853, 1010, 1040, 1010, 19701, 1007, 1025, 1065, 1...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
hankcs/HanLP
src/main/java/com/hankcs/hanlp/dictionary/common/CommonDictionary.java
CommonDictionary.saveDat
protected boolean saveDat(String path, List<V> valueArray) { try { DataOutputStream out = new DataOutputStream(new BufferedOutputStream(IOUtil.newOutputStream(path))); out.writeInt(valueArray.size()); for (V item : valueArray) { saveValue(item, out); } trie.save(out); out.close(); } catch (Exception e) { logger.warning("保存失败" + TextUtility.exceptionToString(e)); return false; } return true; }
java
protected boolean saveDat(String path, List<V> valueArray) { try { DataOutputStream out = new DataOutputStream(new BufferedOutputStream(IOUtil.newOutputStream(path))); out.writeInt(valueArray.size()); for (V item : valueArray) { saveValue(item, out); } trie.save(out); out.close(); } catch (Exception e) { logger.warning("保存失败" + TextUtility.exceptionToString(e)); return false; } return true; }
[ "protected", "boolean", "saveDat", "(", "String", "path", ",", "List", "<", "V", ">", "valueArray", ")", "{", "try", "{", "DataOutputStream", "out", "=", "new", "DataOutputStream", "(", "new", "BufferedOutputStream", "(", "IOUtil", ".", "newOutputStream", "(",...
保存dat到路径 @param path @param valueArray @return
[ "保存dat到路径" ]
a538d0722ab2e4980a9dcd9ea40324fc3ddba7ce
https://github.com/hankcs/HanLP/blob/a538d0722ab2e4980a9dcd9ea40324fc3ddba7ce/src/main/java/com/hankcs/hanlp/dictionary/common/CommonDictionary.java#L116-L135
train
Save a dat file.
[ 30522, 5123, 22017, 20898, 5552, 4017, 1006, 5164, 4130, 1010, 2862, 1026, 1058, 1028, 3643, 2906, 9447, 1007, 1063, 3046, 1063, 2951, 5833, 18780, 21422, 2041, 1027, 2047, 2951, 5833, 18780, 21422, 1006, 2047, 17698, 26010, 4904, 18780, 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...
netty/netty
handler/src/main/java/io/netty/handler/ssl/SslHandler.java
SslHandler.wrap
private void wrap(ChannelHandlerContext ctx, boolean inUnwrap) throws SSLException { ByteBuf out = null; ChannelPromise promise = null; ByteBufAllocator alloc = ctx.alloc(); boolean needUnwrap = false; ByteBuf buf = null; try { final int wrapDataSize = this.wrapDataSize; // Only continue to loop if the handler was not removed in the meantime. // See https://github.com/netty/netty/issues/5860 outer: while (!ctx.isRemoved()) { promise = ctx.newPromise(); buf = wrapDataSize > 0 ? pendingUnencryptedWrites.remove(alloc, wrapDataSize, promise) : pendingUnencryptedWrites.removeFirst(promise); if (buf == null) { break; } if (out == null) { out = allocateOutNetBuf(ctx, buf.readableBytes(), buf.nioBufferCount()); } SSLEngineResult result = wrap(alloc, engine, buf, out); if (result.getStatus() == Status.CLOSED) { buf.release(); buf = null; promise.tryFailure(SSLENGINE_CLOSED); promise = null; // SSLEngine has been closed already. // Any further write attempts should be denied. pendingUnencryptedWrites.releaseAndFailAll(ctx, SSLENGINE_CLOSED); return; } else { if (buf.isReadable()) { pendingUnencryptedWrites.addFirst(buf, promise); // When we add the buffer/promise pair back we need to be sure we don't complete the promise // later in finishWrap. We only complete the promise if the buffer is completely consumed. promise = null; } else { buf.release(); } buf = null; switch (result.getHandshakeStatus()) { case NEED_TASK: if (!runDelegatedTasks(inUnwrap)) { // We scheduled a task on the delegatingTaskExecutor, so stop processing as we will // resume once the task completes. break outer; } break; case FINISHED: setHandshakeSuccess(); // deliberate fall-through case NOT_HANDSHAKING: setHandshakeSuccessIfStillHandshaking(); // deliberate fall-through case NEED_WRAP: finishWrap(ctx, out, promise, inUnwrap, false); promise = null; out = null; break; case NEED_UNWRAP: needUnwrap = true; return; default: throw new IllegalStateException( "Unknown handshake status: " + result.getHandshakeStatus()); } } } } finally { // Ownership of buffer was not transferred, release it. if (buf != null) { buf.release(); } finishWrap(ctx, out, promise, inUnwrap, needUnwrap); } }
java
private void wrap(ChannelHandlerContext ctx, boolean inUnwrap) throws SSLException { ByteBuf out = null; ChannelPromise promise = null; ByteBufAllocator alloc = ctx.alloc(); boolean needUnwrap = false; ByteBuf buf = null; try { final int wrapDataSize = this.wrapDataSize; // Only continue to loop if the handler was not removed in the meantime. // See https://github.com/netty/netty/issues/5860 outer: while (!ctx.isRemoved()) { promise = ctx.newPromise(); buf = wrapDataSize > 0 ? pendingUnencryptedWrites.remove(alloc, wrapDataSize, promise) : pendingUnencryptedWrites.removeFirst(promise); if (buf == null) { break; } if (out == null) { out = allocateOutNetBuf(ctx, buf.readableBytes(), buf.nioBufferCount()); } SSLEngineResult result = wrap(alloc, engine, buf, out); if (result.getStatus() == Status.CLOSED) { buf.release(); buf = null; promise.tryFailure(SSLENGINE_CLOSED); promise = null; // SSLEngine has been closed already. // Any further write attempts should be denied. pendingUnencryptedWrites.releaseAndFailAll(ctx, SSLENGINE_CLOSED); return; } else { if (buf.isReadable()) { pendingUnencryptedWrites.addFirst(buf, promise); // When we add the buffer/promise pair back we need to be sure we don't complete the promise // later in finishWrap. We only complete the promise if the buffer is completely consumed. promise = null; } else { buf.release(); } buf = null; switch (result.getHandshakeStatus()) { case NEED_TASK: if (!runDelegatedTasks(inUnwrap)) { // We scheduled a task on the delegatingTaskExecutor, so stop processing as we will // resume once the task completes. break outer; } break; case FINISHED: setHandshakeSuccess(); // deliberate fall-through case NOT_HANDSHAKING: setHandshakeSuccessIfStillHandshaking(); // deliberate fall-through case NEED_WRAP: finishWrap(ctx, out, promise, inUnwrap, false); promise = null; out = null; break; case NEED_UNWRAP: needUnwrap = true; return; default: throw new IllegalStateException( "Unknown handshake status: " + result.getHandshakeStatus()); } } } } finally { // Ownership of buffer was not transferred, release it. if (buf != null) { buf.release(); } finishWrap(ctx, out, promise, inUnwrap, needUnwrap); } }
[ "private", "void", "wrap", "(", "ChannelHandlerContext", "ctx", ",", "boolean", "inUnwrap", ")", "throws", "SSLException", "{", "ByteBuf", "out", "=", "null", ";", "ChannelPromise", "promise", "=", "null", ";", "ByteBufAllocator", "alloc", "=", "ctx", ".", "al...
This method will not call setHandshakeFailure(...) !
[ "This", "method", "will", "not", "call", "setHandshakeFailure", "(", "...", ")", "!" ]
ba06eafa1c1824bd154f1a380019e7ea2edf3c4c
https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/handler/src/main/java/io/netty/handler/ssl/SslHandler.java#L819-L899
train
Wrap the handler.
[ 30522, 2797, 11675, 10236, 1006, 3149, 11774, 3917, 8663, 18209, 14931, 2595, 1010, 22017, 20898, 1999, 4609, 13088, 9331, 1007, 11618, 7020, 2571, 2595, 24422, 1063, 24880, 8569, 2546, 2041, 1027, 19701, 1025, 3149, 21572, 28732, 4872, 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...
netty/netty
codec/src/main/java/io/netty/handler/codec/HeadersUtils.java
HeadersUtils.getAllAsString
public static <K, V> List<String> getAllAsString(Headers<K, V, ?> headers, K name) { final List<V> allNames = headers.getAll(name); return new AbstractList<String>() { @Override public String get(int index) { V value = allNames.get(index); return value != null ? value.toString() : null; } @Override public int size() { return allNames.size(); } }; }
java
public static <K, V> List<String> getAllAsString(Headers<K, V, ?> headers, K name) { final List<V> allNames = headers.getAll(name); return new AbstractList<String>() { @Override public String get(int index) { V value = allNames.get(index); return value != null ? value.toString() : null; } @Override public int size() { return allNames.size(); } }; }
[ "public", "static", "<", "K", ",", "V", ">", "List", "<", "String", ">", "getAllAsString", "(", "Headers", "<", "K", ",", "V", ",", "?", ">", "headers", ",", "K", "name", ")", "{", "final", "List", "<", "V", ">", "allNames", "=", "headers", ".", ...
{@link Headers#get(Object)} and convert each element of {@link List} to a {@link String}. @param name the name of the header to retrieve @return a {@link List} of header values or an empty {@link List} if no values are found.
[ "{" ]
ba06eafa1c1824bd154f1a380019e7ea2edf3c4c
https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/codec/src/main/java/io/netty/handler/codec/HeadersUtils.java#L41-L55
train
Gets all String value from a Headers object.
[ 30522, 2270, 10763, 1026, 1047, 1010, 1058, 1028, 2862, 1026, 5164, 1028, 2131, 25425, 4757, 18886, 3070, 1006, 20346, 2015, 1026, 1047, 1010, 1058, 1010, 1029, 1028, 20346, 2015, 1010, 1047, 2171, 1007, 1063, 2345, 2862, 1026, 1058, 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-crypto/src/main/java/cn/hutool/crypto/asymmetric/RSA.java
RSA.encryptStr
@Deprecated public String encryptStr(String data, KeyType keyType, Charset charset) { return encryptBcd(data, keyType, charset); }
java
@Deprecated public String encryptStr(String data, KeyType keyType, Charset charset) { return encryptBcd(data, keyType, charset); }
[ "@", "Deprecated", "public", "String", "encryptStr", "(", "String", "data", ",", "KeyType", "keyType", ",", "Charset", "charset", ")", "{", "return", "encryptBcd", "(", "data", ",", "keyType", ",", "charset", ")", ";", "}" ]
分组加密 @param data 数据 @param keyType 密钥类型 @param charset 加密前编码 @return 加密后的密文 @throws CryptoException 加密异常 @since 3.1.1 @deprecated 请使用 {@link #encryptBcd(String, KeyType, Charset)}
[ "分组加密" ]
bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a
https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-crypto/src/main/java/cn/hutool/crypto/asymmetric/RSA.java#L143-L146
train
Encrypts a string using the specified key type and charset.
[ 30522, 1030, 2139, 28139, 12921, 2270, 5164, 4372, 26775, 22571, 3215, 16344, 30524, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
looly/hutool
hutool-core/src/main/java/cn/hutool/core/img/ImgUtil.java
ImgUtil.createFont
public static Font createFont(File fontFile) { try { return Font.createFont(Font.TRUETYPE_FONT, fontFile); } catch (FontFormatException e) { // True Type字体无效时使用Type1字体 try { return Font.createFont(Font.TYPE1_FONT, fontFile); } catch (Exception e1) { throw new UtilException(e); } } catch (IOException e) { throw new IORuntimeException(e); } }
java
public static Font createFont(File fontFile) { try { return Font.createFont(Font.TRUETYPE_FONT, fontFile); } catch (FontFormatException e) { // True Type字体无效时使用Type1字体 try { return Font.createFont(Font.TYPE1_FONT, fontFile); } catch (Exception e1) { throw new UtilException(e); } } catch (IOException e) { throw new IORuntimeException(e); } }
[ "public", "static", "Font", "createFont", "(", "File", "fontFile", ")", "{", "try", "{", "return", "Font", ".", "createFont", "(", "Font", ".", "TRUETYPE_FONT", ",", "fontFile", ")", ";", "}", "catch", "(", "FontFormatException", "e", ")", "{", "// True Ty...
根据文件创建字体<br> 首先尝试创建{@link Font#TRUETYPE_FONT}字体,此类字体无效则创建{@link Font#TYPE1_FONT} @param fontFile 字体文件 @return {@link Font} @since 3.0.9
[ "根据文件创建字体<br", ">", "首先尝试创建", "{", "@link", "Font#TRUETYPE_FONT", "}", "字体,此类字体无效则创建", "{", "@link", "Font#TYPE1_FONT", "}" ]
bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a
https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/img/ImgUtil.java#L1296-L1309
train
Creates a Font object from the specified font file.
[ 30522, 2270, 10763, 15489, 3443, 14876, 3372, 1006, 5371, 15489, 8873, 2571, 1007, 1063, 3046, 1063, 2709, 15489, 1012, 3443, 14876, 3372, 1006, 15489, 1012, 2995, 13874, 1035, 15489, 1010, 15489, 8873, 2571, 1007, 1025, 1065, 4608, 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...
apache/flink
flink-core/src/main/java/org/apache/flink/util/Preconditions.java
Preconditions.checkState
public static void checkState(boolean condition, @Nullable Object errorMessage) { if (!condition) { throw new IllegalStateException(String.valueOf(errorMessage)); } }
java
public static void checkState(boolean condition, @Nullable Object errorMessage) { if (!condition) { throw new IllegalStateException(String.valueOf(errorMessage)); } }
[ "public", "static", "void", "checkState", "(", "boolean", "condition", ",", "@", "Nullable", "Object", "errorMessage", ")", "{", "if", "(", "!", "condition", ")", "{", "throw", "new", "IllegalStateException", "(", "String", ".", "valueOf", "(", "errorMessage",...
Checks the given boolean condition, and throws an {@code IllegalStateException} if the condition is not met (evaluates to {@code false}). The exception will have the given error message. @param condition The condition to check @param errorMessage The message for the {@code IllegalStateException} that is thrown if the check fails. @throws IllegalStateException Thrown, if the condition is violated.
[ "Checks", "the", "given", "boolean", "condition", "and", "throws", "an", "{", "@code", "IllegalStateException", "}", "if", "the", "condition", "is", "not", "met", "(", "evaluates", "to", "{", "@code", "false", "}", ")", ".", "The", "exception", "will", "ha...
b62db93bf63cb3bb34dd03d611a779d9e3fc61ac
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-core/src/main/java/org/apache/flink/util/Preconditions.java#L193-L197
train
Check if condition is true.
[ 30522, 2270, 10763, 11675, 14148, 12259, 1006, 22017, 20898, 4650, 1010, 1030, 19701, 3085, 4874, 7561, 7834, 3736, 3351, 1007, 1063, 2065, 1006, 999, 4650, 1007, 1063, 5466, 2047, 6206, 9153, 17389, 2595, 24422, 1006, 5164, 1012, 3643, 112...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -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/health/HealthStatusHttpMapper.java
HealthStatusHttpMapper.setStatusMapping
public void setStatusMapping(Map<String, Integer> statusMapping) { Assert.notNull(statusMapping, "StatusMapping must not be null"); this.statusMapping = new HashMap<>(statusMapping); }
java
public void setStatusMapping(Map<String, Integer> statusMapping) { Assert.notNull(statusMapping, "StatusMapping must not be null"); this.statusMapping = new HashMap<>(statusMapping); }
[ "public", "void", "setStatusMapping", "(", "Map", "<", "String", ",", "Integer", ">", "statusMapping", ")", "{", "Assert", ".", "notNull", "(", "statusMapping", ",", "\"StatusMapping must not be null\"", ")", ";", "this", ".", "statusMapping", "=", "new", "HashM...
Set specific status mappings. @param statusMapping a map of health status code to HTTP status code
[ "Set", "specific", "status", "mappings", "." ]
0b27f7c70e164b2b1a96477f1d9c1acba56790c1
https://github.com/spring-projects/spring-boot/blob/0b27f7c70e164b2b1a96477f1d9c1acba56790c1/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/health/HealthStatusHttpMapper.java#L53-L56
train
Sets the status mapping.
[ 30522, 2270, 11675, 4520, 29336, 2271, 2863, 14853, 1006, 4949, 1026, 5164, 1010, 16109, 1028, 3570, 2863, 14853, 1007, 1063, 20865, 1012, 2025, 11231, 3363, 1006, 3570, 2863, 14853, 1010, 1000, 3570, 2863, 14853, 2442, 2025, 2022, 19701, 1...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
netty/netty
codec-http/src/main/java/io/netty/handler/codec/http/multipart/HttpPostMultipartRequestDecoder.java
HttpPostMultipartRequestDecoder.readLineStandard
private static String readLineStandard(ByteBuf undecodedChunk, Charset charset) { int readerIndex = undecodedChunk.readerIndex(); try { ByteBuf line = buffer(64); while (undecodedChunk.isReadable()) { byte nextByte = undecodedChunk.readByte(); if (nextByte == HttpConstants.CR) { // check but do not changed readerIndex nextByte = undecodedChunk.getByte(undecodedChunk.readerIndex()); if (nextByte == HttpConstants.LF) { // force read undecodedChunk.readByte(); return line.toString(charset); } else { // Write CR (not followed by LF) line.writeByte(HttpConstants.CR); } } else if (nextByte == HttpConstants.LF) { return line.toString(charset); } else { line.writeByte(nextByte); } } } catch (IndexOutOfBoundsException e) { undecodedChunk.readerIndex(readerIndex); throw new NotEnoughDataDecoderException(e); } undecodedChunk.readerIndex(readerIndex); throw new NotEnoughDataDecoderException(); }
java
private static String readLineStandard(ByteBuf undecodedChunk, Charset charset) { int readerIndex = undecodedChunk.readerIndex(); try { ByteBuf line = buffer(64); while (undecodedChunk.isReadable()) { byte nextByte = undecodedChunk.readByte(); if (nextByte == HttpConstants.CR) { // check but do not changed readerIndex nextByte = undecodedChunk.getByte(undecodedChunk.readerIndex()); if (nextByte == HttpConstants.LF) { // force read undecodedChunk.readByte(); return line.toString(charset); } else { // Write CR (not followed by LF) line.writeByte(HttpConstants.CR); } } else if (nextByte == HttpConstants.LF) { return line.toString(charset); } else { line.writeByte(nextByte); } } } catch (IndexOutOfBoundsException e) { undecodedChunk.readerIndex(readerIndex); throw new NotEnoughDataDecoderException(e); } undecodedChunk.readerIndex(readerIndex); throw new NotEnoughDataDecoderException(); }
[ "private", "static", "String", "readLineStandard", "(", "ByteBuf", "undecodedChunk", ",", "Charset", "charset", ")", "{", "int", "readerIndex", "=", "undecodedChunk", ".", "readerIndex", "(", ")", ";", "try", "{", "ByteBuf", "line", "=", "buffer", "(", "64", ...
Read one line up to the CRLF or LF @return the String from one line @throws NotEnoughDataDecoderException Need more chunks and reset the {@code readerIndex} to the previous value
[ "Read", "one", "line", "up", "to", "the", "CRLF", "or", "LF" ]
ba06eafa1c1824bd154f1a380019e7ea2edf3c4c
https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/codec-http/src/main/java/io/netty/handler/codec/http/multipart/HttpPostMultipartRequestDecoder.java#L991-L1021
train
Read a single line from the given byte buffer.
[ 30522, 2797, 10763, 5164, 3191, 12735, 5794, 7662, 2094, 1006, 24880, 8569, 2546, 6151, 8586, 10244, 16409, 17157, 2243, 1010, 25869, 13462, 25869, 13462, 1007, 1063, 20014, 8068, 22254, 10288, 1027, 6151, 8586, 10244, 16409, 17157, 2243, 101...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
apache/flink
flink-runtime/src/main/java/org/apache/flink/runtime/executiongraph/restart/FixedDelayRestartStrategy.java
FixedDelayRestartStrategy.createFactory
public static FixedDelayRestartStrategyFactory createFactory(Configuration configuration) throws Exception { int maxAttempts = configuration.getInteger(ConfigConstants.RESTART_STRATEGY_FIXED_DELAY_ATTEMPTS, 1); String delayString = configuration.getString(ConfigConstants.RESTART_STRATEGY_FIXED_DELAY_DELAY); long delay; try { delay = Duration.apply(delayString).toMillis(); } catch (NumberFormatException nfe) { throw new Exception("Invalid config value for " + ConfigConstants.RESTART_STRATEGY_FIXED_DELAY_DELAY + ": " + delayString + ". Value must be a valid duration (such as '100 milli' or '10 s')"); } return new FixedDelayRestartStrategyFactory(maxAttempts, delay); }
java
public static FixedDelayRestartStrategyFactory createFactory(Configuration configuration) throws Exception { int maxAttempts = configuration.getInteger(ConfigConstants.RESTART_STRATEGY_FIXED_DELAY_ATTEMPTS, 1); String delayString = configuration.getString(ConfigConstants.RESTART_STRATEGY_FIXED_DELAY_DELAY); long delay; try { delay = Duration.apply(delayString).toMillis(); } catch (NumberFormatException nfe) { throw new Exception("Invalid config value for " + ConfigConstants.RESTART_STRATEGY_FIXED_DELAY_DELAY + ": " + delayString + ". Value must be a valid duration (such as '100 milli' or '10 s')"); } return new FixedDelayRestartStrategyFactory(maxAttempts, delay); }
[ "public", "static", "FixedDelayRestartStrategyFactory", "createFactory", "(", "Configuration", "configuration", ")", "throws", "Exception", "{", "int", "maxAttempts", "=", "configuration", ".", "getInteger", "(", "ConfigConstants", ".", "RESTART_STRATEGY_FIXED_DELAY_ATTEMPTS"...
Creates a FixedDelayRestartStrategy from the given Configuration. @param configuration Configuration containing the parameter values for the restart strategy @return Initialized instance of FixedDelayRestartStrategy @throws Exception
[ "Creates", "a", "FixedDelayRestartStrategy", "from", "the", "given", "Configuration", "." ]
b62db93bf63cb3bb34dd03d611a779d9e3fc61ac
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/executiongraph/restart/FixedDelayRestartStrategy.java#L75-L91
train
Creates a factory for the fixed delay restart strategy.
[ 30522, 2270, 10763, 4964, 9247, 4710, 28533, 20591, 6494, 2618, 6292, 21450, 3443, 21450, 1006, 9563, 9563, 1007, 11618, 6453, 1063, 20014, 4098, 19321, 6633, 22798, 1027, 9563, 1012, 2131, 18447, 26320, 1006, 9530, 8873, 18195, 5644, 5794, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -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/old/lexer/LexerEngine.java
LexerEngine.getDatabaseType
public DatabaseType getDatabaseType() { if (lexer instanceof H2Lexer) { return DatabaseType.H2; } if (lexer instanceof MySQLLexer) { return DatabaseType.MySQL; } if (lexer instanceof OracleLexer) { return DatabaseType.Oracle; } if (lexer instanceof SQLServerLexer) { return DatabaseType.SQLServer; } if (lexer instanceof PostgreSQLLexer) { return DatabaseType.PostgreSQL; } throw new UnsupportedOperationException(String.format("Cannot support lexer class: %s", lexer.getClass().getCanonicalName())); }
java
public DatabaseType getDatabaseType() { if (lexer instanceof H2Lexer) { return DatabaseType.H2; } if (lexer instanceof MySQLLexer) { return DatabaseType.MySQL; } if (lexer instanceof OracleLexer) { return DatabaseType.Oracle; } if (lexer instanceof SQLServerLexer) { return DatabaseType.SQLServer; } if (lexer instanceof PostgreSQLLexer) { return DatabaseType.PostgreSQL; } throw new UnsupportedOperationException(String.format("Cannot support lexer class: %s", lexer.getClass().getCanonicalName())); }
[ "public", "DatabaseType", "getDatabaseType", "(", ")", "{", "if", "(", "lexer", "instanceof", "H2Lexer", ")", "{", "return", "DatabaseType", ".", "H2", ";", "}", "if", "(", "lexer", "instanceof", "MySQLLexer", ")", "{", "return", "DatabaseType", ".", "MySQL"...
Get database type. @return database type
[ "Get", "database", "type", "." ]
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/old/lexer/LexerEngine.java#L208-L225
train
Get the database type of the lexer.
[ 30522, 2270, 7809, 13874, 2131, 2850, 2696, 15058, 13874, 1006, 1007, 1063, 2065, 1006, 17244, 2121, 6013, 11253, 1044, 2475, 2571, 2595, 2121, 1007, 1063, 2709, 7809, 13874, 1012, 1044, 2475, 1025, 1065, 2065, 1006, 17244, 2121, 6013, 1125...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -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.getChar
public static Character getChar(Map<?, ?> map, Object key) { return get(map, key, Character.class); }
java
public static Character getChar(Map<?, ?> map, Object key) { return get(map, key, Character.class); }
[ "public", "static", "Character", "getChar", "(", "Map", "<", "?", ",", "?", ">", "map", ",", "Object", "key", ")", "{", "return", "get", "(", "map", ",", "key", ",", "Character", ".", "class", ")", ";", "}" ]
获取Map指定key的值,并转换为Character @param map Map @param key 键 @return 值 @since 4.0.6
[ "获取Map指定key的值,并转换为Character" ]
bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a
https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/map/MapUtil.java#L828-L830
train
Gets the Character object from the map.
[ 30522, 2270, 10763, 2839, 2131, 7507, 2099, 1006, 4949, 1026, 1029, 1010, 1029, 1028, 4949, 1010, 4874, 3145, 1007, 1063, 2709, 2131, 1006, 4949, 1010, 3145, 1010, 2839, 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, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -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/ExcelReader.java
ExcelReader.read
@SuppressWarnings({ "rawtypes", "unchecked" }) public List<List<Object>> read(int startRowIndex, int endRowIndex) { checkNotClosed(); List<List<Object>> resultList = new ArrayList<>(); startRowIndex = Math.max(startRowIndex, this.sheet.getFirstRowNum());// 读取起始行(包含) endRowIndex = Math.min(endRowIndex, this.sheet.getLastRowNum());// 读取结束行(包含) boolean isFirstLine = true; List rowList; for (int i = startRowIndex; i <= endRowIndex; i++) { rowList = readRow(i); if (CollUtil.isNotEmpty(rowList) || false == ignoreEmptyRow) { if (null == rowList) { rowList = new ArrayList<>(0); } if (isFirstLine) { isFirstLine = false; if (MapUtil.isNotEmpty(this.headerAlias)) { rowList = aliasHeader(rowList); } } resultList.add(rowList); } } return resultList; }
java
@SuppressWarnings({ "rawtypes", "unchecked" }) public List<List<Object>> read(int startRowIndex, int endRowIndex) { checkNotClosed(); List<List<Object>> resultList = new ArrayList<>(); startRowIndex = Math.max(startRowIndex, this.sheet.getFirstRowNum());// 读取起始行(包含) endRowIndex = Math.min(endRowIndex, this.sheet.getLastRowNum());// 读取结束行(包含) boolean isFirstLine = true; List rowList; for (int i = startRowIndex; i <= endRowIndex; i++) { rowList = readRow(i); if (CollUtil.isNotEmpty(rowList) || false == ignoreEmptyRow) { if (null == rowList) { rowList = new ArrayList<>(0); } if (isFirstLine) { isFirstLine = false; if (MapUtil.isNotEmpty(this.headerAlias)) { rowList = aliasHeader(rowList); } } resultList.add(rowList); } } return resultList; }
[ "@", "SuppressWarnings", "(", "{", "\"rawtypes\"", ",", "\"unchecked\"", "}", ")", "public", "List", "<", "List", "<", "Object", ">", ">", "read", "(", "int", "startRowIndex", ",", "int", "endRowIndex", ")", "{", "checkNotClosed", "(", ")", ";", "List", ...
读取工作簿中指定的Sheet @param startRowIndex 起始行(包含,从0开始计数) @param endRowIndex 结束行(包含,从0开始计数) @return 行的集合,一行使用List表示
[ "读取工作簿中指定的Sheet" ]
bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a
https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-poi/src/main/java/cn/hutool/poi/excel/ExcelReader.java#L234-L259
train
Reads a range of records from the specified sheet.
[ 30522, 1030, 16081, 9028, 5582, 2015, 1006, 1063, 1000, 6315, 13874, 2015, 1000, 1010, 1000, 4895, 5403, 18141, 1000, 1065, 1007, 2270, 2862, 1026, 2862, 1026, 4874, 1028, 1028, 3191, 1006, 20014, 2707, 10524, 22254, 10288, 1010, 20014, 220...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -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/util/SQLUtil.java
SQLUtil.getExactlyValue
public static String getExactlyValue(final String value) { return null == value ? null : CharMatcher.anyOf("[]`'\"").removeFrom(value); }
java
public static String getExactlyValue(final String value) { return null == value ? null : CharMatcher.anyOf("[]`'\"").removeFrom(value); }
[ "public", "static", "String", "getExactlyValue", "(", "final", "String", "value", ")", "{", "return", "null", "==", "value", "?", "null", ":", "CharMatcher", ".", "anyOf", "(", "\"[]`'\\\"\"", ")", ".", "removeFrom", "(", "value", ")", ";", "}" ]
Get exactly value for SQL expression. <p>remove special char for SQL expression</p> @param value SQL expression @return exactly SQL expression
[ "Get", "exactly", "value", "for", "SQL", "expression", "." ]
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/util/SQLUtil.java#L44-L46
train
Get exact value.
[ 30522, 2270, 10763, 5164, 2131, 10288, 18908, 2135, 10175, 5657, 1006, 2345, 5164, 3643, 1007, 1063, 2709, 19701, 1027, 1027, 3643, 1029, 19701, 1024, 11084, 4017, 7474, 1012, 2151, 11253, 1006, 1000, 1031, 1033, 1036, 1005, 1032, 1000, 100...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
netty/netty
codec-http2/src/main/java/io/netty/handler/codec/http2/Http2Settings.java
Http2Settings.put
@Override public Long put(char key, Long value) { verifyStandardSetting(key, value); return super.put(key, value); }
java
@Override public Long put(char key, Long value) { verifyStandardSetting(key, value); return super.put(key, value); }
[ "@", "Override", "public", "Long", "put", "(", "char", "key", ",", "Long", "value", ")", "{", "verifyStandardSetting", "(", "key", ",", "value", ")", ";", "return", "super", ".", "put", "(", "key", ",", "value", ")", ";", "}" ]
Adds the given setting key/value pair. For standard settings defined by the HTTP/2 spec, performs validation on the values. @throws IllegalArgumentException if verification for a standard HTTP/2 setting fails.
[ "Adds", "the", "given", "setting", "key", "/", "value", "pair", ".", "For", "standard", "settings", "defined", "by", "the", "HTTP", "/", "2", "spec", "performs", "validation", "on", "the", "values", "." ]
ba06eafa1c1824bd154f1a380019e7ea2edf3c4c
https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/codec-http2/src/main/java/io/netty/handler/codec/http2/Http2Settings.java#L73-L77
train
Override put to verify the standard setting and put the value.
[ 30522, 1030, 2058, 15637, 2270, 2146, 2404, 1006, 25869, 3145, 1010, 2146, 3643, 1007, 1063, 20410, 21515, 18117, 18319, 3070, 1006, 3145, 1010, 3643, 1007, 1025, 2709, 3565, 1012, 2404, 1006, 3145, 1010, 3643, 1007, 1025, 1065, 102, 0, 0...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
apache/flink
flink-libraries/flink-cep/src/main/java/org/apache/flink/cep/pattern/Pattern.java
Pattern.followedByAny
public GroupPattern<T, F> followedByAny(Pattern<T, F> group) { return new GroupPattern<>(this, group, ConsumingStrategy.SKIP_TILL_ANY, afterMatchSkipStrategy); }
java
public GroupPattern<T, F> followedByAny(Pattern<T, F> group) { return new GroupPattern<>(this, group, ConsumingStrategy.SKIP_TILL_ANY, afterMatchSkipStrategy); }
[ "public", "GroupPattern", "<", "T", ",", "F", ">", "followedByAny", "(", "Pattern", "<", "T", ",", "F", ">", "group", ")", "{", "return", "new", "GroupPattern", "<>", "(", "this", ",", "group", ",", "ConsumingStrategy", ".", "SKIP_TILL_ANY", ",", "afterM...
Appends a new group pattern to the existing one. The new pattern enforces non-strict temporal contiguity. This means that a matching event of this pattern and the preceding matching event might be interleaved with other events which are ignored. @param group the pattern to append @return A new pattern which is appended to this one
[ "Appends", "a", "new", "group", "pattern", "to", "the", "existing", "one", ".", "The", "new", "pattern", "enforces", "non", "-", "strict", "temporal", "contiguity", ".", "This", "means", "that", "a", "matching", "event", "of", "this", "pattern", "and", "th...
b62db93bf63cb3bb34dd03d611a779d9e3fc61ac
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-libraries/flink-cep/src/main/java/org/apache/flink/cep/pattern/Pattern.java#L528-L530
train
Creates a new pattern that matches patterns followed by any of the given pattern.
[ 30522, 2270, 2177, 4502, 12079, 2078, 1026, 1056, 1010, 1042, 1028, 2628, 3762, 19092, 1006, 5418, 1026, 1056, 1010, 1042, 1028, 2177, 1007, 1063, 2709, 2047, 2177, 4502, 12079, 2078, 1026, 1028, 1006, 2023, 1010, 2177, 1010, 15077, 20528, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
looly/hutool
hutool-cache/src/main/java/cn/hutool/cache/impl/AbstractCache.java
AbstractCache.put
@Override public void put(K key, V object) { put(key, object, timeout); }
java
@Override public void put(K key, V object) { put(key, object, timeout); }
[ "@", "Override", "public", "void", "put", "(", "K", "key", ",", "V", "object", ")", "{", "put", "(", "key", ",", "object", ",", "timeout", ")", ";", "}" ]
---------------------------------------------------------------- put start
[ "----------------------------------------------------------------", "put", "start" ]
bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a
https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-cache/src/main/java/cn/hutool/cache/impl/AbstractCache.java#L47-L50
train
Override put to add a new object to the cache.
[ 30522, 1030, 2058, 15637, 2270, 11675, 2404, 1006, 1047, 3145, 1010, 1058, 4874, 1007, 1063, 2404, 1006, 3145, 1010, 4874, 1010, 2051, 5833, 1007, 1025, 1065, 102, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -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/CheckpointCoordinator.java
CheckpointCoordinator.triggerSynchronousSavepoint
public CompletableFuture<CompletedCheckpoint> triggerSynchronousSavepoint( final long timestamp, final boolean advanceToEndOfEventTime, @Nullable final String targetLocation) { final CheckpointProperties properties = CheckpointProperties.forSyncSavepoint(); return triggerSavepointInternal(timestamp, properties, advanceToEndOfEventTime, targetLocation); }
java
public CompletableFuture<CompletedCheckpoint> triggerSynchronousSavepoint( final long timestamp, final boolean advanceToEndOfEventTime, @Nullable final String targetLocation) { final CheckpointProperties properties = CheckpointProperties.forSyncSavepoint(); return triggerSavepointInternal(timestamp, properties, advanceToEndOfEventTime, targetLocation); }
[ "public", "CompletableFuture", "<", "CompletedCheckpoint", ">", "triggerSynchronousSavepoint", "(", "final", "long", "timestamp", ",", "final", "boolean", "advanceToEndOfEventTime", ",", "@", "Nullable", "final", "String", "targetLocation", ")", "{", "final", "Checkpoin...
Triggers a synchronous savepoint with the given savepoint directory as a target. @param timestamp The timestamp for the savepoint. @param advanceToEndOfEventTime Flag indicating if the source should inject a {@code MAX_WATERMARK} in the pipeline to fire any registered event-time timers. @param targetLocation Target location for the savepoint, optional. If null, the state backend's configured default will be used. @return A future to the completed checkpoint @throws IllegalStateException If no savepoint directory has been specified and no default savepoint directory has been configured
[ "Triggers", "a", "synchronous", "savepoint", "with", "the", "given", "savepoint", "directory", "as", "a", "target", "." ]
b62db93bf63cb3bb34dd03d611a779d9e3fc61ac
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/checkpoint/CheckpointCoordinator.java#L391-L398
train
Triggers a synchronous savepoint.
[ 30522, 2270, 4012, 10814, 10880, 11263, 11244, 1026, 2949, 5403, 3600, 8400, 1028, 27099, 6038, 2818, 4948, 3560, 3736, 3726, 8400, 1006, 2345, 2146, 2335, 15464, 2361, 1010, 2345, 22017, 20898, 5083, 3406, 10497, 11253, 18697, 3372, 7292, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -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-cli/src/main/java/org/springframework/boot/cli/command/CommandRunner.java
CommandRunner.findCommand
public Command findCommand(String name) { for (Command candidate : this.commands) { String candidateName = candidate.getName(); if (candidateName.equals(name) || (isOptionCommand(candidate) && ("--" + candidateName).equals(name))) { return candidate; } } return null; }
java
public Command findCommand(String name) { for (Command candidate : this.commands) { String candidateName = candidate.getName(); if (candidateName.equals(name) || (isOptionCommand(candidate) && ("--" + candidateName).equals(name))) { return candidate; } } return null; }
[ "public", "Command", "findCommand", "(", "String", "name", ")", "{", "for", "(", "Command", "candidate", ":", "this", ".", "commands", ")", "{", "String", "candidateName", "=", "candidate", ".", "getName", "(", ")", ";", "if", "(", "candidateName", ".", ...
Find a command by name. @param name the name of the command @return the command or {@code null} if not found
[ "Find", "a", "command", "by", "name", "." ]
0b27f7c70e164b2b1a96477f1d9c1acba56790c1
https://github.com/spring-projects/spring-boot/blob/0b27f7c70e164b2b1a96477f1d9c1acba56790c1/spring-boot-project/spring-boot-cli/src/main/java/org/springframework/boot/cli/command/CommandRunner.java#L148-L157
train
Find command by name.
[ 30522, 2270, 3094, 2424, 9006, 2386, 2094, 1006, 5164, 2171, 1007, 1063, 2005, 1006, 3094, 4018, 1024, 2023, 1012, 10954, 1007, 1063, 5164, 4018, 18442, 1027, 4018, 1012, 2131, 18442, 1006, 1007, 1025, 2065, 1006, 4018, 18442, 1012, 19635, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
looly/hutool
hutool-cron/src/main/java/cn/hutool/cron/pattern/matcher/ValueMatcherBuilder.java
ValueMatcherBuilder.parseRange
private static List<Integer> parseRange(String value, int step, ValueParser parser) { final List<Integer> results = new ArrayList<>(); // 全部匹配形式 if (value.length() <= 2) { //根据步进的第一个数字确定起始时间,类似于 12/3则从12(秒、分等)开始 int minValue = parser.getMin(); if(false == isMatchAllStr(value)) { minValue = Math.max(minValue, parser.parse(value)); }else { //在全匹配模式下,如果步进不存在,表示步进为1 if(step < 1) { step = 1; } } if(step > 0) { final int maxValue = parser.getMax(); if(minValue > maxValue) { throw new CronException("Invalid value {} > {}", minValue, maxValue); } //有步进 for (int i = minValue; i <= maxValue; i+=step) { results.add(i); } } else { //固定时间 results.add(minValue); } return results; } //Range模式 List<String> parts = StrUtil.split(value, '-'); int size = parts.size(); if (size == 1) {// 普通值 final int v1 = parser.parse(value); if(step > 0) {//类似 20/2的形式 NumberUtil.appendRange(v1, parser.getMax(), step, results); }else { results.add(v1); } } else if (size == 2) {// range值 final int v1 = parser.parse(parts.get(0)); final int v2 = parser.parse(parts.get(1)); if(step < 1) { //在range模式下,如果步进不存在,表示步进为1 step = 1; } if (v1 < v2) {// 正常范围,例如:2-5 NumberUtil.appendRange(v1, v2, step, results); } else if (v1 > v2) {// 逆向范围,反选模式,例如:5-2 NumberUtil.appendRange(v1, parser.getMax(), step, results); NumberUtil.appendRange(parser.getMin(), v2, step, results); } else {// v1 == v2,此时与单值模式一致 if(step > 0) {//类似 20/2的形式 NumberUtil.appendRange(v1, parser.getMax(), step, results); }else { results.add(v1); } } } else { throw new CronException("Invalid syntax of field: [{}]", value); } return results; }
java
private static List<Integer> parseRange(String value, int step, ValueParser parser) { final List<Integer> results = new ArrayList<>(); // 全部匹配形式 if (value.length() <= 2) { //根据步进的第一个数字确定起始时间,类似于 12/3则从12(秒、分等)开始 int minValue = parser.getMin(); if(false == isMatchAllStr(value)) { minValue = Math.max(minValue, parser.parse(value)); }else { //在全匹配模式下,如果步进不存在,表示步进为1 if(step < 1) { step = 1; } } if(step > 0) { final int maxValue = parser.getMax(); if(minValue > maxValue) { throw new CronException("Invalid value {} > {}", minValue, maxValue); } //有步进 for (int i = minValue; i <= maxValue; i+=step) { results.add(i); } } else { //固定时间 results.add(minValue); } return results; } //Range模式 List<String> parts = StrUtil.split(value, '-'); int size = parts.size(); if (size == 1) {// 普通值 final int v1 = parser.parse(value); if(step > 0) {//类似 20/2的形式 NumberUtil.appendRange(v1, parser.getMax(), step, results); }else { results.add(v1); } } else if (size == 2) {// range值 final int v1 = parser.parse(parts.get(0)); final int v2 = parser.parse(parts.get(1)); if(step < 1) { //在range模式下,如果步进不存在,表示步进为1 step = 1; } if (v1 < v2) {// 正常范围,例如:2-5 NumberUtil.appendRange(v1, v2, step, results); } else if (v1 > v2) {// 逆向范围,反选模式,例如:5-2 NumberUtil.appendRange(v1, parser.getMax(), step, results); NumberUtil.appendRange(parser.getMin(), v2, step, results); } else {// v1 == v2,此时与单值模式一致 if(step > 0) {//类似 20/2的形式 NumberUtil.appendRange(v1, parser.getMax(), step, results); }else { results.add(v1); } } } else { throw new CronException("Invalid syntax of field: [{}]", value); } return results; }
[ "private", "static", "List", "<", "Integer", ">", "parseRange", "(", "String", "value", ",", "int", "step", ",", "ValueParser", "parser", ")", "{", "final", "List", "<", "Integer", ">", "results", "=", "new", "ArrayList", "<>", "(", ")", ";", "// 全部匹配形式\...
处理表达式中范围表达式 处理的形式包括: <ul> <li>*</li> <li>2</li> <li>3-8</li> <li>8-3</li> <li>3-3</li> </ul> @param value 范围表达式 @param step 步进 @param parser 针对这个时间字段的解析器 @return List
[ "处理表达式中范围表达式", "处理的形式包括:", "<ul", ">", "<li", ">", "*", "<", "/", "li", ">", "<li", ">", "2<", "/", "li", ">", "<li", ">", "3", "-", "8<", "/", "li", ">", "<li", ">", "8", "-", "3<", "/", "li", ">", "<li", ">", "3", "-", "3<", "/", "li", ...
bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a
https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-cron/src/main/java/cn/hutool/cron/pattern/matcher/ValueMatcherBuilder.java#L119-L183
train
Parse a range of strings.
[ 30522, 2797, 10763, 2862, 1026, 16109, 1028, 11968, 8043, 22043, 1006, 5164, 3643, 1010, 20014, 3357, 1010, 3643, 19362, 8043, 11968, 8043, 1007, 1063, 2345, 2862, 1026, 16109, 1028, 3463, 1027, 2047, 9140, 9863, 1026, 1028, 1006, 1007, 102...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
hankcs/HanLP
src/main/java/com/hankcs/hanlp/dictionary/CoreBiGramTableDictionary.java
CoreBiGramTableDictionary.binarySearch
private static int binarySearch(int[] a, int fromIndex, int length, int key) { int low = fromIndex; int high = fromIndex + length - 1; while (low <= high) { int mid = (low + high) >>> 1; int midVal = a[mid << 1]; if (midVal < key) low = mid + 1; else if (midVal > key) high = mid - 1; else return mid; // key found } return -(low + 1); // key not found. }
java
private static int binarySearch(int[] a, int fromIndex, int length, int key) { int low = fromIndex; int high = fromIndex + length - 1; while (low <= high) { int mid = (low + high) >>> 1; int midVal = a[mid << 1]; if (midVal < key) low = mid + 1; else if (midVal > key) high = mid - 1; else return mid; // key found } return -(low + 1); // key not found. }
[ "private", "static", "int", "binarySearch", "(", "int", "[", "]", "a", ",", "int", "fromIndex", ",", "int", "length", ",", "int", "key", ")", "{", "int", "low", "=", "fromIndex", ";", "int", "high", "=", "fromIndex", "+", "length", "-", "1", ";", "...
二分搜索,由于二元接续前一个词固定时,后一个词比较少,所以二分也能取得很高的性能 @param a 目标数组 @param fromIndex 开始下标 @param length 长度 @param key 词的id @return 共现频次
[ "二分搜索,由于二元接续前一个词固定时,后一个词比较少,所以二分也能取得很高的性能" ]
a538d0722ab2e4980a9dcd9ea40324fc3ddba7ce
https://github.com/hankcs/HanLP/blob/a538d0722ab2e4980a9dcd9ea40324fc3ddba7ce/src/main/java/com/hankcs/hanlp/dictionary/CoreBiGramTableDictionary.java#L218-L236
train
Searches the array for the key in the array.
[ 30522, 2797, 10763, 20014, 12441, 17310, 11140, 1006, 20014, 1031, 1033, 1037, 1010, 20014, 2013, 22254, 10288, 1010, 20014, 3091, 1010, 20014, 3145, 1007, 1063, 20014, 2659, 1027, 2013, 22254, 10288, 1025, 20014, 2152, 1027, 2013, 22254, 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-core/src/main/java/org/apache/flink/api/common/operators/base/MapOperatorBase.java
MapOperatorBase.executeOnCollections
@Override protected List<OUT> executeOnCollections(List<IN> inputData, RuntimeContext ctx, ExecutionConfig executionConfig) throws Exception { MapFunction<IN, OUT> function = this.userFunction.getUserCodeObject(); FunctionUtils.setFunctionRuntimeContext(function, ctx); FunctionUtils.openFunction(function, this.parameters); ArrayList<OUT> result = new ArrayList<OUT>(inputData.size()); TypeSerializer<IN> inSerializer = getOperatorInfo().getInputType().createSerializer(executionConfig); TypeSerializer<OUT> outSerializer = getOperatorInfo().getOutputType().createSerializer(executionConfig); for (IN element : inputData) { IN inCopy = inSerializer.copy(element); OUT out = function.map(inCopy); result.add(outSerializer.copy(out)); } FunctionUtils.closeFunction(function); return result; }
java
@Override protected List<OUT> executeOnCollections(List<IN> inputData, RuntimeContext ctx, ExecutionConfig executionConfig) throws Exception { MapFunction<IN, OUT> function = this.userFunction.getUserCodeObject(); FunctionUtils.setFunctionRuntimeContext(function, ctx); FunctionUtils.openFunction(function, this.parameters); ArrayList<OUT> result = new ArrayList<OUT>(inputData.size()); TypeSerializer<IN> inSerializer = getOperatorInfo().getInputType().createSerializer(executionConfig); TypeSerializer<OUT> outSerializer = getOperatorInfo().getOutputType().createSerializer(executionConfig); for (IN element : inputData) { IN inCopy = inSerializer.copy(element); OUT out = function.map(inCopy); result.add(outSerializer.copy(out)); } FunctionUtils.closeFunction(function); return result; }
[ "@", "Override", "protected", "List", "<", "OUT", ">", "executeOnCollections", "(", "List", "<", "IN", ">", "inputData", ",", "RuntimeContext", "ctx", ",", "ExecutionConfig", "executionConfig", ")", "throws", "Exception", "{", "MapFunction", "<", "IN", ",", "O...
--------------------------------------------------------------------------------------------
[ "--------------------------------------------------------------------------------------------" ]
b62db93bf63cb3bb34dd03d611a779d9e3fc61ac
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-core/src/main/java/org/apache/flink/api/common/operators/base/MapOperatorBase.java#L59-L80
train
Execute on collections.
[ 30522, 1030, 2058, 15637, 5123, 2862, 1026, 2041, 1028, 15389, 2239, 26895, 18491, 2015, 1006, 2862, 1026, 1999, 1028, 7953, 2850, 2696, 1010, 2448, 7292, 8663, 18209, 14931, 2595, 1010, 7781, 8663, 8873, 2290, 7781, 8663, 8873, 2290, 1007,...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
apache/flink
flink-runtime/src/main/java/org/apache/flink/runtime/memory/MemoryManager.java
MemoryManager.shutdown
public void shutdown() { // -------------------- BEGIN CRITICAL SECTION ------------------- synchronized (lock) { if (!isShutDown) { // mark as shutdown and release memory isShutDown = true; numNonAllocatedPages = 0; // go over all allocated segments and release them for (Set<MemorySegment> segments : allocatedSegments.values()) { for (MemorySegment seg : segments) { seg.free(); } } memoryPool.clear(); } } // -------------------- END CRITICAL SECTION ------------------- }
java
public void shutdown() { // -------------------- BEGIN CRITICAL SECTION ------------------- synchronized (lock) { if (!isShutDown) { // mark as shutdown and release memory isShutDown = true; numNonAllocatedPages = 0; // go over all allocated segments and release them for (Set<MemorySegment> segments : allocatedSegments.values()) { for (MemorySegment seg : segments) { seg.free(); } } memoryPool.clear(); } } // -------------------- END CRITICAL SECTION ------------------- }
[ "public", "void", "shutdown", "(", ")", "{", "// -------------------- BEGIN CRITICAL SECTION -------------------", "synchronized", "(", "lock", ")", "{", "if", "(", "!", "isShutDown", ")", "{", "// mark as shutdown and release memory", "isShutDown", "=", "true", ";", "n...
Shuts the memory manager down, trying to release all the memory it managed. Depending on implementation details, the memory does not necessarily become reclaimable by the garbage collector, because there might still be references to allocated segments in the code that allocated them from the memory manager.
[ "Shuts", "the", "memory", "manager", "down", "trying", "to", "release", "all", "the", "memory", "it", "managed", ".", "Depending", "on", "implementation", "details", "the", "memory", "does", "not", "necessarily", "become", "reclaimable", "by", "the", "garbage", ...
b62db93bf63cb3bb34dd03d611a779d9e3fc61ac
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/memory/MemoryManager.java#L201-L220
train
Shutdown the memory manager.
[ 30522, 2270, 11675, 3844, 7698, 1006, 1007, 1063, 1013, 1013, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 4088, 4187, 2930, 1011, 1011, 1011, 1011, 1011, 1011, 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/clusterframework/ContainerSpecification.java
ContainerSpecification.formatSystemProperties
public static String formatSystemProperties(Configuration jvmArgs) { StringBuilder sb = new StringBuilder(); for(Map.Entry<String,String> entry : jvmArgs.toMap().entrySet()) { if(sb.length() > 0) { sb.append(" "); } boolean quoted = entry.getValue().contains(" "); if(quoted) { sb.append("\""); } sb.append("-D").append(entry.getKey()).append('=').append(entry.getValue()); if(quoted) { sb.append("\""); } } return sb.toString(); }
java
public static String formatSystemProperties(Configuration jvmArgs) { StringBuilder sb = new StringBuilder(); for(Map.Entry<String,String> entry : jvmArgs.toMap().entrySet()) { if(sb.length() > 0) { sb.append(" "); } boolean quoted = entry.getValue().contains(" "); if(quoted) { sb.append("\""); } sb.append("-D").append(entry.getKey()).append('=').append(entry.getValue()); if(quoted) { sb.append("\""); } } return sb.toString(); }
[ "public", "static", "String", "formatSystemProperties", "(", "Configuration", "jvmArgs", ")", "{", "StringBuilder", "sb", "=", "new", "StringBuilder", "(", ")", ";", "for", "(", "Map", ".", "Entry", "<", "String", ",", "String", ">", "entry", ":", "jvmArgs",...
Format the system properties as a shell-compatible command-line argument.
[ "Format", "the", "system", "properties", "as", "a", "shell", "-", "compatible", "command", "-", "line", "argument", "." ]
b62db93bf63cb3bb34dd03d611a779d9e3fc61ac
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/clusterframework/ContainerSpecification.java#L189-L205
train
Format the system properties.
[ 30522, 2270, 10763, 5164, 11630, 27268, 6633, 21572, 4842, 7368, 1006, 9563, 1046, 2615, 7849, 5620, 1007, 1063, 5164, 8569, 23891, 2099, 24829, 1027, 2047, 5164, 8569, 23891, 2099, 1006, 1007, 1025, 2005, 1006, 4949, 1012, 4443, 1026, 5164...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
looly/hutool
hutool-crypto/src/main/java/cn/hutool/crypto/asymmetric/AsymmetricCrypto.java
AsymmetricCrypto.encrypt
@Override public byte[] encrypt(byte[] data, KeyType keyType) { final Key key = getKeyByType(keyType); final int inputLen = data.length; final int maxBlockSize = this.encryptBlockSize < 0 ? inputLen : this.encryptBlockSize; lock.lock(); try (ByteArrayOutputStream out = new ByteArrayOutputStream();) { cipher.init(Cipher.ENCRYPT_MODE, key); int offSet = 0; byte[] cache; // 剩余长度 int remainLength = inputLen; // 对数据分段加密 while (remainLength > 0) { cache = cipher.doFinal(data, offSet, Math.min(remainLength, maxBlockSize)); out.write(cache, 0, cache.length); offSet += maxBlockSize; remainLength = inputLen - offSet; } return out.toByteArray(); } catch (Exception e) { throw new CryptoException(e); } finally { lock.unlock(); } }
java
@Override public byte[] encrypt(byte[] data, KeyType keyType) { final Key key = getKeyByType(keyType); final int inputLen = data.length; final int maxBlockSize = this.encryptBlockSize < 0 ? inputLen : this.encryptBlockSize; lock.lock(); try (ByteArrayOutputStream out = new ByteArrayOutputStream();) { cipher.init(Cipher.ENCRYPT_MODE, key); int offSet = 0; byte[] cache; // 剩余长度 int remainLength = inputLen; // 对数据分段加密 while (remainLength > 0) { cache = cipher.doFinal(data, offSet, Math.min(remainLength, maxBlockSize)); out.write(cache, 0, cache.length); offSet += maxBlockSize; remainLength = inputLen - offSet; } return out.toByteArray(); } catch (Exception e) { throw new CryptoException(e); } finally { lock.unlock(); } }
[ "@", "Override", "public", "byte", "[", "]", "encrypt", "(", "byte", "[", "]", "data", ",", "KeyType", "keyType", ")", "{", "final", "Key", "key", "=", "getKeyByType", "(", "keyType", ")", ";", "final", "int", "inputLen", "=", "data", ".", "length", ...
加密 @param data 被加密的bytes @param keyType 私钥或公钥 {@link KeyType} @return 加密后的bytes
[ "加密" ]
bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a
https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-crypto/src/main/java/cn/hutool/crypto/asymmetric/AsymmetricCrypto.java#L191-L218
train
Encrypts the given byte array using the specified key.
[ 30522, 1030, 2058, 15637, 2270, 24880, 1031, 1033, 4372, 26775, 22571, 2102, 1006, 24880, 1031, 1033, 2951, 1010, 3145, 13874, 3145, 13874, 1007, 1063, 2345, 3145, 3145, 1027, 2131, 14839, 3762, 13874, 1006, 3145, 13874, 1007, 1025, 2345, 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/Unpooled.java
Unpooled.wrappedBuffer
public static ByteBuf wrappedBuffer(int maxNumComponents, ByteBuf... buffers) { switch (buffers.length) { case 0: break; case 1: ByteBuf buffer = buffers[0]; if (buffer.isReadable()) { return wrappedBuffer(buffer.order(BIG_ENDIAN)); } else { buffer.release(); } break; default: for (int i = 0; i < buffers.length; i++) { ByteBuf buf = buffers[i]; if (buf.isReadable()) { return new CompositeByteBuf(ALLOC, false, maxNumComponents, buffers, i); } buf.release(); } break; } return EMPTY_BUFFER; }
java
public static ByteBuf wrappedBuffer(int maxNumComponents, ByteBuf... buffers) { switch (buffers.length) { case 0: break; case 1: ByteBuf buffer = buffers[0]; if (buffer.isReadable()) { return wrappedBuffer(buffer.order(BIG_ENDIAN)); } else { buffer.release(); } break; default: for (int i = 0; i < buffers.length; i++) { ByteBuf buf = buffers[i]; if (buf.isReadable()) { return new CompositeByteBuf(ALLOC, false, maxNumComponents, buffers, i); } buf.release(); } break; } return EMPTY_BUFFER; }
[ "public", "static", "ByteBuf", "wrappedBuffer", "(", "int", "maxNumComponents", ",", "ByteBuf", "...", "buffers", ")", "{", "switch", "(", "buffers", ".", "length", ")", "{", "case", "0", ":", "break", ";", "case", "1", ":", "ByteBuf", "buffer", "=", "bu...
Creates a new big-endian composite buffer which wraps the readable bytes of the specified buffers without copying them. A modification on the content of the specified buffers will be visible to the returned buffer. @param maxNumComponents Advisement as to how many independent buffers are allowed to exist before consolidation occurs. @param buffers The buffers to wrap. Reference count ownership of all variables is transferred to this method. @return The readable portion of the {@code buffers}. The caller is responsible for releasing this buffer.
[ "Creates", "a", "new", "big", "-", "endian", "composite", "buffer", "which", "wraps", "the", "readable", "bytes", "of", "the", "specified", "buffers", "without", "copying", "them", ".", "A", "modification", "on", "the", "content", "of", "the", "specified", "...
ba06eafa1c1824bd154f1a380019e7ea2edf3c4c
https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/buffer/src/main/java/io/netty/buffer/Unpooled.java#L306-L329
train
Returns a new ByteBuf that wraps the specified buffers.
[ 30522, 2270, 10763, 24880, 8569, 2546, 5058, 8569, 12494, 1006, 20014, 4098, 19172, 9006, 29513, 7666, 1010, 24880, 8569, 2546, 1012, 1012, 1012, 17698, 2015, 1007, 1063, 6942, 1006, 17698, 2015, 1012, 3091, 1007, 1063, 2553, 1014, 1024, 33...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
looly/hutool
hutool-core/src/main/java/cn/hutool/core/util/NumberUtil.java
NumberUtil.min
@SuppressWarnings("unchecked") public static <T extends Comparable<? super T>> T min(T... numberArray) { return ArrayUtil.min(numberArray); }
java
@SuppressWarnings("unchecked") public static <T extends Comparable<? super T>> T min(T... numberArray) { return ArrayUtil.min(numberArray); }
[ "@", "SuppressWarnings", "(", "\"unchecked\"", ")", "public", "static", "<", "T", "extends", "Comparable", "<", "?", "super", "T", ">", ">", "T", "min", "(", "T", "...", "numberArray", ")", "{", "return", "ArrayUtil", ".", "min", "(", "numberArray", ")",...
取最小值 @param <T> 元素类型 @param numberArray 数字数组 @return 最小值 @since 4.0.7 @see ArrayUtil#min(Comparable[])
[ "取最小值" ]
bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a
https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/util/NumberUtil.java#L1708-L1711
train
Returns the smallest element of an array.
[ 30522, 1030, 16081, 9028, 5582, 2015, 1006, 1000, 4895, 5403, 18141, 1000, 1007, 2270, 10763, 1026, 1056, 8908, 12435, 1026, 1029, 3565, 1056, 1028, 1028, 1056, 8117, 1006, 1056, 1012, 1012, 1012, 2193, 2906, 9447, 1007, 1063, 2709, 9140, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
apache/flink
flink-filesystems/flink-fs-hadoop-shaded/src/main/java/org/apache/hadoop/conf/Configuration.java
Configuration.getLongBytes
public long getLongBytes(String name, long defaultValue) { String valueString = getTrimmed(name); if (valueString == null) return defaultValue; return StringUtils.TraditionalBinaryPrefix.string2long(valueString); }
java
public long getLongBytes(String name, long defaultValue) { String valueString = getTrimmed(name); if (valueString == null) return defaultValue; return StringUtils.TraditionalBinaryPrefix.string2long(valueString); }
[ "public", "long", "getLongBytes", "(", "String", "name", ",", "long", "defaultValue", ")", "{", "String", "valueString", "=", "getTrimmed", "(", "name", ")", ";", "if", "(", "valueString", "==", "null", ")", "return", "defaultValue", ";", "return", "StringUt...
Get the value of the <code>name</code> property as a <code>long</code> or human readable format. If no such property exists, the provided default value is returned, or if the specified value is not a valid <code>long</code> or human readable format, then an error is thrown. You can use the following suffix (case insensitive): k(kilo), m(mega), g(giga), t(tera), p(peta), e(exa) @param name property name. @param defaultValue default value. @throws NumberFormatException when the value is invalid @return property value as a <code>long</code>, or <code>defaultValue</code>.
[ "Get", "the", "value", "of", "the", "<code", ">", "name<", "/", "code", ">", "property", "as", "a", "<code", ">", "long<", "/", "code", ">", "or", "human", "readable", "format", ".", "If", "no", "such", "property", "exists", "the", "provided", "default...
b62db93bf63cb3bb34dd03d611a779d9e3fc61ac
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-filesystems/flink-fs-hadoop-shaded/src/main/java/org/apache/hadoop/conf/Configuration.java#L1431-L1436
train
Returns the value of the specified attribute as a long.
[ 30522, 2270, 2146, 2131, 10052, 3762, 4570, 1006, 5164, 2171, 1010, 2146, 12398, 10175, 5657, 1007, 1063, 5164, 5300, 18886, 3070, 1027, 2131, 18886, 20058, 2094, 1006, 2171, 1007, 1025, 2065, 1006, 5300, 18886, 3070, 1027, 1027, 19701, 100...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
looly/hutool
hutool-core/src/main/java/cn/hutool/core/util/ArrayUtil.java
ArrayUtil.zip
public static <K, V> Map<K, V> zip(K[] keys, V[] values, boolean isOrder) { if (isEmpty(keys) || isEmpty(values)) { return null; } final int size = Math.min(keys.length, values.length); final Map<K, V> map = CollectionUtil.newHashMap(size, isOrder); for (int i = 0; i < size; i++) { map.put(keys[i], values[i]); } return map; }
java
public static <K, V> Map<K, V> zip(K[] keys, V[] values, boolean isOrder) { if (isEmpty(keys) || isEmpty(values)) { return null; } final int size = Math.min(keys.length, values.length); final Map<K, V> map = CollectionUtil.newHashMap(size, isOrder); for (int i = 0; i < size; i++) { map.put(keys[i], values[i]); } return map; }
[ "public", "static", "<", "K", ",", "V", ">", "Map", "<", "K", ",", "V", ">", "zip", "(", "K", "[", "]", "keys", ",", "V", "[", "]", "values", ",", "boolean", "isOrder", ")", "{", "if", "(", "isEmpty", "(", "keys", ")", "||", "isEmpty", "(", ...
映射键值(参考Python的zip()函数)<br> 例如:<br> keys = [a,b,c,d]<br> values = [1,2,3,4]<br> 则得到的Map是 {a=1, b=2, c=3, d=4}<br> 如果两个数组长度不同,则只对应最短部分 @param <K> Key类型 @param <V> Value类型 @param keys 键列表 @param values 值列表 @param isOrder 是否有序 @return Map @since 3.0.4
[ "映射键值(参考Python的zip", "()", "函数)<br", ">", "例如:<br", ">", "keys", "=", "[", "a", "b", "c", "d", "]", "<br", ">", "values", "=", "[", "1", "2", "3", "4", "]", "<br", ">", "则得到的Map是", "{", "a", "=", "1", "b", "=", "2", "c", "=", "3", "d", "=",...
bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a
https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/util/ArrayUtil.java#L855-L867
train
Creates a map of the specified keys and values using the specified order.
[ 30522, 2270, 10763, 1026, 1047, 1010, 1058, 1028, 4949, 1026, 1047, 1010, 1058, 1028, 14101, 1006, 1047, 1031, 1033, 6309, 1010, 1058, 1031, 1033, 5300, 1010, 22017, 20898, 11163, 26764, 1007, 1063, 2065, 1006, 2003, 6633, 13876, 2100, 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-core/src/main/java/org/apache/flink/util/Preconditions.java
Preconditions.checkElementIndex
public static void checkElementIndex(int index, int size) { checkArgument(size >= 0, "Size was negative."); if (index < 0 || index >= size) { throw new IndexOutOfBoundsException("Index: " + index + ", Size: " + size); } }
java
public static void checkElementIndex(int index, int size) { checkArgument(size >= 0, "Size was negative."); if (index < 0 || index >= size) { throw new IndexOutOfBoundsException("Index: " + index + ", Size: " + size); } }
[ "public", "static", "void", "checkElementIndex", "(", "int", "index", ",", "int", "size", ")", "{", "checkArgument", "(", "size", ">=", "0", ",", "\"Size was negative.\"", ")", ";", "if", "(", "index", "<", "0", "||", "index", ">=", "size", ")", "{", "...
Ensures that the given index is valid for an array, list or string of the given size. @param index index to check @param size size of the array, list or string @throws IllegalArgumentException Thrown, if size is negative. @throws IndexOutOfBoundsException Thrown, if the index negative or greater than or equal to size
[ "Ensures", "that", "the", "given", "index", "is", "valid", "for", "an", "array", "list", "or", "string", "of", "the", "given", "size", "." ]
b62db93bf63cb3bb34dd03d611a779d9e3fc61ac
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-core/src/main/java/org/apache/flink/util/Preconditions.java#L230-L235
train
Check that the index is within the bounds of the specified size.
[ 30522, 2270, 10763, 11675, 4638, 12260, 3672, 22254, 10288, 1006, 20014, 5950, 1010, 20014, 2946, 1007, 1063, 4638, 2906, 22850, 4765, 1006, 2946, 1028, 1027, 1014, 1010, 1000, 2946, 2001, 4997, 1012, 1000, 1007, 1025, 2065, 1006, 5950, 102...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
spring-projects/spring-boot
spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/properties/bind/Binder.java
Binder.bind
public <T> BindResult<T> bind(String name, Class<T> target) { return bind(name, Bindable.of(target)); }
java
public <T> BindResult<T> bind(String name, Class<T> target) { return bind(name, Bindable.of(target)); }
[ "public", "<", "T", ">", "BindResult", "<", "T", ">", "bind", "(", "String", "name", ",", "Class", "<", "T", ">", "target", ")", "{", "return", "bind", "(", "name", ",", "Bindable", ".", "of", "(", "target", ")", ")", ";", "}" ]
Bind the specified target {@link Class} using this binder's {@link ConfigurationPropertySource property sources}. @param name the configuration property name to bind @param target the target class @param <T> the bound type @return the binding result (never {@code null}) @see #bind(ConfigurationPropertyName, Bindable, BindHandler)
[ "Bind", "the", "specified", "target", "{" ]
0b27f7c70e164b2b1a96477f1d9c1acba56790c1
https://github.com/spring-projects/spring-boot/blob/0b27f7c70e164b2b1a96477f1d9c1acba56790c1/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/properties/bind/Binder.java#L151-L153
train
Binds the given class to the named parameter.
[ 30522, 2270, 1026, 1056, 1028, 14187, 6072, 11314, 1026, 1056, 1028, 14187, 1006, 5164, 2171, 1010, 2465, 1026, 1056, 1028, 4539, 1007, 1063, 2709, 14187, 1006, 2171, 1010, 14187, 3085, 1012, 1997, 1006, 4539, 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...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
looly/hutool
hutool-core/src/main/java/cn/hutool/core/util/ZipUtil.java
ZipUtil.unGzip
public static String unGzip(byte[] buf, String charset) throws UtilException { return StrUtil.str(unGzip(buf), charset); }
java
public static String unGzip(byte[] buf, String charset) throws UtilException { return StrUtil.str(unGzip(buf), charset); }
[ "public", "static", "String", "unGzip", "(", "byte", "[", "]", "buf", ",", "String", "charset", ")", "throws", "UtilException", "{", "return", "StrUtil", ".", "str", "(", "unGzip", "(", "buf", ")", ",", "charset", ")", ";", "}" ]
Gzip解压缩处理 @param buf 压缩过的字节流 @param charset 编码 @return 解压后的字符串 @throws UtilException IO异常
[ "Gzip解压缩处理" ]
bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a
https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/util/ZipUtil.java#L567-L569
train
Un - GZIP encodes the given byte array into a String.
[ 30522, 2270, 10763, 5164, 4895, 2290, 5831, 2361, 1006, 24880, 1031, 1033, 20934, 2546, 1010, 5164, 25869, 13462, 1007, 11618, 21183, 9463, 2595, 24422, 1063, 2709, 2358, 22134, 4014, 1012, 2358, 2099, 1006, 4895, 2290, 5831, 2361, 1006, 20...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
apache/spark
sql/hive-thriftserver/src/main/java/org/apache/hive/service/cli/thrift/ThriftHttpServlet.java
ThriftHttpServlet.validateCookie
private String validateCookie(HttpServletRequest request) throws UnsupportedEncodingException { // Find all the valid cookies associated with the request. Cookie[] cookies = request.getCookies(); if (cookies == null) { if (LOG.isDebugEnabled()) { LOG.debug("No valid cookies associated with the request " + request); } return null; } if (LOG.isDebugEnabled()) { LOG.debug("Received cookies: " + toCookieStr(cookies)); } return getClientNameFromCookie(cookies); }
java
private String validateCookie(HttpServletRequest request) throws UnsupportedEncodingException { // Find all the valid cookies associated with the request. Cookie[] cookies = request.getCookies(); if (cookies == null) { if (LOG.isDebugEnabled()) { LOG.debug("No valid cookies associated with the request " + request); } return null; } if (LOG.isDebugEnabled()) { LOG.debug("Received cookies: " + toCookieStr(cookies)); } return getClientNameFromCookie(cookies); }
[ "private", "String", "validateCookie", "(", "HttpServletRequest", "request", ")", "throws", "UnsupportedEncodingException", "{", "// Find all the valid cookies associated with the request.", "Cookie", "[", "]", "cookies", "=", "request", ".", "getCookies", "(", ")", ";", ...
Validate the request cookie. This function iterates over the request cookie headers and finds a cookie that represents a valid client/server session. If it finds one, it returns the client name associated with the session. Else, it returns null. @param request The HTTP Servlet Request send by the client @return Client Username if the request has valid HS2 cookie, else returns null @throws UnsupportedEncodingException
[ "Validate", "the", "request", "cookie", ".", "This", "function", "iterates", "over", "the", "request", "cookie", "headers", "and", "finds", "a", "cookie", "that", "represents", "a", "valid", "client", "/", "server", "session", ".", "If", "it", "finds", "one"...
25ee0474f47d9c30d6f553a7892d9549f91071cf
https://github.com/apache/spark/blob/25ee0474f47d9c30d6f553a7892d9549f91071cf/sql/hive-thriftserver/src/main/java/org/apache/hive/service/cli/thrift/ThriftHttpServlet.java#L259-L273
train
Validate the cookies associated with the request.
[ 30522, 2797, 5164, 9398, 3686, 3597, 23212, 2063, 1006, 16770, 2121, 2615, 7485, 2890, 15500, 5227, 1007, 11618, 4895, 6342, 9397, 15613, 2368, 3597, 4667, 10288, 24422, 1063, 1013, 1013, 2424, 2035, 1996, 9398, 16324, 3378, 2007, 1996, 522...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -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/Zodiac.java
Zodiac.getZodiac
public static String getZodiac(Calendar calendar) { if (null == calendar) { return null; } return getZodiac(calendar.get(Calendar.MONTH), calendar.get(Calendar.DAY_OF_MONTH)); }
java
public static String getZodiac(Calendar calendar) { if (null == calendar) { return null; } return getZodiac(calendar.get(Calendar.MONTH), calendar.get(Calendar.DAY_OF_MONTH)); }
[ "public", "static", "String", "getZodiac", "(", "Calendar", "calendar", ")", "{", "if", "(", "null", "==", "calendar", ")", "{", "return", "null", ";", "}", "return", "getZodiac", "(", "calendar", ".", "get", "(", "Calendar", ".", "MONTH", ")", ",", "c...
通过生日计算星座 @param calendar 出生日期 @return 星座名
[ "通过生日计算星座" ]
bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a
https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/date/Zodiac.java#L36-L41
train
Gets the zodiac string from a calendar object.
[ 30522, 2270, 10763, 5164, 2131, 6844, 9032, 2278, 1006, 8094, 8094, 1007, 1063, 2065, 1006, 19701, 1027, 1027, 8094, 1007, 1063, 2709, 19701, 1025, 1065, 2709, 2131, 6844, 9032, 2278, 1006, 8094, 1012, 2131, 1006, 8094, 1012, 3204, 1007, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
apache/flink
flink-runtime/src/main/java/org/apache/flink/runtime/operators/hash/CompactingHashTable.java
CompactingHashTable.createPartitions
private void createPartitions(int numPartitions) { this.partitions.clear(); ListMemorySegmentSource memSource = new ListMemorySegmentSource(this.availableMemory); for (int i = 0; i < numPartitions; i++) { this.partitions.add(new InMemoryPartition<T>(this.buildSideSerializer, i, memSource, this.segmentSize, pageSizeInBits)); } this.compactionMemory = new InMemoryPartition<T>(this.buildSideSerializer, -1, memSource, this.segmentSize, pageSizeInBits); }
java
private void createPartitions(int numPartitions) { this.partitions.clear(); ListMemorySegmentSource memSource = new ListMemorySegmentSource(this.availableMemory); for (int i = 0; i < numPartitions; i++) { this.partitions.add(new InMemoryPartition<T>(this.buildSideSerializer, i, memSource, this.segmentSize, pageSizeInBits)); } this.compactionMemory = new InMemoryPartition<T>(this.buildSideSerializer, -1, memSource, this.segmentSize, pageSizeInBits); }
[ "private", "void", "createPartitions", "(", "int", "numPartitions", ")", "{", "this", ".", "partitions", ".", "clear", "(", ")", ";", "ListMemorySegmentSource", "memSource", "=", "new", "ListMemorySegmentSource", "(", "this", ".", "availableMemory", ")", ";", "f...
--------------------------------------------------------------------------------------------
[ "--------------------------------------------------------------------------------------------" ]
b62db93bf63cb3bb34dd03d611a779d9e3fc61ac
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/operators/hash/CompactingHashTable.java#L676-L685
train
Creates the partitions.
[ 30522, 2797, 11675, 3443, 19362, 3775, 9285, 1006, 20014, 16371, 8737, 8445, 22753, 2015, 1007, 1063, 2023, 1012, 13571, 2015, 1012, 3154, 1006, 1007, 1025, 2862, 4168, 5302, 24769, 13910, 8163, 8162, 3401, 2033, 5244, 8162, 3401, 1027, 204...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
hankcs/HanLP
src/main/java/com/hankcs/hanlp/corpus/io/IOUtil.java
IOUtil.removeUTF8BOM
public static String removeUTF8BOM(String line) { if (line != null && line.startsWith("\uFEFF")) // UTF-8 byte order mark (EF BB BF) { line = line.substring(1); } return line; }
java
public static String removeUTF8BOM(String line) { if (line != null && line.startsWith("\uFEFF")) // UTF-8 byte order mark (EF BB BF) { line = line.substring(1); } return line; }
[ "public", "static", "String", "removeUTF8BOM", "(", "String", "line", ")", "{", "if", "(", "line", "!=", "null", "&&", "line", ".", "startsWith", "(", "\"\\uFEFF\"", ")", ")", "// UTF-8 byte order mark (EF BB BF)", "{", "line", "=", "line", ".", "substring", ...
去除文件第一行中的UTF8 BOM<br> 这是Java的bug,且官方不会修复。参考 https://stackoverflow.com/questions/4897876/reading-utf-8-bom-marker @param line 文件第一行 @return 去除BOM的部分
[ "去除文件第一行中的UTF8", "BOM<br", ">", "这是Java的bug,且官方不会修复。参考", "https", ":", "//", "stackoverflow", ".", "com", "/", "questions", "/", "4897876", "/", "reading", "-", "utf", "-", "8", "-", "bom", "-", "marker" ]
a538d0722ab2e4980a9dcd9ea40324fc3ddba7ce
https://github.com/hankcs/HanLP/blob/a538d0722ab2e4980a9dcd9ea40324fc3ddba7ce/src/main/java/com/hankcs/hanlp/corpus/io/IOUtil.java#L410-L417
train
Remove UTF - 8 BOM from a line of text.
[ 30522, 2270, 10763, 5164, 6366, 4904, 2546, 2620, 5092, 2213, 1006, 5164, 2240, 1007, 1063, 2065, 1006, 2240, 999, 1027, 19701, 1004, 1004, 2240, 1012, 4627, 24415, 1006, 1000, 1032, 1057, 7959, 4246, 1000, 1007, 1007, 1013, 1013, 21183, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
spring-projects/spring-boot
spring-boot-project/spring-boot-tools/spring-boot-configuration-processor/src/json-shade/java/org/springframework/boot/configurationprocessor/json/JSONObject.java
JSONObject.toJSONArray
public JSONArray toJSONArray(JSONArray names) { JSONArray result = new JSONArray(); if (names == null) { return null; } int length = names.length(); if (length == 0) { return null; } for (int i = 0; i < length; i++) { String name = JSON.toString(names.opt(i)); result.put(opt(name)); } return result; }
java
public JSONArray toJSONArray(JSONArray names) { JSONArray result = new JSONArray(); if (names == null) { return null; } int length = names.length(); if (length == 0) { return null; } for (int i = 0; i < length; i++) { String name = JSON.toString(names.opt(i)); result.put(opt(name)); } return result; }
[ "public", "JSONArray", "toJSONArray", "(", "JSONArray", "names", ")", "{", "JSONArray", "result", "=", "new", "JSONArray", "(", ")", ";", "if", "(", "names", "==", "null", ")", "{", "return", "null", ";", "}", "int", "length", "=", "names", ".", "lengt...
Returns an array with the values corresponding to {@code names}. The array contains null for names that aren't mapped. This method returns null if {@code names} is either null or empty. @param names the names of the properties @return the array
[ "Returns", "an", "array", "with", "the", "values", "corresponding", "to", "{" ]
0b27f7c70e164b2b1a96477f1d9c1acba56790c1
https://github.com/spring-projects/spring-boot/blob/0b27f7c70e164b2b1a96477f1d9c1acba56790c1/spring-boot-project/spring-boot-tools/spring-boot-configuration-processor/src/json-shade/java/org/springframework/boot/configurationprocessor/json/JSONObject.java#L657-L671
train
Converts a JSONArray of names to a JSONArray.
[ 30522, 2270, 1046, 3385, 2906, 9447, 2000, 22578, 7856, 11335, 2100, 1006, 1046, 3385, 2906, 9447, 3415, 1007, 1063, 1046, 3385, 2906, 9447, 2765, 1027, 2047, 1046, 3385, 2906, 9447, 1006, 1007, 1025, 2065, 1006, 3415, 1027, 1027, 19701, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
looly/hutool
hutool-cache/src/main/java/cn/hutool/cache/impl/AbstractCache.java
AbstractCache.remove
private void remove(K key, boolean withMissCount) { writeLock.lock(); CacheObj<K, V> co; try { co = cacheMap.remove(key); if (withMissCount) { this.missCount--; } } finally { writeLock.unlock(); } if (null != co) { onRemove(co.key, co.obj); } }
java
private void remove(K key, boolean withMissCount) { writeLock.lock(); CacheObj<K, V> co; try { co = cacheMap.remove(key); if (withMissCount) { this.missCount--; } } finally { writeLock.unlock(); } if (null != co) { onRemove(co.key, co.obj); } }
[ "private", "void", "remove", "(", "K", "key", ",", "boolean", "withMissCount", ")", "{", "writeLock", ".", "lock", "(", ")", ";", "CacheObj", "<", "K", ",", "V", ">", "co", ";", "try", "{", "co", "=", "cacheMap", ".", "remove", "(", "key", ")", "...
移除key对应的对象 @param key 键 @param withMissCount 是否计数丢失数
[ "移除key对应的对象" ]
bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a
https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-cache/src/main/java/cn/hutool/cache/impl/AbstractCache.java#L292-L306
train
Remove the object from the cache.
[ 30522, 2797, 11675, 6366, 1006, 1047, 3145, 1010, 22017, 20898, 2007, 15630, 9363, 16671, 1007, 1063, 4339, 7878, 1012, 5843, 1006, 1007, 1025, 17053, 16429, 3501, 1026, 1047, 1010, 1058, 1028, 2522, 1025, 3046, 1063, 2522, 1027, 17053, 286...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
looly/hutool
hutool-core/src/main/java/cn/hutool/core/util/ArrayUtil.java
ArrayUtil.filter
public static <T> T[] filter(T[] array, Editor<T> editor) { ArrayList<T> list = new ArrayList<T>(array.length); T modified; for (T t : array) { modified = editor.edit(t); if (null != modified) { list.add(modified); } } return list.toArray(Arrays.copyOf(array, list.size())); }
java
public static <T> T[] filter(T[] array, Editor<T> editor) { ArrayList<T> list = new ArrayList<T>(array.length); T modified; for (T t : array) { modified = editor.edit(t); if (null != modified) { list.add(modified); } } return list.toArray(Arrays.copyOf(array, list.size())); }
[ "public", "static", "<", "T", ">", "T", "[", "]", "filter", "(", "T", "[", "]", "array", ",", "Editor", "<", "T", ">", "editor", ")", "{", "ArrayList", "<", "T", ">", "list", "=", "new", "ArrayList", "<", "T", ">", "(", "array", ".", "length", ...
过滤<br> 过滤过程通过传入的Editor实现来返回需要的元素内容,这个Editor实现可以实现以下功能: <pre> 1、过滤出需要的对象,如果返回null表示这个元素对象抛弃 2、修改元素对象,返回集合中为修改后的对象 </pre> @param <T> 数组元素类型 @param array 数组 @param editor 编辑器接口 @return 过滤后的数组
[ "过滤<br", ">", "过滤过程通过传入的Editor实现来返回需要的元素内容,这个Editor实现可以实现以下功能:" ]
bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a
https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/util/ArrayUtil.java#L733-L743
train
Filters the given array using the given editor.
[ 30522, 2270, 10763, 1026, 1056, 1028, 1056, 1031, 1033, 11307, 1006, 1056, 1031, 1033, 9140, 1010, 3559, 1026, 1056, 1028, 3559, 1007, 1063, 9140, 9863, 1026, 1056, 1028, 2862, 1027, 2047, 9140, 9863, 1026, 1056, 1028, 1006, 9140, 1012, 3...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
apache/spark
common/network-common/src/main/java/org/apache/spark/network/util/JavaUtils.java
JavaUtils.closeQuietly
public static void closeQuietly(Closeable closeable) { try { if (closeable != null) { closeable.close(); } } catch (IOException e) { logger.error("IOException should not have been thrown.", e); } }
java
public static void closeQuietly(Closeable closeable) { try { if (closeable != null) { closeable.close(); } } catch (IOException e) { logger.error("IOException should not have been thrown.", e); } }
[ "public", "static", "void", "closeQuietly", "(", "Closeable", "closeable", ")", "{", "try", "{", "if", "(", "closeable", "!=", "null", ")", "{", "closeable", ".", "close", "(", ")", ";", "}", "}", "catch", "(", "IOException", "e", ")", "{", "logger", ...
Closes the given object, ignoring IOExceptions.
[ "Closes", "the", "given", "object", "ignoring", "IOExceptions", "." ]
25ee0474f47d9c30d6f553a7892d9549f91071cf
https://github.com/apache/spark/blob/25ee0474f47d9c30d6f553a7892d9549f91071cf/common/network-common/src/main/java/org/apache/spark/network/util/JavaUtils.java#L50-L58
train
Close a Closeable object.
[ 30522, 2270, 10763, 11675, 2485, 15549, 3388, 2135, 1006, 2485, 3085, 2485, 3085, 1007, 1063, 3046, 1063, 2065, 1006, 2485, 3085, 999, 1027, 19701, 1007, 1063, 2485, 3085, 1012, 2485, 1006, 1007, 1025, 1065, 1065, 4608, 1006, 22834, 10288, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -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/ExecutionEnvironment.java
ExecutionEnvironment.createLocalEnvironmentWithWebUI
@PublicEvolving public static ExecutionEnvironment createLocalEnvironmentWithWebUI(Configuration conf) { checkNotNull(conf, "conf"); conf.setBoolean(ConfigConstants.LOCAL_START_WEBSERVER, true); if (!conf.contains(RestOptions.PORT)) { // explicitly set this option so that it's not set to 0 later conf.setInteger(RestOptions.PORT, RestOptions.PORT.defaultValue()); } return createLocalEnvironment(conf, -1); }
java
@PublicEvolving public static ExecutionEnvironment createLocalEnvironmentWithWebUI(Configuration conf) { checkNotNull(conf, "conf"); conf.setBoolean(ConfigConstants.LOCAL_START_WEBSERVER, true); if (!conf.contains(RestOptions.PORT)) { // explicitly set this option so that it's not set to 0 later conf.setInteger(RestOptions.PORT, RestOptions.PORT.defaultValue()); } return createLocalEnvironment(conf, -1); }
[ "@", "PublicEvolving", "public", "static", "ExecutionEnvironment", "createLocalEnvironmentWithWebUI", "(", "Configuration", "conf", ")", "{", "checkNotNull", "(", "conf", ",", "\"conf\"", ")", ";", "conf", ".", "setBoolean", "(", "ConfigConstants", ".", "LOCAL_START_W...
Creates a {@link LocalEnvironment} for local program execution that also starts the web monitoring UI. <p>The local execution environment will run the program in a multi-threaded fashion in the same JVM as the environment was created in. It will use the parallelism specified in the parameter. <p>If the configuration key 'rest.port' was set in the configuration, that particular port will be used for the web UI. Otherwise, the default port (8081) will be used.
[ "Creates", "a", "{", "@link", "LocalEnvironment", "}", "for", "local", "program", "execution", "that", "also", "starts", "the", "web", "monitoring", "UI", "." ]
b62db93bf63cb3bb34dd03d611a779d9e3fc61ac
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-java/src/main/java/org/apache/flink/api/java/ExecutionEnvironment.java#L1128-L1140
train
Creates a local environment with web UI.
[ 30522, 1030, 2270, 6777, 4747, 6455, 2270, 10763, 7781, 2368, 21663, 2239, 3672, 3443, 4135, 9289, 2368, 21663, 2239, 3672, 24415, 8545, 8569, 2072, 1006, 9563, 9530, 2546, 1007, 1063, 4638, 17048, 11231, 3363, 1006, 9530, 2546, 1010, 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...
apache/flink
flink-core/src/main/java/org/apache/flink/api/java/typeutils/runtime/PojoComparator.java
PojoComparator.accessField
public final Object accessField(Field field, Object object) { try { object = field.get(object); } catch (NullPointerException npex) { throw new NullKeyFieldException("Unable to access field "+field+" on object "+object); } catch (IllegalAccessException iaex) { throw new RuntimeException("This should not happen since we call setAccesssible(true) in PojoTypeInfo." + " fields: " + field + " obj: " + object); } return object; }
java
public final Object accessField(Field field, Object object) { try { object = field.get(object); } catch (NullPointerException npex) { throw new NullKeyFieldException("Unable to access field "+field+" on object "+object); } catch (IllegalAccessException iaex) { throw new RuntimeException("This should not happen since we call setAccesssible(true) in PojoTypeInfo." + " fields: " + field + " obj: " + object); } return object; }
[ "public", "final", "Object", "accessField", "(", "Field", "field", ",", "Object", "object", ")", "{", "try", "{", "object", "=", "field", ".", "get", "(", "object", ")", ";", "}", "catch", "(", "NullPointerException", "npex", ")", "{", "throw", "new", ...
This method is handling the IllegalAccess exceptions of Field.get()
[ "This", "method", "is", "handling", "the", "IllegalAccess", "exceptions", "of", "Field", ".", "get", "()" ]
b62db93bf63cb3bb34dd03d611a779d9e3fc61ac
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-core/src/main/java/org/apache/flink/api/java/typeutils/runtime/PojoComparator.java#L177-L187
train
Access the value of the given field on the given object.
[ 30522, 2270, 2345, 4874, 3229, 3790, 1006, 2492, 2492, 1010, 4874, 4874, 1007, 1063, 3046, 1063, 4874, 1027, 2492, 1012, 2131, 1006, 4874, 1007, 1025, 1065, 4608, 1006, 19701, 8400, 7869, 2595, 24422, 27937, 10288, 1007, 1063, 5466, 2047, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -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/highavailability/zookeeper/ZooKeeperHaServices.java
ZooKeeperHaServices.close
@Override public void close() throws Exception { Throwable exception = null; try { blobStoreService.close(); } catch (Throwable t) { exception = t; } internalClose(); if (exception != null) { ExceptionUtils.rethrowException(exception, "Could not properly close the ZooKeeperHaServices."); } }
java
@Override public void close() throws Exception { Throwable exception = null; try { blobStoreService.close(); } catch (Throwable t) { exception = t; } internalClose(); if (exception != null) { ExceptionUtils.rethrowException(exception, "Could not properly close the ZooKeeperHaServices."); } }
[ "@", "Override", "public", "void", "close", "(", ")", "throws", "Exception", "{", "Throwable", "exception", "=", "null", ";", "try", "{", "blobStoreService", ".", "close", "(", ")", ";", "}", "catch", "(", "Throwable", "t", ")", "{", "exception", "=", ...
------------------------------------------------------------------------
[ "------------------------------------------------------------------------" ]
b62db93bf63cb3bb34dd03d611a779d9e3fc61ac
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/highavailability/zookeeper/ZooKeeperHaServices.java#L202-L217
train
Close the ZooKeeperHaServices.
[ 30522, 1030, 2058, 15637, 2270, 11675, 2485, 1006, 1007, 11618, 6453, 1063, 5466, 3085, 6453, 1027, 19701, 1025, 3046, 1063, 1038, 4135, 5910, 19277, 8043, 7903, 2063, 1012, 2485, 1006, 1007, 1025, 1065, 4608, 1006, 5466, 3085, 1056, 1007, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
apache/flink
flink-java/src/main/java/org/apache/flink/api/java/utils/DataSetUtils.java
DataSetUtils.zipWithUniqueId
public static <T> DataSet<Tuple2<Long, T>> zipWithUniqueId (DataSet <T> input) { return input.mapPartition(new RichMapPartitionFunction<T, Tuple2<Long, T>>() { long maxBitSize = getBitSize(Long.MAX_VALUE); long shifter = 0; long start = 0; long taskId = 0; long label = 0; @Override public void open(Configuration parameters) throws Exception { super.open(parameters); shifter = getBitSize(getRuntimeContext().getNumberOfParallelSubtasks() - 1); taskId = getRuntimeContext().getIndexOfThisSubtask(); } @Override public void mapPartition(Iterable<T> values, Collector<Tuple2<Long, T>> out) throws Exception { for (T value : values) { label = (start << shifter) + taskId; if (getBitSize(start) + shifter < maxBitSize) { out.collect(new Tuple2<>(label, value)); start++; } else { throw new Exception("Exceeded Long value range while generating labels"); } } } }); }
java
public static <T> DataSet<Tuple2<Long, T>> zipWithUniqueId (DataSet <T> input) { return input.mapPartition(new RichMapPartitionFunction<T, Tuple2<Long, T>>() { long maxBitSize = getBitSize(Long.MAX_VALUE); long shifter = 0; long start = 0; long taskId = 0; long label = 0; @Override public void open(Configuration parameters) throws Exception { super.open(parameters); shifter = getBitSize(getRuntimeContext().getNumberOfParallelSubtasks() - 1); taskId = getRuntimeContext().getIndexOfThisSubtask(); } @Override public void mapPartition(Iterable<T> values, Collector<Tuple2<Long, T>> out) throws Exception { for (T value : values) { label = (start << shifter) + taskId; if (getBitSize(start) + shifter < maxBitSize) { out.collect(new Tuple2<>(label, value)); start++; } else { throw new Exception("Exceeded Long value range while generating labels"); } } } }); }
[ "public", "static", "<", "T", ">", "DataSet", "<", "Tuple2", "<", "Long", ",", "T", ">", ">", "zipWithUniqueId", "(", "DataSet", "<", "T", ">", "input", ")", "{", "return", "input", ".", "mapPartition", "(", "new", "RichMapPartitionFunction", "<", "T", ...
Method that assigns a unique {@link Long} value to all elements in the input data set as described below. <ul> <li> a map function is applied to the input data set <li> each map task holds a counter c which is increased for each record <li> c is shifted by n bits where n = log2(number of parallel tasks) <li> to create a unique ID among all tasks, the task id is added to the counter <li> for each record, the resulting counter is collected </ul> @param input the input data set @return a data set of tuple 2 consisting of ids and initial values.
[ "Method", "that", "assigns", "a", "unique", "{", "@link", "Long", "}", "value", "to", "all", "elements", "in", "the", "input", "data", "set", "as", "described", "below", ".", "<ul", ">", "<li", ">", "a", "map", "function", "is", "applied", "to", "the",...
b62db93bf63cb3bb34dd03d611a779d9e3fc61ac
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-java/src/main/java/org/apache/flink/api/java/utils/DataSetUtils.java#L149-L180
train
Zip with unique id.
[ 30522, 2270, 10763, 1026, 1056, 1028, 2951, 13462, 1026, 10722, 10814, 2475, 1026, 2146, 1010, 1056, 1028, 1028, 14101, 24415, 19496, 4226, 3593, 1006, 2951, 13462, 1026, 1056, 1028, 7953, 1007, 1063, 2709, 7953, 1012, 4949, 19362, 3775, 35...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -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.replaceAll
public static String replaceAll(CharSequence str, String regex, Func1<Matcher, String> replaceFun) { return replaceAll(str, Pattern.compile(regex), replaceFun); }
java
public static String replaceAll(CharSequence str, String regex, Func1<Matcher, String> replaceFun) { return replaceAll(str, Pattern.compile(regex), replaceFun); }
[ "public", "static", "String", "replaceAll", "(", "CharSequence", "str", ",", "String", "regex", ",", "Func1", "<", "Matcher", ",", "String", ">", "replaceFun", ")", "{", "return", "replaceAll", "(", "str", ",", "Pattern", ".", "compile", "(", "regex", ")",...
替换所有正则匹配的文本,并使用自定义函数决定如何替换 @param str 要替换的字符串 @param regex 用于匹配的正则式 @param replaceFun 决定如何替换的函数 @return 替换后的文本 @since 4.2.2
[ "替换所有正则匹配的文本,并使用自定义函数决定如何替换" ]
bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a
https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/util/ReUtil.java#L649-L651
train
Replaces all occurrences of the given regular expression with the given replacement function.
[ 30522, 2270, 10763, 5164, 5672, 8095, 1006, 25869, 3366, 4226, 5897, 2358, 2099, 1010, 5164, 19723, 10288, 1010, 4569, 2278, 2487, 1026, 2674, 2121, 1010, 5164, 1028, 5672, 11263, 2078, 1007, 1063, 2709, 5672, 8095, 1006, 2358, 2099, 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...
looly/hutool
hutool-core/src/main/java/cn/hutool/core/io/file/FileWriter.java
FileWriter.writeMap
public File writeMap(Map<?, ?> map, LineSeparator lineSeparator, String kvSeparator, boolean isAppend) throws IORuntimeException { if(null == kvSeparator) { kvSeparator = " = "; } try(PrintWriter writer = getPrintWriter(isAppend)) { for (Entry<?, ?> entry : map.entrySet()) { if (null != entry) { writer.print(StrUtil.format("{}{}{}", entry.getKey(), kvSeparator, entry.getValue())); printNewLine(writer, lineSeparator); writer.flush(); } } } return this.file; }
java
public File writeMap(Map<?, ?> map, LineSeparator lineSeparator, String kvSeparator, boolean isAppend) throws IORuntimeException { if(null == kvSeparator) { kvSeparator = " = "; } try(PrintWriter writer = getPrintWriter(isAppend)) { for (Entry<?, ?> entry : map.entrySet()) { if (null != entry) { writer.print(StrUtil.format("{}{}{}", entry.getKey(), kvSeparator, entry.getValue())); printNewLine(writer, lineSeparator); writer.flush(); } } } return this.file; }
[ "public", "File", "writeMap", "(", "Map", "<", "?", ",", "?", ">", "map", ",", "LineSeparator", "lineSeparator", ",", "String", "kvSeparator", ",", "boolean", "isAppend", ")", "throws", "IORuntimeException", "{", "if", "(", "null", "==", "kvSeparator", ")", ...
将Map写入文件,每个键值对为一行,一行中键与值之间使用kvSeparator分隔 @param map Map @param lineSeparator 换行符枚举(Windows、Mac或Linux换行符) @param kvSeparator 键和值之间的分隔符,如果传入null使用默认分隔符" = " @param isAppend 是否追加 @return 目标文件 @throws IORuntimeException IO异常 @since 4.0.5
[ "将Map写入文件,每个键值对为一行,一行中键与值之间使用kvSeparator分隔" ]
bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a
https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/io/file/FileWriter.java#L235-L249
train
Write a map to the file.
[ 30522, 2270, 5371, 4339, 2863, 30524, 3210, 13699, 25879, 2953, 3210, 13699, 25879, 2953, 1010, 5164, 24888, 3366, 28689, 4263, 1010, 22017, 20898, 18061, 21512, 4859, 1007, 11618, 22834, 15532, 7292, 10288, 24422, 1063, 2065, 1006, 19701, 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/checkpoint/savepoint/SavepointV2.java
SavepointV2.convertToOperatorStateSavepointV2
@Deprecated public static Savepoint convertToOperatorStateSavepointV2( Map<JobVertexID, ExecutionJobVertex> tasks, Savepoint savepoint) { if (savepoint.getOperatorStates() != null) { return savepoint; } boolean expandedToLegacyIds = false; Map<OperatorID, OperatorState> operatorStates = new HashMap<>(savepoint.getTaskStates().size() << 1); for (TaskState taskState : savepoint.getTaskStates()) { ExecutionJobVertex jobVertex = tasks.get(taskState.getJobVertexID()); // on the first time we can not find the execution job vertex for an id, we also consider alternative ids, // for example as generated from older flink versions, to provide backwards compatibility. if (jobVertex == null && !expandedToLegacyIds) { tasks = ExecutionJobVertex.includeLegacyJobVertexIDs(tasks); jobVertex = tasks.get(taskState.getJobVertexID()); expandedToLegacyIds = true; } if (jobVertex == null) { throw new IllegalStateException( "Could not find task for state with ID " + taskState.getJobVertexID() + ". " + "When migrating a savepoint from a version < 1.3 please make sure that the topology was not " + "changed through removal of a stateful operator or modification of a chain containing a stateful " + "operator."); } List<OperatorID> operatorIDs = jobVertex.getOperatorIDs(); Preconditions.checkArgument( jobVertex.getParallelism() == taskState.getParallelism(), "Detected change in parallelism during migration for task " + jobVertex.getJobVertexId() +"." + "When migrating a savepoint from a version < 1.3 please make sure that no changes were made " + "to the parallelism of stateful operators."); Preconditions.checkArgument( operatorIDs.size() == taskState.getChainLength(), "Detected change in chain length during migration for task " + jobVertex.getJobVertexId() +". " + "When migrating a savepoint from a version < 1.3 please make sure that the topology was not " + "changed by modification of a chain containing a stateful operator."); for (int subtaskIndex = 0; subtaskIndex < jobVertex.getParallelism(); subtaskIndex++) { SubtaskState subtaskState; try { subtaskState = taskState.getState(subtaskIndex); } catch (Exception e) { throw new IllegalStateException( "Could not find subtask with index " + subtaskIndex + " for task " + jobVertex.getJobVertexId() + ". " + "When migrating a savepoint from a version < 1.3 please make sure that no changes were made " + "to the parallelism of stateful operators.", e); } if (subtaskState == null) { continue; } ChainedStateHandle<OperatorStateHandle> partitioneableState = subtaskState.getManagedOperatorState(); ChainedStateHandle<OperatorStateHandle> rawOperatorState = subtaskState.getRawOperatorState(); for (int chainIndex = 0; chainIndex < taskState.getChainLength(); chainIndex++) { // task consists of multiple operators so we have to break the state apart for (int operatorIndex = 0; operatorIndex < operatorIDs.size(); operatorIndex++) { OperatorID operatorID = operatorIDs.get(operatorIndex); OperatorState operatorState = operatorStates.get(operatorID); if (operatorState == null) { operatorState = new OperatorState( operatorID, jobVertex.getParallelism(), jobVertex.getMaxParallelism()); operatorStates.put(operatorID, operatorState); } KeyedStateHandle managedKeyedState = null; KeyedStateHandle rawKeyedState = null; // only the head operator retains the keyed state if (operatorIndex == operatorIDs.size() - 1) { managedKeyedState = subtaskState.getManagedKeyedState(); rawKeyedState = subtaskState.getRawKeyedState(); } OperatorSubtaskState operatorSubtaskState = new OperatorSubtaskState( partitioneableState != null ? partitioneableState.get(operatorIndex) : null, rawOperatorState != null ? rawOperatorState.get(operatorIndex) : null, managedKeyedState, rawKeyedState); operatorState.putState(subtaskIndex, operatorSubtaskState); } } } } return new SavepointV2( savepoint.getCheckpointId(), operatorStates.values(), savepoint.getMasterStates()); }
java
@Deprecated public static Savepoint convertToOperatorStateSavepointV2( Map<JobVertexID, ExecutionJobVertex> tasks, Savepoint savepoint) { if (savepoint.getOperatorStates() != null) { return savepoint; } boolean expandedToLegacyIds = false; Map<OperatorID, OperatorState> operatorStates = new HashMap<>(savepoint.getTaskStates().size() << 1); for (TaskState taskState : savepoint.getTaskStates()) { ExecutionJobVertex jobVertex = tasks.get(taskState.getJobVertexID()); // on the first time we can not find the execution job vertex for an id, we also consider alternative ids, // for example as generated from older flink versions, to provide backwards compatibility. if (jobVertex == null && !expandedToLegacyIds) { tasks = ExecutionJobVertex.includeLegacyJobVertexIDs(tasks); jobVertex = tasks.get(taskState.getJobVertexID()); expandedToLegacyIds = true; } if (jobVertex == null) { throw new IllegalStateException( "Could not find task for state with ID " + taskState.getJobVertexID() + ". " + "When migrating a savepoint from a version < 1.3 please make sure that the topology was not " + "changed through removal of a stateful operator or modification of a chain containing a stateful " + "operator."); } List<OperatorID> operatorIDs = jobVertex.getOperatorIDs(); Preconditions.checkArgument( jobVertex.getParallelism() == taskState.getParallelism(), "Detected change in parallelism during migration for task " + jobVertex.getJobVertexId() +"." + "When migrating a savepoint from a version < 1.3 please make sure that no changes were made " + "to the parallelism of stateful operators."); Preconditions.checkArgument( operatorIDs.size() == taskState.getChainLength(), "Detected change in chain length during migration for task " + jobVertex.getJobVertexId() +". " + "When migrating a savepoint from a version < 1.3 please make sure that the topology was not " + "changed by modification of a chain containing a stateful operator."); for (int subtaskIndex = 0; subtaskIndex < jobVertex.getParallelism(); subtaskIndex++) { SubtaskState subtaskState; try { subtaskState = taskState.getState(subtaskIndex); } catch (Exception e) { throw new IllegalStateException( "Could not find subtask with index " + subtaskIndex + " for task " + jobVertex.getJobVertexId() + ". " + "When migrating a savepoint from a version < 1.3 please make sure that no changes were made " + "to the parallelism of stateful operators.", e); } if (subtaskState == null) { continue; } ChainedStateHandle<OperatorStateHandle> partitioneableState = subtaskState.getManagedOperatorState(); ChainedStateHandle<OperatorStateHandle> rawOperatorState = subtaskState.getRawOperatorState(); for (int chainIndex = 0; chainIndex < taskState.getChainLength(); chainIndex++) { // task consists of multiple operators so we have to break the state apart for (int operatorIndex = 0; operatorIndex < operatorIDs.size(); operatorIndex++) { OperatorID operatorID = operatorIDs.get(operatorIndex); OperatorState operatorState = operatorStates.get(operatorID); if (operatorState == null) { operatorState = new OperatorState( operatorID, jobVertex.getParallelism(), jobVertex.getMaxParallelism()); operatorStates.put(operatorID, operatorState); } KeyedStateHandle managedKeyedState = null; KeyedStateHandle rawKeyedState = null; // only the head operator retains the keyed state if (operatorIndex == operatorIDs.size() - 1) { managedKeyedState = subtaskState.getManagedKeyedState(); rawKeyedState = subtaskState.getRawKeyedState(); } OperatorSubtaskState operatorSubtaskState = new OperatorSubtaskState( partitioneableState != null ? partitioneableState.get(operatorIndex) : null, rawOperatorState != null ? rawOperatorState.get(operatorIndex) : null, managedKeyedState, rawKeyedState); operatorState.putState(subtaskIndex, operatorSubtaskState); } } } } return new SavepointV2( savepoint.getCheckpointId(), operatorStates.values(), savepoint.getMasterStates()); }
[ "@", "Deprecated", "public", "static", "Savepoint", "convertToOperatorStateSavepointV2", "(", "Map", "<", "JobVertexID", ",", "ExecutionJobVertex", ">", "tasks", ",", "Savepoint", "savepoint", ")", "{", "if", "(", "savepoint", ".", "getOperatorStates", "(", ")", "...
Converts the {@link Savepoint} containing {@link TaskState TaskStates} to an equivalent savepoint containing {@link OperatorState OperatorStates}. @param savepoint savepoint to convert @param tasks map of all vertices and their job vertex ids @return converted completed checkpoint @deprecated Only kept for backwards-compatibility with versions < 1.3. Will be removed in the future.
[ "Converts", "the", "{", "@link", "Savepoint", "}", "containing", "{", "@link", "TaskState", "TaskStates", "}", "to", "an", "equivalent", "savepoint", "containing", "{", "@link", "OperatorState", "OperatorStates", "}", "." ]
b62db93bf63cb3bb34dd03d611a779d9e3fc61ac
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/checkpoint/savepoint/SavepointV2.java#L147-L254
train
Convert a savepoint from a version 1. 3 to a savepoint from a version 1. 3.
[ 30522, 1030, 2139, 28139, 12921, 2270, 10763, 3828, 8400, 10463, 3406, 25918, 18926, 12259, 3736, 3726, 8400, 2615, 2475, 1006, 4949, 1026, 3105, 16874, 10288, 3593, 1010, 7781, 5558, 2497, 16874, 10288, 1028, 8518, 1010, 3828, 8400, 3828, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
looly/hutool
hutool-crypto/src/main/java/cn/hutool/crypto/KeyUtil.java
KeyUtil.getKeyFactory
public static KeyFactory getKeyFactory(String algorithm) { final Provider provider = GlobalBouncyCastleProvider.INSTANCE.getProvider(); KeyFactory keyFactory; try { keyFactory = (null == provider) // ? KeyFactory.getInstance(getMainAlgorithm(algorithm)) // : KeyFactory.getInstance(getMainAlgorithm(algorithm), provider); } catch (NoSuchAlgorithmException e) { throw new CryptoException(e); } return keyFactory; }
java
public static KeyFactory getKeyFactory(String algorithm) { final Provider provider = GlobalBouncyCastleProvider.INSTANCE.getProvider(); KeyFactory keyFactory; try { keyFactory = (null == provider) // ? KeyFactory.getInstance(getMainAlgorithm(algorithm)) // : KeyFactory.getInstance(getMainAlgorithm(algorithm), provider); } catch (NoSuchAlgorithmException e) { throw new CryptoException(e); } return keyFactory; }
[ "public", "static", "KeyFactory", "getKeyFactory", "(", "String", "algorithm", ")", "{", "final", "Provider", "provider", "=", "GlobalBouncyCastleProvider", ".", "INSTANCE", ".", "getProvider", "(", ")", ";", "KeyFactory", "keyFactory", ";", "try", "{", "keyFactor...
获取{@link KeyFactory} @param algorithm 非对称加密算法 @return {@link KeyFactory} @since 4.4.4
[ "获取", "{", "@link", "KeyFactory", "}" ]
bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a
https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-crypto/src/main/java/cn/hutool/crypto/KeyUtil.java#L459-L471
train
Gets the KeyFactory for the given algorithm.
[ 30522, 2270, 10763, 3145, 21450, 2131, 14839, 21450, 1006, 5164, 9896, 1007, 1063, 2345, 10802, 10802, 1027, 3795, 5092, 4609, 5666, 23662, 21572, 17258, 2121, 1012, 6013, 1012, 2131, 21572, 17258, 2121, 1006, 1007, 30524, 1024, 3145, 21450, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
looly/hutool
hutool-core/src/main/java/cn/hutool/core/img/ImgUtil.java
ImgUtil.rotate
public static BufferedImage rotate(Image image, int degree) { return Img.from(image).rotate(degree).getImg(); }
java
public static BufferedImage rotate(Image image, int degree) { return Img.from(image).rotate(degree).getImg(); }
[ "public", "static", "BufferedImage", "rotate", "(", "Image", "image", ",", "int", "degree", ")", "{", "return", "Img", ".", "from", "(", "image", ")", ".", "rotate", "(", "degree", ")", ".", "getImg", "(", ")", ";", "}" ]
旋转图片为指定角度<br> 来自:http://blog.51cto.com/cping1982/130066 @param image 目标图像 @param degree 旋转角度 @return 旋转后的图片 @since 3.2.2
[ "旋转图片为指定角度<br", ">", "来自:http", ":", "//", "blog", ".", "51cto", ".", "com", "/", "cping1982", "/", "130066" ]
bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a
https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/img/ImgUtil.java#L1057-L1059
train
Rotate an image.
[ 30522, 2270, 10763, 17698, 2098, 9581, 3351, 24357, 1006, 3746, 3746, 1010, 20014, 3014, 1007, 1063, 2709, 10047, 2290, 1012, 2013, 1006, 3746, 1007, 1012, 24357, 1006, 3014, 1007, 1012, 2131, 5714, 2290, 1006, 1007, 1025, 1065, 102, 0, 0...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
looly/hutool
hutool-extra/src/main/java/cn/hutool/extra/ftp/Ftp.java
Ftp.init
public Ftp init(String host, int port, String user, String password) { return this.init(host,port,user,password,null); }
java
public Ftp init(String host, int port, String user, String password) { return this.init(host,port,user,password,null); }
[ "public", "Ftp", "init", "(", "String", "host", ",", "int", "port", ",", "String", "user", ",", "String", "password", ")", "{", "return", "this", ".", "init", "(", "host", ",", "port", ",", "user", ",", "password", ",", "null", ")", ";", "}" ]
初始化连接 @param host 域名或IP @param port 端口 @param user 用户名 @param password 密码 @return this
[ "初始化连接" ]
bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a
https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-extra/src/main/java/cn/hutool/extra/ftp/Ftp.java#L118-L120
train
Initializes the connection to the specified host.
[ 30522, 2270, 3027, 2361, 1999, 4183, 1006, 5164, 3677, 1010, 20014, 3417, 1010, 5164, 5310, 1010, 5164, 20786, 1007, 1063, 2709, 2023, 1012, 1999, 4183, 1006, 3677, 1010, 3417, 1010, 5310, 1010, 20786, 1010, 19701, 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...
apache/spark
core/src/main/java/org/apache/spark/memory/MemoryConsumer.java
MemoryConsumer.allocateArray
public LongArray allocateArray(long size) { long required = size * 8L; MemoryBlock page = taskMemoryManager.allocatePage(required, this); if (page == null || page.size() < required) { throwOom(page, required); } used += required; return new LongArray(page); }
java
public LongArray allocateArray(long size) { long required = size * 8L; MemoryBlock page = taskMemoryManager.allocatePage(required, this); if (page == null || page.size() < required) { throwOom(page, required); } used += required; return new LongArray(page); }
[ "public", "LongArray", "allocateArray", "(", "long", "size", ")", "{", "long", "required", "=", "size", "*", "8L", ";", "MemoryBlock", "page", "=", "taskMemoryManager", ".", "allocatePage", "(", "required", ",", "this", ")", ";", "if", "(", "page", "==", ...
Allocates a LongArray of `size`. Note that this method may throw `SparkOutOfMemoryError` if Spark doesn't have enough memory for this allocation, or throw `TooLargePageException` if this `LongArray` is too large to fit in a single page. The caller side should take care of these two exceptions, or make sure the `size` is small enough that won't trigger exceptions. @throws SparkOutOfMemoryError @throws TooLargePageException
[ "Allocates", "a", "LongArray", "of", "size", ".", "Note", "that", "this", "method", "may", "throw", "SparkOutOfMemoryError", "if", "Spark", "doesn", "t", "have", "enough", "memory", "for", "this", "allocation", "or", "throw", "TooLargePageException", "if", "this...
25ee0474f47d9c30d6f553a7892d9549f91071cf
https://github.com/apache/spark/blob/25ee0474f47d9c30d6f553a7892d9549f91071cf/core/src/main/java/org/apache/spark/memory/MemoryConsumer.java#L94-L102
train
Allocate a long array of the specified size.
[ 30522, 2270, 2146, 2906, 9447, 2035, 24755, 27058, 11335, 2100, 1006, 2146, 2946, 1007, 1063, 2146, 3223, 1027, 2946, 1008, 1022, 2140, 1025, 3638, 23467, 3931, 1027, 4708, 4168, 5302, 2854, 24805, 4590, 1012, 2035, 24755, 2618, 13704, 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/web/servlet/ServletRegistrationBean.java
ServletRegistrationBean.addUrlMappings
public void addUrlMappings(String... urlMappings) { Assert.notNull(urlMappings, "UrlMappings must not be null"); this.urlMappings.addAll(Arrays.asList(urlMappings)); }
java
public void addUrlMappings(String... urlMappings) { Assert.notNull(urlMappings, "UrlMappings must not be null"); this.urlMappings.addAll(Arrays.asList(urlMappings)); }
[ "public", "void", "addUrlMappings", "(", "String", "...", "urlMappings", ")", "{", "Assert", ".", "notNull", "(", "urlMappings", ",", "\"UrlMappings must not be null\"", ")", ";", "this", ".", "urlMappings", ".", "addAll", "(", "Arrays", ".", "asList", "(", "u...
Add URL mappings, as defined in the Servlet specification, for the servlet. @param urlMappings the mappings to add @see #setUrlMappings(Collection)
[ "Add", "URL", "mappings", "as", "defined", "in", "the", "Servlet", "specification", "for", "the", "servlet", "." ]
0b27f7c70e164b2b1a96477f1d9c1acba56790c1
https://github.com/spring-projects/spring-boot/blob/0b27f7c70e164b2b1a96477f1d9c1acba56790c1/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/servlet/ServletRegistrationBean.java#L140-L143
train
Add url mappings.
[ 30522, 2270, 11675, 5587, 3126, 19145, 14853, 2015, 1006, 5164, 1012, 1012, 1012, 24471, 19145, 14853, 2015, 1007, 1063, 20865, 1012, 2025, 11231, 3363, 1006, 24471, 19145, 14853, 2015, 1010, 1000, 24471, 19145, 14853, 2015, 2442, 2025, 2022,...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
apache/flink
flink-connectors/flink-connector-elasticsearch-base/src/main/java/org/apache/flink/table/descriptors/Elasticsearch.java
Elasticsearch.bulkFlushMaxSize
public Elasticsearch bulkFlushMaxSize(String maxSize) { internalProperties.putMemorySize(CONNECTOR_BULK_FLUSH_MAX_SIZE, MemorySize.parse(maxSize, MemorySize.MemoryUnit.BYTES)); return this; }
java
public Elasticsearch bulkFlushMaxSize(String maxSize) { internalProperties.putMemorySize(CONNECTOR_BULK_FLUSH_MAX_SIZE, MemorySize.parse(maxSize, MemorySize.MemoryUnit.BYTES)); return this; }
[ "public", "Elasticsearch", "bulkFlushMaxSize", "(", "String", "maxSize", ")", "{", "internalProperties", ".", "putMemorySize", "(", "CONNECTOR_BULK_FLUSH_MAX_SIZE", ",", "MemorySize", ".", "parse", "(", "maxSize", ",", "MemorySize", ".", "MemoryUnit", ".", "BYTES", ...
Configures how to buffer elements before sending them in bulk to the cluster for efficiency. <p>Sets the maximum size of buffered actions per bulk request (using the syntax of {@link MemorySize}).
[ "Configures", "how", "to", "buffer", "elements", "before", "sending", "them", "in", "bulk", "to", "the", "cluster", "for", "efficiency", "." ]
b62db93bf63cb3bb34dd03d611a779d9e3fc61ac
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-connectors/flink-connector-elasticsearch-base/src/main/java/org/apache/flink/table/descriptors/Elasticsearch.java#L209-L212
train
Sets the maximum size of the bulk flush operation to be performed.
[ 30522, 2270, 21274, 17310, 11140, 9625, 10258, 20668, 17848, 5332, 4371, 1006, 5164, 4098, 5332, 4371, 1007, 1063, 4722, 21572, 4842, 7368, 1012, 2404, 4168, 5302, 24769, 4697, 1006, 19400, 1035, 9625, 1035, 13862, 1035, 4098, 1035, 2946, 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-optimizer/src/main/java/org/apache/flink/optimizer/plan/WorksetIterationPlanNode.java
WorksetIterationPlanNode.setCosts
public void setCosts(Costs nodeCosts) { // add the costs from the step function nodeCosts.addCosts(this.solutionSetDeltaPlanNode.getCumulativeCostsShare()); nodeCosts.addCosts(this.nextWorkSetPlanNode.getCumulativeCostsShare()); super.setCosts(nodeCosts); }
java
public void setCosts(Costs nodeCosts) { // add the costs from the step function nodeCosts.addCosts(this.solutionSetDeltaPlanNode.getCumulativeCostsShare()); nodeCosts.addCosts(this.nextWorkSetPlanNode.getCumulativeCostsShare()); super.setCosts(nodeCosts); }
[ "public", "void", "setCosts", "(", "Costs", "nodeCosts", ")", "{", "// add the costs from the step function", "nodeCosts", ".", "addCosts", "(", "this", ".", "solutionSetDeltaPlanNode", ".", "getCumulativeCostsShare", "(", ")", ")", ";", "nodeCosts", ".", "addCosts", ...
--------------------------------------------------------------------------------------------
[ "--------------------------------------------------------------------------------------------" ]
b62db93bf63cb3bb34dd03d611a779d9e3fc61ac
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-optimizer/src/main/java/org/apache/flink/optimizer/plan/WorksetIterationPlanNode.java#L152-L158
train
Add costs from the solution set delta and next work set costs to the node costs
[ 30522, 2270, 11675, 2275, 13186, 3215, 1006, 5366, 13045, 13186, 3215, 1007, 1063, 1013, 1013, 5587, 1996, 5366, 2013, 1996, 3357, 3853, 13045, 13186, 3215, 1012, 5587, 13186, 3215, 1006, 2023, 1012, 7300, 3388, 9247, 2696, 24759, 11639, 10...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
looly/hutool
hutool-core/src/main/java/cn/hutool/core/collection/IterUtil.java
IterUtil.join
public static <T> String join(Iterator<T> iterator, CharSequence conjunction) { return join(iterator, conjunction, null, null); }
java
public static <T> String join(Iterator<T> iterator, CharSequence conjunction) { return join(iterator, conjunction, null, null); }
[ "public", "static", "<", "T", ">", "String", "join", "(", "Iterator", "<", "T", ">", "iterator", ",", "CharSequence", "conjunction", ")", "{", "return", "join", "(", "iterator", ",", "conjunction", ",", "null", ",", "null", ")", ";", "}" ]
以 conjunction 为分隔符将集合转换为字符串<br> 如果集合元素为数组、{@link Iterable}或{@link Iterator},则递归组合其为字符串 @param <T> 集合元素类型 @param iterator 集合 @param conjunction 分隔符 @return 连接后的字符串
[ "以", "conjunction", "为分隔符将集合转换为字符串<br", ">", "如果集合元素为数组、", "{", "@link", "Iterable", "}", "或", "{", "@link", "Iterator", "}", ",则递归组合其为字符串" ]
bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a
https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/collection/IterUtil.java#L296-L298
train
Joins the elements of an iterator with the given conjunction.
[ 30522, 2270, 10763, 1026, 1056, 1028, 5164, 3693, 1006, 2009, 6906, 4263, 1026, 1056, 1028, 2009, 6906, 4263, 1010, 25869, 3366, 4226, 5897, 9595, 1007, 1063, 2709, 3693, 1006, 2009, 6906, 4263, 1010, 9595, 1010, 19701, 1010, 19701, 1007, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
apache/flink
flink-runtime/src/main/java/org/apache/flink/runtime/broadcast/BroadcastVariableManager.java
BroadcastVariableManager.materializeBroadcastVariable
public <T> BroadcastVariableMaterialization<T, ?> materializeBroadcastVariable(String name, int superstep, BatchTask<?, ?> holder, MutableReader<?> reader, TypeSerializerFactory<T> serializerFactory) throws IOException { final BroadcastVariableKey key = new BroadcastVariableKey(holder.getEnvironment().getJobVertexId(), name, superstep); while (true) { final BroadcastVariableMaterialization<T, Object> newMat = new BroadcastVariableMaterialization<T, Object>(key); final BroadcastVariableMaterialization<?, ?> previous = variables.putIfAbsent(key, newMat); @SuppressWarnings("unchecked") final BroadcastVariableMaterialization<T, ?> materialization = (previous == null) ? newMat : (BroadcastVariableMaterialization<T, ?>) previous; try { materialization.materializeVariable(reader, serializerFactory, holder); return materialization; } catch (MaterializationExpiredException e) { // concurrent release. as an optimization, try to replace the previous one with our version. otherwise we might spin for a while // until the releaser removes the variable // NOTE: This would also catch a bug prevented an expired materialization from ever being removed, so it acts as a future safeguard boolean replaceSuccessful = false; try { replaceSuccessful = variables.replace(key, materialization, newMat); } catch (Throwable t) {} if (replaceSuccessful) { try { newMat.materializeVariable(reader, serializerFactory, holder); return newMat; } catch (MaterializationExpiredException ee) { // can still happen in cases of extreme races and fast tasks // fall through the loop; } } // else fall through the loop } } }
java
public <T> BroadcastVariableMaterialization<T, ?> materializeBroadcastVariable(String name, int superstep, BatchTask<?, ?> holder, MutableReader<?> reader, TypeSerializerFactory<T> serializerFactory) throws IOException { final BroadcastVariableKey key = new BroadcastVariableKey(holder.getEnvironment().getJobVertexId(), name, superstep); while (true) { final BroadcastVariableMaterialization<T, Object> newMat = new BroadcastVariableMaterialization<T, Object>(key); final BroadcastVariableMaterialization<?, ?> previous = variables.putIfAbsent(key, newMat); @SuppressWarnings("unchecked") final BroadcastVariableMaterialization<T, ?> materialization = (previous == null) ? newMat : (BroadcastVariableMaterialization<T, ?>) previous; try { materialization.materializeVariable(reader, serializerFactory, holder); return materialization; } catch (MaterializationExpiredException e) { // concurrent release. as an optimization, try to replace the previous one with our version. otherwise we might spin for a while // until the releaser removes the variable // NOTE: This would also catch a bug prevented an expired materialization from ever being removed, so it acts as a future safeguard boolean replaceSuccessful = false; try { replaceSuccessful = variables.replace(key, materialization, newMat); } catch (Throwable t) {} if (replaceSuccessful) { try { newMat.materializeVariable(reader, serializerFactory, holder); return newMat; } catch (MaterializationExpiredException ee) { // can still happen in cases of extreme races and fast tasks // fall through the loop; } } // else fall through the loop } } }
[ "public", "<", "T", ">", "BroadcastVariableMaterialization", "<", "T", ",", "?", ">", "materializeBroadcastVariable", "(", "String", "name", ",", "int", "superstep", ",", "BatchTask", "<", "?", ",", "?", ">", "holder", ",", "MutableReader", "<", "?", ">", ...
Materializes the broadcast variable for the given name, scoped to the given task and its iteration superstep. An existing materialization created by another parallel subtask may be returned, if it hasn't expired yet.
[ "Materializes", "the", "broadcast", "variable", "for", "the", "given", "name", "scoped", "to", "the", "given", "task", "and", "its", "iteration", "superstep", ".", "An", "existing", "materialization", "created", "by", "another", "parallel", "subtask", "may", "be...
b62db93bf63cb3bb34dd03d611a779d9e3fc61ac
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/broadcast/BroadcastVariableManager.java#L45-L85
train
Materialize a broadcast variable.
[ 30522, 2270, 1026, 1056, 1028, 3743, 10755, 19210, 30524, 11610, 28863, 21450, 1026, 1056, 1028, 7642, 17629, 21450, 1007, 11618, 22834, 10288, 24422, 1063, 2345, 3743, 10755, 19210, 14839, 3145, 1027, 2047, 3743, 10755, 19210, 14839, 1006, 9...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -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.file
public static File file(String... names) { if (ArrayUtil.isEmpty(names)) { return null; } File file = null; for (String name : names) { if (file == null) { file = file(name); } else { file = file(file, name); } } return file; }
java
public static File file(String... names) { if (ArrayUtil.isEmpty(names)) { return null; } File file = null; for (String name : names) { if (file == null) { file = file(name); } else { file = file(file, name); } } return file; }
[ "public", "static", "File", "file", "(", "String", "...", "names", ")", "{", "if", "(", "ArrayUtil", ".", "isEmpty", "(", "names", ")", ")", "{", "return", "null", ";", "}", "File", "file", "=", "null", ";", "for", "(", "String", "name", ":", "name...
通过多层目录创建文件 元素名(多层目录名) @return the file 文件 @since 4.0.6
[ "通过多层目录创建文件" ]
bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a
https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/io/FileUtil.java#L380-L394
train
Creates a new File object with the specified name and directories.
[ 30522, 2270, 10763, 5371, 5371, 1006, 5164, 1012, 1012, 1012, 3415, 1007, 1063, 2065, 1006, 9140, 21823, 2140, 1012, 2003, 6633, 13876, 2100, 1006, 3415, 1007, 1007, 1063, 2709, 19701, 1025, 1065, 5371, 5371, 1027, 19701, 1025, 2005, 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-json/src/main/java/cn/hutool/json/JSONArray.java
JSONArray.toJSONObject
public JSONObject toJSONObject(JSONArray names) throws JSONException { if (names == null || names.size() == 0 || this.size() == 0) { return null; } JSONObject jo = new JSONObject(); for (int i = 0; i < names.size(); i += 1) { jo.put(names.getStr(i), this.getObj(i)); } return jo; }
java
public JSONObject toJSONObject(JSONArray names) throws JSONException { if (names == null || names.size() == 0 || this.size() == 0) { return null; } JSONObject jo = new JSONObject(); for (int i = 0; i < names.size(); i += 1) { jo.put(names.getStr(i), this.getObj(i)); } return jo; }
[ "public", "JSONObject", "toJSONObject", "(", "JSONArray", "names", ")", "throws", "JSONException", "{", "if", "(", "names", "==", "null", "||", "names", ".", "size", "(", ")", "==", "0", "||", "this", ".", "size", "(", ")", "==", "0", ")", "{", "retu...
根据给定名列表,与其位置对应的值组成JSONObject @param names 名列表,位置与JSONArray中的值位置对应 @return A JSONObject,无名或值返回null @throws JSONException 如果任何一个名为null
[ "根据给定名列表,与其位置对应的值组成JSONObject" ]
bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a
https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-json/src/main/java/cn/hutool/json/JSONArray.java#L248-L257
train
Returns a JSONObject containing the contents of this object with the specified names.
[ 30522, 2270, 1046, 3385, 16429, 20614, 2000, 22578, 17175, 2497, 20614, 1006, 1046, 3385, 2906, 9447, 3415, 1007, 11618, 1046, 3385, 10288, 24422, 1063, 2065, 1006, 3415, 1027, 1027, 19701, 1064, 1064, 3415, 1012, 2946, 1006, 1007, 1027, 10...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
apache/flink
flink-table/flink-table-planner/src/main/java/org/apache/flink/table/operations/JoinOperationFactory.java
JoinOperationFactory.create
public TableOperation create( TableOperation left, TableOperation right, JoinType joinType, Expression condition, boolean correlated) { verifyConditionType(condition); validateNamesAmbiguity(left, right); validateCondition(right, joinType, condition, correlated); return new JoinTableOperation(left, right, joinType, condition, correlated); }
java
public TableOperation create( TableOperation left, TableOperation right, JoinType joinType, Expression condition, boolean correlated) { verifyConditionType(condition); validateNamesAmbiguity(left, right); validateCondition(right, joinType, condition, correlated); return new JoinTableOperation(left, right, joinType, condition, correlated); }
[ "public", "TableOperation", "create", "(", "TableOperation", "left", ",", "TableOperation", "right", ",", "JoinType", "joinType", ",", "Expression", "condition", ",", "boolean", "correlated", ")", "{", "verifyConditionType", "(", "condition", ")", ";", "validateName...
Creates a valid {@link JoinTableOperation} operation. <p>It performs validations such as: <ul> <li>condition returns boolean</li> <li>the condition is either always true or contains equi join</li> <li>left and right side of the join do not contain ambiguous column names</li> <li>that correlated join is an INNER join</li> </ul> @param left left side of the relational operation @param right right side of the relational operation @param joinType what sort of join to create @param condition join condition to apply @param correlated if the join should be a correlated join @return valid join operation
[ "Creates", "a", "valid", "{", "@link", "JoinTableOperation", "}", "operation", "." ]
b62db93bf63cb3bb34dd03d611a779d9e3fc61ac
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-table/flink-table-planner/src/main/java/org/apache/flink/table/operations/JoinOperationFactory.java#L71-L81
train
Create a new JoinTableOperation.
[ 30522, 2270, 2795, 25918, 3370, 3443, 1006, 2795, 25918, 3370, 2187, 1010, 2795, 25918, 3370, 2157, 1010, 4101, 18863, 4101, 18863, 1010, 3670, 4650, 1010, 22017, 20898, 23900, 1007, 1063, 20410, 8663, 20562, 13874, 1006, 4650, 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...
spring-projects/spring-boot
spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/embedded/tomcat/TomcatReactiveWebServerFactory.java
TomcatReactiveWebServerFactory.addProtocolHandlerCustomizers
@Override public void addProtocolHandlerCustomizers( TomcatProtocolHandlerCustomizer<?>... tomcatProtocolHandlerCustomizers) { Assert.notNull(tomcatProtocolHandlerCustomizers, "TomcatProtocolHandlerCustomizers must not be null"); this.tomcatProtocolHandlerCustomizers .addAll(Arrays.asList(tomcatProtocolHandlerCustomizers)); }
java
@Override public void addProtocolHandlerCustomizers( TomcatProtocolHandlerCustomizer<?>... tomcatProtocolHandlerCustomizers) { Assert.notNull(tomcatProtocolHandlerCustomizers, "TomcatProtocolHandlerCustomizers must not be null"); this.tomcatProtocolHandlerCustomizers .addAll(Arrays.asList(tomcatProtocolHandlerCustomizers)); }
[ "@", "Override", "public", "void", "addProtocolHandlerCustomizers", "(", "TomcatProtocolHandlerCustomizer", "<", "?", ">", "...", "tomcatProtocolHandlerCustomizers", ")", "{", "Assert", ".", "notNull", "(", "tomcatProtocolHandlerCustomizers", ",", "\"TomcatProtocolHandlerCust...
Add {@link TomcatProtocolHandlerCustomizer}s that should be added to the Tomcat {@link Connector}. @param tomcatProtocolHandlerCustomizers the customizers to add @since 2.2.0
[ "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/TomcatReactiveWebServerFactory.java#L311-L318
train
Add a list of Tomcat protocol handler customizers to the list.
[ 30522, 1030, 2058, 15637, 2270, 11675, 5587, 21572, 3406, 25778, 11774, 3917, 7874, 20389, 17629, 2015, 1006, 3419, 11266, 21572, 3406, 25778, 11774, 3917, 7874, 20389, 17629, 1026, 1029, 1028, 1012, 1012, 1012, 3419, 11266, 21572, 3406, 2577...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
apache/flink
flink-core/src/main/java/org/apache/flink/api/java/tuple/Tuple4.java
Tuple4.of
public static <T0, T1, T2, T3> Tuple4<T0, T1, T2, T3> of(T0 value0, T1 value1, T2 value2, T3 value3) { return new Tuple4<>(value0, value1, value2, value3); }
java
public static <T0, T1, T2, T3> Tuple4<T0, T1, T2, T3> of(T0 value0, T1 value1, T2 value2, T3 value3) { return new Tuple4<>(value0, value1, value2, value3); }
[ "public", "static", "<", "T0", ",", "T1", ",", "T2", ",", "T3", ">", "Tuple4", "<", "T0", ",", "T1", ",", "T2", ",", "T3", ">", "of", "(", "T0", "value0", ",", "T1", "value1", ",", "T2", "value2", ",", "T3", "value3", ")", "{", "return", "new...
Creates a new tuple and assigns the given values to the tuple's fields. This is more convenient than using the constructor, because the compiler can infer the generic type arguments implicitly. For example: {@code Tuple3.of(n, x, s)} instead of {@code new Tuple3<Integer, Double, String>(n, x, s)}
[ "Creates", "a", "new", "tuple", "and", "assigns", "the", "given", "values", "to", "the", "tuple", "s", "fields", ".", "This", "is", "more", "convenient", "than", "using", "the", "constructor", "because", "the", "compiler", "can", "infer", "the", "generic", ...
b62db93bf63cb3bb34dd03d611a779d9e3fc61ac
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-core/src/main/java/org/apache/flink/api/java/tuple/Tuple4.java#L217-L222
train
Construct a tuple of size 4.
[ 30522, 2270, 10763, 1026, 1056, 2692, 1010, 1056, 2487, 1010, 1056, 2475, 1010, 1056, 2509, 1028, 10722, 10814, 2549, 1026, 1056, 2692, 1010, 1056, 2487, 1010, 1056, 2475, 1010, 1056, 2509, 1028, 1997, 1006, 1056, 2692, 3643, 2692, 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-java/src/main/java/org/apache/flink/api/java/utils/ParameterTool.java
ParameterTool.has
public boolean has(String value) { addToDefaults(value, null); unrequestedParameters.remove(value); return data.containsKey(value); }
java
public boolean has(String value) { addToDefaults(value, null); unrequestedParameters.remove(value); return data.containsKey(value); }
[ "public", "boolean", "has", "(", "String", "value", ")", "{", "addToDefaults", "(", "value", ",", "null", ")", ";", "unrequestedParameters", ".", "remove", "(", "value", ")", ";", "return", "data", ".", "containsKey", "(", "value", ")", ";", "}" ]
Check if value is set.
[ "Check", "if", "value", "is", "set", "." ]
b62db93bf63cb3bb34dd03d611a779d9e3fc61ac
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-java/src/main/java/org/apache/flink/api/java/utils/ParameterTool.java#L273-L277
train
Checks if the given value is present in the data.
[ 30522, 2270, 22017, 20898, 2038, 1006, 5164, 3643, 1007, 1063, 5587, 3406, 3207, 7011, 11314, 2015, 1006, 3643, 1010, 19701, 1007, 1025, 4895, 2890, 15500, 2098, 28689, 22828, 2015, 1012, 6366, 1006, 3643, 1007, 1025, 2709, 2951, 1012, 3397...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -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/plan/SingleInputPlanNode.java
SingleInputPlanNode.getTrueArray
protected static boolean[] getTrueArray(int length) { final boolean[] a = new boolean[length]; for (int i = 0; i < length; i++) { a[i] = true; } return a; }
java
protected static boolean[] getTrueArray(int length) { final boolean[] a = new boolean[length]; for (int i = 0; i < length; i++) { a[i] = true; } return a; }
[ "protected", "static", "boolean", "[", "]", "getTrueArray", "(", "int", "length", ")", "{", "final", "boolean", "[", "]", "a", "=", "new", "boolean", "[", "length", "]", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "length", ";", "i", "+...
--------------------------------------------------------------------------------------------
[ "--------------------------------------------------------------------------------------------" ]
b62db93bf63cb3bb34dd03d611a779d9e3fc61ac
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-optimizer/src/main/java/org/apache/flink/optimizer/plan/SingleInputPlanNode.java#L264-L270
train
Get true array.
[ 30522, 5123, 10763, 22017, 20898, 1031, 1033, 2131, 16344, 5657, 2906, 9447, 1006, 20014, 3091, 1007, 1063, 2345, 22017, 20898, 1031, 1033, 1037, 1027, 2047, 22017, 20898, 1031, 3091, 1033, 1025, 2005, 1006, 20014, 1045, 1027, 1014, 1025, 1...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...