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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
apache/flink | flink-runtime/src/main/java/org/apache/flink/runtime/rest/handler/job/metrics/AbstractAggregatingMetricsHandler.java | AbstractAggregatingMetricsHandler.getAggregatedMetricValues | private AggregatedMetricsResponseBody getAggregatedMetricValues(
Collection<? extends MetricStore.ComponentMetricStore> stores,
List<String> requestedMetrics,
MetricAccumulatorFactory requestedAggregationsFactories) {
Collection<AggregatedMetric> aggregatedMetrics = new ArrayList<>(requestedMetrics.size());... | java | private AggregatedMetricsResponseBody getAggregatedMetricValues(
Collection<? extends MetricStore.ComponentMetricStore> stores,
List<String> requestedMetrics,
MetricAccumulatorFactory requestedAggregationsFactories) {
Collection<AggregatedMetric> aggregatedMetrics = new ArrayList<>(requestedMetrics.size());... | [
"private",
"AggregatedMetricsResponseBody",
"getAggregatedMetricValues",
"(",
"Collection",
"<",
"?",
"extends",
"MetricStore",
".",
"ComponentMetricStore",
">",
"stores",
",",
"List",
"<",
"String",
">",
"requestedMetrics",
",",
"MetricAccumulatorFactory",
"requestedAggreg... | Extracts and aggregates all requested metrics from the given metric stores, and maps the result to a JSON string.
@param stores available metrics
@param requestedMetrics ids of requested metrics
@param requestedAggregationsFactories requested aggregations
@return JSON string containing the requested metrics | [
"Extracts",
"and",
"aggregates",
"all",
"requested",
"metrics",
"from",
"the",
"given",
"metric",
"stores",
"and",
"maps",
"the",
"result",
"to",
"a",
"JSON",
"string",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/rest/handler/job/metrics/AbstractAggregatingMetricsHandler.java#L179-L211 | train | Get the aggregated metric values. | [
30522,
2797,
9572,
22117,
3388,
7277,
21338,
2229,
26029,
3366,
23684,
2131,
8490,
17603,
11644,
12589,
10175,
15808,
1006,
3074,
1026,
1029,
8908,
12046,
23809,
2063,
1012,
6922,
12589,
23809,
2063,
1028,
5324,
1010,
2862,
1026,
5164,
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... |
spring-projects/spring-boot | spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/embedded/jetty/JettyServletWebServerFactory.java | JettyServletWebServerFactory.addDefaultServlet | protected final void addDefaultServlet(WebAppContext context) {
Assert.notNull(context, "Context must not be null");
ServletHolder holder = new ServletHolder();
holder.setName("default");
holder.setClassName("org.eclipse.jetty.servlet.DefaultServlet");
holder.setInitParameter("dirAllowed", "false");
holder.... | java | protected final void addDefaultServlet(WebAppContext context) {
Assert.notNull(context, "Context must not be null");
ServletHolder holder = new ServletHolder();
holder.setName("default");
holder.setClassName("org.eclipse.jetty.servlet.DefaultServlet");
holder.setInitParameter("dirAllowed", "false");
holder.... | [
"protected",
"final",
"void",
"addDefaultServlet",
"(",
"WebAppContext",
"context",
")",
"{",
"Assert",
".",
"notNull",
"(",
"context",
",",
"\"Context must not be null\"",
")",
";",
"ServletHolder",
"holder",
"=",
"new",
"ServletHolder",
"(",
")",
";",
"holder",
... | Add Jetty's {@code DefaultServlet} to the given {@link WebAppContext}.
@param context the jetty {@link WebAppContext} | [
"Add",
"Jetty",
"s",
"{"
] | 0b27f7c70e164b2b1a96477f1d9c1acba56790c1 | https://github.com/spring-projects/spring-boot/blob/0b27f7c70e164b2b1a96477f1d9c1acba56790c1/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/embedded/jetty/JettyServletWebServerFactory.java#L297-L306 | train | Add a default servlet. | [
30522,
5123,
2345,
11675,
5587,
3207,
7011,
11314,
8043,
2615,
7485,
1006,
4773,
29098,
8663,
18209,
6123,
1007,
1063,
20865,
1012,
2025,
11231,
3363,
1006,
6123,
1010,
1000,
6123,
2442,
2025,
2022,
19701,
1000,
1007,
1025,
14262,
2615,
748... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
apache/flink | flink-java/src/main/java/org/apache/flink/api/java/io/CsvOutputFormat.java | CsvOutputFormat.open | @Override
public void open(int taskNumber, int numTasks) throws IOException {
super.open(taskNumber, numTasks);
this.wrt = this.charsetName == null ? new OutputStreamWriter(new BufferedOutputStream(this.stream, 4096)) :
new OutputStreamWriter(new BufferedOutputStream(this.stream, 4096), this.charsetName);
} | java | @Override
public void open(int taskNumber, int numTasks) throws IOException {
super.open(taskNumber, numTasks);
this.wrt = this.charsetName == null ? new OutputStreamWriter(new BufferedOutputStream(this.stream, 4096)) :
new OutputStreamWriter(new BufferedOutputStream(this.stream, 4096), this.charsetName);
} | [
"@",
"Override",
"public",
"void",
"open",
"(",
"int",
"taskNumber",
",",
"int",
"numTasks",
")",
"throws",
"IOException",
"{",
"super",
".",
"open",
"(",
"taskNumber",
",",
"numTasks",
")",
";",
"this",
".",
"wrt",
"=",
"this",
".",
"charsetName",
"==",... | -------------------------------------------------------------------------------------------- | [
"--------------------------------------------------------------------------------------------"
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-java/src/main/java/org/apache/flink/api/java/io/CsvOutputFormat.java#L159-L164 | train | Override open to create a writer for the bytes in the output stream. | [
30522,
1030,
2058,
15637,
2270,
11675,
2330,
1006,
20014,
4708,
19172,
5677,
1010,
20014,
16371,
20492,
19895,
2015,
1007,
11618,
22834,
10288,
24422,
1063,
3565,
1012,
2330,
1006,
4708,
19172,
5677,
1010,
16371,
20492,
19895,
2015,
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... |
networknt/light-4j | resource/src/main/java/com/networknt/resource/ResourceHelpers.java | ResourceHelpers.addProvidersToPathHandler | public static void addProvidersToPathHandler(PathResourceProvider[] pathResourceProviders, PathHandler pathHandler) {
if (pathResourceProviders != null && pathResourceProviders.length > 0) {
for (PathResourceProvider pathResourceProvider : pathResourceProviders) {
if (pathResourcePro... | java | public static void addProvidersToPathHandler(PathResourceProvider[] pathResourceProviders, PathHandler pathHandler) {
if (pathResourceProviders != null && pathResourceProviders.length > 0) {
for (PathResourceProvider pathResourceProvider : pathResourceProviders) {
if (pathResourcePro... | [
"public",
"static",
"void",
"addProvidersToPathHandler",
"(",
"PathResourceProvider",
"[",
"]",
"pathResourceProviders",
",",
"PathHandler",
"pathHandler",
")",
"{",
"if",
"(",
"pathResourceProviders",
"!=",
"null",
"&&",
"pathResourceProviders",
".",
"length",
">",
"... | Helper to add given PathResourceProviders to a PathHandler.
@param pathResourceProviders List of instances of classes implementing PathResourceProvider.
@param pathHandler The handler that will have these handlers added to it. | [
"Helper",
"to",
"add",
"given",
"PathResourceProviders",
"to",
"a",
"PathHandler",
"."
] | 2a60257c60663684c8f6dc8b5ea3cf184e534db6 | https://github.com/networknt/light-4j/blob/2a60257c60663684c8f6dc8b5ea3cf184e534db6/resource/src/main/java/com/networknt/resource/ResourceHelpers.java#L38-L48 | train | Add the path resource providers to the PathHandler | [
30522,
2270,
10763,
11675,
5587,
21572,
17258,
2545,
14399,
8988,
11774,
3917,
1006,
4130,
6072,
8162,
3401,
21572,
17258,
2121,
1031,
1033,
4130,
6072,
8162,
3401,
21572,
17258,
2545,
1010,
4130,
11774,
3917,
4130,
11774,
3917,
1007,
1063,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
apache/flink | flink-clients/src/main/java/org/apache/flink/client/cli/CliFrontend.java | CliFrontend.cancel | protected void cancel(String[] args) throws Exception {
LOG.info("Running 'cancel' command.");
final Options commandOptions = CliFrontendParser.getCancelCommandOptions();
final Options commandLineOptions = CliFrontendParser.mergeOptions(commandOptions, customCommandLineOptions);
final CommandLine commandLine... | java | protected void cancel(String[] args) throws Exception {
LOG.info("Running 'cancel' command.");
final Options commandOptions = CliFrontendParser.getCancelCommandOptions();
final Options commandLineOptions = CliFrontendParser.mergeOptions(commandOptions, customCommandLineOptions);
final CommandLine commandLine... | [
"protected",
"void",
"cancel",
"(",
"String",
"[",
"]",
"args",
")",
"throws",
"Exception",
"{",
"LOG",
".",
"info",
"(",
"\"Running 'cancel' command.\"",
")",
";",
"final",
"Options",
"commandOptions",
"=",
"CliFrontendParser",
".",
"getCancelCommandOptions",
"("... | Executes the CANCEL action.
@param args Command line arguments for the cancel action. | [
"Executes",
"the",
"CANCEL",
"action",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-clients/src/main/java/org/apache/flink/client/cli/CliFrontend.java#L548-L623 | train | Cancel the job with the given arguments. | [
30522,
5123,
11675,
17542,
1006,
5164,
1031,
1033,
12098,
5620,
1007,
11618,
6453,
1063,
8833,
1012,
18558,
1006,
1000,
2770,
1005,
17542,
1005,
3094,
1012,
1000,
1007,
1025,
2345,
7047,
15054,
16790,
2015,
1027,
18856,
10128,
4948,
6528,
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... |
spring-projects/spring-boot | spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/context/properties/ConfigurationPropertiesReportEndpoint.java | ConfigurationPropertiesReportEndpoint.sanitize | @SuppressWarnings("unchecked")
private Map<String, Object> sanitize(String prefix, Map<String, Object> map) {
map.forEach((key, value) -> {
String qualifiedKey = (prefix.isEmpty() ? prefix : prefix + ".") + key;
if (value instanceof Map) {
map.put(key, sanitize(qualifiedKey, (Map<String, Object>) value));
... | java | @SuppressWarnings("unchecked")
private Map<String, Object> sanitize(String prefix, Map<String, Object> map) {
map.forEach((key, value) -> {
String qualifiedKey = (prefix.isEmpty() ? prefix : prefix + ".") + key;
if (value instanceof Map) {
map.put(key, sanitize(qualifiedKey, (Map<String, Object>) value));
... | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"private",
"Map",
"<",
"String",
",",
"Object",
">",
"sanitize",
"(",
"String",
"prefix",
",",
"Map",
"<",
"String",
",",
"Object",
">",
"map",
")",
"{",
"map",
".",
"forEach",
"(",
"(",
"key",
",",
... | Sanitize all unwanted configuration properties to avoid leaking of sensitive
information.
@param prefix the property prefix
@param map the source map
@return the sanitized map | [
"Sanitize",
"all",
"unwanted",
"configuration",
"properties",
"to",
"avoid",
"leaking",
"of",
"sensitive",
"information",
"."
] | 0b27f7c70e164b2b1a96477f1d9c1acba56790c1 | https://github.com/spring-projects/spring-boot/blob/0b27f7c70e164b2b1a96477f1d9c1acba56790c1/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/context/properties/ConfigurationPropertiesReportEndpoint.java#L238-L255 | train | Sanitize a map of objects. | [
30522,
1030,
16081,
9028,
5582,
2015,
1006,
1000,
4895,
5403,
18141,
1000,
1007,
2797,
4949,
1026,
5164,
1010,
4874,
1028,
2624,
25090,
4371,
1006,
5164,
17576,
1010,
4949,
1026,
5164,
1010,
4874,
1028,
4949,
1007,
1063,
4949,
1012,
18921,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/occurrence/Occurrence.java | Occurrence.compute | public void compute()
{
entrySetPair = triePair.entrySet();
double total_mi = 0;
double total_le = 0;
double total_re = 0;
for (Map.Entry<String, PairFrequency> entry : entrySetPair)
{
PairFrequency value = entry.getValue();
value.mi = computeM... | java | public void compute()
{
entrySetPair = triePair.entrySet();
double total_mi = 0;
double total_le = 0;
double total_re = 0;
for (Map.Entry<String, PairFrequency> entry : entrySetPair)
{
PairFrequency value = entry.getValue();
value.mi = computeM... | [
"public",
"void",
"compute",
"(",
")",
"{",
"entrySetPair",
"=",
"triePair",
".",
"entrySet",
"(",
")",
";",
"double",
"total_mi",
"=",
"0",
";",
"double",
"total_le",
"=",
"0",
";",
"double",
"total_re",
"=",
"0",
";",
"for",
"(",
"Map",
".",
"Entry... | 输入数据完毕,执行计算 | [
"输入数据完毕,执行计算"
] | a538d0722ab2e4980a9dcd9ea40324fc3ddba7ce | https://github.com/hankcs/HanLP/blob/a538d0722ab2e4980a9dcd9ea40324fc3ddba7ce/src/main/java/com/hankcs/hanlp/corpus/occurrence/Occurrence.java#L347-L370 | train | Compute the CIS language. | [
30522,
2270,
11675,
24134,
1006,
1007,
1063,
4443,
13462,
4502,
4313,
1027,
13012,
13699,
11215,
1012,
4443,
13462,
1006,
1007,
1025,
3313,
2561,
1035,
2771,
1027,
1014,
1025,
3313,
2561,
1035,
3393,
1027,
1014,
1025,
3313,
2561,
1035,
2128... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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.read | public static BufferedImage read(ImageInputStream imageStream) {
try {
return ImageIO.read(imageStream);
} catch (IOException e) {
throw new IORuntimeException(e);
}
} | java | public static BufferedImage read(ImageInputStream imageStream) {
try {
return ImageIO.read(imageStream);
} catch (IOException e) {
throw new IORuntimeException(e);
}
} | [
"public",
"static",
"BufferedImage",
"read",
"(",
"ImageInputStream",
"imageStream",
")",
"{",
"try",
"{",
"return",
"ImageIO",
".",
"read",
"(",
"imageStream",
")",
";",
"}",
"catch",
"(",
"IOException",
"e",
")",
"{",
"throw",
"new",
"IORuntimeException",
... | 从图片流中读取图片
@param imageStream 图片文件
@return 图片
@since 3.2.2 | [
"从图片流中读取图片"
] | bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/img/ImgUtil.java#L1575-L1581 | train | Reads a 16 - bit image from an input stream. | [
30522,
2270,
10763,
17698,
2098,
9581,
3351,
3191,
1006,
3746,
2378,
18780,
21422,
4871,
25379,
1007,
1063,
3046,
1063,
2709,
3746,
3695,
1012,
3191,
1006,
4871,
25379,
1007,
1025,
1065,
4608,
1006,
22834,
10288,
24422,
1041,
1007,
1063,
54... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/NettyUtils.java | NettyUtils.defaultNumThreads | public static int defaultNumThreads(int numUsableCores) {
final int availableCores;
if (numUsableCores > 0) {
availableCores = numUsableCores;
} else {
availableCores = Runtime.getRuntime().availableProcessors();
}
return Math.min(availableCores, MAX_DEFAULT_NETTY_THREADS);
} | java | public static int defaultNumThreads(int numUsableCores) {
final int availableCores;
if (numUsableCores > 0) {
availableCores = numUsableCores;
} else {
availableCores = Runtime.getRuntime().availableProcessors();
}
return Math.min(availableCores, MAX_DEFAULT_NETTY_THREADS);
} | [
"public",
"static",
"int",
"defaultNumThreads",
"(",
"int",
"numUsableCores",
")",
"{",
"final",
"int",
"availableCores",
";",
"if",
"(",
"numUsableCores",
">",
"0",
")",
"{",
"availableCores",
"=",
"numUsableCores",
";",
"}",
"else",
"{",
"availableCores",
"=... | Returns the default number of threads for both the Netty client and server thread pools.
If numUsableCores is 0, we will use Runtime get an approximate number of available cores. | [
"Returns",
"the",
"default",
"number",
"of",
"threads",
"for",
"both",
"the",
"Netty",
"client",
"and",
"server",
"thread",
"pools",
".",
"If",
"numUsableCores",
"is",
"0",
"we",
"will",
"use",
"Runtime",
"get",
"an",
"approximate",
"number",
"of",
"availabl... | 25ee0474f47d9c30d6f553a7892d9549f91071cf | https://github.com/apache/spark/blob/25ee0474f47d9c30d6f553a7892d9549f91071cf/common/network-common/src/main/java/org/apache/spark/network/util/NettyUtils.java#L118-L126 | train | Get the default number of threads. | [
30522,
2270,
10763,
20014,
12398,
19172,
2705,
16416,
5104,
1006,
20014,
16371,
7606,
3085,
17345,
2015,
1007,
1063,
2345,
20014,
2800,
17345,
2015,
1025,
2065,
1006,
16371,
7606,
3085,
17345,
2015,
1028,
1014,
1007,
1063,
2800,
17345,
2015,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
looly/hutool | hutool-json/src/main/java/cn/hutool/json/JSONUtil.java | JSONUtil.isJsonArray | public static boolean isJsonArray(String str) {
if (StrUtil.isBlank(str)) {
return false;
}
return StrUtil.isWrap(str.trim(), '[', ']');
} | java | public static boolean isJsonArray(String str) {
if (StrUtil.isBlank(str)) {
return false;
}
return StrUtil.isWrap(str.trim(), '[', ']');
} | [
"public",
"static",
"boolean",
"isJsonArray",
"(",
"String",
"str",
")",
"{",
"if",
"(",
"StrUtil",
".",
"isBlank",
"(",
"str",
")",
")",
"{",
"return",
"false",
";",
"}",
"return",
"StrUtil",
".",
"isWrap",
"(",
"str",
".",
"trim",
"(",
")",
",",
... | 是否为JSONObject字符串,首尾都为大括号或中括号判定为JSON字符串
@param str 字符串
@return 是否为JSON字符串
@since 3.3.0 | [
"是否为JSONObject字符串,首尾都为大括号或中括号判定为JSON字符串"
] | bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-json/src/main/java/cn/hutool/json/JSONUtil.java#L668-L673 | train | Checks if the given string is a JSON array. | [
30522,
2270,
10763,
22017,
20898,
2003,
22578,
7856,
11335,
2100,
1006,
5164,
2358,
2099,
1007,
1063,
2065,
1006,
2358,
22134,
4014,
1012,
2003,
28522,
8950,
1006,
2358,
2099,
1007,
1007,
1063,
2709,
6270,
1025,
1065,
2709,
2358,
22134,
401... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/InMemoryPartition.java | InMemoryPartition.overwriteRecordAt | @Deprecated
public void overwriteRecordAt(long pointer, T record) throws IOException {
long tmpPointer = this.writeView.getCurrentPointer();
this.writeView.resetTo(pointer);
this.serializer.serialize(record, this.writeView);
this.writeView.resetTo(tmpPointer);
} | java | @Deprecated
public void overwriteRecordAt(long pointer, T record) throws IOException {
long tmpPointer = this.writeView.getCurrentPointer();
this.writeView.resetTo(pointer);
this.serializer.serialize(record, this.writeView);
this.writeView.resetTo(tmpPointer);
} | [
"@",
"Deprecated",
"public",
"void",
"overwriteRecordAt",
"(",
"long",
"pointer",
",",
"T",
"record",
")",
"throws",
"IOException",
"{",
"long",
"tmpPointer",
"=",
"this",
".",
"writeView",
".",
"getCurrentPointer",
"(",
")",
";",
"this",
".",
"writeView",
"... | UNSAFE!! overwrites record
causes inconsistency or data loss for overwriting everything but records of the exact same size
@param pointer pointer to start of record
@param record record to overwrite old one with
@throws IOException
@deprecated Don't use this, overwrites record and causes inconsistency or data loss for... | [
"UNSAFE!!",
"overwrites",
"record",
"causes",
"inconsistency",
"or",
"data",
"loss",
"for",
"overwriting",
"everything",
"but",
"records",
"of",
"the",
"exact",
"same",
"size"
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/operators/hash/InMemoryPartition.java#L254-L260 | train | Overwrites the record at the given pointer. | [
30522,
1030,
2139,
28139,
12921,
2270,
11675,
2058,
15994,
8586,
8551,
4017,
1006,
2146,
20884,
1010,
1056,
2501,
1007,
11618,
22834,
10288,
24422,
1063,
2146,
1056,
8737,
8400,
2121,
1027,
2023,
1012,
4339,
8584,
1012,
2131,
10841,
14343,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
spring-projects/spring-boot | spring-boot-project/spring-boot-devtools/src/main/java/org/springframework/boot/devtools/livereload/Connection.java | Connection.run | public void run() throws Exception {
if (this.header.contains("Upgrade: websocket")
&& this.header.contains("Sec-WebSocket-Version: 13")) {
runWebSocket();
}
if (this.header.contains("GET /livereload.js")) {
this.outputStream.writeHttp(getClass().getResourceAsStream("livereload.js"),
"text/javascri... | java | public void run() throws Exception {
if (this.header.contains("Upgrade: websocket")
&& this.header.contains("Sec-WebSocket-Version: 13")) {
runWebSocket();
}
if (this.header.contains("GET /livereload.js")) {
this.outputStream.writeHttp(getClass().getResourceAsStream("livereload.js"),
"text/javascri... | [
"public",
"void",
"run",
"(",
")",
"throws",
"Exception",
"{",
"if",
"(",
"this",
".",
"header",
".",
"contains",
"(",
"\"Upgrade: websocket\"",
")",
"&&",
"this",
".",
"header",
".",
"contains",
"(",
"\"Sec-WebSocket-Version: 13\"",
")",
")",
"{",
"runWebSo... | Run the connection.
@throws Exception in case of errors | [
"Run",
"the",
"connection",
"."
] | 0b27f7c70e164b2b1a96477f1d9c1acba56790c1 | https://github.com/spring-projects/spring-boot/blob/0b27f7c70e164b2b1a96477f1d9c1acba56790c1/spring-boot-project/spring-boot-devtools/src/main/java/org/springframework/boot/devtools/livereload/Connection.java#L80-L89 | train | Run the server. | [
30522,
2270,
11675,
2448,
1006,
1007,
11618,
6453,
1063,
2065,
1006,
2023,
1012,
20346,
1012,
3397,
1006,
1000,
12200,
1024,
4773,
6499,
19869,
2102,
1000,
1007,
1004,
1004,
2023,
1012,
20346,
1012,
3397,
1006,
1000,
10819,
1011,
4773,
6499... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/FlinkKafkaProducer08.java | FlinkKafkaProducer08.flush | @Override
protected void flush() {
// The Kafka 0.8 producer doesn't support flushing, we wait here
// until all pending records are confirmed
synchronized (pendingRecordsLock) {
while (pendingRecords > 0) {
try {
pendingRecordsLock.wait();
} catch (InterruptedException e) {
// this can be i... | java | @Override
protected void flush() {
// The Kafka 0.8 producer doesn't support flushing, we wait here
// until all pending records are confirmed
synchronized (pendingRecordsLock) {
while (pendingRecords > 0) {
try {
pendingRecordsLock.wait();
} catch (InterruptedException e) {
// this can be i... | [
"@",
"Override",
"protected",
"void",
"flush",
"(",
")",
"{",
"// The Kafka 0.8 producer doesn't support flushing, we wait here",
"// until all pending records are confirmed",
"synchronized",
"(",
"pendingRecordsLock",
")",
"{",
"while",
"(",
"pendingRecords",
">",
"0",
")",
... | --------------------------------------------------------------------- | [
"---------------------------------------------------------------------"
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-connectors/flink-connector-kafka-0.8/src/main/java/org/apache/flink/streaming/connectors/kafka/FlinkKafkaProducer08.java#L231-L246 | train | Flushes the pending records. | [
30522,
1030,
2058,
15637,
5123,
11675,
13862,
1006,
1007,
1063,
1013,
1013,
1996,
10556,
24316,
2050,
1014,
1012,
1022,
3135,
2987,
1005,
1056,
2490,
23519,
1010,
2057,
3524,
2182,
1013,
1013,
2127,
2035,
14223,
2636,
2024,
4484,
25549,
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-crypto/src/main/java/cn/hutool/crypto/KeyUtil.java | KeyUtil.generateKeyPair | public static KeyPair generateKeyPair(String algorithm, byte[] seed, AlgorithmParameterSpec param) {
return generateKeyPair(algorithm, DEFAULT_KEY_SIZE, seed, param);
} | java | public static KeyPair generateKeyPair(String algorithm, byte[] seed, AlgorithmParameterSpec param) {
return generateKeyPair(algorithm, DEFAULT_KEY_SIZE, seed, param);
} | [
"public",
"static",
"KeyPair",
"generateKeyPair",
"(",
"String",
"algorithm",
",",
"byte",
"[",
"]",
"seed",
",",
"AlgorithmParameterSpec",
"param",
")",
"{",
"return",
"generateKeyPair",
"(",
"algorithm",
",",
"DEFAULT_KEY_SIZE",
",",
"seed",
",",
"param",
")",... | 生成用于非对称加密的公钥和私钥<br>
密钥对生成算法见:https://docs.oracle.com/javase/7/docs/technotes/guides/security/StandardNames.html#KeyPairGenerator
@param algorithm 非对称加密算法
@param param {@link AlgorithmParameterSpec}
@param seed 种子
@return {@link KeyPair}
@since 4.3.3 | [
"生成用于非对称加密的公钥和私钥<br",
">",
"密钥对生成算法见:https",
":",
"//",
"docs",
".",
"oracle",
".",
"com",
"/",
"javase",
"/",
"7",
"/",
"docs",
"/",
"technotes",
"/",
"guides",
"/",
"security",
"/",
"StandardNames",
".",
"html#KeyPairGenerator"
] | bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-crypto/src/main/java/cn/hutool/crypto/KeyUtil.java#L378-L380 | train | Generates a key pair using the specified algorithm and seed. | [
30522,
2270,
10763,
3145,
4502,
4313,
9699,
14839,
4502,
4313,
1006,
5164,
9896,
1010,
24880,
1031,
1033,
6534,
1010,
9896,
28689,
22828,
13102,
8586,
11498,
2213,
1007,
1063,
2709,
9699,
14839,
4502,
4313,
1006,
9896,
1010,
12398,
1035,
31... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
apache/flink | flink-core/src/main/java/org/apache/flink/configuration/GlobalConfiguration.java | GlobalConfiguration.loadConfiguration | public static Configuration loadConfiguration() {
final String configDir = System.getenv(ConfigConstants.ENV_FLINK_CONF_DIR);
if (configDir == null) {
return new Configuration();
}
return loadConfiguration(configDir, null);
} | java | public static Configuration loadConfiguration() {
final String configDir = System.getenv(ConfigConstants.ENV_FLINK_CONF_DIR);
if (configDir == null) {
return new Configuration();
}
return loadConfiguration(configDir, null);
} | [
"public",
"static",
"Configuration",
"loadConfiguration",
"(",
")",
"{",
"final",
"String",
"configDir",
"=",
"System",
".",
"getenv",
"(",
"ConfigConstants",
".",
"ENV_FLINK_CONF_DIR",
")",
";",
"if",
"(",
"configDir",
"==",
"null",
")",
"{",
"return",
"new",... | Loads the global configuration from the environment. Fails if an error occurs during loading. Returns an
empty configuration object if the environment variable is not set. In production this variable is set but
tests and local execution/debugging don't have this environment variable set. That's why we should fail
if it... | [
"Loads",
"the",
"global",
"configuration",
"from",
"the",
"environment",
".",
"Fails",
"if",
"an",
"error",
"occurs",
"during",
"loading",
".",
"Returns",
"an",
"empty",
"configuration",
"object",
"if",
"the",
"environment",
"variable",
"is",
"not",
"set",
"."... | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-core/src/main/java/org/apache/flink/configuration/GlobalConfiguration.java#L65-L71 | train | Load the configuration from the environment variable FLINK_CONF_DIR. | [
30522,
2270,
10763,
9563,
7170,
8663,
8873,
27390,
3370,
1006,
1007,
1063,
2345,
5164,
9530,
8873,
2290,
4305,
2099,
1027,
2291,
1012,
2131,
2368,
2615,
1006,
9530,
8873,
18195,
5644,
5794,
3215,
1012,
4372,
2615,
1035,
13109,
19839,
1035,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
alibaba/canal | client-adapter/launcher/src/main/java/com/alibaba/otter/canal/adapter/launcher/monitor/remote/DbRemoteConfigLoader.java | DbRemoteConfigLoader.overrideLocalCanalConfig | private void overrideLocalCanalConfig(String content) {
try (OutputStreamWriter writer = new OutputStreamWriter(
new FileOutputStream(CommonUtils.getConfPath() + "application.yml"),
StandardCharsets.UTF_8)) {
writer.write(content);
writer.flush();
... | java | private void overrideLocalCanalConfig(String content) {
try (OutputStreamWriter writer = new OutputStreamWriter(
new FileOutputStream(CommonUtils.getConfPath() + "application.yml"),
StandardCharsets.UTF_8)) {
writer.write(content);
writer.flush();
... | [
"private",
"void",
"overrideLocalCanalConfig",
"(",
"String",
"content",
")",
"{",
"try",
"(",
"OutputStreamWriter",
"writer",
"=",
"new",
"OutputStreamWriter",
"(",
"new",
"FileOutputStream",
"(",
"CommonUtils",
".",
"getConfPath",
"(",
")",
"+",
"\"application.yml... | 覆盖本地application.yml文件
@param content 文件内容 | [
"覆盖本地application",
".",
"yml文件"
] | 8f088cddc0755f4350c5aaae95c6e4002d90a40f | https://github.com/alibaba/canal/blob/8f088cddc0755f4350c5aaae95c6e4002d90a40f/client-adapter/launcher/src/main/java/com/alibaba/otter/canal/adapter/launcher/monitor/remote/DbRemoteConfigLoader.java#L119-L129 | train | Override the local canal config with the content. | [
30522,
2797,
11675,
2058,
15637,
4135,
9289,
28621,
22499,
2078,
8873,
2290,
1006,
5164,
4180,
1007,
1063,
3046,
1006,
27852,
25379,
15994,
3213,
1027,
2047,
27852,
25379,
15994,
1006,
2047,
5371,
5833,
18780,
21422,
1006,
2691,
21823,
4877,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/StrSpliter.java | StrSpliter.split | public static List<String> split(String str, Pattern separatorPattern, int limit, boolean isTrim, boolean ignoreEmpty){
if(StrUtil.isEmpty(str)){
return new ArrayList<String>(0);
}
if(limit == 1){
return addToList(new ArrayList<String>(1), str, isTrim, ignoreEmpty);
}
if(null == separatorPatt... | java | public static List<String> split(String str, Pattern separatorPattern, int limit, boolean isTrim, boolean ignoreEmpty){
if(StrUtil.isEmpty(str)){
return new ArrayList<String>(0);
}
if(limit == 1){
return addToList(new ArrayList<String>(1), str, isTrim, ignoreEmpty);
}
if(null == separatorPatt... | [
"public",
"static",
"List",
"<",
"String",
">",
"split",
"(",
"String",
"str",
",",
"Pattern",
"separatorPattern",
",",
"int",
"limit",
",",
"boolean",
"isTrim",
",",
"boolean",
"ignoreEmpty",
")",
"{",
"if",
"(",
"StrUtil",
".",
"isEmpty",
"(",
"str",
"... | 通过正则切分字符串
@param str 字符串
@param separatorPattern 分隔符正则{@link Pattern}
@param limit 限制分片数
@param isTrim 是否去除切分字符串后每个元素两边的空格
@param ignoreEmpty 是否忽略空串
@return 切分后的集合
@since 3.0.8 | [
"通过正则切分字符串"
] | bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/text/StrSpliter.java#L414-L440 | train | Creates a list of strings from the specified string using the specified separator pattern. | [
30522,
2270,
10763,
2862,
1026,
5164,
1028,
3975,
1006,
5164,
2358,
2099,
1010,
5418,
19802,
25879,
2953,
4502,
12079,
2078,
1010,
20014,
5787,
1010,
22017,
20898,
21541,
20026,
1010,
22017,
20898,
8568,
6633,
13876,
2100,
1007,
1063,
2065,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
apache/flink | flink-table/flink-table-runtime-blink/src/main/java/org/apache/flink/table/util/MurmurHashUtil.java | MurmurHashUtil.hashBytes | public static int hashBytes(MemorySegment segment, int offset, int lengthInBytes) {
return hashBytes(segment, offset, lengthInBytes, DEFAULT_SEED);
} | java | public static int hashBytes(MemorySegment segment, int offset, int lengthInBytes) {
return hashBytes(segment, offset, lengthInBytes, DEFAULT_SEED);
} | [
"public",
"static",
"int",
"hashBytes",
"(",
"MemorySegment",
"segment",
",",
"int",
"offset",
",",
"int",
"lengthInBytes",
")",
"{",
"return",
"hashBytes",
"(",
"segment",
",",
"offset",
",",
"lengthInBytes",
",",
"DEFAULT_SEED",
")",
";",
"}"
] | Hash bytes in MemorySegment.
@param segment segment.
@param offset offset for MemorySegment
@param lengthInBytes length in MemorySegment
@return hash code | [
"Hash",
"bytes",
"in",
"MemorySegment",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-table/flink-table-runtime-blink/src/main/java/org/apache/flink/table/util/MurmurHashUtil.java#L73-L75 | train | Hash bytes. | [
30522,
2270,
10763,
20014,
23325,
3762,
4570,
1006,
3638,
3366,
21693,
4765,
6903,
1010,
20014,
16396,
1010,
20014,
3091,
2378,
3762,
4570,
1007,
1063,
2709,
23325,
3762,
4570,
1006,
6903,
1010,
16396,
1010,
3091,
2378,
3762,
4570,
1010,
12... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/ResourceSpec.java | ResourceSpec.merge | public ResourceSpec merge(ResourceSpec other) {
ResourceSpec target = new ResourceSpec(
Math.max(this.cpuCores, other.cpuCores),
this.heapMemoryInMB + other.heapMemoryInMB,
this.directMemoryInMB + other.directMemoryInMB,
this.nativeMemoryInMB + other.nativeMemoryInMB,
this.stateSizeInMB + other.st... | java | public ResourceSpec merge(ResourceSpec other) {
ResourceSpec target = new ResourceSpec(
Math.max(this.cpuCores, other.cpuCores),
this.heapMemoryInMB + other.heapMemoryInMB,
this.directMemoryInMB + other.directMemoryInMB,
this.nativeMemoryInMB + other.nativeMemoryInMB,
this.stateSizeInMB + other.st... | [
"public",
"ResourceSpec",
"merge",
"(",
"ResourceSpec",
"other",
")",
"{",
"ResourceSpec",
"target",
"=",
"new",
"ResourceSpec",
"(",
"Math",
".",
"max",
"(",
"this",
".",
"cpuCores",
",",
"other",
".",
"cpuCores",
")",
",",
"this",
".",
"heapMemoryInMB",
... | Used by system internally to merge the other resources of chained operators
when generating the job graph or merge the resource consumed by state backend.
@param other Reference to resource to merge in.
@return The new resource with merged values. | [
"Used",
"by",
"system",
"internally",
"to",
"merge",
"the",
"other",
"resources",
"of",
"chained",
"operators",
"when",
"generating",
"the",
"job",
"graph",
"or",
"merge",
"the",
"resource",
"consumed",
"by",
"state",
"backend",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-core/src/main/java/org/apache/flink/api/common/operators/ResourceSpec.java#L111-L123 | train | Merge two ResourceSpecs. | [
30522,
2270,
4219,
5051,
2278,
13590,
1006,
4219,
5051,
2278,
2060,
1007,
1063,
4219,
5051,
2278,
4539,
1027,
2047,
4219,
5051,
2278,
1006,
8785,
1012,
4098,
1006,
2023,
1012,
17368,
17345,
2015,
1010,
2060,
1012,
17368,
17345,
2015,
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... |
spring-projects/spring-boot | spring-boot-project/spring-boot/src/main/java/org/springframework/boot/convert/ApplicationConversionService.java | ApplicationConversionService.addApplicationFormatters | public static void addApplicationFormatters(FormatterRegistry registry) {
registry.addFormatter(new CharArrayFormatter());
registry.addFormatter(new InetAddressFormatter());
registry.addFormatter(new IsoOffsetFormatter());
} | java | public static void addApplicationFormatters(FormatterRegistry registry) {
registry.addFormatter(new CharArrayFormatter());
registry.addFormatter(new InetAddressFormatter());
registry.addFormatter(new IsoOffsetFormatter());
} | [
"public",
"static",
"void",
"addApplicationFormatters",
"(",
"FormatterRegistry",
"registry",
")",
"{",
"registry",
".",
"addFormatter",
"(",
"new",
"CharArrayFormatter",
"(",
")",
")",
";",
"registry",
".",
"addFormatter",
"(",
"new",
"InetAddressFormatter",
"(",
... | Add formatters useful for most Spring Boot applications.
@param registry the service to register default formatters with | [
"Add",
"formatters",
"useful",
"for",
"most",
"Spring",
"Boot",
"applications",
"."
] | 0b27f7c70e164b2b1a96477f1d9c1acba56790c1 | https://github.com/spring-projects/spring-boot/blob/0b27f7c70e164b2b1a96477f1d9c1acba56790c1/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/convert/ApplicationConversionService.java#L131-L135 | train | Add the application formatters to the given formatter registry. | [
30522,
2270,
10763,
11675,
5587,
29098,
19341,
3508,
14192,
20097,
2015,
1006,
4289,
3334,
2890,
24063,
2854,
15584,
1007,
1063,
15584,
1012,
5587,
14192,
20097,
1006,
2047,
25869,
2906,
9447,
14192,
20097,
1006,
1007,
1007,
1025,
15584,
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-core/sharding-core-rewrite/src/main/java/org/apache/shardingsphere/core/rewrite/SQLBuilder.java | SQLBuilder.toSQL | public SQLUnit toSQL() {
StringBuilder result = new StringBuilder();
List<Object> insertParameters = new LinkedList<>();
for (Object each : segments) {
if (!(each instanceof ShardingPlaceholder)) {
result.append(each);
continue;
}
... | java | public SQLUnit toSQL() {
StringBuilder result = new StringBuilder();
List<Object> insertParameters = new LinkedList<>();
for (Object each : segments) {
if (!(each instanceof ShardingPlaceholder)) {
result.append(each);
continue;
}
... | [
"public",
"SQLUnit",
"toSQL",
"(",
")",
"{",
"StringBuilder",
"result",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"List",
"<",
"Object",
">",
"insertParameters",
"=",
"new",
"LinkedList",
"<>",
"(",
")",
";",
"for",
"(",
"Object",
"each",
":",
"segment... | Convert to SQL unit.
@return SQL unit | [
"Convert",
"to",
"SQL",
"unit",
"."
] | f88fd29fc345dfb31fdce12e9e96cbfa0fd2402d | https://github.com/apache/incubator-shardingsphere/blob/f88fd29fc345dfb31fdce12e9e96cbfa0fd2402d/sharding-core/sharding-core-rewrite/src/main/java/org/apache/shardingsphere/core/rewrite/SQLBuilder.java#L148-L165 | train | Returns a SQLUnit object representing this unit. | [
30522,
2270,
29296,
19496,
2102,
2000,
2015,
4160,
2140,
1006,
1007,
1063,
5164,
8569,
23891,
2099,
2765,
1027,
2047,
5164,
8569,
23891,
2099,
1006,
1007,
1025,
2862,
1026,
4874,
1028,
19274,
28689,
22828,
2015,
1027,
2047,
5799,
9863,
1026... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
hankcs/HanLP | src/main/java/com/hankcs/hanlp/corpus/dictionary/DictionaryMaker.java | DictionaryMaker.normalizeFrequency | public static List<Item> normalizeFrequency(List<Item> itemList)
{
for (Item item : itemList)
{
ArrayList<Map.Entry<String, Integer>> entryArray = new ArrayList<Map.Entry<String, Integer>>(item.labelMap.entrySet());
Collections.sort(entryArray, new Comparator<Map.Entry<String... | java | public static List<Item> normalizeFrequency(List<Item> itemList)
{
for (Item item : itemList)
{
ArrayList<Map.Entry<String, Integer>> entryArray = new ArrayList<Map.Entry<String, Integer>>(item.labelMap.entrySet());
Collections.sort(entryArray, new Comparator<Map.Entry<String... | [
"public",
"static",
"List",
"<",
"Item",
">",
"normalizeFrequency",
"(",
"List",
"<",
"Item",
">",
"itemList",
")",
"{",
"for",
"(",
"Item",
"item",
":",
"itemList",
")",
"{",
"ArrayList",
"<",
"Map",
".",
"Entry",
"<",
"String",
",",
"Integer",
">",
... | 调整频次,按排序后的次序给定频次
@param itemList
@return 处理后的列表 | [
"调整频次,按排序后的次序给定频次"
] | a538d0722ab2e4980a9dcd9ea40324fc3ddba7ce | https://github.com/hankcs/HanLP/blob/a538d0722ab2e4980a9dcd9ea40324fc3ddba7ce/src/main/java/com/hankcs/hanlp/corpus/dictionary/DictionaryMaker.java#L372-L393 | train | Normalize frequency of a list of items. | [
30522,
2270,
10763,
2862,
1026,
8875,
1028,
3671,
4697,
19699,
2063,
4226,
9407,
1006,
2862,
1026,
8875,
1028,
8875,
9863,
1007,
1063,
2005,
1006,
8875,
8875,
1024,
8875,
9863,
1007,
1063,
9140,
9863,
1026,
4949,
1012,
4443,
1026,
5164,
1... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
alibaba/canal | dbsync/src/main/java/com/taobao/tddl/dbsync/binlog/LogBuffer.java | LogBuffer.getBeLong48 | public final long getBeLong48() {
if (position + 5 >= origin + limit) throw new IllegalArgumentException("limit excceed: "
+ (position - origin + 5));
byte[] buf = buffer;
return ((long) (buf[position++]) << 40)... | java | public final long getBeLong48() {
if (position + 5 >= origin + limit) throw new IllegalArgumentException("limit excceed: "
+ (position - origin + 5));
byte[] buf = buffer;
return ((long) (buf[position++]) << 40)... | [
"public",
"final",
"long",
"getBeLong48",
"(",
")",
"{",
"if",
"(",
"position",
"+",
"5",
">=",
"origin",
"+",
"limit",
")",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"limit excceed: \"",
"+",
"(",
"position",
"-",
"origin",
"+",
"5",
")",
")",
... | Return next 48-bit signed long from buffer. (Big-endian)
@see mysql-5.6.10/include/myisampack.h - mi_sint6korr | [
"Return",
"next",
"48",
"-",
"bit",
"signed",
"long",
"from",
"buffer",
".",
"(",
"Big",
"-",
"endian",
")"
] | 8f088cddc0755f4350c5aaae95c6e4002d90a40f | https://github.com/alibaba/canal/blob/8f088cddc0755f4350c5aaae95c6e4002d90a40f/dbsync/src/main/java/com/taobao/tddl/dbsync/binlog/LogBuffer.java#L698-L706 | train | Gets a long value in the buffer as encoded in BE long48 format. | [
30522,
2270,
2345,
2146,
2131,
8671,
5063,
18139,
1006,
1007,
1063,
2065,
1006,
2597,
1009,
1019,
1028,
1027,
4761,
1009,
5787,
1007,
5466,
2047,
6206,
2906,
22850,
15781,
2595,
24422,
1006,
1000,
5787,
4654,
9468,
13089,
1024,
1000,
1009,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
SeleniumHQ/selenium | java/client/src/org/openqa/selenium/firefox/xpi/XpiDriverService.java | XpiDriverService.createDefaultService | public static XpiDriverService createDefaultService() {
try {
return new Builder().build();
} catch (WebDriverException e) {
throw new IllegalStateException(e.getMessage(), e.getCause());
}
} | java | public static XpiDriverService createDefaultService() {
try {
return new Builder().build();
} catch (WebDriverException e) {
throw new IllegalStateException(e.getMessage(), e.getCause());
}
} | [
"public",
"static",
"XpiDriverService",
"createDefaultService",
"(",
")",
"{",
"try",
"{",
"return",
"new",
"Builder",
"(",
")",
".",
"build",
"(",
")",
";",
"}",
"catch",
"(",
"WebDriverException",
"e",
")",
"{",
"throw",
"new",
"IllegalStateException",
"("... | Configures and returns a new {@link XpiDriverService} using the default configuration. In
this configuration, the service will use the firefox executable identified by the
{@link FirefoxDriver.SystemProperty#BROWSER_BINARY} system property on a free port.
@return A new XpiDriverService using the default configuration. | [
"Configures",
"and",
"returns",
"a",
"new",
"{",
"@link",
"XpiDriverService",
"}",
"using",
"the",
"default",
"configuration",
".",
"In",
"this",
"configuration",
"the",
"service",
"will",
"use",
"the",
"firefox",
"executable",
"identified",
"by",
"the",
"{",
... | 7af172729f17b20269c8ca4ea6f788db48616535 | https://github.com/SeleniumHQ/selenium/blob/7af172729f17b20269c8ca4ea6f788db48616535/java/client/src/org/openqa/selenium/firefox/xpi/XpiDriverService.java#L275-L281 | train | Create a default XPIDriverService. | [
30522,
2270,
10763,
26726,
3593,
24352,
8043,
7903,
2063,
2580,
12879,
23505,
8043,
7903,
2063,
1006,
1007,
1063,
3046,
1063,
2709,
2047,
12508,
1006,
1007,
1012,
3857,
1006,
1007,
1025,
1065,
4608,
1006,
4773,
23663,
2890,
2595,
24422,
104... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
looly/hutool | hutool-db/src/main/java/cn/hutool/db/SqlConnRunner.java | SqlConnRunner.page | public <T> T page(Connection conn, Collection<String> fields, Entity where, Page page, RsHandler<T> rsh) throws SQLException {
checkConn(conn);
if(null == page){
return this.find(conn, fields, where, rsh);
}
final Query query = new Query(SqlUtil.buildConditions(where), where.getTableName());
quer... | java | public <T> T page(Connection conn, Collection<String> fields, Entity where, Page page, RsHandler<T> rsh) throws SQLException {
checkConn(conn);
if(null == page){
return this.find(conn, fields, where, rsh);
}
final Query query = new Query(SqlUtil.buildConditions(where), where.getTableName());
quer... | [
"public",
"<",
"T",
">",
"T",
"page",
"(",
"Connection",
"conn",
",",
"Collection",
"<",
"String",
">",
"fields",
",",
"Entity",
"where",
",",
"Page",
"page",
",",
"RsHandler",
"<",
"T",
">",
"rsh",
")",
"throws",
"SQLException",
"{",
"checkConn",
"(",... | 分页查询<br>
此方法不会关闭Connection
@param <T> 结果对象类型
@param conn 数据库连接对象
@param fields 返回的字段列表,null则返回所有字段
@param where 条件实体类(包含表名)
@param page 分页对象
@param rsh 结果集处理对象
@return 结果对象
@throws SQLException SQL执行异常 | [
"分页查询<br",
">",
"此方法不会关闭Connection"
] | bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-db/src/main/java/cn/hutool/db/SqlConnRunner.java#L485-L495 | train | Retrieves a single page of entities from a database connection. | [
30522,
2270,
1026,
1056,
1028,
1056,
3931,
1006,
4434,
9530,
2078,
1010,
3074,
1026,
5164,
1028,
4249,
1010,
9178,
2073,
1010,
3931,
3931,
1010,
12667,
11774,
3917,
1026,
1056,
1028,
12667,
2232,
1007,
11618,
29296,
10288,
24422,
1063,
4638... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
looly/hutool | hutool-core/src/main/java/cn/hutool/core/util/NumberUtil.java | NumberUtil.mul | public static double mul(Double v1, Double v2) {
return mul((Number) v1, (Number) v2).doubleValue();
} | java | public static double mul(Double v1, Double v2) {
return mul((Number) v1, (Number) v2).doubleValue();
} | [
"public",
"static",
"double",
"mul",
"(",
"Double",
"v1",
",",
"Double",
"v2",
")",
"{",
"return",
"mul",
"(",
"(",
"Number",
")",
"v1",
",",
"(",
"Number",
")",
"v2",
")",
".",
"doubleValue",
"(",
")",
";",
"}"
] | 提供精确的乘法运算<br>
如果传入多个值为null或者空,则返回0
@param v1 被乘数
@param v2 乘数
@return 积 | [
"提供精确的乘法运算<br",
">",
"如果传入多个值为null或者空,则返回0"
] | bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/util/NumberUtil.java#L376-L378 | train | Multiply two numbers. | [
30522,
2270,
10763,
3313,
14163,
2140,
1006,
3313,
1058,
2487,
1010,
3313,
1058,
2475,
1007,
1063,
2709,
14163,
2140,
1006,
1006,
2193,
1007,
1058,
2487,
1010,
1006,
2193,
1007,
1058,
2475,
1007,
1012,
3313,
10175,
5657,
1006,
1007,
1025,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
networknt/light-4j | metrics/src/main/java/io/dropwizard/metrics/UniformSnapshot.java | UniformSnapshot.getStdDev | @Override
public double getStdDev() {
// two-pass algorithm for variance, avoids numeric overflow
if (values.length <= 1) {
return 0;
}
final double mean = getMean();
double sum = 0;
for (long value : values) {
final double diff = value - me... | java | @Override
public double getStdDev() {
// two-pass algorithm for variance, avoids numeric overflow
if (values.length <= 1) {
return 0;
}
final double mean = getMean();
double sum = 0;
for (long value : values) {
final double diff = value - me... | [
"@",
"Override",
"public",
"double",
"getStdDev",
"(",
")",
"{",
"// two-pass algorithm for variance, avoids numeric overflow",
"if",
"(",
"values",
".",
"length",
"<=",
"1",
")",
"{",
"return",
"0",
";",
"}",
"final",
"double",
"mean",
"=",
"getMean",
"(",
")... | Returns the standard deviation of the values in the snapshot.
@return the standard deviation value | [
"Returns",
"the",
"standard",
"deviation",
"of",
"the",
"values",
"in",
"the",
"snapshot",
"."
] | 2a60257c60663684c8f6dc8b5ea3cf184e534db6 | https://github.com/networknt/light-4j/blob/2a60257c60663684c8f6dc8b5ea3cf184e534db6/metrics/src/main/java/io/dropwizard/metrics/UniformSnapshot.java#L176-L194 | train | Get the standard deviation of the set of CIS values. | [
30522,
1030,
2058,
15637,
2270,
3313,
4152,
2102,
14141,
6777,
1006,
1007,
1063,
1013,
1013,
2048,
1011,
3413,
9896,
2005,
23284,
1010,
26777,
16371,
25531,
2058,
12314,
2065,
1006,
5300,
1012,
3091,
1026,
1027,
1015,
1007,
1063,
2709,
1014... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
netty/netty | common/src/main/java/io/netty/util/internal/PlatformDependent.java | PlatformDependent.isZero | public static boolean isZero(byte[] bytes, int startPos, int length) {
return !hasUnsafe() || !unalignedAccess() ?
isZeroSafe(bytes, startPos, length) :
PlatformDependent0.isZero(bytes, startPos, length);
} | java | public static boolean isZero(byte[] bytes, int startPos, int length) {
return !hasUnsafe() || !unalignedAccess() ?
isZeroSafe(bytes, startPos, length) :
PlatformDependent0.isZero(bytes, startPos, length);
} | [
"public",
"static",
"boolean",
"isZero",
"(",
"byte",
"[",
"]",
"bytes",
",",
"int",
"startPos",
",",
"int",
"length",
")",
"{",
"return",
"!",
"hasUnsafe",
"(",
")",
"||",
"!",
"unalignedAccess",
"(",
")",
"?",
"isZeroSafe",
"(",
"bytes",
",",
"startP... | Determine if a subsection of an array is zero.
@param bytes The byte array.
@param startPos The starting index (inclusive) in {@code bytes}.
@param length The amount of bytes to check for zero.
@return {@code false} if {@code bytes[startPos:startsPos+length)} contains a value other than zero. | [
"Determine",
"if",
"a",
"subsection",
"of",
"an",
"array",
"is",
"zero",
"."
] | ba06eafa1c1824bd154f1a380019e7ea2edf3c4c | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/common/src/main/java/io/netty/util/internal/PlatformDependent.java#L709-L713 | train | Checks if the byte array is zero. | [
30522,
2270,
10763,
22017,
20898,
2003,
6290,
2080,
1006,
24880,
1031,
1033,
27507,
1010,
20014,
2707,
6873,
2015,
1010,
20014,
3091,
1007,
1063,
2709,
999,
2038,
4609,
3736,
7959,
1006,
1007,
1064,
1064,
999,
14477,
3669,
19225,
6305,
9623... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/entrypoint/ClusterEntrypoint.java | ClusterEntrypoint.closeClusterComponent | private CompletableFuture<Void> closeClusterComponent(ApplicationStatus applicationStatus, @Nullable String diagnostics) {
synchronized (lock) {
if (clusterComponent != null) {
return clusterComponent.deregisterApplicationAndClose(applicationStatus, diagnostics);
} else {
return CompletableFuture.comple... | java | private CompletableFuture<Void> closeClusterComponent(ApplicationStatus applicationStatus, @Nullable String diagnostics) {
synchronized (lock) {
if (clusterComponent != null) {
return clusterComponent.deregisterApplicationAndClose(applicationStatus, diagnostics);
} else {
return CompletableFuture.comple... | [
"private",
"CompletableFuture",
"<",
"Void",
">",
"closeClusterComponent",
"(",
"ApplicationStatus",
"applicationStatus",
",",
"@",
"Nullable",
"String",
"diagnostics",
")",
"{",
"synchronized",
"(",
"lock",
")",
"{",
"if",
"(",
"clusterComponent",
"!=",
"null",
"... | Deregister the Flink application from the resource management system by signalling
the {@link ResourceManager}.
@param applicationStatus to terminate the application with
@param diagnostics additional information about the shut down, can be {@code null}
@return Future which is completed once the shut down | [
"Deregister",
"the",
"Flink",
"application",
"from",
"the",
"resource",
"management",
"system",
"by",
"signalling",
"the",
"{",
"@link",
"ResourceManager",
"}",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/entrypoint/ClusterEntrypoint.java#L437-L445 | train | Closes the cluster component. | [
30522,
2797,
4012,
10814,
10880,
11263,
11244,
1026,
11675,
1028,
2485,
20464,
19966,
2121,
9006,
29513,
3372,
1006,
5097,
29336,
2271,
5097,
29336,
2271,
1010,
1030,
19701,
3085,
5164,
16474,
2015,
1007,
1063,
25549,
1006,
5843,
1007,
1063,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
apache/flink | flink-table/flink-table-planner-blink/src/main/java/org/apache/flink/table/plan/rules/logical/FlinkAggregateExpandDistinctAggregatesRule.java | FlinkAggregateExpandDistinctAggregatesRule.onMatch | public void onMatch(RelOptRuleCall call) {
final Aggregate aggregate = call.rel(0);
if (!AggregateUtil.containsAccurateDistinctCall(aggregate.getAggCallList())) {
return;
}
// Check unsupported aggregate which contains both approximate distinct call and
// accurate distinct call.
if (AggregateUtil.contai... | java | public void onMatch(RelOptRuleCall call) {
final Aggregate aggregate = call.rel(0);
if (!AggregateUtil.containsAccurateDistinctCall(aggregate.getAggCallList())) {
return;
}
// Check unsupported aggregate which contains both approximate distinct call and
// accurate distinct call.
if (AggregateUtil.contai... | [
"public",
"void",
"onMatch",
"(",
"RelOptRuleCall",
"call",
")",
"{",
"final",
"Aggregate",
"aggregate",
"=",
"call",
".",
"rel",
"(",
"0",
")",
";",
"if",
"(",
"!",
"AggregateUtil",
".",
"containsAccurateDistinctCall",
"(",
"aggregate",
".",
"getAggCallList",... | ~ Methods ---------------------------------------------------------------- | [
"~",
"Methods",
"----------------------------------------------------------------"
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-table/flink-table-planner-blink/src/main/java/org/apache/flink/table/plan/rules/logical/FlinkAggregateExpandDistinctAggregatesRule.java#L131-L263 | train | This is the main entry point for the rule. | [
30522,
2270,
11675,
2006,
18900,
2818,
1006,
2128,
4135,
13876,
6820,
2571,
9289,
2140,
2655,
1007,
1063,
2345,
9572,
9572,
1027,
2655,
1012,
2128,
2140,
1006,
1014,
1007,
1025,
2065,
1006,
999,
9572,
21823,
2140,
1012,
3397,
6305,
10841,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
netty/netty | resolver-dns/src/main/java/io/netty/resolver/dns/Cache.java | Cache.cache | final void cache(String hostname, E value, int ttl, EventLoop loop) {
Entries entries = resolveCache.get(hostname);
if (entries == null) {
entries = new Entries(hostname);
Entries oldEntries = resolveCache.putIfAbsent(hostname, entries);
if (oldEntries != null) {
... | java | final void cache(String hostname, E value, int ttl, EventLoop loop) {
Entries entries = resolveCache.get(hostname);
if (entries == null) {
entries = new Entries(hostname);
Entries oldEntries = resolveCache.putIfAbsent(hostname, entries);
if (oldEntries != null) {
... | [
"final",
"void",
"cache",
"(",
"String",
"hostname",
",",
"E",
"value",
",",
"int",
"ttl",
",",
"EventLoop",
"loop",
")",
"{",
"Entries",
"entries",
"=",
"resolveCache",
".",
"get",
"(",
"hostname",
")",
";",
"if",
"(",
"entries",
"==",
"null",
")",
... | Cache a value for the given hostname that will automatically expire once the TTL is reached. | [
"Cache",
"a",
"value",
"for",
"the",
"given",
"hostname",
"that",
"will",
"automatically",
"expire",
"once",
"the",
"TTL",
"is",
"reached",
"."
] | ba06eafa1c1824bd154f1a380019e7ea2edf3c4c | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/resolver-dns/src/main/java/io/netty/resolver/dns/Cache.java#L124-L134 | train | Cache an entry in the cache. | [
30522,
2345,
11675,
17053,
1006,
5164,
3677,
18442,
1010,
1041,
3643,
1010,
20014,
23746,
2140,
1010,
2724,
4135,
7361,
7077,
1007,
1063,
10445,
10445,
1027,
10663,
3540,
5403,
1012,
2131,
1006,
3677,
18442,
1007,
1025,
2065,
1006,
10445,
1... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
looly/hutool | hutool-poi/src/main/java/cn/hutool/poi/excel/ExcelWriter.java | ExcelWriter.setColumnWidth | public ExcelWriter setColumnWidth(int columnIndex, int width) {
if (columnIndex < 0) {
this.sheet.setDefaultColumnWidth(width);
} else {
this.sheet.setColumnWidth(columnIndex, width * 256);
}
return this;
} | java | public ExcelWriter setColumnWidth(int columnIndex, int width) {
if (columnIndex < 0) {
this.sheet.setDefaultColumnWidth(width);
} else {
this.sheet.setColumnWidth(columnIndex, width * 256);
}
return this;
} | [
"public",
"ExcelWriter",
"setColumnWidth",
"(",
"int",
"columnIndex",
",",
"int",
"width",
")",
"{",
"if",
"(",
"columnIndex",
"<",
"0",
")",
"{",
"this",
".",
"sheet",
".",
"setDefaultColumnWidth",
"(",
"width",
")",
";",
"}",
"else",
"{",
"this",
".",
... | 设置列宽(单位为一个字符的宽度,例如传入width为10,表示10个字符的宽度)
@param columnIndex 列号(从0开始计数,-1表示所有列的默认宽度)
@param width 宽度(单位1~256个字符宽度)
@return this
@since 4.0.8 | [
"设置列宽(单位为一个字符的宽度,例如传入width为10,表示10个字符的宽度)"
] | bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-poi/src/main/java/cn/hutool/poi/excel/ExcelWriter.java#L430-L437 | train | Sets the column width. | [
30522,
2270,
24970,
15994,
2275,
25778,
2819,
2078,
9148,
11927,
2232,
1006,
20014,
5930,
22254,
10288,
1010,
20014,
9381,
1007,
1063,
2065,
1006,
5930,
22254,
10288,
1026,
1014,
1007,
1063,
2023,
1012,
7123,
1012,
2275,
3207,
7011,
11314,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/state/ImmutableMapState.java | ImmutableMapState.iterator | @Override
public Iterator<Map.Entry<K, V>> iterator() {
return Collections.unmodifiableSet(state.entrySet()).iterator();
} | java | @Override
public Iterator<Map.Entry<K, V>> iterator() {
return Collections.unmodifiableSet(state.entrySet()).iterator();
} | [
"@",
"Override",
"public",
"Iterator",
"<",
"Map",
".",
"Entry",
"<",
"K",
",",
"V",
">",
">",
"iterator",
"(",
")",
"{",
"return",
"Collections",
".",
"unmodifiableSet",
"(",
"state",
".",
"entrySet",
"(",
")",
")",
".",
"iterator",
"(",
")",
";",
... | Iterates over all the mappings in the state. The iterator cannot
remove elements.
@return A read-only iterator over all the mappings in the state. | [
"Iterates",
"over",
"all",
"the",
"mappings",
"in",
"the",
"state",
".",
"The",
"iterator",
"cannot",
"remove",
"elements",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-queryable-state/flink-queryable-state-client-java/src/main/java/org/apache/flink/queryablestate/client/state/ImmutableMapState.java#L111-L114 | train | Returns an iterator over the entries in this state. | [
30522,
1030,
2058,
15637,
2270,
2009,
6906,
4263,
1026,
4949,
1012,
4443,
1026,
1047,
1010,
1058,
1028,
1028,
2009,
6906,
4263,
1006,
1007,
1063,
2709,
6407,
1012,
4895,
5302,
4305,
22749,
13510,
3388,
1006,
2110,
1012,
4443,
13462,
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-streaming-java/src/main/java/org/apache/flink/streaming/api/graph/StreamGraphHasherV2.java | StreamGraphHasherV2.traverseStreamGraphAndGenerateHashes | @Override
public Map<Integer, byte[]> traverseStreamGraphAndGenerateHashes(StreamGraph streamGraph) {
// The hash function used to generate the hash
final HashFunction hashFunction = Hashing.murmur3_128(0);
final Map<Integer, byte[]> hashes = new HashMap<>();
Set<Integer> visited = new HashSet<>();
Queue<St... | java | @Override
public Map<Integer, byte[]> traverseStreamGraphAndGenerateHashes(StreamGraph streamGraph) {
// The hash function used to generate the hash
final HashFunction hashFunction = Hashing.murmur3_128(0);
final Map<Integer, byte[]> hashes = new HashMap<>();
Set<Integer> visited = new HashSet<>();
Queue<St... | [
"@",
"Override",
"public",
"Map",
"<",
"Integer",
",",
"byte",
"[",
"]",
">",
"traverseStreamGraphAndGenerateHashes",
"(",
"StreamGraph",
"streamGraph",
")",
"{",
"// The hash function used to generate the hash",
"final",
"HashFunction",
"hashFunction",
"=",
"Hashing",
... | Returns a map with a hash for each {@link StreamNode} of the {@link
StreamGraph}. The hash is used as the {@link JobVertexID} in order to
identify nodes across job submissions if they didn't change.
<p>The complete {@link StreamGraph} is traversed. The hash is either
computed from the transformation's user-specified i... | [
"Returns",
"a",
"map",
"with",
"a",
"hash",
"for",
"each",
"{",
"@link",
"StreamNode",
"}",
"of",
"the",
"{",
"@link",
"StreamGraph",
"}",
".",
"The",
"hash",
"is",
"used",
"as",
"the",
"{",
"@link",
"JobVertexID",
"}",
"in",
"order",
"to",
"identify",... | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-streaming-java/src/main/java/org/apache/flink/streaming/api/graph/StreamGraphHasherV2.java#L77-L129 | train | Traverses the given stream graph and generates the hash code for each node. | [
30522,
1030,
2058,
15637,
2270,
4949,
1026,
16109,
1010,
24880,
1031,
1033,
1028,
20811,
21422,
14413,
5685,
6914,
22139,
14949,
15689,
1006,
5460,
14413,
5460,
14413,
1007,
1063,
1013,
1013,
1996,
23325,
3853,
2109,
2000,
9699,
1996,
23325,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/PendingCheckpointStats.java | PendingCheckpointStats.reportFailedCheckpoint | void reportFailedCheckpoint(long failureTimestamp, @Nullable Throwable cause) {
FailedCheckpointStats failed = new FailedCheckpointStats(
checkpointId,
triggerTimestamp,
props,
numberOfSubtasks,
new HashMap<>(taskStats),
currentNumAcknowledgedSubtasks,
currentStateSize,
currentAlignmentBuffere... | java | void reportFailedCheckpoint(long failureTimestamp, @Nullable Throwable cause) {
FailedCheckpointStats failed = new FailedCheckpointStats(
checkpointId,
triggerTimestamp,
props,
numberOfSubtasks,
new HashMap<>(taskStats),
currentNumAcknowledgedSubtasks,
currentStateSize,
currentAlignmentBuffere... | [
"void",
"reportFailedCheckpoint",
"(",
"long",
"failureTimestamp",
",",
"@",
"Nullable",
"Throwable",
"cause",
")",
"{",
"FailedCheckpointStats",
"failed",
"=",
"new",
"FailedCheckpointStats",
"(",
"checkpointId",
",",
"triggerTimestamp",
",",
"props",
",",
"numberOfS... | Reports a failed pending checkpoint.
@param failureTimestamp Timestamp of the failure.
@param cause Optional cause of the failure. | [
"Reports",
"a",
"failed",
"pending",
"checkpoint",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/checkpoint/PendingCheckpointStats.java#L170-L185 | train | Reports a failed checkpoint. | [
30522,
11675,
3189,
7011,
18450,
5403,
3600,
8400,
1006,
2146,
4945,
7292,
9153,
8737,
1010,
1030,
19701,
3085,
5466,
3085,
3426,
1007,
1063,
3478,
5403,
3600,
26521,
29336,
2015,
3478,
1027,
2047,
3478,
5403,
3600,
26521,
29336,
2015,
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-filesystems/flink-mapr-fs/src/main/java/org/apache/flink/runtime/fs/maprfs/MapRFileSystem.java | MapRFileSystem.getCLDBLocations | private static String[] getCLDBLocations(String authority) throws IOException {
// Determine the MapR home
String maprHome = System.getenv(MAPR_HOME_ENV);
if (maprHome == null) {
maprHome = DEFAULT_MAPR_HOME;
}
final File maprClusterConf = new File(maprHome, MAPR_CLUSTER_CONF_FILE);
if (LOG.isDebugEna... | java | private static String[] getCLDBLocations(String authority) throws IOException {
// Determine the MapR home
String maprHome = System.getenv(MAPR_HOME_ENV);
if (maprHome == null) {
maprHome = DEFAULT_MAPR_HOME;
}
final File maprClusterConf = new File(maprHome, MAPR_CLUSTER_CONF_FILE);
if (LOG.isDebugEna... | [
"private",
"static",
"String",
"[",
"]",
"getCLDBLocations",
"(",
"String",
"authority",
")",
"throws",
"IOException",
"{",
"// Determine the MapR home",
"String",
"maprHome",
"=",
"System",
".",
"getenv",
"(",
"MAPR_HOME_ENV",
")",
";",
"if",
"(",
"maprHome",
"... | Retrieves the CLDB locations for the given MapR cluster name.
@param authority
the name of the MapR cluster
@return a list of CLDB locations
@throws IOException
thrown if the CLDB locations for the given MapR cluster name
cannot be determined | [
"Retrieves",
"the",
"CLDB",
"locations",
"for",
"the",
"given",
"MapR",
"cluster",
"name",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-filesystems/flink-mapr-fs/src/main/java/org/apache/flink/runtime/fs/maprfs/MapRFileSystem.java#L105-L175 | train | Get the CLDB locations for the given authority. | [
30522,
2797,
10763,
5164,
1031,
1033,
2131,
20464,
18939,
4135,
10719,
2015,
1006,
5164,
3691,
1007,
11618,
22834,
10288,
24422,
1063,
1013,
1013,
5646,
1996,
4949,
2099,
2188,
5164,
4949,
25032,
8462,
1027,
2291,
1012,
2131,
2368,
2615,
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-json/src/main/java/cn/hutool/json/JSONUtil.java | JSONUtil.quote | public static String quote(String string, boolean isWrap) {
StringWriter sw = new StringWriter();
try {
return quote(string, sw, isWrap).toString();
} catch (IOException ignored) {
// will never happen - we are writing to a string writer
return StrUtil.EMPTY;
}
} | java | public static String quote(String string, boolean isWrap) {
StringWriter sw = new StringWriter();
try {
return quote(string, sw, isWrap).toString();
} catch (IOException ignored) {
// will never happen - we are writing to a string writer
return StrUtil.EMPTY;
}
} | [
"public",
"static",
"String",
"quote",
"(",
"String",
"string",
",",
"boolean",
"isWrap",
")",
"{",
"StringWriter",
"sw",
"=",
"new",
"StringWriter",
"(",
")",
";",
"try",
"{",
"return",
"quote",
"(",
"string",
",",
"sw",
",",
"isWrap",
")",
".",
"toSt... | 对所有双引号做转义处理(使用双反斜杠做转义)<br>
为了能在HTML中较好的显示,会将</转义为<\/<br>
JSON字符串中不能包含控制字符和未经转义的引号和反斜杠
@param string 字符串
@param isWrap 是否使用双引号包装字符串
@return 适合在JSON中显示的字符串
@since 3.3.1 | [
"对所有双引号做转义处理(使用双反斜杠做转义)<br",
">",
"为了能在HTML中较好的显示,会将<",
";",
"/",
"转义为<",
";",
"\\",
"/",
"<br",
">",
"JSON字符串中不能包含控制字符和未经转义的引号和反斜杠"
] | bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-json/src/main/java/cn/hutool/json/JSONUtil.java#L462-L470 | train | Quote a string. | [
30522,
2270,
10763,
5164,
14686,
1006,
5164,
5164,
1010,
22017,
20898,
2003,
13088,
9331,
1007,
1063,
5164,
15994,
25430,
1027,
2047,
5164,
15994,
1006,
1007,
1025,
3046,
1063,
2709,
14686,
1006,
5164,
1010,
25430,
1010,
2003,
13088,
9331,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
apache/flink | flink-core/src/main/java/org/apache/flink/types/LongValue.java | LongValue.compareTo | @Override
public int compareTo(LongValue o) {
final long other = o.value;
return this.value < other ? -1 : this.value > other ? 1 : 0;
} | java | @Override
public int compareTo(LongValue o) {
final long other = o.value;
return this.value < other ? -1 : this.value > other ? 1 : 0;
} | [
"@",
"Override",
"public",
"int",
"compareTo",
"(",
"LongValue",
"o",
")",
"{",
"final",
"long",
"other",
"=",
"o",
".",
"value",
";",
"return",
"this",
".",
"value",
"<",
"other",
"?",
"-",
"1",
":",
"this",
".",
"value",
">",
"other",
"?",
"1",
... | -------------------------------------------------------------------------------------------- | [
"--------------------------------------------------------------------------------------------"
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-core/src/main/java/org/apache/flink/types/LongValue.java#L102-L106 | train | Compares two LongValues. | [
30522,
1030,
2058,
15637,
2270,
20014,
12826,
3406,
1006,
2146,
10175,
5657,
1051,
1007,
1063,
2345,
2146,
2060,
1027,
1051,
1012,
3643,
1025,
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... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
apache/flink | flink-streaming-java/src/main/java/org/apache/flink/streaming/api/datastream/AllWindowedStream.java | AllWindowedStream.fold | @PublicEvolving
@Deprecated
public <ACC, R> SingleOutputStreamOperator<R> fold(ACC initialValue,
FoldFunction<T, ACC> foldFunction,
AllWindowFunction<ACC, R, W> function,
TypeInformation<ACC> foldAccumulatorType,
TypeInformation<R> resultType) {
if (foldFunction instanceof RichFunction) {
throw new U... | java | @PublicEvolving
@Deprecated
public <ACC, R> SingleOutputStreamOperator<R> fold(ACC initialValue,
FoldFunction<T, ACC> foldFunction,
AllWindowFunction<ACC, R, W> function,
TypeInformation<ACC> foldAccumulatorType,
TypeInformation<R> resultType) {
if (foldFunction instanceof RichFunction) {
throw new U... | [
"@",
"PublicEvolving",
"@",
"Deprecated",
"public",
"<",
"ACC",
",",
"R",
">",
"SingleOutputStreamOperator",
"<",
"R",
">",
"fold",
"(",
"ACC",
"initialValue",
",",
"FoldFunction",
"<",
"T",
",",
"ACC",
">",
"foldFunction",
",",
"AllWindowFunction",
"<",
"AC... | Applies the given window function to each window. The window function is called for each
evaluation of the window for each key individually. The output of the window function is
interpreted as a regular non-windowed stream.
<p>Arriving data is incrementally aggregated using the given fold function.
@param initialValu... | [
"Applies",
"the",
"given",
"window",
"function",
"to",
"each",
"window",
".",
"The",
"window",
"function",
"is",
"called",
"for",
"each",
"evaluation",
"of",
"the",
"window",
"for",
"each",
"key",
"individually",
".",
"The",
"output",
"of",
"the",
"window",
... | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-streaming-java/src/main/java/org/apache/flink/streaming/api/datastream/AllWindowedStream.java#L860-L927 | train | Folds the stream using the given fold function. | [
30522,
1030,
30524,
11263,
27989,
1026,
16222,
1010,
1054,
1010,
1059,
1028,
3853,
1010,
2828,
2378,
14192,
3370,
1026,
16222,
1028,
10671,
6305,
24894,
20350,
13874,
1010,
2828,
2378,
14192,
3370,
1026,
1054,
1028,
2765,
13874,
1007,
1063,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
hankcs/HanLP | src/main/java/com/hankcs/hanlp/tokenizer/NotionalTokenizer.java | NotionalTokenizer.segment | public static List<Term> segment(char[] text)
{
List<Term> resultList = SEGMENT.seg(text);
ListIterator<Term> listIterator = resultList.listIterator();
while (listIterator.hasNext())
{
if (!CoreStopWordDictionary.shouldInclude(listIterator.next()))
{
... | java | public static List<Term> segment(char[] text)
{
List<Term> resultList = SEGMENT.seg(text);
ListIterator<Term> listIterator = resultList.listIterator();
while (listIterator.hasNext())
{
if (!CoreStopWordDictionary.shouldInclude(listIterator.next()))
{
... | [
"public",
"static",
"List",
"<",
"Term",
">",
"segment",
"(",
"char",
"[",
"]",
"text",
")",
"{",
"List",
"<",
"Term",
">",
"resultList",
"=",
"SEGMENT",
".",
"seg",
"(",
"text",
")",
";",
"ListIterator",
"<",
"Term",
">",
"listIterator",
"=",
"resul... | 分词
@param text 文本
@return 分词结果 | [
"分词"
] | a538d0722ab2e4980a9dcd9ea40324fc3ddba7ce | https://github.com/hankcs/HanLP/blob/a538d0722ab2e4980a9dcd9ea40324fc3ddba7ce/src/main/java/com/hankcs/hanlp/tokenizer/NotionalTokenizer.java#L46-L59 | train | segment method. | [
30522,
2270,
10763,
2862,
1026,
2744,
1028,
6903,
1006,
25869,
1031,
1033,
3793,
1007,
1063,
2862,
1026,
2744,
1028,
2765,
9863,
1027,
6903,
1012,
7367,
2290,
1006,
3793,
1007,
1025,
2862,
21646,
8844,
1026,
2744,
1028,
2862,
21646,
8844,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
looly/hutool | hutool-core/src/main/java/cn/hutool/core/collection/CollUtil.java | CollUtil.newHashSet | @SafeVarargs
public static <T> HashSet<T> newHashSet(T... ts) {
return newHashSet(false, ts);
} | java | @SafeVarargs
public static <T> HashSet<T> newHashSet(T... ts) {
return newHashSet(false, ts);
} | [
"@",
"SafeVarargs",
"public",
"static",
"<",
"T",
">",
"HashSet",
"<",
"T",
">",
"newHashSet",
"(",
"T",
"...",
"ts",
")",
"{",
"return",
"newHashSet",
"(",
"false",
",",
"ts",
")",
";",
"}"
] | 新建一个HashSet
@param <T> 集合元素类型
@param ts 元素数组
@return HashSet对象 | [
"新建一个HashSet"
] | bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/collection/CollUtil.java#L401-L404 | train | Creates a new HashSet instance containing all of the elements in the given array. | [
30522,
1030,
3647,
24516,
10623,
2015,
2270,
10763,
1026,
1056,
1028,
23325,
13462,
1026,
1056,
1028,
2047,
14949,
7898,
3388,
1006,
1056,
1012,
1012,
1012,
24529,
1007,
1063,
2709,
2047,
14949,
7898,
3388,
1006,
6270,
1010,
24529,
1007,
10... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
apache/flink | flink-runtime/src/main/java/org/apache/flink/runtime/rpc/akka/AkkaRpcServiceUtils.java | AkkaRpcServiceUtils.createRandomName | public static String createRandomName(String prefix) {
Preconditions.checkNotNull(prefix, "Prefix must not be null.");
long nameOffset;
// obtain the next name offset by incrementing it atomically
do {
nameOffset = nextNameOffset.get();
} while (!nextNameOffset.compareAndSet(nameOffset, nameOffset + 1L))... | java | public static String createRandomName(String prefix) {
Preconditions.checkNotNull(prefix, "Prefix must not be null.");
long nameOffset;
// obtain the next name offset by incrementing it atomically
do {
nameOffset = nextNameOffset.get();
} while (!nextNameOffset.compareAndSet(nameOffset, nameOffset + 1L))... | [
"public",
"static",
"String",
"createRandomName",
"(",
"String",
"prefix",
")",
"{",
"Preconditions",
".",
"checkNotNull",
"(",
"prefix",
",",
"\"Prefix must not be null.\"",
")",
";",
"long",
"nameOffset",
";",
"// obtain the next name offset by incrementing it atomically"... | Creates a random name of the form prefix_X, where X is an increasing number.
@param prefix Prefix string to prepend to the monotonically increasing name offset number
@return A random name of the form prefix_X where X is an increasing number | [
"Creates",
"a",
"random",
"name",
"of",
"the",
"form",
"prefix_X",
"where",
"X",
"is",
"an",
"increasing",
"number",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/rpc/akka/AkkaRpcServiceUtils.java#L224-L235 | train | Creates a random name that is unique within a prefix. | [
30522,
2270,
10763,
5164,
3443,
13033,
5358,
18442,
1006,
5164,
17576,
1007,
1063,
3653,
8663,
20562,
2015,
1012,
4638,
17048,
11231,
3363,
1006,
17576,
1010,
1000,
17576,
2442,
2025,
2022,
19701,
1012,
1000,
1007,
1025,
2146,
2171,
27475,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
apache/flink | flink-runtime/src/main/java/org/apache/flink/runtime/io/network/partition/consumer/InputChannel.java | InputChannel.increaseBackoff | protected boolean increaseBackoff() {
// Backoff is disabled
if (currentBackoff < 0) {
return false;
}
// This is the first time backing off
if (currentBackoff == 0) {
currentBackoff = initialBackoff;
return true;
}
// Continue backing off
else if (currentBackoff < maxBackoff) {
currentBa... | java | protected boolean increaseBackoff() {
// Backoff is disabled
if (currentBackoff < 0) {
return false;
}
// This is the first time backing off
if (currentBackoff == 0) {
currentBackoff = initialBackoff;
return true;
}
// Continue backing off
else if (currentBackoff < maxBackoff) {
currentBa... | [
"protected",
"boolean",
"increaseBackoff",
"(",
")",
"{",
"// Backoff is disabled",
"if",
"(",
"currentBackoff",
"<",
"0",
")",
"{",
"return",
"false",
";",
"}",
"// This is the first time backing off",
"if",
"(",
"currentBackoff",
"==",
"0",
")",
"{",
"currentBac... | Increases the current backoff and returns whether the operation was successful.
@return <code>true</code>, iff the operation was successful. Otherwise, <code>false</code>. | [
"Increases",
"the",
"current",
"backoff",
"and",
"returns",
"whether",
"the",
"operation",
"was",
"successful",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/io/network/partition/consumer/InputChannel.java#L223-L245 | train | Increase the backoff value. | [
30522,
5123,
22017,
20898,
3623,
5963,
7245,
1006,
1007,
1063,
1013,
1013,
2067,
7245,
2003,
9776,
2065,
1006,
2783,
5963,
7245,
1026,
1014,
1007,
1063,
2709,
30524,
2034,
2051,
5150,
2125,
2065,
1006,
2783,
5963,
7245,
1027,
1027,
1014,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
apache/flink | flink-core/src/main/java/org/apache/flink/types/parser/FieldParser.java | FieldParser.nextStringEndPos | protected final int nextStringEndPos(byte[] bytes, int startPos, int limit, byte[] delimiter) {
int endPos = startPos;
final int delimLimit = limit - delimiter.length + 1;
while (endPos < limit) {
if (endPos < delimLimit && delimiterNext(bytes, endPos, delimiter)) {
break;
}
endPos++;
}
if (en... | java | protected final int nextStringEndPos(byte[] bytes, int startPos, int limit, byte[] delimiter) {
int endPos = startPos;
final int delimLimit = limit - delimiter.length + 1;
while (endPos < limit) {
if (endPos < delimLimit && delimiterNext(bytes, endPos, delimiter)) {
break;
}
endPos++;
}
if (en... | [
"protected",
"final",
"int",
"nextStringEndPos",
"(",
"byte",
"[",
"]",
"bytes",
",",
"int",
"startPos",
",",
"int",
"limit",
",",
"byte",
"[",
"]",
"delimiter",
")",
"{",
"int",
"endPos",
"=",
"startPos",
";",
"final",
"int",
"delimLimit",
"=",
"limit",... | Returns the end position of a string. Sets the error state if the column is empty.
@return the end position of the string or -1 if an error occurred | [
"Returns",
"the",
"end",
"position",
"of",
"a",
"string",
".",
"Sets",
"the",
"error",
"state",
"if",
"the",
"column",
"is",
"empty",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-core/src/main/java/org/apache/flink/types/parser/FieldParser.java#L206-L223 | train | Returns the end position of the next string in the byte array starting at startPos. | [
30522,
5123,
2345,
20014,
2279,
3367,
4892,
10497,
6873,
2015,
1006,
24880,
1031,
1033,
27507,
1010,
20014,
2707,
6873,
2015,
1010,
20014,
5787,
1010,
24880,
1031,
1033,
3972,
27605,
3334,
1007,
1063,
20014,
2203,
6873,
2015,
1027,
2707,
68... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/accumulators/AccumulatorHelper.java | AccumulatorHelper.toResultMap | public static Map<String, OptionalFailure<Object>> toResultMap(Map<String, Accumulator<?, ?>> accumulators) {
Map<String, OptionalFailure<Object>> resultMap = new HashMap<>();
for (Map.Entry<String, Accumulator<?, ?>> entry : accumulators.entrySet()) {
resultMap.put(entry.getKey(), wrapUnchecked(entry.getKey(), ... | java | public static Map<String, OptionalFailure<Object>> toResultMap(Map<String, Accumulator<?, ?>> accumulators) {
Map<String, OptionalFailure<Object>> resultMap = new HashMap<>();
for (Map.Entry<String, Accumulator<?, ?>> entry : accumulators.entrySet()) {
resultMap.put(entry.getKey(), wrapUnchecked(entry.getKey(), ... | [
"public",
"static",
"Map",
"<",
"String",
",",
"OptionalFailure",
"<",
"Object",
">",
">",
"toResultMap",
"(",
"Map",
"<",
"String",
",",
"Accumulator",
"<",
"?",
",",
"?",
">",
">",
"accumulators",
")",
"{",
"Map",
"<",
"String",
",",
"OptionalFailure",... | Transform the Map with accumulators into a Map containing only the
results. | [
"Transform",
"the",
"Map",
"with",
"accumulators",
"into",
"a",
"Map",
"containing",
"only",
"the",
"results",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-core/src/main/java/org/apache/flink/api/common/accumulators/AccumulatorHelper.java#L127-L133 | train | Converts a map of accumulators to a map of OptionalFailure objects. | [
30522,
2270,
10763,
4949,
1026,
5164,
1010,
11887,
7011,
4014,
5397,
1026,
4874,
1028,
1028,
9538,
23722,
29418,
2361,
1006,
4949,
1026,
5164,
1010,
16222,
2819,
20350,
1026,
1029,
1010,
1029,
1028,
1028,
30524,
1007,
1025,
2005,
1006,
4949... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/watch/WatchMonitor.java | WatchMonitor.init | public void init() throws WatchException{
//获取目录或文件路径
if(false ==Files.exists(this.path, LinkOption.NOFOLLOW_LINKS)) {
final Path lastPathEle = FileUtil.getLastPathEle(this.path);
if(null != lastPathEle) {
final String lastPathEleStr = lastPathEle.toString();
//带有点表示有扩展名,按照未创建的文件对待。Linux下.d的为目录,... | java | public void init() throws WatchException{
//获取目录或文件路径
if(false ==Files.exists(this.path, LinkOption.NOFOLLOW_LINKS)) {
final Path lastPathEle = FileUtil.getLastPathEle(this.path);
if(null != lastPathEle) {
final String lastPathEleStr = lastPathEle.toString();
//带有点表示有扩展名,按照未创建的文件对待。Linux下.d的为目录,... | [
"public",
"void",
"init",
"(",
")",
"throws",
"WatchException",
"{",
"//获取目录或文件路径\r",
"if",
"(",
"false",
"==",
"Files",
".",
"exists",
"(",
"this",
".",
"path",
",",
"LinkOption",
".",
"NOFOLLOW_LINKS",
")",
")",
"{",
"final",
"Path",
"lastPathEle",
"=",
... | 初始化<br>
初始化包括:
<pre>
1、解析传入的路径,判断其为目录还是文件
2、创建{@link WatchService} 对象
</pre>
@throws WatchException 监听异常,IO异常时抛出此异常 | [
"初始化<br",
">",
"初始化包括:",
"<pre",
">",
"1、解析传入的路径,判断其为目录还是文件",
"2、创建",
"{",
"@link",
"WatchService",
"}",
"对象",
"<",
"/",
"pre",
">"
] | bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/io/watch/WatchMonitor.java#L304-L336 | train | Initializes the file system. | [
30522,
2270,
11675,
1999,
4183,
1006,
1007,
11618,
3422,
10288,
24422,
1063,
1013,
1013,
100,
100,
1918,
100,
100,
1861,
100,
100,
100,
2065,
1006,
6270,
1027,
1027,
6764,
1012,
6526,
1006,
2023,
1012,
4130,
1010,
4957,
7361,
3508,
1012,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
apache/flink | flink-runtime/src/main/java/org/apache/flink/runtime/state/AbstractKeyedStateBackend.java | AbstractKeyedStateBackend.dispose | @Override
public void dispose() {
IOUtils.closeQuietly(cancelStreamRegistry);
if (kvStateRegistry != null) {
kvStateRegistry.unregisterAll();
}
lastName = null;
lastState = null;
keyValueStatesByName.clear();
} | java | @Override
public void dispose() {
IOUtils.closeQuietly(cancelStreamRegistry);
if (kvStateRegistry != null) {
kvStateRegistry.unregisterAll();
}
lastName = null;
lastState = null;
keyValueStatesByName.clear();
} | [
"@",
"Override",
"public",
"void",
"dispose",
"(",
")",
"{",
"IOUtils",
".",
"closeQuietly",
"(",
"cancelStreamRegistry",
")",
";",
"if",
"(",
"kvStateRegistry",
"!=",
"null",
")",
"{",
"kvStateRegistry",
".",
"unregisterAll",
"(",
")",
";",
"}",
"lastName",... | Closes the state backend, releasing all internal resources, but does not delete any persistent
checkpoint data. | [
"Closes",
"the",
"state",
"backend",
"releasing",
"all",
"internal",
"resources",
"but",
"does",
"not",
"delete",
"any",
"persistent",
"checkpoint",
"data",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/state/AbstractKeyedStateBackend.java#L154-L166 | train | Dispose of the state manager. | [
30522,
1030,
2058,
15637,
2270,
11675,
27764,
1006,
1007,
1063,
22834,
21823,
4877,
1012,
2485,
15549,
3388,
2135,
1006,
17542,
21422,
2890,
24063,
2854,
1007,
1025,
2065,
1006,
24888,
9153,
3334,
13910,
2923,
2854,
999,
1027,
19701,
1007,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
apache/flink | flink-runtime/src/main/java/org/apache/flink/runtime/checkpoint/Checkpoints.java | Checkpoints.disposeSavepoint | public static void disposeSavepoint(
String pointer,
StateBackend stateBackend,
ClassLoader classLoader) throws IOException, FlinkException {
checkNotNull(pointer, "location");
checkNotNull(stateBackend, "stateBackend");
checkNotNull(classLoader, "classLoader");
final CompletedCheckpointStorageLocati... | java | public static void disposeSavepoint(
String pointer,
StateBackend stateBackend,
ClassLoader classLoader) throws IOException, FlinkException {
checkNotNull(pointer, "location");
checkNotNull(stateBackend, "stateBackend");
checkNotNull(classLoader, "classLoader");
final CompletedCheckpointStorageLocati... | [
"public",
"static",
"void",
"disposeSavepoint",
"(",
"String",
"pointer",
",",
"StateBackend",
"stateBackend",
",",
"ClassLoader",
"classLoader",
")",
"throws",
"IOException",
",",
"FlinkException",
"{",
"checkNotNull",
"(",
"pointer",
",",
"\"location\"",
")",
";",... | ------------------------------------------------------------------------ | [
"------------------------------------------------------------------------"
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/checkpoint/Checkpoints.java#L231-L284 | train | Disposes of a savepoint. | [
30522,
2270,
10763,
11675,
27764,
3736,
3726,
8400,
1006,
5164,
20884,
1010,
2110,
5963,
10497,
2110,
5963,
10497,
1010,
2465,
11066,
2121,
2465,
11066,
2121,
1007,
11618,
22834,
10288,
24422,
1010,
13109,
19839,
10288,
24422,
1063,
4638,
170... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
apache/flink | flink-runtime/src/main/java/org/apache/flink/runtime/taskexecutor/TaskManagerRunner.java | TaskManagerRunner.main | public static void main(String[] args) throws Exception {
// startup checks and logging
EnvironmentInformation.logEnvironmentInfo(LOG, "TaskManager", args);
SignalHandler.register(LOG);
JvmShutdownSafeguard.installAsShutdownHook(LOG);
long maxOpenFileHandles = EnvironmentInformation.getOpenFileHandlesLimit()... | java | public static void main(String[] args) throws Exception {
// startup checks and logging
EnvironmentInformation.logEnvironmentInfo(LOG, "TaskManager", args);
SignalHandler.register(LOG);
JvmShutdownSafeguard.installAsShutdownHook(LOG);
long maxOpenFileHandles = EnvironmentInformation.getOpenFileHandlesLimit()... | [
"public",
"static",
"void",
"main",
"(",
"String",
"[",
"]",
"args",
")",
"throws",
"Exception",
"{",
"// startup checks and logging",
"EnvironmentInformation",
".",
"logEnvironmentInfo",
"(",
"LOG",
",",
"\"TaskManager\"",
",",
"args",
")",
";",
"SignalHandler",
... | -------------------------------------------------------------------------------------------- | [
"--------------------------------------------------------------------------------------------"
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/taskexecutor/TaskManagerRunner.java#L270-L304 | train | Main method for the task manager. | [
30522,
2270,
10763,
11675,
2364,
1006,
5164,
1031,
1033,
12098,
5620,
1007,
11618,
6453,
1063,
1013,
1013,
22752,
14148,
1998,
15899,
4044,
2378,
14192,
3370,
1012,
8833,
2368,
21663,
2239,
3672,
2378,
14876,
1006,
8833,
1010,
1000,
4708,
2... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
looly/hutool | hutool-cron/src/main/java/cn/hutool/cron/TaskTable.java | TaskTable.add | public TaskTable add(String id, CronPattern pattern, Task task) {
final Lock writeLock = lock.writeLock();
try {
writeLock.lock();
if (ids.contains(id)) {
throw new CronException("Id [{}] has been existed!", id);
}
ids.add(id);
patterns.add(pattern);
tasks.add(task);
size++;
} ... | java | public TaskTable add(String id, CronPattern pattern, Task task) {
final Lock writeLock = lock.writeLock();
try {
writeLock.lock();
if (ids.contains(id)) {
throw new CronException("Id [{}] has been existed!", id);
}
ids.add(id);
patterns.add(pattern);
tasks.add(task);
size++;
} ... | [
"public",
"TaskTable",
"add",
"(",
"String",
"id",
",",
"CronPattern",
"pattern",
",",
"Task",
"task",
")",
"{",
"final",
"Lock",
"writeLock",
"=",
"lock",
".",
"writeLock",
"(",
")",
";",
"try",
"{",
"writeLock",
".",
"lock",
"(",
")",
";",
"if",
"(... | 新增Task
@param id ID
@param pattern {@link CronPattern}
@param task {@link Task}
@return this | [
"新增Task"
] | bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-cron/src/main/java/cn/hutool/cron/TaskTable.java#L50-L65 | train | Adds a new entry to the table. | [
30522,
2270,
4708,
10880,
5587,
1006,
5164,
8909,
1010,
13675,
2239,
4502,
12079,
2078,
5418,
1010,
4708,
4708,
1007,
1063,
2345,
5843,
4339,
7878,
1027,
5843,
1012,
4339,
7878,
1006,
1007,
1025,
3046,
1063,
4339,
7878,
1012,
5843,
1006,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
looly/hutool | hutool-core/src/main/java/cn/hutool/core/util/ObjectUtil.java | ObjectUtil.cloneByStream | @SuppressWarnings("unchecked")
public static <T> T cloneByStream(T obj) {
if (null == obj || false == (obj instanceof Serializable)) {
return null;
}
final FastByteArrayOutputStream byteOut = new FastByteArrayOutputStream();
ObjectOutputStream out = null;
try {
out = new ObjectOutputStream(byte... | java | @SuppressWarnings("unchecked")
public static <T> T cloneByStream(T obj) {
if (null == obj || false == (obj instanceof Serializable)) {
return null;
}
final FastByteArrayOutputStream byteOut = new FastByteArrayOutputStream();
ObjectOutputStream out = null;
try {
out = new ObjectOutputStream(byte... | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"static",
"<",
"T",
">",
"T",
"cloneByStream",
"(",
"T",
"obj",
")",
"{",
"if",
"(",
"null",
"==",
"obj",
"||",
"false",
"==",
"(",
"obj",
"instanceof",
"Serializable",
")",
")",
"{",
"retur... | 序列化后拷贝流的方式克隆<br>
对象必须实现Serializable接口
@param <T> 对象类型
@param obj 被克隆对象
@return 克隆后的对象
@throws UtilException IO异常和ClassNotFoundException封装 | [
"序列化后拷贝流的方式克隆<br",
">",
"对象必须实现Serializable接口"
] | bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/util/ObjectUtil.java#L326-L344 | train | Clones the given object by copying it from a stream. | [
30522,
1030,
16081,
9028,
5582,
2015,
1006,
1000,
4895,
5403,
18141,
1000,
1007,
2270,
10763,
1026,
1056,
1028,
1056,
17598,
3762,
21422,
1006,
1056,
27885,
3501,
1007,
1063,
2065,
1006,
19701,
1027,
1027,
27885,
3501,
1064,
1064,
6270,
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-queryable-state/flink-queryable-state-client-java/src/main/java/org/apache/flink/queryablestate/network/AbstractServerBase.java | AbstractServerBase.attemptToBind | private boolean attemptToBind(final int port) throws Throwable {
log.debug("Attempting to start {} on port {}.", serverName, port);
this.queryExecutor = createQueryExecutor();
this.handler = initializeHandler();
final NettyBufferPool bufferPool = new NettyBufferPool(numEventLoopThreads);
final ThreadFactor... | java | private boolean attemptToBind(final int port) throws Throwable {
log.debug("Attempting to start {} on port {}.", serverName, port);
this.queryExecutor = createQueryExecutor();
this.handler = initializeHandler();
final NettyBufferPool bufferPool = new NettyBufferPool(numEventLoopThreads);
final ThreadFactor... | [
"private",
"boolean",
"attemptToBind",
"(",
"final",
"int",
"port",
")",
"throws",
"Throwable",
"{",
"log",
".",
"debug",
"(",
"\"Attempting to start {} on port {}.\"",
",",
"serverName",
",",
"port",
")",
";",
"this",
".",
"queryExecutor",
"=",
"createQueryExecut... | Tries to start the server at the provided port.
<p>This, in conjunction with {@link #start()}, try to start the
server on a free port among the port range provided at the constructor.
@param port the port to try to bind the server to.
@throws Exception If something goes wrong during the bind operation. | [
"Tries",
"to",
"start",
"the",
"server",
"at",
"the",
"provided",
"port",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-queryable-state/flink-queryable-state-client-java/src/main/java/org/apache/flink/queryablestate/network/AbstractServerBase.java#L211-L279 | train | Attempt to bind to the given port. | [
30522,
2797,
22017,
20898,
3535,
3406,
8428,
2094,
1006,
2345,
20014,
3417,
1007,
11618,
5466,
3085,
1063,
8833,
1012,
2139,
8569,
2290,
1006,
1000,
7161,
2000,
2707,
1063,
1065,
2006,
3417,
1063,
1065,
1012,
1000,
1010,
8241,
18442,
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/FileUtil.java | FileUtil.appendUtf8Lines | public static <T> File appendUtf8Lines(Collection<T> list, File file) throws IORuntimeException {
return appendLines(list, file, CharsetUtil.CHARSET_UTF_8);
} | java | public static <T> File appendUtf8Lines(Collection<T> list, File file) throws IORuntimeException {
return appendLines(list, file, CharsetUtil.CHARSET_UTF_8);
} | [
"public",
"static",
"<",
"T",
">",
"File",
"appendUtf8Lines",
"(",
"Collection",
"<",
"T",
">",
"list",
",",
"File",
"file",
")",
"throws",
"IORuntimeException",
"{",
"return",
"appendLines",
"(",
"list",
",",
"file",
",",
"CharsetUtil",
".",
"CHARSET_UTF_8"... | 将列表写入文件,追加模式
@param <T> 集合元素类型
@param list 列表
@param file 文件
@return 目标文件
@throws IORuntimeException IO异常
@since 3.1.2 | [
"将列表写入文件,追加模式"
] | bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/io/FileUtil.java#L2939-L2941 | train | Append UTF - 8 lines to a file. | [
30522,
2270,
10763,
1026,
1056,
1028,
5371,
10439,
10497,
4904,
2546,
2620,
12735,
1006,
3074,
1026,
1056,
1028,
2862,
1010,
5371,
5371,
1007,
11618,
22834,
15532,
7292,
10288,
24422,
1063,
2709,
10439,
10497,
12735,
1006,
2862,
1010,
5371,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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.append | @SafeVarargs
public static <T> T[] append(T[] buffer, T... newElements) {
if(isEmpty(buffer)) {
return newElements;
}
return insert(buffer, buffer.length, newElements);
} | java | @SafeVarargs
public static <T> T[] append(T[] buffer, T... newElements) {
if(isEmpty(buffer)) {
return newElements;
}
return insert(buffer, buffer.length, newElements);
} | [
"@",
"SafeVarargs",
"public",
"static",
"<",
"T",
">",
"T",
"[",
"]",
"append",
"(",
"T",
"[",
"]",
"buffer",
",",
"T",
"...",
"newElements",
")",
"{",
"if",
"(",
"isEmpty",
"(",
"buffer",
")",
")",
"{",
"return",
"newElements",
";",
"}",
"return",... | 将新元素添加到已有数组中<br>
添加新元素会生成一个新的数组,不影响原数组
@param <T> 数组元素类型
@param buffer 已有数组
@param newElements 新元素
@return 新数组 | [
"将新元素添加到已有数组中<br",
">",
"添加新元素会生成一个新的数组,不影响原数组"
] | bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/util/ArrayUtil.java#L382-L388 | train | Append the elements to the end of the array. | [
30522,
1030,
3647,
24516,
10623,
2015,
2270,
10763,
1026,
1056,
1028,
1056,
1031,
1033,
10439,
10497,
1006,
1056,
1031,
1033,
17698,
1010,
1056,
1012,
1012,
1012,
2047,
12260,
8163,
1007,
1063,
2065,
1006,
2003,
6633,
13876,
2100,
1006,
176... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
looly/hutool | hutool-core/src/main/java/cn/hutool/core/collection/CollUtil.java | CollUtil.union | public static <T> Collection<T> union(Collection<T> coll1, Collection<T> coll2) {
final ArrayList<T> list = new ArrayList<>();
if (isEmpty(coll1)) {
list.addAll(coll2);
} else if (isEmpty(coll2)) {
list.addAll(coll1);
} else {
final Map<T, Integer> map1 = countMap(coll1);
final Map<T, Intege... | java | public static <T> Collection<T> union(Collection<T> coll1, Collection<T> coll2) {
final ArrayList<T> list = new ArrayList<>();
if (isEmpty(coll1)) {
list.addAll(coll2);
} else if (isEmpty(coll2)) {
list.addAll(coll1);
} else {
final Map<T, Integer> map1 = countMap(coll1);
final Map<T, Intege... | [
"public",
"static",
"<",
"T",
">",
"Collection",
"<",
"T",
">",
"union",
"(",
"Collection",
"<",
"T",
">",
"coll1",
",",
"Collection",
"<",
"T",
">",
"coll2",
")",
"{",
"final",
"ArrayList",
"<",
"T",
">",
"list",
"=",
"new",
"ArrayList",
"<>",
"("... | 两个集合的并集<br>
针对一个集合中存在多个相同元素的情况,计算两个集合中此元素的个数,保留最多的个数<br>
例如:集合1:[a, b, c, c, c],集合2:[a, b, c, c]<br>
结果:[a, b, c, c, c],此结果中只保留了三个c
@param <T> 集合元素类型
@param coll1 集合1
@param coll2 集合2
@return 并集的集合,返回 {@link ArrayList} | [
"两个集合的并集<br",
">",
"针对一个集合中存在多个相同元素的情况,计算两个集合中此元素的个数,保留最多的个数<br",
">",
"例如:集合1:",
"[",
"a",
"b",
"c",
"c",
"c",
"]",
",集合2:",
"[",
"a",
"b",
"c",
"c",
"]",
"<br",
">",
"结果:",
"[",
"a",
"b",
"c",
"c",
"c",
"]",
",此结果中只保留了三个c"
] | bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/collection/CollUtil.java#L74-L94 | train | Creates a new collection containing the union of the two collections. | [
30522,
2270,
10763,
1026,
1056,
1028,
3074,
1026,
1056,
1028,
2586,
1006,
3074,
1026,
1056,
1028,
8902,
2140,
2487,
1010,
3074,
1026,
1056,
1028,
8902,
2140,
2475,
1007,
1063,
2345,
9140,
9863,
1026,
1056,
1028,
2862,
1027,
2047,
9140,
98... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
apache/flink | flink-streaming-java/src/main/java/org/apache/flink/streaming/api/datastream/AllWindowedStream.java | AllWindowedStream.reduce | @PublicEvolving
public <R> SingleOutputStreamOperator<R> reduce(
ReduceFunction<T> reduceFunction,
ProcessAllWindowFunction<T, R, W> function) {
TypeInformation<R> resultType = getProcessAllWindowFunctionReturnType(function, input.getType());
return reduce(reduceFunction, function, resultType);
} | java | @PublicEvolving
public <R> SingleOutputStreamOperator<R> reduce(
ReduceFunction<T> reduceFunction,
ProcessAllWindowFunction<T, R, W> function) {
TypeInformation<R> resultType = getProcessAllWindowFunctionReturnType(function, input.getType());
return reduce(reduceFunction, function, resultType);
} | [
"@",
"PublicEvolving",
"public",
"<",
"R",
">",
"SingleOutputStreamOperator",
"<",
"R",
">",
"reduce",
"(",
"ReduceFunction",
"<",
"T",
">",
"reduceFunction",
",",
"ProcessAllWindowFunction",
"<",
"T",
",",
"R",
",",
"W",
">",
"function",
")",
"{",
"TypeInfo... | Applies the given window function to each window. The window function is called for each
evaluation of the window for each key individually. The output of the window function is
interpreted as a regular non-windowed stream.
<p>Arriving data is incrementally aggregated using the given reducer.
@param reduceFunction Th... | [
"Applies",
"the",
"given",
"window",
"function",
"to",
"each",
"window",
".",
"The",
"window",
"function",
"is",
"called",
"for",
"each",
"evaluation",
"of",
"the",
"window",
"for",
"each",
"key",
"individually",
".",
"The",
"output",
"of",
"the",
"window",
... | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-streaming-java/src/main/java/org/apache/flink/streaming/api/datastream/AllWindowedStream.java#L332-L340 | train | Reduces the input stream by applying a reduce function to the result of the process all window function. | [
30522,
1030,
2270,
6777,
4747,
30524,
1054,
1028,
2765,
13874,
1027,
2131,
21572,
9623,
12002,
2140,
11101,
5004,
11263,
27989,
13465,
14287,
13874,
1006,
3853,
1010,
7953,
1012,
2131,
13874,
1006,
1007,
1007,
1025,
2709,
5547,
1006,
5547,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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.doCommitInternalOffsetsToKafka | @Override
protected void doCommitInternalOffsetsToKafka(
Map<KafkaTopicPartition, Long> offsets,
@Nonnull KafkaCommitCallback commitCallback) throws Exception {
ZookeeperOffsetHandler zkHandler = this.zookeeperOffsetHandler;
if (zkHandler != null) {
try {
// the ZK handler takes care of incrementing ... | java | @Override
protected void doCommitInternalOffsetsToKafka(
Map<KafkaTopicPartition, Long> offsets,
@Nonnull KafkaCommitCallback commitCallback) throws Exception {
ZookeeperOffsetHandler zkHandler = this.zookeeperOffsetHandler;
if (zkHandler != null) {
try {
// the ZK handler takes care of incrementing ... | [
"@",
"Override",
"protected",
"void",
"doCommitInternalOffsetsToKafka",
"(",
"Map",
"<",
"KafkaTopicPartition",
",",
"Long",
">",
"offsets",
",",
"@",
"Nonnull",
"KafkaCommitCallback",
"commitCallback",
")",
"throws",
"Exception",
"{",
"ZookeeperOffsetHandler",
"zkHandl... | ------------------------------------------------------------------------ | [
"------------------------------------------------------------------------"
] | 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#L349-L378 | train | Commit offsets to Kafka. | [
30522,
1030,
2058,
15637,
5123,
11675,
9986,
5358,
22930,
18447,
11795,
23067,
21807,
8454,
18715,
10354,
2912,
1006,
4949,
1026,
10556,
24316,
10610,
24330,
19362,
3775,
3508,
1010,
2146,
1028,
16396,
2015,
1010,
1030,
2512,
11231,
3363,
105... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
apache/flink | flink-core/src/main/java/org/apache/flink/configuration/Configuration.java | Configuration.addAllToProperties | public void addAllToProperties(Properties props) {
synchronized (this.confData) {
for (Map.Entry<String, Object> entry : this.confData.entrySet()) {
props.put(entry.getKey(), entry.getValue());
}
}
} | java | public void addAllToProperties(Properties props) {
synchronized (this.confData) {
for (Map.Entry<String, Object> entry : this.confData.entrySet()) {
props.put(entry.getKey(), entry.getValue());
}
}
} | [
"public",
"void",
"addAllToProperties",
"(",
"Properties",
"props",
")",
"{",
"synchronized",
"(",
"this",
".",
"confData",
")",
"{",
"for",
"(",
"Map",
".",
"Entry",
"<",
"String",
",",
"Object",
">",
"entry",
":",
"this",
".",
"confData",
".",
"entrySe... | Adds all entries in this {@code Configuration} to the given {@link Properties}. | [
"Adds",
"all",
"entries",
"in",
"this",
"{"
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-core/src/main/java/org/apache/flink/configuration/Configuration.java#L658-L664 | train | Add all the properties of this configuration to the given properties. | [
30522,
2270,
11675,
5587,
8095,
14399,
18981,
8743,
3111,
1006,
5144,
24387,
1007,
1063,
25549,
1006,
2023,
1012,
9530,
2546,
2850,
2696,
1007,
1063,
2005,
1006,
4949,
1012,
4443,
1026,
5164,
1010,
4874,
1028,
4443,
1024,
2023,
1012,
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... |
netty/netty | common/src/main/java/io/netty/util/internal/ThreadLocalRandom.java | ThreadLocalRandom.nextDouble | public double nextDouble(double least, double bound) {
if (least >= bound) {
throw new IllegalArgumentException();
}
return nextDouble() * (bound - least) + least;
} | java | public double nextDouble(double least, double bound) {
if (least >= bound) {
throw new IllegalArgumentException();
}
return nextDouble() * (bound - least) + least;
} | [
"public",
"double",
"nextDouble",
"(",
"double",
"least",
",",
"double",
"bound",
")",
"{",
"if",
"(",
"least",
">=",
"bound",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
")",
";",
"}",
"return",
"nextDouble",
"(",
")",
"*",
"(",
"bound",
... | Returns a pseudorandom, uniformly distributed value between the
given least value (inclusive) and bound (exclusive).
@param least the least value returned
@param bound the upper bound (exclusive)
@return the next value
@throws IllegalArgumentException if least greater than or equal
to bound | [
"Returns",
"a",
"pseudorandom",
"uniformly",
"distributed",
"value",
"between",
"the",
"given",
"least",
"value",
"(",
"inclusive",
")",
"and",
"bound",
"(",
"exclusive",
")",
"."
] | ba06eafa1c1824bd154f1a380019e7ea2edf3c4c | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/common/src/main/java/io/netty/util/internal/ThreadLocalRandom.java#L378-L383 | train | Returns the next double value in the range [ least bound ). | [
30522,
2270,
3313,
2279,
26797,
3468,
1006,
3313,
2560,
1010,
3313,
5391,
1007,
1063,
2065,
1006,
2560,
1028,
1027,
5391,
1007,
1063,
5466,
2047,
6206,
2906,
22850,
15781,
2595,
24422,
1006,
1007,
1025,
1065,
2709,
2279,
26797,
3468,
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-db/src/main/java/cn/hutool/db/AbstractDb.java | AbstractDb.page | public <T> T page(Collection<String> fields, Entity where, int page, int numPerPage, RsHandler<T> rsh) throws SQLException {
Connection conn = null;
try {
conn = this.getConnection();
return runner.page(conn, fields, where, page, numPerPage, rsh);
} catch (SQLException e) {
throw e;
} finally {
... | java | public <T> T page(Collection<String> fields, Entity where, int page, int numPerPage, RsHandler<T> rsh) throws SQLException {
Connection conn = null;
try {
conn = this.getConnection();
return runner.page(conn, fields, where, page, numPerPage, rsh);
} catch (SQLException e) {
throw e;
} finally {
... | [
"public",
"<",
"T",
">",
"T",
"page",
"(",
"Collection",
"<",
"String",
">",
"fields",
",",
"Entity",
"where",
",",
"int",
"page",
",",
"int",
"numPerPage",
",",
"RsHandler",
"<",
"T",
">",
"rsh",
")",
"throws",
"SQLException",
"{",
"Connection",
"conn... | 分页查询<br>
查询条件为多个key value对表示,默认key = value,如果使用其它条件可以使用:where.put("key", " > 1"),value也可以传Condition对象,key被忽略
@param <T> 结果对象类型
@param fields 返回的字段列表,null则返回所有字段
@param where 条件实体类(包含表名)
@param page 页码
@param numPerPage 每页条目数
@param rsh 结果集处理对象
@return 结果对象
@throws SQLException SQL执行异常 | [
"分页查询<br",
">",
"查询条件为多个key",
"value对表示,默认key",
"=",
"value,如果使用其它条件可以使用:where",
".",
"put",
"(",
"key",
">",
";",
"1",
")",
",value也可以传Condition对象,key被忽略"
] | bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-db/src/main/java/cn/hutool/db/AbstractDb.java#L619-L629 | train | Retrieves a page of records from the database. | [
30522,
2270,
1026,
1056,
1028,
1056,
3931,
1006,
3074,
1026,
5164,
1028,
4249,
1010,
9178,
2073,
1010,
20014,
3931,
1010,
20014,
16371,
8737,
2121,
13704,
1010,
12667,
11774,
3917,
1026,
1056,
1028,
12667,
2232,
1007,
11618,
29296,
10288,
2... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
apache/incubator-shardingsphere | sharding-spring/sharding-jdbc-orchestration-spring/sharding-jdbc-orchestration-spring-boot-starter/src/main/java/org/apache/shardingsphere/shardingjdbc/orchestration/spring/boot/OrchestrationSpringBootConfiguration.java | OrchestrationSpringBootConfiguration.dataSource | @Bean
public DataSource dataSource() throws SQLException {
Preconditions.checkState(isValidConfiguration(), "The orchestration configuration is invalid, please choose one from Sharding rule and Master-slave rule.");
return isShardingRule() ? createShardingDataSource() : createMasterSlaveDataSource()... | java | @Bean
public DataSource dataSource() throws SQLException {
Preconditions.checkState(isValidConfiguration(), "The orchestration configuration is invalid, please choose one from Sharding rule and Master-slave rule.");
return isShardingRule() ? createShardingDataSource() : createMasterSlaveDataSource()... | [
"@",
"Bean",
"public",
"DataSource",
"dataSource",
"(",
")",
"throws",
"SQLException",
"{",
"Preconditions",
".",
"checkState",
"(",
"isValidConfiguration",
"(",
")",
",",
"\"The orchestration configuration is invalid, please choose one from Sharding rule and Master-slave rule.\"... | Get data source bean.
@return data source bean
@throws SQLException SQL Exception | [
"Get",
"data",
"source",
"bean",
"."
] | f88fd29fc345dfb31fdce12e9e96cbfa0fd2402d | https://github.com/apache/incubator-shardingsphere/blob/f88fd29fc345dfb31fdce12e9e96cbfa0fd2402d/sharding-spring/sharding-jdbc-orchestration-spring/sharding-jdbc-orchestration-spring-boot-starter/src/main/java/org/apache/shardingsphere/shardingjdbc/orchestration/spring/boot/OrchestrationSpringBootConfiguration.java#L93... | train | The DataSource implementation. | [
30522,
1030,
14068,
2270,
2951,
6499,
3126,
3401,
2951,
6499,
3126,
3401,
1006,
1007,
11618,
29296,
10288,
24422,
1063,
3653,
8663,
20562,
2015,
1012,
14148,
12259,
1006,
2003,
10175,
3593,
8663,
8873,
27390,
3370,
1006,
1007,
1010,
1000,
1... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
looly/hutool | hutool-core/src/main/java/cn/hutool/core/util/PageUtil.java | PageUtil.totalPage | public static int totalPage(int totalCount, int pageSize) {
if (pageSize == 0) {
return 0;
}
return totalCount % pageSize == 0 ? (totalCount / pageSize) : (totalCount / pageSize + 1);
} | java | public static int totalPage(int totalCount, int pageSize) {
if (pageSize == 0) {
return 0;
}
return totalCount % pageSize == 0 ? (totalCount / pageSize) : (totalCount / pageSize + 1);
} | [
"public",
"static",
"int",
"totalPage",
"(",
"int",
"totalCount",
",",
"int",
"pageSize",
")",
"{",
"if",
"(",
"pageSize",
"==",
"0",
")",
"{",
"return",
"0",
";",
"}",
"return",
"totalCount",
"%",
"pageSize",
"==",
"0",
"?",
"(",
"totalCount",
"/",
... | 根据总数计算总页数
@param totalCount 总数
@param pageSize 每页数
@return 总页数 | [
"根据总数计算总页数"
] | bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/util/PageUtil.java#L70-L75 | train | Returns the total page of the records in a page. | [
30522,
2270,
10763,
20014,
2561,
13704,
1006,
20014,
2561,
3597,
16671,
1010,
20014,
5530,
4697,
1007,
1063,
2065,
1006,
5530,
4697,
1027,
1027,
1014,
1007,
1063,
2709,
1014,
1025,
1065,
2709,
2561,
3597,
16671,
1003,
5530,
4697,
1027,
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 | example/src/main/java/io/netty/example/memcache/binary/MemcacheClientHandler.java | MemcacheClientHandler.write | @Override
public void write(ChannelHandlerContext ctx, Object msg, ChannelPromise promise) {
String command = (String) msg;
if (command.startsWith("get ")) {
String keyString = command.substring("get ".length());
ByteBuf key = Unpooled.wrappedBuffer(keyString.getBytes(Charset... | java | @Override
public void write(ChannelHandlerContext ctx, Object msg, ChannelPromise promise) {
String command = (String) msg;
if (command.startsWith("get ")) {
String keyString = command.substring("get ".length());
ByteBuf key = Unpooled.wrappedBuffer(keyString.getBytes(Charset... | [
"@",
"Override",
"public",
"void",
"write",
"(",
"ChannelHandlerContext",
"ctx",
",",
"Object",
"msg",
",",
"ChannelPromise",
"promise",
")",
"{",
"String",
"command",
"=",
"(",
"String",
")",
"msg",
";",
"if",
"(",
"command",
".",
"startsWith",
"(",
"\"ge... | Transforms basic string requests to binary memcache requests | [
"Transforms",
"basic",
"string",
"requests",
"to",
"binary",
"memcache",
"requests"
] | ba06eafa1c1824bd154f1a380019e7ea2edf3c4c | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/example/src/main/java/io/netty/example/memcache/binary/MemcacheClientHandler.java#L35-L66 | train | Implementation of the write method. | [
30522,
1030,
2058,
15637,
2270,
11675,
4339,
1006,
3149,
11774,
3917,
8663,
18209,
14931,
2595,
1010,
4874,
5796,
2290,
1010,
3149,
21572,
28732,
4872,
1007,
1063,
5164,
3094,
1027,
1006,
5164,
1007,
5796,
2290,
1025,
2065,
1006,
3094,
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... |
looly/hutool | hutool-core/src/main/java/cn/hutool/core/io/FileUtil.java | FileUtil.readUtf8Lines | public static List<String> readUtf8Lines(URL url) throws IORuntimeException {
return readLines(url, CharsetUtil.CHARSET_UTF_8);
} | java | public static List<String> readUtf8Lines(URL url) throws IORuntimeException {
return readLines(url, CharsetUtil.CHARSET_UTF_8);
} | [
"public",
"static",
"List",
"<",
"String",
">",
"readUtf8Lines",
"(",
"URL",
"url",
")",
"throws",
"IORuntimeException",
"{",
"return",
"readLines",
"(",
"url",
",",
"CharsetUtil",
".",
"CHARSET_UTF_8",
")",
";",
"}"
] | 从文件中读取每一行数据
@param url 文件的URL
@return 文件中的每行内容的集合List
@throws IORuntimeException IO异常 | [
"从文件中读取每一行数据"
] | bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/io/FileUtil.java#L2295-L2297 | train | Reads the contents of the given URL as UTF - 8 lines. | [
30522,
2270,
10763,
2862,
1026,
5164,
1028,
3191,
4904,
2546,
2620,
12735,
1006,
24471,
2140,
24471,
2140,
1007,
11618,
22834,
15532,
7292,
10288,
24422,
1063,
2709,
3191,
12735,
1006,
24471,
2140,
1010,
25869,
13462,
21823,
2140,
1012,
25869... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/ExcelUtil.java | ExcelUtil.readBySax | public static void readBySax(String path, int sheetIndex, RowHandler rowHandler) {
BufferedInputStream in = null;
try {
in = FileUtil.getInputStream(path);
readBySax(in, sheetIndex, rowHandler);
} finally {
IoUtil.close(in);
}
} | java | public static void readBySax(String path, int sheetIndex, RowHandler rowHandler) {
BufferedInputStream in = null;
try {
in = FileUtil.getInputStream(path);
readBySax(in, sheetIndex, rowHandler);
} finally {
IoUtil.close(in);
}
} | [
"public",
"static",
"void",
"readBySax",
"(",
"String",
"path",
",",
"int",
"sheetIndex",
",",
"RowHandler",
"rowHandler",
")",
"{",
"BufferedInputStream",
"in",
"=",
"null",
";",
"try",
"{",
"in",
"=",
"FileUtil",
".",
"getInputStream",
"(",
"path",
")",
... | 通过Sax方式读取Excel,同时支持03和07格式
@param path Excel文件路径
@param sheetIndex sheet序号
@param rowHandler 行处理器
@since 3.2.0 | [
"通过Sax方式读取Excel,同时支持03和07格式"
] | bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-poi/src/main/java/cn/hutool/poi/excel/ExcelUtil.java#L35-L43 | train | Reads a sequence of bytes from a file using the specified sheet index and row handler. | [
30522,
2270,
10763,
11675,
3191,
3762,
3736,
2595,
1006,
5164,
4130,
1010,
20014,
7123,
22254,
10288,
1010,
5216,
11774,
3917,
5216,
11774,
3917,
1007,
1063,
17698,
2098,
2378,
18780,
21422,
1999,
1027,
19701,
1025,
3046,
1063,
1999,
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... |
apache/incubator-shardingsphere | sharding-transaction/sharding-transaction-2pc/sharding-transaction-xa/sharding-transaction-xa-core/src/main/java/org/apache/shardingsphere/transaction/xa/jta/datasource/XADataSourceFactory.java | XADataSourceFactory.build | @SneakyThrows
public static XADataSource build(final DatabaseType databaseType, final DataSource dataSource) {
XADataSource result = createXADataSource(databaseType);
Properties xaProperties = XAPropertiesFactory.createXAProperties(databaseType).build(SWAPPER.swap(dataSource));
PropertyUtils... | java | @SneakyThrows
public static XADataSource build(final DatabaseType databaseType, final DataSource dataSource) {
XADataSource result = createXADataSource(databaseType);
Properties xaProperties = XAPropertiesFactory.createXAProperties(databaseType).build(SWAPPER.swap(dataSource));
PropertyUtils... | [
"@",
"SneakyThrows",
"public",
"static",
"XADataSource",
"build",
"(",
"final",
"DatabaseType",
"databaseType",
",",
"final",
"DataSource",
"dataSource",
")",
"{",
"XADataSource",
"result",
"=",
"createXADataSource",
"(",
"databaseType",
")",
";",
"Properties",
"xaP... | Create XA data source through general data source.
@param databaseType database type
@param dataSource data source
@return XA data source | [
"Create",
"XA",
"data",
"source",
"through",
"general",
"data",
"source",
"."
] | f88fd29fc345dfb31fdce12e9e96cbfa0fd2402d | https://github.com/apache/incubator-shardingsphere/blob/f88fd29fc345dfb31fdce12e9e96cbfa0fd2402d/sharding-transaction/sharding-transaction-2pc/sharding-transaction-xa/sharding-transaction-xa-core/src/main/java/org/apache/shardingsphere/transaction/xa/jta/datasource/XADataSourceFactory.java#L75-L81 | train | Build an XA DataSource. | [
30522,
1030,
13583,
22123,
8093,
15568,
2270,
10763,
1060,
8447,
10230,
8162,
3401,
3857,
1006,
2345,
7809,
13874,
7809,
13874,
1010,
2345,
2951,
6499,
3126,
3401,
2951,
6499,
3126,
3401,
1007,
1063,
1060,
8447,
10230,
8162,
3401,
2765,
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-java/src/main/java/org/apache/flink/api/java/summarize/aggregation/ShortSummaryAggregator.java | ShortSummaryAggregator.max | public static Short max(Short a, Short b) {
return a >= b ? a : b;
} | java | public static Short max(Short a, Short b) {
return a >= b ? a : b;
} | [
"public",
"static",
"Short",
"max",
"(",
"Short",
"a",
",",
"Short",
"b",
")",
"{",
"return",
"a",
">=",
"b",
"?",
"a",
":",
"b",
";",
"}"
] | Like Math.max() except for shorts. | [
"Like",
"Math",
".",
"max",
"()",
"except",
"for",
"shorts",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-java/src/main/java/org/apache/flink/api/java/summarize/aggregation/ShortSummaryAggregator.java#L41-L43 | train | Get the max value of two shorts. | [
30522,
2270,
10763,
2460,
4098,
1006,
2460,
1037,
1010,
2460,
1038,
1007,
1063,
2709,
1037,
1028,
1027,
1038,
1029,
1037,
1024,
1038,
1025,
1065,
102,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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.decrypt | @Override
public byte[] decrypt(byte[] bytes, KeyType keyType) {
final Key key = getKeyByType(keyType);
// 模长
final int inputLen = bytes.length;
final int maxBlockSize = this.decryptBlockSize < 0 ? inputLen : this.decryptBlockSize;
lock.lock();
try (ByteArrayOutputStream out = new ByteArrayOutputS... | java | @Override
public byte[] decrypt(byte[] bytes, KeyType keyType) {
final Key key = getKeyByType(keyType);
// 模长
final int inputLen = bytes.length;
final int maxBlockSize = this.decryptBlockSize < 0 ? inputLen : this.decryptBlockSize;
lock.lock();
try (ByteArrayOutputStream out = new ByteArrayOutputS... | [
"@",
"Override",
"public",
"byte",
"[",
"]",
"decrypt",
"(",
"byte",
"[",
"]",
"bytes",
",",
"KeyType",
"keyType",
")",
"{",
"final",
"Key",
"key",
"=",
"getKeyByType",
"(",
"keyType",
")",
";",
"// 模长\r",
"final",
"int",
"inputLen",
"=",
"bytes",
".",... | 解密
@param bytes 被解密的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#L228-L256 | train | Decrypt a byte array using the specified key type. | [
30522,
1030,
2058,
15637,
2270,
24880,
1031,
1033,
11703,
2854,
13876,
1006,
24880,
1031,
1033,
27507,
1010,
3145,
13874,
3145,
13874,
1007,
1063,
2345,
3145,
3145,
1027,
2131,
14839,
3762,
13874,
1006,
3145,
13874,
1007,
1025,
1013,
1013,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
looly/hutool | hutool-db/src/main/java/cn/hutool/db/DbUtil.java | DbUtil.setShowSqlGlobal | public static void setShowSqlGlobal(boolean isShowSql, boolean isFormatSql, boolean isShowParams, Level level) {
SqlLog.INSTASNCE.init(isShowSql, isFormatSql, isShowParams, level);
} | java | public static void setShowSqlGlobal(boolean isShowSql, boolean isFormatSql, boolean isShowParams, Level level) {
SqlLog.INSTASNCE.init(isShowSql, isFormatSql, isShowParams, level);
} | [
"public",
"static",
"void",
"setShowSqlGlobal",
"(",
"boolean",
"isShowSql",
",",
"boolean",
"isFormatSql",
",",
"boolean",
"isShowParams",
",",
"Level",
"level",
")",
"{",
"SqlLog",
".",
"INSTASNCE",
".",
"init",
"(",
"isShowSql",
",",
"isFormatSql",
",",
"is... | 设置全局配置:是否通过debug日志显示SQL
@param isShowSql 是否显示SQL
@param isFormatSql 是否格式化显示的SQL
@param isShowParams 是否打印参数
@param level SQL打印到的日志等级
@since 4.1.7 | [
"设置全局配置:是否通过debug日志显示SQL"
] | bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-db/src/main/java/cn/hutool/db/DbUtil.java#L259-L261 | train | Sets the showSql global flag. | [
30522,
2270,
10763,
11675,
4520,
14406,
2015,
4160,
2140,
23296,
16429,
2389,
1006,
22017,
20898,
26354,
14406,
2015,
4160,
2140,
1010,
22017,
20898,
2003,
14192,
11149,
4160,
2140,
1010,
22017,
20898,
26354,
14406,
28689,
5244,
1010,
2504,
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 | common/src/main/java/io/netty/util/NetUtil.java | NetUtil.intToIpAddress | public static String intToIpAddress(int i) {
StringBuilder buf = new StringBuilder(15);
buf.append(i >> 24 & 0xff);
buf.append('.');
buf.append(i >> 16 & 0xff);
buf.append('.');
buf.append(i >> 8 & 0xff);
buf.append('.');
buf.append(i & 0xff);
retu... | java | public static String intToIpAddress(int i) {
StringBuilder buf = new StringBuilder(15);
buf.append(i >> 24 & 0xff);
buf.append('.');
buf.append(i >> 16 & 0xff);
buf.append('.');
buf.append(i >> 8 & 0xff);
buf.append('.');
buf.append(i & 0xff);
retu... | [
"public",
"static",
"String",
"intToIpAddress",
"(",
"int",
"i",
")",
"{",
"StringBuilder",
"buf",
"=",
"new",
"StringBuilder",
"(",
"15",
")",
";",
"buf",
".",
"append",
"(",
"i",
">>",
"24",
"&",
"0xff",
")",
";",
"buf",
".",
"append",
"(",
"'",
... | Converts a 32-bit integer into an IPv4 address. | [
"Converts",
"a",
"32",
"-",
"bit",
"integer",
"into",
"an",
"IPv4",
"address",
"."
] | ba06eafa1c1824bd154f1a380019e7ea2edf3c4c | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/common/src/main/java/io/netty/util/NetUtil.java#L419-L429 | train | Convert an int to an ip address string. | [
30522,
2270,
10763,
5164,
20014,
3406,
11514,
4215,
16200,
4757,
1006,
20014,
1045,
1007,
1063,
5164,
8569,
23891,
2099,
20934,
2546,
1027,
2047,
5164,
8569,
23891,
2099,
1006,
2321,
1007,
1025,
20934,
2546,
1012,
10439,
10497,
1006,
1045,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
apache/flink | flink-table/flink-table-common/src/main/java/org/apache/flink/table/descriptors/DescriptorProperties.java | DescriptorProperties.putString | public void putString(String key, String str) {
checkNotNull(key);
checkNotNull(str);
put(key, str);
} | java | public void putString(String key, String str) {
checkNotNull(key);
checkNotNull(str);
put(key, str);
} | [
"public",
"void",
"putString",
"(",
"String",
"key",
",",
"String",
"str",
")",
"{",
"checkNotNull",
"(",
"key",
")",
";",
"checkNotNull",
"(",
"str",
")",
";",
"put",
"(",
"key",
",",
"str",
")",
";",
"}"
] | Adds a string under the given key. | [
"Adds",
"a",
"string",
"under",
"the",
"given",
"key",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-table/flink-table-common/src/main/java/org/apache/flink/table/descriptors/DescriptorProperties.java#L122-L126 | train | Put a String value into the mapping. | [
30522,
2270,
11675,
8509,
18886,
3070,
1006,
5164,
3145,
1010,
5164,
2358,
2099,
1007,
1063,
4638,
17048,
11231,
3363,
1006,
3145,
1007,
1025,
4638,
17048,
11231,
3363,
1006,
2358,
2099,
1007,
1025,
2404,
1006,
3145,
1010,
2358,
2099,
1007,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
looly/hutool | hutool-db/src/main/java/cn/hutool/db/Entity.java | Entity.setFieldNames | public Entity setFieldNames(Collection<String> fieldNames) {
if (CollectionUtil.isNotEmpty(fieldNames)) {
this.fieldNames = new HashSet<String>(fieldNames);
}
return this;
} | java | public Entity setFieldNames(Collection<String> fieldNames) {
if (CollectionUtil.isNotEmpty(fieldNames)) {
this.fieldNames = new HashSet<String>(fieldNames);
}
return this;
} | [
"public",
"Entity",
"setFieldNames",
"(",
"Collection",
"<",
"String",
">",
"fieldNames",
")",
"{",
"if",
"(",
"CollectionUtil",
".",
"isNotEmpty",
"(",
"fieldNames",
")",
")",
"{",
"this",
".",
"fieldNames",
"=",
"new",
"HashSet",
"<",
"String",
">",
"(",... | 设置字段列表,用于限制加入的字段的值
@param fieldNames 字段列表
@return 自身 | [
"设置字段列表,用于限制加入的字段的值"
] | bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-db/src/main/java/cn/hutool/db/Entity.java#L145-L150 | train | Sets the field names of the entity. | [
30522,
2270,
9178,
2275,
3790,
18442,
2015,
1006,
3074,
1026,
5164,
1028,
2492,
18442,
2015,
1007,
1063,
2065,
1006,
3074,
21823,
2140,
1012,
3475,
12184,
27718,
2100,
1006,
2492,
18442,
2015,
1007,
1007,
1063,
2023,
1012,
2492,
18442,
2015... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
looly/hutool | hutool-core/src/main/java/cn/hutool/core/io/IoUtil.java | IoUtil.toMarkSupportStream | public static InputStream toMarkSupportStream(InputStream in) {
if (null == in) {
return null;
}
if (false == in.markSupported()) {
return new BufferedInputStream(in);
}
return in;
} | java | public static InputStream toMarkSupportStream(InputStream in) {
if (null == in) {
return null;
}
if (false == in.markSupported()) {
return new BufferedInputStream(in);
}
return in;
} | [
"public",
"static",
"InputStream",
"toMarkSupportStream",
"(",
"InputStream",
"in",
")",
"{",
"if",
"(",
"null",
"==",
"in",
")",
"{",
"return",
"null",
";",
"}",
"if",
"(",
"false",
"==",
"in",
".",
"markSupported",
"(",
")",
")",
"{",
"return",
"new"... | 将{@link InputStream}转换为支持mark标记的流<br>
若原流支持mark标记,则返回原流,否则使用{@link BufferedInputStream} 包装之
@param in 流
@return {@link InputStream}
@since 4.0.9 | [
"将",
"{",
"@link",
"InputStream",
"}",
"转换为支持mark标记的流<br",
">",
"若原流支持mark标记,则返回原流,否则使用",
"{",
"@link",
"BufferedInputStream",
"}",
"包装之"
] | bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/io/IoUtil.java#L826-L834 | train | Returns a stream that can be used to mark the input stream as if it is not markSupported. | [
30522,
2270,
10763,
20407,
25379,
3419,
17007,
6342,
9397,
11589,
21422,
1006,
20407,
25379,
1999,
1007,
1063,
2065,
1006,
19701,
1027,
1027,
1999,
1007,
1063,
2709,
19701,
1025,
1065,
2065,
1006,
6270,
1027,
1027,
1999,
1012,
6017,
6279,
6... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
looly/hutool | hutool-core/src/main/java/cn/hutool/core/collection/CollUtil.java | CollUtil.count | public static <T> int count(Iterable<T> iterable, Matcher<T> matcher) {
int count = 0;
if (null != iterable) {
for (T t : iterable) {
if (null == matcher || matcher.match(t)) {
count++;
}
}
}
return count;
} | java | public static <T> int count(Iterable<T> iterable, Matcher<T> matcher) {
int count = 0;
if (null != iterable) {
for (T t : iterable) {
if (null == matcher || matcher.match(t)) {
count++;
}
}
}
return count;
} | [
"public",
"static",
"<",
"T",
">",
"int",
"count",
"(",
"Iterable",
"<",
"T",
">",
"iterable",
",",
"Matcher",
"<",
"T",
">",
"matcher",
")",
"{",
"int",
"count",
"=",
"0",
";",
"if",
"(",
"null",
"!=",
"iterable",
")",
"{",
"for",
"(",
"T",
"t... | 集合中匹配规则的数量
@param <T> 集合元素类型
@param iterable {@link Iterable}
@param matcher 匹配器,为空则全部匹配
@return 匹配数量 | [
"集合中匹配规则的数量"
] | bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/collection/CollUtil.java#L1301-L1311 | train | Count the number of instances of the specified type in the iterable that match the specified matcher. | [
30522,
2270,
10763,
1026,
1056,
1028,
20014,
4175,
1006,
2009,
6906,
3468,
1026,
1056,
1028,
2009,
6906,
3468,
1010,
2674,
2121,
1026,
1056,
1028,
2674,
2121,
1007,
1063,
20014,
4175,
1027,
1014,
1025,
2065,
1006,
19701,
999,
1027,
2009,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
netty/netty | codec-http/src/main/java/io/netty/handler/codec/http/HttpHeaders.java | HttpHeaders.setIntHeader | @Deprecated
public static void setIntHeader(HttpMessage message, String name, int value) {
message.headers().setInt(name, value);
} | java | @Deprecated
public static void setIntHeader(HttpMessage message, String name, int value) {
message.headers().setInt(name, value);
} | [
"@",
"Deprecated",
"public",
"static",
"void",
"setIntHeader",
"(",
"HttpMessage",
"message",
",",
"String",
"name",
",",
"int",
"value",
")",
"{",
"message",
".",
"headers",
"(",
")",
".",
"setInt",
"(",
"name",
",",
"value",
")",
";",
"}"
] | @deprecated Use {@link #setInt(CharSequence, int)} instead.
@see #setIntHeader(HttpMessage, CharSequence, int) | [
"@deprecated",
"Use",
"{",
"@link",
"#setInt",
"(",
"CharSequence",
"int",
")",
"}",
"instead",
"."
] | ba06eafa1c1824bd154f1a380019e7ea2edf3c4c | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/codec-http/src/main/java/io/netty/handler/codec/http/HttpHeaders.java#L764-L767 | train | Sets a header with an int value. | [
30522,
1030,
2139,
28139,
12921,
2270,
10763,
11675,
2275,
18447,
4974,
2121,
1006,
8299,
7834,
3736,
3351,
4471,
1010,
5164,
2171,
1010,
20014,
3643,
1007,
1063,
4471,
1012,
20346,
2015,
1006,
1007,
1012,
2275,
18447,
1006,
2171,
1010,
364... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
apache/flink | flink-runtime/src/main/java/org/apache/flink/runtime/rest/handler/util/HandlerRequestUtils.java | HandlerRequestUtils.fromRequestBodyOrQueryParameter | public static <T> T fromRequestBodyOrQueryParameter(
T requestValue,
SupplierWithException<T, RestHandlerException> queryParameterExtractor,
T defaultValue,
Logger log) throws RestHandlerException {
if (requestValue != null) {
return requestValue;
} else {
T queryParameterValue = queryParameterExt... | java | public static <T> T fromRequestBodyOrQueryParameter(
T requestValue,
SupplierWithException<T, RestHandlerException> queryParameterExtractor,
T defaultValue,
Logger log) throws RestHandlerException {
if (requestValue != null) {
return requestValue;
} else {
T queryParameterValue = queryParameterExt... | [
"public",
"static",
"<",
"T",
">",
"T",
"fromRequestBodyOrQueryParameter",
"(",
"T",
"requestValue",
",",
"SupplierWithException",
"<",
"T",
",",
"RestHandlerException",
">",
"queryParameterExtractor",
",",
"T",
"defaultValue",
",",
"Logger",
"log",
")",
"throws",
... | Returns {@code requestValue} if it is not null, otherwise returns the query parameter value
if it is not null, otherwise returns the default value. | [
"Returns",
"{"
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/rest/handler/util/HandlerRequestUtils.java#L73-L90 | train | Creates a new instance of the class based on the given value from the request body or query parameter. | [
30522,
2270,
10763,
1026,
1056,
1028,
1056,
2013,
2890,
15500,
23684,
2953,
4226,
2854,
28689,
22828,
1006,
1056,
5227,
10175,
5657,
1010,
17024,
24415,
10288,
24422,
1026,
1056,
1010,
2717,
11774,
3917,
10288,
24422,
1028,
23032,
28689,
2282... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/ExcelUtil.java | ExcelUtil.getBigWriter | public static ExcelWriter getBigWriter() {
try {
return new BigExcelWriter();
} catch (NoClassDefFoundError e) {
throw new DependencyException(ObjectUtil.defaultIfNull(e.getCause(), e), PoiChecker.NO_POI_ERROR_MSG);
}
} | java | public static ExcelWriter getBigWriter() {
try {
return new BigExcelWriter();
} catch (NoClassDefFoundError e) {
throw new DependencyException(ObjectUtil.defaultIfNull(e.getCause(), e), PoiChecker.NO_POI_ERROR_MSG);
}
} | [
"public",
"static",
"ExcelWriter",
"getBigWriter",
"(",
")",
"{",
"try",
"{",
"return",
"new",
"BigExcelWriter",
"(",
")",
";",
"}",
"catch",
"(",
"NoClassDefFoundError",
"e",
")",
"{",
"throw",
"new",
"DependencyException",
"(",
"ObjectUtil",
".",
"defaultIfN... | 获得{@link BigExcelWriter},默认写出到第一个sheet<br>
不传入写出的Excel文件路径,只能调用{@link BigExcelWriter#flush(OutputStream)}方法写出到流<br>
若写出到文件,还需调用{@link BigExcelWriter#setDestFile(File)}方法自定义写出的文件,然后调用{@link BigExcelWriter#flush()}方法写出到文件
@return {@link BigExcelWriter}
@since 4.1.13 | [
"获得",
"{",
"@link",
"BigExcelWriter",
"}",
",默认写出到第一个sheet<br",
">",
"不传入写出的Excel文件路径,只能调用",
"{",
"@link",
"BigExcelWriter#flush",
"(",
"OutputStream",
")",
"}",
"方法写出到流<br",
">",
"若写出到文件,还需调用",
"{",
"@link",
"BigExcelWriter#setDestFile",
"(",
"File",
")",
"}",
"方法自... | bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-poi/src/main/java/cn/hutool/poi/excel/ExcelUtil.java#L447-L453 | train | Returns a BigExcelWriter. | [
30522,
2270,
10763,
24970,
15994,
2131,
5638,
2290,
15994,
1006,
1007,
1063,
3046,
1063,
2709,
2047,
2502,
10288,
29109,
15994,
1006,
1007,
1025,
1065,
4608,
1006,
2053,
26266,
3207,
4246,
28819,
2121,
29165,
1041,
1007,
1063,
5466,
2047,
2... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
apache/flink | flink-scala-shell/src/main/java/org/apache/flink/api/java/JarHelper.java | JarHelper.unjarDir | public void unjarDir(File jarFile, File destDir) throws IOException {
BufferedOutputStream dest = null;
FileInputStream fis = new FileInputStream(jarFile);
unjar(fis, destDir);
} | java | public void unjarDir(File jarFile, File destDir) throws IOException {
BufferedOutputStream dest = null;
FileInputStream fis = new FileInputStream(jarFile);
unjar(fis, destDir);
} | [
"public",
"void",
"unjarDir",
"(",
"File",
"jarFile",
",",
"File",
"destDir",
")",
"throws",
"IOException",
"{",
"BufferedOutputStream",
"dest",
"=",
"null",
";",
"FileInputStream",
"fis",
"=",
"new",
"FileInputStream",
"(",
"jarFile",
")",
";",
"unjar",
"(",
... | Unjars a given jar file into a given directory. | [
"Unjars",
"a",
"given",
"jar",
"file",
"into",
"a",
"given",
"directory",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-scala-shell/src/main/java/org/apache/flink/api/java/JarHelper.java#L95-L99 | train | Unjar a directory. | [
30522,
2270,
11675,
4895,
16084,
4305,
2099,
1006,
5371,
15723,
30524,
2099,
1007,
1025,
1065,
102,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
SeleniumHQ/selenium | java/client/src/org/openqa/selenium/remote/service/DriverService.java | DriverService.stop | public void stop() {
lock.lock();
WebDriverException toThrow = null;
try {
if (process == null) {
return;
}
if (hasShutdownEndpoint()) {
try {
URL killUrl = new URL(url.toString() + "/shutdown");
new UrlChecker().waitUntilUnavailable(3, SECONDS, killUr... | java | public void stop() {
lock.lock();
WebDriverException toThrow = null;
try {
if (process == null) {
return;
}
if (hasShutdownEndpoint()) {
try {
URL killUrl = new URL(url.toString() + "/shutdown");
new UrlChecker().waitUntilUnavailable(3, SECONDS, killUr... | [
"public",
"void",
"stop",
"(",
")",
"{",
"lock",
".",
"lock",
"(",
")",
";",
"WebDriverException",
"toThrow",
"=",
"null",
";",
"try",
"{",
"if",
"(",
"process",
"==",
"null",
")",
"{",
"return",
";",
"}",
"if",
"(",
"hasShutdownEndpoint",
"(",
")",
... | Stops this service if it is currently running. This method will attempt to block until the
server has been fully shutdown.
@see #start() | [
"Stops",
"this",
"service",
"if",
"it",
"is",
"currently",
"running",
".",
"This",
"method",
"will",
"attempt",
"to",
"block",
"until",
"the",
"server",
"has",
"been",
"fully",
"shutdown",
"."
] | 7af172729f17b20269c8ca4ea6f788db48616535 | https://github.com/SeleniumHQ/selenium/blob/7af172729f17b20269c8ca4ea6f788db48616535/java/client/src/org/openqa/selenium/remote/service/DriverService.java#L213-L249 | train | Stop the current process. | [
30522,
2270,
11675,
2644,
1006,
1007,
1063,
5843,
1012,
5843,
1006,
1007,
1025,
4773,
23663,
2890,
2595,
24422,
2000,
2705,
10524,
1027,
19701,
1025,
3046,
1063,
2065,
1006,
2832,
1027,
1027,
19701,
1007,
1063,
2709,
1025,
1065,
2065,
1006,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
apache/flink | flink-runtime/src/main/java/org/apache/flink/runtime/executiongraph/IntermediateResult.java | IntermediateResult.getPartitionById | public IntermediateResultPartition getPartitionById(IntermediateResultPartitionID resultPartitionId) {
// Looks ups the partition number via the helper map and returns the
// partition. Currently, this happens infrequently enough that we could
// consider removing the map and scanning the partitions on every look... | java | public IntermediateResultPartition getPartitionById(IntermediateResultPartitionID resultPartitionId) {
// Looks ups the partition number via the helper map and returns the
// partition. Currently, this happens infrequently enough that we could
// consider removing the map and scanning the partitions on every look... | [
"public",
"IntermediateResultPartition",
"getPartitionById",
"(",
"IntermediateResultPartitionID",
"resultPartitionId",
")",
"{",
"// Looks ups the partition number via the helper map and returns the",
"// partition. Currently, this happens infrequently enough that we could",
"// consider removi... | Returns the partition with the given ID.
@param resultPartitionId ID of the partition to look up
@throws NullPointerException If partition ID <code>null</code>
@throws IllegalArgumentException Thrown if unknown partition ID
@return Intermediate result partition with the given ID | [
"Returns",
"the",
"partition",
"with",
"the",
"given",
"ID",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/executiongraph/IntermediateResult.java#L120-L132 | train | Gets the partition by ID. | [
30522,
2270,
7783,
6072,
11314,
19362,
3775,
3508,
2131,
19362,
3775,
3508,
3762,
3593,
1006,
7783,
6072,
11314,
19362,
3775,
3508,
3593,
2765,
19362,
30524,
2438,
2008,
2057,
2071,
1013,
1013,
5136,
9268,
1996,
4949,
1998,
13722,
1996,
135... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
apache/flink | flink-table/flink-table-planner/src/main/java/org/apache/calcite/sql/validate/SqlValidatorImpl.java | SqlValidatorImpl.performUnconditionalRewrites | protected SqlNode performUnconditionalRewrites(
SqlNode node,
boolean underFrom) {
if (node == null) {
return node;
}
SqlNode newOperand;
// first transform operands and invoke generic call rewrite
if (node instanceof SqlCall) {
if (node instanceof SqlMerge) {
validatingSqlMerge = true;
}
... | java | protected SqlNode performUnconditionalRewrites(
SqlNode node,
boolean underFrom) {
if (node == null) {
return node;
}
SqlNode newOperand;
// first transform operands and invoke generic call rewrite
if (node instanceof SqlCall) {
if (node instanceof SqlMerge) {
validatingSqlMerge = true;
}
... | [
"protected",
"SqlNode",
"performUnconditionalRewrites",
"(",
"SqlNode",
"node",
",",
"boolean",
"underFrom",
")",
"{",
"if",
"(",
"node",
"==",
"null",
")",
"{",
"return",
"node",
";",
"}",
"SqlNode",
"newOperand",
";",
"// first transform operands and invoke generi... | Performs expression rewrites which are always used unconditionally. These
rewrites massage the expression tree into a standard form so that the
rest of the validation logic can be simpler.
@param node expression to be rewritten
@param underFrom whether node appears directly under a FROM clause
@return rewritten e... | [
"Performs",
"expression",
"rewrites",
"which",
"are",
"always",
"used",
"unconditionally",
".",
"These",
"rewrites",
"massage",
"the",
"expression",
"tree",
"into",
"a",
"standard",
"form",
"so",
"that",
"the",
"rest",
"of",
"the",
"validation",
"logic",
"can",
... | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-table/flink-table-planner/src/main/java/org/apache/calcite/sql/validate/SqlValidatorImpl.java#L1122-L1308 | train | This method performs the actual unconditional rewrite of a given node. | [
30522,
5123,
29296,
3630,
3207,
4685,
4609,
8663,
27064,
15603,
28884,
1006,
29296,
3630,
3207,
13045,
1010,
22017,
20898,
2104,
19699,
5358,
1007,
1063,
2065,
1006,
13045,
1027,
1027,
19701,
1007,
1063,
2709,
13045,
1025,
1065,
29296,
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... |
alibaba/canal | client/src/main/java/com/alibaba/otter/canal/client/rocketmq/ConsumerBatchMessage.java | ConsumerBatchMessage.fail | public void fail() {
hasFailure = true;
// fail fast
long count = latch.getCount();
for (int i = 0; i < count; i++) {
latch.countDown();
}
} | java | public void fail() {
hasFailure = true;
// fail fast
long count = latch.getCount();
for (int i = 0; i < count; i++) {
latch.countDown();
}
} | [
"public",
"void",
"fail",
"(",
")",
"{",
"hasFailure",
"=",
"true",
";",
"// fail fast",
"long",
"count",
"=",
"latch",
".",
"getCount",
"(",
")",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"count",
";",
"i",
"++",
")",
"{",
"latch",
... | Countdown and fail-fast if the sub message is failed. | [
"Countdown",
"and",
"fail",
"-",
"fast",
"if",
"the",
"sub",
"message",
"is",
"failed",
"."
] | 8f088cddc0755f4350c5aaae95c6e4002d90a40f | https://github.com/alibaba/canal/blob/8f088cddc0755f4350c5aaae95c6e4002d90a40f/client/src/main/java/com/alibaba/otter/canal/client/rocketmq/ConsumerBatchMessage.java#L40-L47 | train | fail the exception | [
30522,
2270,
11675,
8246,
1006,
1007,
1063,
2038,
7011,
4014,
5397,
1027,
2995,
1025,
1013,
1013,
8246,
3435,
2146,
4175,
1027,
25635,
1012,
2131,
3597,
16671,
1006,
1007,
1025,
2005,
1006,
20014,
1045,
1027,
1014,
1025,
1045,
1026,
4175,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
netty/netty | common/src/main/java/io/netty/util/AsciiString.java | AsciiString.replace | public AsciiString replace(char oldChar, char newChar) {
if (oldChar > MAX_CHAR_VALUE) {
return this;
}
final byte oldCharAsByte = c2b0(oldChar);
final byte newCharAsByte = c2b(newChar);
final int len = offset + length;
for (int i = offset; i < len; ++i) {
... | java | public AsciiString replace(char oldChar, char newChar) {
if (oldChar > MAX_CHAR_VALUE) {
return this;
}
final byte oldCharAsByte = c2b0(oldChar);
final byte newCharAsByte = c2b(newChar);
final int len = offset + length;
for (int i = offset; i < len; ++i) {
... | [
"public",
"AsciiString",
"replace",
"(",
"char",
"oldChar",
",",
"char",
"newChar",
")",
"{",
"if",
"(",
"oldChar",
">",
"MAX_CHAR_VALUE",
")",
"{",
"return",
"this",
";",
"}",
"final",
"byte",
"oldCharAsByte",
"=",
"c2b0",
"(",
"oldChar",
")",
";",
"fin... | Copies this string replacing occurrences of the specified character with another character.
@param oldChar the character to replace.
@param newChar the replacement character.
@return a new string with occurrences of oldChar replaced by newChar. | [
"Copies",
"this",
"string",
"replacing",
"occurrences",
"of",
"the",
"specified",
"character",
"with",
"another",
"character",
"."
] | ba06eafa1c1824bd154f1a380019e7ea2edf3c4c | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/common/src/main/java/io/netty/util/AsciiString.java#L874-L896 | train | Replaces the first character with the second character. | [
30522,
2270,
2004,
6895,
2923,
4892,
5672,
1006,
25869,
2214,
7507,
2099,
1010,
25869,
2047,
7507,
2099,
1007,
1063,
2065,
1006,
2214,
7507,
2099,
1028,
4098,
1035,
25869,
1035,
3643,
1007,
1063,
2709,
2023,
1025,
1065,
2345,
24880,
2214,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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.setSocketAddr | public void setSocketAddr(String name, InetSocketAddress addr) {
set(name, NetUtils.getHostPortString(addr));
} | java | public void setSocketAddr(String name, InetSocketAddress addr) {
set(name, NetUtils.getHostPortString(addr));
} | [
"public",
"void",
"setSocketAddr",
"(",
"String",
"name",
",",
"InetSocketAddress",
"addr",
")",
"{",
"set",
"(",
"name",
",",
"NetUtils",
".",
"getHostPortString",
"(",
"addr",
")",
")",
";",
"}"
] | Set the socket address for the <code>name</code> property as
a <code>host:port</code>. | [
"Set",
"the",
"socket",
"address",
"for",
"the",
"<code",
">",
"name<",
"/",
"code",
">",
"property",
"as",
"a",
"<code",
">",
"host",
":",
"port<",
"/",
"code",
">",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-filesystems/flink-fs-hadoop-shaded/src/main/java/org/apache/hadoop/conf/Configuration.java#L2312-L2314 | train | Set socket address. | [
30522,
2270,
11675,
4520,
7432,
12928,
14141,
2099,
1006,
5164,
2171,
1010,
1999,
8454,
7432,
12928,
14141,
8303,
5587,
2099,
1007,
1063,
2275,
1006,
2171,
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... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
spring-projects/spring-boot | spring-boot-project/spring-boot-tools/spring-boot-loader/src/main/java/org/springframework/boot/loader/util/SystemPropertyUtils.java | SystemPropertyUtils.getProperty | public static String getProperty(String key, String defaultValue, String text) {
try {
String propVal = System.getProperty(key);
if (propVal == null) {
// Fall back to searching the system environment.
propVal = System.getenv(key);
}
if (propVal == null) {
// Try with underscores.
String n... | java | public static String getProperty(String key, String defaultValue, String text) {
try {
String propVal = System.getProperty(key);
if (propVal == null) {
// Fall back to searching the system environment.
propVal = System.getenv(key);
}
if (propVal == null) {
// Try with underscores.
String n... | [
"public",
"static",
"String",
"getProperty",
"(",
"String",
"key",
",",
"String",
"defaultValue",
",",
"String",
"text",
")",
"{",
"try",
"{",
"String",
"propVal",
"=",
"System",
".",
"getProperty",
"(",
"key",
")",
";",
"if",
"(",
"propVal",
"==",
"null... | Search the System properties and environment variables for a value with the
provided key. Environment variables in {@code UPPER_CASE} style are allowed where
System properties would normally be {@code lower.case}.
@param key the key to resolve
@param defaultValue the default value
@param text optional extra context for... | [
"Search",
"the",
"System",
"properties",
"and",
"environment",
"variables",
"for",
"a",
"value",
"with",
"the",
"provided",
"key",
".",
"Environment",
"variables",
"in",
"{"
] | 0b27f7c70e164b2b1a96477f1d9c1acba56790c1 | https://github.com/spring-projects/spring-boot/blob/0b27f7c70e164b2b1a96477f1d9c1acba56790c1/spring-boot-project/spring-boot-tools/spring-boot-loader/src/main/java/org/springframework/boot/loader/util/SystemPropertyUtils.java#L179-L205 | train | Get a property from the system or environment. | [
30522,
2270,
10763,
5164,
2131,
21572,
4842,
3723,
1006,
5164,
3145,
1010,
5164,
12398,
10175,
5657,
1010,
5164,
3793,
1007,
1063,
3046,
1063,
5164,
17678,
10175,
1027,
2291,
1012,
2131,
21572,
4842,
3723,
1006,
3145,
1007,
1025,
2065,
1006... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
apache/flink | flink-runtime/src/main/java/org/apache/flink/runtime/taskexecutor/JobLeaderService.java | JobLeaderService.removeJob | public void removeJob(JobID jobId) throws Exception {
Preconditions.checkState(JobLeaderService.State.STARTED == state, "The service is currently not running.");
Tuple2<LeaderRetrievalService, JobLeaderService.JobManagerLeaderListener> entry = jobLeaderServices.remove(jobId);
if (entry != null) {
LOG.info("R... | java | public void removeJob(JobID jobId) throws Exception {
Preconditions.checkState(JobLeaderService.State.STARTED == state, "The service is currently not running.");
Tuple2<LeaderRetrievalService, JobLeaderService.JobManagerLeaderListener> entry = jobLeaderServices.remove(jobId);
if (entry != null) {
LOG.info("R... | [
"public",
"void",
"removeJob",
"(",
"JobID",
"jobId",
")",
"throws",
"Exception",
"{",
"Preconditions",
".",
"checkState",
"(",
"JobLeaderService",
".",
"State",
".",
"STARTED",
"==",
"state",
",",
"\"The service is currently not running.\"",
")",
";",
"Tuple2",
"... | Remove the given job from being monitored by the job leader service.
@param jobId identifying the job to remove from monitoring
@throws Exception if an error occurred while stopping the leader retrieval service and listener | [
"Remove",
"the",
"given",
"job",
"from",
"being",
"monitored",
"by",
"the",
"job",
"leader",
"service",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/taskexecutor/JobLeaderService.java#L166-L180 | train | Removes the given job from the job leader monitoring service. | [
30522,
2270,
11675,
6366,
5558,
2497,
1006,
3105,
3593,
3105,
3593,
1007,
11618,
6453,
1063,
3653,
8663,
20562,
2015,
1012,
14148,
12259,
1006,
3105,
19000,
8043,
7903,
2063,
1012,
2110,
1012,
2318,
1027,
1027,
2110,
1010,
1000,
1996,
2326,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/InstantiationUtil.java | InstantiationUtil.createCopyWritable | public static <T extends IOReadableWritable> T createCopyWritable(T original) throws IOException {
if (original == null) {
return null;
}
final ByteArrayOutputStream baos = new ByteArrayOutputStream();
try (DataOutputViewStreamWrapper out = new DataOutputViewStreamWrapper(baos)) {
original.write(out);
... | java | public static <T extends IOReadableWritable> T createCopyWritable(T original) throws IOException {
if (original == null) {
return null;
}
final ByteArrayOutputStream baos = new ByteArrayOutputStream();
try (DataOutputViewStreamWrapper out = new DataOutputViewStreamWrapper(baos)) {
original.write(out);
... | [
"public",
"static",
"<",
"T",
"extends",
"IOReadableWritable",
">",
"T",
"createCopyWritable",
"(",
"T",
"original",
")",
"throws",
"IOException",
"{",
"if",
"(",
"original",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"final",
"ByteArrayOutputStream",... | Clones the given writable using the {@link IOReadableWritable serialization}.
@param original Object to clone
@param <T> Type of the object to clone
@return Cloned object
@throws IOException Thrown is the serialization fails. | [
"Clones",
"the",
"given",
"writable",
"using",
"the",
"{",
"@link",
"IOReadableWritable",
"serialization",
"}",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-core/src/main/java/org/apache/flink/util/InstantiationUtil.java#L647-L665 | train | Creates a copy of the given IOWritable. | [
30522,
2270,
10763,
1026,
1056,
8908,
22834,
16416,
20782,
13088,
6590,
3468,
1028,
1056,
3443,
3597,
7685,
13088,
6590,
3468,
1006,
1056,
2434,
1007,
11618,
22834,
10288,
24422,
1063,
2065,
1006,
2434,
1027,
1027,
19701,
1007,
1063,
2709,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
looly/hutool | hutool-core/src/main/java/cn/hutool/core/convert/impl/ArrayConverter.java | ArrayConverter.convertToSingleElementArray | private Object[] convertToSingleElementArray(Object value) {
final Object[] singleElementArray = ArrayUtil.newArray(targetComponentType, 1);
singleElementArray[0] = ConverterRegistry.getInstance().convert(targetComponentType, value);
return singleElementArray;
} | java | private Object[] convertToSingleElementArray(Object value) {
final Object[] singleElementArray = ArrayUtil.newArray(targetComponentType, 1);
singleElementArray[0] = ConverterRegistry.getInstance().convert(targetComponentType, value);
return singleElementArray;
} | [
"private",
"Object",
"[",
"]",
"convertToSingleElementArray",
"(",
"Object",
"value",
")",
"{",
"final",
"Object",
"[",
"]",
"singleElementArray",
"=",
"ArrayUtil",
".",
"newArray",
"(",
"targetComponentType",
",",
"1",
")",
";",
"singleElementArray",
"[",
"0",
... | 单元素数组
@param value 被转换的值
@return 数组,只包含一个元素 | [
"单元素数组"
] | bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/convert/impl/ArrayConverter.java#L145-L149 | train | Converts the given value to an array of target component type. | [
30522,
2797,
4874,
1031,
1033,
10463,
13122,
2075,
10559,
16930,
4765,
2906,
9447,
1006,
4874,
3643,
1007,
1063,
2345,
4874,
1031,
1033,
30524,
1027,
10463,
28849,
24063,
2854,
1012,
2131,
7076,
26897,
1006,
1007,
1012,
10463,
1006,
4539,
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... |
apache/flink | flink-table/flink-table-runtime-blink/src/main/java/org/apache/flink/table/runtime/functions/SqlDateTimeUtils.java | SqlDateTimeUtils.timestampFloor | public static long timestampFloor(TimeUnitRange range, long ts, TimeZone tz) {
// assume that we are at UTC timezone, just for algorithm performance
long offset = tz.getOffset(ts);
long utcTs = ts + offset;
switch (range) {
case HOUR:
return floor(utcTs, MILLIS_PER_HOUR) - offset;
case DAY:
retur... | java | public static long timestampFloor(TimeUnitRange range, long ts, TimeZone tz) {
// assume that we are at UTC timezone, just for algorithm performance
long offset = tz.getOffset(ts);
long utcTs = ts + offset;
switch (range) {
case HOUR:
return floor(utcTs, MILLIS_PER_HOUR) - offset;
case DAY:
retur... | [
"public",
"static",
"long",
"timestampFloor",
"(",
"TimeUnitRange",
"range",
",",
"long",
"ts",
",",
"TimeZone",
"tz",
")",
"{",
"// assume that we are at UTC timezone, just for algorithm performance",
"long",
"offset",
"=",
"tz",
".",
"getOffset",
"(",
"ts",
")",
"... | -------------------------------------------------------------------------------------------- | [
"--------------------------------------------------------------------------------------------"
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-table/flink-table-runtime-blink/src/main/java/org/apache/flink/table/runtime/functions/SqlDateTimeUtils.java#L601-L621 | train | Returns the floor of the given timestamp in the given time unit range. | [
30522,
2270,
10763,
2146,
2335,
15464,
14376,
4135,
2953,
1006,
2051,
19496,
6494,
15465,
2846,
1010,
2146,
24529,
1010,
2051,
15975,
1056,
2480,
1007,
1063,
1013,
1013,
7868,
2008,
2057,
2024,
2012,
11396,
2051,
15975,
1010,
2074,
2005,
98... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/symmetric/Vigenere.java | Vigenere.encrypt | public static String encrypt(CharSequence data, CharSequence cipherKey) {
final int dataLen = data.length();
final int cipherKeyLen = cipherKey.length();
final char[] cipherArray = new char[dataLen];
for (int i = 0; i < dataLen / cipherKeyLen + 1; i++) {
for (int t = 0; t < cipherKeyLen; t++) {
i... | java | public static String encrypt(CharSequence data, CharSequence cipherKey) {
final int dataLen = data.length();
final int cipherKeyLen = cipherKey.length();
final char[] cipherArray = new char[dataLen];
for (int i = 0; i < dataLen / cipherKeyLen + 1; i++) {
for (int t = 0; t < cipherKeyLen; t++) {
i... | [
"public",
"static",
"String",
"encrypt",
"(",
"CharSequence",
"data",
",",
"CharSequence",
"cipherKey",
")",
"{",
"final",
"int",
"dataLen",
"=",
"data",
".",
"length",
"(",
")",
";",
"final",
"int",
"cipherKeyLen",
"=",
"cipherKey",
".",
"length",
"(",
")... | 加密
@param data 数据
@param cipherKey 密钥
@return 密文 | [
"加密"
] | bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-crypto/src/main/java/cn/hutool/crypto/symmetric/Vigenere.java#L20-L36 | train | Encrypts the data with the cipherKey. | [
30522,
2270,
10763,
5164,
4372,
26775,
22571,
2102,
1006,
25869,
3366,
4226,
5897,
2951,
1010,
25869,
3366,
4226,
5897,
27715,
14839,
1007,
1063,
2345,
20014,
2951,
7770,
1027,
2951,
1012,
3091,
1006,
1007,
1025,
2345,
20014,
27715,
14839,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/dag/TwoInputNode.java | TwoInputNode.accept | @Override
public void accept(Visitor<OptimizerNode> visitor) {
if (visitor.preVisit(this)) {
if (this.input1 == null || this.input2 == null) {
throw new CompilerException();
}
getFirstPredecessorNode().accept(visitor);
getSecondPredecessorNode().accept(visitor);
for (DagConnection connecti... | java | @Override
public void accept(Visitor<OptimizerNode> visitor) {
if (visitor.preVisit(this)) {
if (this.input1 == null || this.input2 == null) {
throw new CompilerException();
}
getFirstPredecessorNode().accept(visitor);
getSecondPredecessorNode().accept(visitor);
for (DagConnection connecti... | [
"@",
"Override",
"public",
"void",
"accept",
"(",
"Visitor",
"<",
"OptimizerNode",
">",
"visitor",
")",
"{",
"if",
"(",
"visitor",
".",
"preVisit",
"(",
"this",
")",
")",
"{",
"if",
"(",
"this",
".",
"input1",
"==",
"null",
"||",
"this",
".",
"input2... | -------------------------------------------------------------------------------------------- | [
"--------------------------------------------------------------------------------------------"
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-optimizer/src/main/java/org/apache/flink/optimizer/dag/TwoInputNode.java#L743-L759 | train | Visit this node. | [
30522,
1030,
2058,
15637,
2270,
11675,
5138,
1006,
10367,
1026,
23569,
27605,
6290,
3630,
3207,
1028,
10367,
1007,
1063,
2065,
1006,
10367,
1012,
3653,
11365,
4183,
1006,
2023,
1007,
1007,
1063,
2065,
1006,
2023,
1012,
7953,
2487,
1027,
102... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
netty/netty | codec-http/src/main/java/io/netty/handler/codec/http/multipart/HttpPostRequestDecoder.java | HttpPostRequestDecoder.getMultipartDataBoundary | protected static String[] getMultipartDataBoundary(String contentType) {
// Check if Post using "multipart/form-data; boundary=--89421926422648 [; charset=xxx]"
String[] headerContentType = splitHeaderContentType(contentType);
final String multiPartHeader = HttpHeaderValues.MULTIPART_FORM_DATA.t... | java | protected static String[] getMultipartDataBoundary(String contentType) {
// Check if Post using "multipart/form-data; boundary=--89421926422648 [; charset=xxx]"
String[] headerContentType = splitHeaderContentType(contentType);
final String multiPartHeader = HttpHeaderValues.MULTIPART_FORM_DATA.t... | [
"protected",
"static",
"String",
"[",
"]",
"getMultipartDataBoundary",
"(",
"String",
"contentType",
")",
"{",
"// Check if Post using \"multipart/form-data; boundary=--89421926422648 [; charset=xxx]\"",
"String",
"[",
"]",
"headerContentType",
"=",
"splitHeaderContentType",
"(",... | Check from the request ContentType if this request is a Multipart request.
@return an array of String if multipartDataBoundary exists with the multipartDataBoundary
as first element, charset if any as second (missing if not set), else null | [
"Check",
"from",
"the",
"request",
"ContentType",
"if",
"this",
"request",
"is",
"a",
"Multipart",
"request",
"."
] | ba06eafa1c1824bd154f1a380019e7ea2edf3c4c | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/codec-http/src/main/java/io/netty/handler/codec/http/multipart/HttpPostRequestDecoder.java#L155-L193 | train | Get the multi - part boundary from the content type. | [
30522,
5123,
10763,
5164,
1031,
1033,
2131,
12274,
7096,
11514,
8445,
2850,
2696,
15494,
5649,
1006,
5164,
4180,
13874,
1007,
1063,
1013,
1013,
4638,
2065,
2695,
2478,
1000,
4800,
19362,
2102,
1013,
2433,
1011,
2951,
1025,
6192,
1027,
1011,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
networknt/light-4j | dump/src/main/java/com/networknt/dump/DumpHelper.java | DumpHelper.getTabBasedOnLevel | private static String getTabBasedOnLevel(int level, int indentSize) {
StringBuilder sb = new StringBuilder();
for(int i = 0; i < level; i ++) {
for(int j = 0; j < indentSize; j++) {
sb.append(" ");
}
}
return sb.toString();
} | java | private static String getTabBasedOnLevel(int level, int indentSize) {
StringBuilder sb = new StringBuilder();
for(int i = 0; i < level; i ++) {
for(int j = 0; j < indentSize; j++) {
sb.append(" ");
}
}
return sb.toString();
} | [
"private",
"static",
"String",
"getTabBasedOnLevel",
"(",
"int",
"level",
",",
"int",
"indentSize",
")",
"{",
"StringBuilder",
"sb",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"level",
";",
"i",
"++",
... | calculate indent for formatting
@return " " string of empty spaces | [
"calculate",
"indent",
"for",
"formatting"
] | 2a60257c60663684c8f6dc8b5ea3cf184e534db6 | https://github.com/networknt/light-4j/blob/2a60257c60663684c8f6dc8b5ea3cf184e534db6/dump/src/main/java/com/networknt/dump/DumpHelper.java#L101-L109 | train | Get a tab based on level | [
30522,
2797,
10763,
5164,
2131,
2696,
22414,
6924,
2239,
20414,
2884,
1006,
20014,
2504,
1010,
20014,
27427,
11187,
4697,
1007,
1063,
5164,
8569,
23891,
2099,
24829,
1027,
2047,
5164,
8569,
23891,
2099,
1006,
1007,
1025,
2005,
1006,
20014,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/Img.java | Img.write | public boolean write(File targetFile) throws IORuntimeException {
final String formatName = FileUtil.extName(targetFile);
if (StrUtil.isNotBlank(formatName)) {
this.targetImageType = formatName;
}
if(targetFile.exists()) {
targetFile.delete();
}
ImageOutputStream out = null;
try {
... | java | public boolean write(File targetFile) throws IORuntimeException {
final String formatName = FileUtil.extName(targetFile);
if (StrUtil.isNotBlank(formatName)) {
this.targetImageType = formatName;
}
if(targetFile.exists()) {
targetFile.delete();
}
ImageOutputStream out = null;
try {
... | [
"public",
"boolean",
"write",
"(",
"File",
"targetFile",
")",
"throws",
"IORuntimeException",
"{",
"final",
"String",
"formatName",
"=",
"FileUtil",
".",
"extName",
"(",
"targetFile",
")",
";",
"if",
"(",
"StrUtil",
".",
"isNotBlank",
"(",
"formatName",
")",
... | 写出图像为目标文件扩展名对应的格式
@param targetFile 目标文件
@return 是否成功写出,如果返回false表示未找到合适的Writer
@throws IORuntimeException IO异常 | [
"写出图像为目标文件扩展名对应的格式"
] | bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/img/Img.java#L546-L563 | train | Write the image to the target file. | [
30522,
2270,
22017,
20898,
4339,
1006,
5371,
4539,
8873,
2571,
1007,
11618,
22834,
15532,
7292,
10288,
24422,
1063,
2345,
5164,
4289,
18442,
1027,
5371,
21823,
2140,
1012,
4654,
2102,
18442,
1006,
4539,
8873,
2571,
1007,
1025,
2065,
1006,
2... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
apache/flink | flink-state-backends/flink-statebackend-rocksdb/src/main/java/org/apache/flink/contrib/streaming/state/RocksDBMapState.java | RocksDBMapState.deserializeUserKey | private static <UK> UK deserializeUserKey(
DataInputDeserializer dataInputView,
int userKeyOffset,
byte[] rawKeyBytes,
TypeSerializer<UK> keySerializer) throws IOException {
dataInputView.setBuffer(rawKeyBytes, userKeyOffset, rawKeyBytes.length - userKeyOffset);
return keySerializer.deserialize(dataInputVie... | java | private static <UK> UK deserializeUserKey(
DataInputDeserializer dataInputView,
int userKeyOffset,
byte[] rawKeyBytes,
TypeSerializer<UK> keySerializer) throws IOException {
dataInputView.setBuffer(rawKeyBytes, userKeyOffset, rawKeyBytes.length - userKeyOffset);
return keySerializer.deserialize(dataInputVie... | [
"private",
"static",
"<",
"UK",
">",
"UK",
"deserializeUserKey",
"(",
"DataInputDeserializer",
"dataInputView",
",",
"int",
"userKeyOffset",
",",
"byte",
"[",
"]",
"rawKeyBytes",
",",
"TypeSerializer",
"<",
"UK",
">",
"keySerializer",
")",
"throws",
"IOException",... | ------------------------------------------------------------------------ | [
"------------------------------------------------------------------------"
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-state-backends/flink-statebackend-rocksdb/src/main/java/org/apache/flink/contrib/streaming/state/RocksDBMapState.java#L301-L308 | train | Deserialize a user key. | [
30522,
2797,
10763,
1026,
2866,
1028,
2866,
4078,
11610,
3669,
4371,
20330,
14839,
1006,
2951,
2378,
18780,
6155,
11610,
28863,
2951,
2378,
18780,
8584,
1010,
20014,
5310,
14839,
27475,
3388,
1010,
24880,
1031,
1033,
6315,
14839,
3762,
4570,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
looly/hutool | hutool-core/src/main/java/cn/hutool/core/bean/BeanDesc.java | BeanDesc.init | private BeanDesc init() {
for (Field field : ReflectUtil.getFields(this.beanClass)) {
if(false == ModifierUtil.isStatic(field)) {
//只针对非static属性
this.propMap.put(field.getName(), createProp(field));
}
}
return this;
} | java | private BeanDesc init() {
for (Field field : ReflectUtil.getFields(this.beanClass)) {
if(false == ModifierUtil.isStatic(field)) {
//只针对非static属性
this.propMap.put(field.getName(), createProp(field));
}
}
return this;
} | [
"private",
"BeanDesc",
"init",
"(",
")",
"{",
"for",
"(",
"Field",
"field",
":",
"ReflectUtil",
".",
"getFields",
"(",
"this",
".",
"beanClass",
")",
")",
"{",
"if",
"(",
"false",
"==",
"ModifierUtil",
".",
"isStatic",
"(",
"field",
")",
")",
"{",
"/... | 初始化<br>
只有与属性关联的相关Getter和Setter方法才会被读取,无关的getXXX和setXXX都被忽略
@return this | [
"初始化<br",
">",
"只有与属性关联的相关Getter和Setter方法才会被读取,无关的getXXX和setXXX都被忽略"
] | bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/bean/BeanDesc.java#L138-L146 | train | init method. | [
30522,
2797,
14068,
6155,
2278,
1999,
4183,
1006,
1007,
1063,
2005,
1006,
2492,
2492,
1024,
8339,
21823,
2140,
1012,
2131,
15155,
1006,
2023,
1012,
14068,
26266,
1007,
1007,
1063,
2065,
1006,
6270,
1027,
1027,
16913,
18095,
21823,
2140,
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... |
looly/hutool | hutool-db/src/main/java/cn/hutool/db/sql/SqlExecutor.java | SqlExecutor.executeBatch | public static int[] executeBatch(Connection conn, String sql, Iterable<Object[]> paramsBatch) throws SQLException {
PreparedStatement ps = null;
try {
ps = StatementUtil.prepareStatementForBatch(conn, sql, paramsBatch);
return ps.executeBatch();
} finally {
DbUtil.close(ps);
}
} | java | public static int[] executeBatch(Connection conn, String sql, Iterable<Object[]> paramsBatch) throws SQLException {
PreparedStatement ps = null;
try {
ps = StatementUtil.prepareStatementForBatch(conn, sql, paramsBatch);
return ps.executeBatch();
} finally {
DbUtil.close(ps);
}
} | [
"public",
"static",
"int",
"[",
"]",
"executeBatch",
"(",
"Connection",
"conn",
",",
"String",
"sql",
",",
"Iterable",
"<",
"Object",
"[",
"]",
">",
"paramsBatch",
")",
"throws",
"SQLException",
"{",
"PreparedStatement",
"ps",
"=",
"null",
";",
"try",
"{",... | 批量执行非查询语句<br>
语句包括 插入、更新、删除<br>
此方法不会关闭Connection
@param conn 数据库连接对象
@param sql SQL
@param paramsBatch 批量的参数
@return 每个SQL执行影响的行数
@throws SQLException SQL执行异常 | [
"批量执行非查询语句<br",
">",
"语句包括",
"插入、更新、删除<br",
">",
"此方法不会关闭Connection"
] | bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-db/src/main/java/cn/hutool/db/sql/SqlExecutor.java#L179-L187 | train | Execute a batch of SQL statements. | [
30522,
2270,
10763,
20014,
1031,
1033,
15389,
14479,
2818,
1006,
4434,
9530,
2078,
1010,
5164,
29296,
1010,
2009,
6906,
3468,
1026,
4874,
1031,
1033,
1028,
11498,
5244,
14479,
2818,
1007,
11618,
29296,
10288,
24422,
1063,
4810,
9153,
18532,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
networknt/light-4j | config/src/main/java/com/networknt/config/ConfigInjection.java | ConfigInjection.getInjectionPattern | private static InjectionPattern getInjectionPattern(String contents) {
if (contents == null || contents.trim().equals("")) {
return null;
}
InjectionPattern injectionPattern = new InjectionPattern();
contents = contents.trim();
// Retrieve key, default value and error... | java | private static InjectionPattern getInjectionPattern(String contents) {
if (contents == null || contents.trim().equals("")) {
return null;
}
InjectionPattern injectionPattern = new InjectionPattern();
contents = contents.trim();
// Retrieve key, default value and error... | [
"private",
"static",
"InjectionPattern",
"getInjectionPattern",
"(",
"String",
"contents",
")",
"{",
"if",
"(",
"contents",
"==",
"null",
"||",
"contents",
".",
"trim",
"(",
")",
".",
"equals",
"(",
"\"\"",
")",
")",
"{",
"return",
"null",
";",
"}",
"Inj... | Get instance of InjectionPattern based on the contents inside pattern "${}" | [
"Get",
"instance",
"of",
"InjectionPattern",
"based",
"on",
"the",
"contents",
"inside",
"pattern",
"$",
"{}"
] | 2a60257c60663684c8f6dc8b5ea3cf184e534db6 | https://github.com/networknt/light-4j/blob/2a60257c60663684c8f6dc8b5ea3cf184e534db6/config/src/main/java/com/networknt/config/ConfigInjection.java#L121-L156 | train | Get InjectionPattern from contents | [
30522,
2797,
10763,
13341,
4502,
12079,
2078,
2131,
2378,
20614,
3258,
4502,
12079,
2078,
1006,
5164,
8417,
1007,
1063,
2065,
1006,
8417,
1027,
1027,
19701,
1064,
1064,
8417,
1012,
12241,
1006,
1007,
1012,
19635,
1006,
1000,
1000,
1007,
100... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
apache/flink | flink-runtime/src/main/java/org/apache/flink/runtime/jobmaster/JobMaster.java | JobMaster.start | public CompletableFuture<Acknowledge> start(final JobMasterId newJobMasterId) throws Exception {
// make sure we receive RPC and async calls
start();
return callAsyncWithoutFencing(() -> startJobExecution(newJobMasterId), RpcUtils.INF_TIMEOUT);
} | java | public CompletableFuture<Acknowledge> start(final JobMasterId newJobMasterId) throws Exception {
// make sure we receive RPC and async calls
start();
return callAsyncWithoutFencing(() -> startJobExecution(newJobMasterId), RpcUtils.INF_TIMEOUT);
} | [
"public",
"CompletableFuture",
"<",
"Acknowledge",
">",
"start",
"(",
"final",
"JobMasterId",
"newJobMasterId",
")",
"throws",
"Exception",
"{",
"// make sure we receive RPC and async calls",
"start",
"(",
")",
";",
"return",
"callAsyncWithoutFencing",
"(",
"(",
")",
... | Start the rpc service and begin to run the job.
@param newJobMasterId The necessary fencing token to run the job
@return Future acknowledge if the job could be started. Otherwise the future contains an exception | [
"Start",
"the",
"rpc",
"service",
"and",
"begin",
"to",
"run",
"the",
"job",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/jobmaster/JobMaster.java#L304-L309 | train | Starts the job with the given job master id. | [
30522,
2270,
4012,
10814,
10880,
11263,
11244,
1026,
13399,
1028,
2707,
1006,
2345,
3105,
8706,
3593,
2047,
5558,
25526,
24268,
3593,
1007,
11618,
6453,
1063,
1013,
1013,
2191,
2469,
2057,
4374,
1054,
15042,
1998,
2004,
6038,
2278,
4455,
27... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/SslContextBuilder.java | SslContextBuilder.trustManager | public SslContextBuilder trustManager(InputStream trustCertCollectionInputStream) {
try {
return trustManager(SslContext.toX509Certificates(trustCertCollectionInputStream));
} catch (Exception e) {
throw new IllegalArgumentException("Input stream does not contain valid certificat... | java | public SslContextBuilder trustManager(InputStream trustCertCollectionInputStream) {
try {
return trustManager(SslContext.toX509Certificates(trustCertCollectionInputStream));
} catch (Exception e) {
throw new IllegalArgumentException("Input stream does not contain valid certificat... | [
"public",
"SslContextBuilder",
"trustManager",
"(",
"InputStream",
"trustCertCollectionInputStream",
")",
"{",
"try",
"{",
"return",
"trustManager",
"(",
"SslContext",
".",
"toX509Certificates",
"(",
"trustCertCollectionInputStream",
")",
")",
";",
"}",
"catch",
"(",
... | Trusted certificates for verifying the remote endpoint's certificate. The input stream should
contain an X.509 certificate collection in PEM format. {@code null} uses the system default. | [
"Trusted",
"certificates",
"for",
"verifying",
"the",
"remote",
"endpoint",
"s",
"certificate",
".",
"The",
"input",
"stream",
"should",
"contain",
"an",
"X",
".",
"509",
"certificate",
"collection",
"in",
"PEM",
"format",
".",
"{"
] | ba06eafa1c1824bd154f1a380019e7ea2edf3c4c | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/handler/src/main/java/io/netty/handler/ssl/SslContextBuilder.java#L191-L197 | train | Sets the trust manager for the input stream. | [
30522,
2270,
7020,
22499,
10111,
18413,
8569,
23891,
2099,
3404,
24805,
4590,
1006,
20407,
25379,
3404,
17119,
13535,
14511,
18491,
2378,
18780,
21422,
1007,
30524,
1006,
3404,
17119,
13535,
14511,
18491,
2378,
18780,
21422,
1007,
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... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.