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/instance/InstanceManager.java | InstanceManager.unregisterTaskManager | public void unregisterTaskManager(InstanceID instanceId, boolean terminated){
Instance instance = registeredHostsById.get(instanceId);
if (instance != null){
registeredHostsById.remove(instance.getId());
registeredHostsByResource.remove(instance.getTaskManagerID());
if (terminated) {
deadHosts.add(in... | java | public void unregisterTaskManager(InstanceID instanceId, boolean terminated){
Instance instance = registeredHostsById.get(instanceId);
if (instance != null){
registeredHostsById.remove(instance.getId());
registeredHostsByResource.remove(instance.getTaskManagerID());
if (terminated) {
deadHosts.add(in... | [
"public",
"void",
"unregisterTaskManager",
"(",
"InstanceID",
"instanceId",
",",
"boolean",
"terminated",
")",
"{",
"Instance",
"instance",
"=",
"registeredHostsById",
".",
"get",
"(",
"instanceId",
")",
";",
"if",
"(",
"instance",
"!=",
"null",
")",
"{",
"reg... | Unregisters the TaskManager with the given instance id. Unregistering means to mark
the given instance as dead and notify {@link InstanceListener} about the dead instance.
@param instanceId TaskManager which is about to be marked dead. | [
"Unregisters",
"the",
"TaskManager",
"with",
"the",
"given",
"instance",
"id",
".",
"Unregistering",
"means",
"to",
"mark",
"the",
"given",
"instance",
"as",
"dead",
"and",
"notify",
"{",
"@link",
"InstanceListener",
"}",
"about",
"the",
"dead",
"instance",
".... | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/instance/InstanceManager.java#L201-L225 | train | Unregister a task manager instance. | [
30522,
2270,
11675,
4895,
2890,
24063,
8743,
19895,
24805,
4590,
1006,
6013,
3593,
6013,
3593,
1010,
22017,
20898,
12527,
1007,
1063,
6013,
6013,
1027,
5068,
15006,
3215,
3762,
3593,
1012,
2131,
1006,
6013,
3593,
1007,
1025,
2065,
1006,
601... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/system/ApplicationPid.java | ApplicationPid.write | public void write(File file) throws IOException {
Assert.state(this.pid != null, "No PID available");
createParentFolder(file);
if (file.exists()) {
assertCanOverwrite(file);
}
try (FileWriter writer = new FileWriter(file)) {
writer.append(this.pid);
}
} | java | public void write(File file) throws IOException {
Assert.state(this.pid != null, "No PID available");
createParentFolder(file);
if (file.exists()) {
assertCanOverwrite(file);
}
try (FileWriter writer = new FileWriter(file)) {
writer.append(this.pid);
}
} | [
"public",
"void",
"write",
"(",
"File",
"file",
")",
"throws",
"IOException",
"{",
"Assert",
".",
"state",
"(",
"this",
".",
"pid",
"!=",
"null",
",",
"\"No PID available\"",
")",
";",
"createParentFolder",
"(",
"file",
")",
";",
"if",
"(",
"file",
".",
... | Write the PID to the specified file.
@param file the PID file
@throws IllegalStateException if no PID is available.
@throws IOException if the file cannot be written | [
"Write",
"the",
"PID",
"to",
"the",
"specified",
"file",
"."
] | 0b27f7c70e164b2b1a96477f1d9c1acba56790c1 | https://github.com/spring-projects/spring-boot/blob/0b27f7c70e164b2b1a96477f1d9c1acba56790c1/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/system/ApplicationPid.java#L90-L99 | train | Write the PID to the specified file. | [
30522,
2270,
11675,
4339,
1006,
5371,
5371,
1007,
11618,
22834,
10288,
24422,
1063,
20865,
1012,
2110,
1006,
2023,
1012,
14255,
2094,
999,
1027,
19701,
1010,
1000,
2053,
14255,
2094,
2800,
1000,
1007,
1025,
3443,
19362,
4765,
10371,
2121,
1... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
networknt/light-4j | metrics/src/main/java/io/dropwizard/metrics/InstrumentedExecutorService.java | InstrumentedExecutorService.submit | @Nonnull
@Override
public <T> Future<T> submit(@Nonnull Callable<T> task) {
submitted.mark();
try {
return delegate.submit(new InstrumentedCallable<>(task));
} catch (RejectedExecutionException e) {
rejected.mark();
throw e;
}
} | java | @Nonnull
@Override
public <T> Future<T> submit(@Nonnull Callable<T> task) {
submitted.mark();
try {
return delegate.submit(new InstrumentedCallable<>(task));
} catch (RejectedExecutionException e) {
rejected.mark();
throw e;
}
} | [
"@",
"Nonnull",
"@",
"Override",
"public",
"<",
"T",
">",
"Future",
"<",
"T",
">",
"submit",
"(",
"@",
"Nonnull",
"Callable",
"<",
"T",
">",
"task",
")",
"{",
"submitted",
".",
"mark",
"(",
")",
";",
"try",
"{",
"return",
"delegate",
".",
"submit",... | {@inheritDoc} | [
"{"
] | 2a60257c60663684c8f6dc8b5ea3cf184e534db6 | https://github.com/networknt/light-4j/blob/2a60257c60663684c8f6dc8b5ea3cf184e534db6/metrics/src/main/java/io/dropwizard/metrics/InstrumentedExecutorService.java#L118-L128 | train | Submits a Callable to the delegate thread. | [
30522,
1030,
2512,
11231,
3363,
1030,
2058,
15637,
2270,
1026,
1056,
1028,
2925,
1026,
1056,
1028,
12040,
1006,
1030,
2512,
11231,
3363,
2655,
3085,
1026,
1056,
1028,
4708,
1007,
1063,
7864,
1012,
2928,
1006,
1007,
1025,
3046,
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... |
SeleniumHQ/selenium | java/client/src/org/openqa/selenium/Proxy.java | Proxy.setFtpProxy | public Proxy setFtpProxy(String ftpProxy) {
verifyProxyTypeCompatibility(ProxyType.MANUAL);
this.proxyType = ProxyType.MANUAL;
this.ftpProxy = ftpProxy;
return this;
} | java | public Proxy setFtpProxy(String ftpProxy) {
verifyProxyTypeCompatibility(ProxyType.MANUAL);
this.proxyType = ProxyType.MANUAL;
this.ftpProxy = ftpProxy;
return this;
} | [
"public",
"Proxy",
"setFtpProxy",
"(",
"String",
"ftpProxy",
")",
"{",
"verifyProxyTypeCompatibility",
"(",
"ProxyType",
".",
"MANUAL",
")",
";",
"this",
".",
"proxyType",
"=",
"ProxyType",
".",
"MANUAL",
";",
"this",
".",
"ftpProxy",
"=",
"ftpProxy",
";",
"... | Specify which proxy to use for FTP connections.
@param ftpProxy the proxy host, expected format is <code>hostname.com:1234</code>
@return reference to self | [
"Specify",
"which",
"proxy",
"to",
"use",
"for",
"FTP",
"connections",
"."
] | 7af172729f17b20269c8ca4ea6f788db48616535 | https://github.com/SeleniumHQ/selenium/blob/7af172729f17b20269c8ca4ea6f788db48616535/java/client/src/org/openqa/selenium/Proxy.java#L217-L222 | train | Sets the FTP proxy. | [
30522,
2270,
24540,
2275,
6199,
9397,
3217,
18037,
1006,
5164,
3027,
9397,
3217,
18037,
1007,
1063,
20410,
21572,
18037,
13874,
9006,
24952,
8553,
1006,
24540,
13874,
1012,
6410,
1007,
1025,
2023,
1012,
24540,
13874,
1027,
24540,
13874,
1012,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
netty/netty | transport-native-epoll/src/main/java/io/netty/channel/epoll/EpollSocketChannel.java | EpollSocketChannel.tcpInfo | public EpollTcpInfo tcpInfo(EpollTcpInfo info) {
try {
socket.getTcpInfo(info);
return info;
} catch (IOException e) {
throw new ChannelException(e);
}
} | java | public EpollTcpInfo tcpInfo(EpollTcpInfo info) {
try {
socket.getTcpInfo(info);
return info;
} catch (IOException e) {
throw new ChannelException(e);
}
} | [
"public",
"EpollTcpInfo",
"tcpInfo",
"(",
"EpollTcpInfo",
"info",
")",
"{",
"try",
"{",
"socket",
".",
"getTcpInfo",
"(",
"info",
")",
";",
"return",
"info",
";",
"}",
"catch",
"(",
"IOException",
"e",
")",
"{",
"throw",
"new",
"ChannelException",
"(",
"... | Updates and returns the {@code TCP_INFO} for the current socket.
See <a href="http://linux.die.net/man/7/tcp">man 7 tcp</a>. | [
"Updates",
"and",
"returns",
"the",
"{"
] | ba06eafa1c1824bd154f1a380019e7ea2edf3c4c | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/transport-native-epoll/src/main/java/io/netty/channel/epoll/EpollSocketChannel.java#L79-L86 | train | Get the tcp info. | [
30522,
2270,
4958,
14511,
13535,
8091,
14876,
22975,
8091,
14876,
1006,
4958,
14511,
13535,
8091,
14876,
18558,
1007,
1063,
3046,
1063,
22278,
1012,
2131,
13535,
8091,
14876,
1006,
18558,
1007,
1025,
2709,
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... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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-hadoop-fs/src/main/java/org/apache/flink/runtime/util/HadoopUtils.java | HadoopUtils.hasHDFSDelegationToken | public static boolean hasHDFSDelegationToken() throws Exception {
UserGroupInformation loginUser = UserGroupInformation.getCurrentUser();
Collection<Token<? extends TokenIdentifier>> usrTok = loginUser.getTokens();
for (Token<? extends TokenIdentifier> token : usrTok) {
if (token.getKind().equals(HDFS_DELEGATI... | java | public static boolean hasHDFSDelegationToken() throws Exception {
UserGroupInformation loginUser = UserGroupInformation.getCurrentUser();
Collection<Token<? extends TokenIdentifier>> usrTok = loginUser.getTokens();
for (Token<? extends TokenIdentifier> token : usrTok) {
if (token.getKind().equals(HDFS_DELEGATI... | [
"public",
"static",
"boolean",
"hasHDFSDelegationToken",
"(",
")",
"throws",
"Exception",
"{",
"UserGroupInformation",
"loginUser",
"=",
"UserGroupInformation",
".",
"getCurrentUser",
"(",
")",
";",
"Collection",
"<",
"Token",
"<",
"?",
"extends",
"TokenIdentifier",
... | Indicates whether the current user has an HDFS delegation token. | [
"Indicates",
"whether",
"the",
"current",
"user",
"has",
"an",
"HDFS",
"delegation",
"token",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-filesystems/flink-hadoop-fs/src/main/java/org/apache/flink/runtime/util/HadoopUtils.java#L118-L127 | train | Checks if the current user has a delegation token. | [
30522,
2270,
10763,
22017,
20898,
23325,
20952,
16150,
12260,
12540,
18715,
2368,
1006,
1007,
11618,
6453,
1063,
5310,
17058,
2378,
14192,
3370,
8833,
13429,
2121,
1027,
5310,
17058,
2378,
14192,
3370,
1012,
2131,
10841,
14343,
3372,
20330,
1... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
apache/flink | flink-runtime/src/main/java/org/apache/flink/runtime/taskexecutor/slot/TaskSlotTable.java | TaskSlotTable.allocateSlot | public boolean allocateSlot(int index, JobID jobId, AllocationID allocationId, Time slotTimeout) {
checkInit();
TaskSlot taskSlot = taskSlots.get(index);
boolean result = taskSlot.allocate(jobId, allocationId);
if (result) {
// update the allocation id to task slot map
allocationIDTaskSlotMap.put(alloc... | java | public boolean allocateSlot(int index, JobID jobId, AllocationID allocationId, Time slotTimeout) {
checkInit();
TaskSlot taskSlot = taskSlots.get(index);
boolean result = taskSlot.allocate(jobId, allocationId);
if (result) {
// update the allocation id to task slot map
allocationIDTaskSlotMap.put(alloc... | [
"public",
"boolean",
"allocateSlot",
"(",
"int",
"index",
",",
"JobID",
"jobId",
",",
"AllocationID",
"allocationId",
",",
"Time",
"slotTimeout",
")",
"{",
"checkInit",
"(",
")",
";",
"TaskSlot",
"taskSlot",
"=",
"taskSlots",
".",
"get",
"(",
"index",
")",
... | Allocate the slot with the given index for the given job and allocation id. Returns true if
the slot could be allocated. Otherwise it returns false.
@param index of the task slot to allocate
@param jobId to allocate the task slot for
@param allocationId identifying the allocation
@param slotTimeout until the slot time... | [
"Allocate",
"the",
"slot",
"with",
"the",
"given",
"index",
"for",
"the",
"given",
"job",
"and",
"allocation",
"id",
".",
"Returns",
"true",
"if",
"the",
"slot",
"could",
"be",
"allocated",
".",
"Otherwise",
"it",
"returns",
"false",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/taskexecutor/slot/TaskSlotTable.java#L193-L219 | train | Allocate a slot. | [
30522,
2270,
22017,
20898,
2035,
24755,
4570,
10994,
1006,
20014,
5950,
1010,
3105,
3593,
3105,
3593,
1010,
16169,
3593,
16169,
3593,
1010,
2051,
10453,
7292,
5833,
1007,
1063,
4638,
5498,
2102,
1006,
1007,
1025,
8518,
10994,
8518,
10994,
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-http/src/main/java/cn/hutool/http/webservice/SoapClient.java | SoapClient.create | public static SoapClient create(String url, SoapProtocol protocol, String namespaceURI) {
return new SoapClient(url, protocol, namespaceURI);
} | java | public static SoapClient create(String url, SoapProtocol protocol, String namespaceURI) {
return new SoapClient(url, protocol, namespaceURI);
} | [
"public",
"static",
"SoapClient",
"create",
"(",
"String",
"url",
",",
"SoapProtocol",
"protocol",
",",
"String",
"namespaceURI",
")",
"{",
"return",
"new",
"SoapClient",
"(",
"url",
",",
"protocol",
",",
"namespaceURI",
")",
";",
"}"
] | 创建SOAP客户端
@param url WS的URL地址
@param protocol 协议,见{@link SoapProtocol}
@param namespaceURI 方法上的命名空间URI
@return {@link SoapClient}
@since 4.5.6 | [
"创建SOAP客户端"
] | bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-http/src/main/java/cn/hutool/http/webservice/SoapClient.java#L85-L87 | train | Create a new instance of the class. | [
30522,
2270,
10763,
7815,
20464,
11638,
3443,
1006,
5164,
24471,
2140,
1010,
7815,
21572,
3406,
25778,
8778,
1010,
5164,
3415,
15327,
9496,
1007,
1063,
2709,
2047,
7815,
20464,
11638,
1006,
24471,
2140,
1010,
8778,
1010,
3415,
15327,
9496,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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-hadoop-fs/src/main/java/org/apache/flink/runtime/fs/hdfs/HadoopFileSystem.java | HadoopFileSystem.getKindForScheme | static FileSystemKind getKindForScheme(String scheme) {
scheme = scheme.toLowerCase(Locale.US);
if (scheme.startsWith("s3") || scheme.startsWith("emr") || scheme.startsWith("oss")) {
// the Amazon S3 storage or Aliyun OSS storage
return FileSystemKind.OBJECT_STORE;
}
else if (scheme.startsWith("http") ||... | java | static FileSystemKind getKindForScheme(String scheme) {
scheme = scheme.toLowerCase(Locale.US);
if (scheme.startsWith("s3") || scheme.startsWith("emr") || scheme.startsWith("oss")) {
// the Amazon S3 storage or Aliyun OSS storage
return FileSystemKind.OBJECT_STORE;
}
else if (scheme.startsWith("http") ||... | [
"static",
"FileSystemKind",
"getKindForScheme",
"(",
"String",
"scheme",
")",
"{",
"scheme",
"=",
"scheme",
".",
"toLowerCase",
"(",
"Locale",
".",
"US",
")",
";",
"if",
"(",
"scheme",
".",
"startsWith",
"(",
"\"s3\"",
")",
"||",
"scheme",
".",
"startsWith... | Gets the kind of the file system from its scheme.
<p>Implementation note: Initially, especially within the Flink 1.3.x line
(in order to not break backwards compatibility), we must only label file systems
as 'inconsistent' or as 'not proper filesystems' if we are sure about it.
Otherwise, we cause regression for examp... | [
"Gets",
"the",
"kind",
"of",
"the",
"file",
"system",
"from",
"its",
"scheme",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-filesystems/flink-hadoop-fs/src/main/java/org/apache/flink/runtime/fs/hdfs/HadoopFileSystem.java#L224-L242 | train | Returns the kind of the file system based on the scheme. | [
30522,
10763,
6764,
27268,
6633,
18824,
2131,
18824,
29278,
22842,
4168,
1006,
5164,
5679,
1007,
1063,
5679,
1027,
5679,
1012,
2000,
27663,
18992,
3366,
1006,
2334,
2063,
1012,
2149,
1007,
1025,
2065,
1006,
5679,
1012,
4627,
24415,
1006,
10... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
looly/hutool | hutool-core/src/main/java/cn/hutool/core/io/resource/ResourceUtil.java | ResourceUtil.getResourceIter | public static EnumerationIter<URL> getResourceIter(String resource) {
final Enumeration<URL> resources;
try {
resources = ClassLoaderUtil.getClassLoader().getResources(resource);
} catch (IOException e) {
throw new IORuntimeException(e);
}
return new EnumerationIter<>(resources);
} | java | public static EnumerationIter<URL> getResourceIter(String resource) {
final Enumeration<URL> resources;
try {
resources = ClassLoaderUtil.getClassLoader().getResources(resource);
} catch (IOException e) {
throw new IORuntimeException(e);
}
return new EnumerationIter<>(resources);
} | [
"public",
"static",
"EnumerationIter",
"<",
"URL",
">",
"getResourceIter",
"(",
"String",
"resource",
")",
"{",
"final",
"Enumeration",
"<",
"URL",
">",
"resources",
";",
"try",
"{",
"resources",
"=",
"ClassLoaderUtil",
".",
"getClassLoader",
"(",
")",
".",
... | 获取指定路径下的资源Iterator<br>
路径格式必须为目录格式,用/分隔,例如:
<pre>
config/a
spring/xml
</pre>
@param resource 资源路径
@return 资源列表
@since 4.1.5 | [
"获取指定路径下的资源Iterator<br",
">",
"路径格式必须为目录格式",
"用",
"/",
"分隔,例如",
":"
] | bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/io/resource/ResourceUtil.java#L142-L150 | train | Gets the resource iterator. | [
30522,
2270,
10763,
4372,
17897,
8156,
21646,
1026,
24471,
2140,
1028,
2131,
6072,
8162,
3401,
21646,
1006,
5164,
7692,
1007,
1063,
2345,
4372,
17897,
8156,
1026,
24471,
2140,
1028,
4219,
1025,
3046,
1063,
4219,
1027,
2465,
11066,
2121,
218... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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.getPropsWithPrefix | public Map<String, String> getPropsWithPrefix(String confPrefix) {
Properties props = getProps();
Enumeration e = props.propertyNames();
Map<String, String> configMap = new HashMap<>();
String name = null;
while (e.hasMoreElements()) {
name = (String) e.nextElement();
if (name.startsWith(confPrefix)) {
... | java | public Map<String, String> getPropsWithPrefix(String confPrefix) {
Properties props = getProps();
Enumeration e = props.propertyNames();
Map<String, String> configMap = new HashMap<>();
String name = null;
while (e.hasMoreElements()) {
name = (String) e.nextElement();
if (name.startsWith(confPrefix)) {
... | [
"public",
"Map",
"<",
"String",
",",
"String",
">",
"getPropsWithPrefix",
"(",
"String",
"confPrefix",
")",
"{",
"Properties",
"props",
"=",
"getProps",
"(",
")",
";",
"Enumeration",
"e",
"=",
"props",
".",
"propertyNames",
"(",
")",
";",
"Map",
"<",
"St... | Constructs a mapping of configuration and includes all properties that
start with the specified configuration prefix. Property names in the
mapping are trimmed to remove the configuration prefix.
@param confPrefix configuration prefix
@return mapping of configuration properties with prefix stripped | [
"Constructs",
"a",
"mapping",
"of",
"configuration",
"and",
"includes",
"all",
"properties",
"that",
"start",
"with",
"the",
"specified",
"configuration",
"prefix",
".",
"Property",
"names",
"in",
"the",
"mapping",
"are",
"trimmed",
"to",
"remove",
"the",
"confi... | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-filesystems/flink-fs-hadoop-shaded/src/main/java/org/apache/hadoop/conf/Configuration.java#L2746-L2760 | train | Get the properties with the specified prefix. | [
30522,
2270,
4949,
1026,
5164,
1010,
5164,
1028,
2131,
21572,
4523,
24415,
28139,
8873,
2595,
1006,
5164,
9530,
22540,
2890,
8873,
2595,
1007,
1063,
5144,
24387,
1027,
2131,
21572,
4523,
1006,
1007,
1025,
4372,
17897,
8156,
1041,
1027,
2438... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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.lastIndexOfSeparator | public static int lastIndexOfSeparator(String filePath) {
if (StrUtil.isNotEmpty(filePath)) {
int i = filePath.length();
char c;
while (--i >= 0) {
c = filePath.charAt(i);
if (CharUtil.isFileSeparator(c)) {
return i;
}
}
}
return -1;
} | java | public static int lastIndexOfSeparator(String filePath) {
if (StrUtil.isNotEmpty(filePath)) {
int i = filePath.length();
char c;
while (--i >= 0) {
c = filePath.charAt(i);
if (CharUtil.isFileSeparator(c)) {
return i;
}
}
}
return -1;
} | [
"public",
"static",
"int",
"lastIndexOfSeparator",
"(",
"String",
"filePath",
")",
"{",
"if",
"(",
"StrUtil",
".",
"isNotEmpty",
"(",
"filePath",
")",
")",
"{",
"int",
"i",
"=",
"filePath",
".",
"length",
"(",
")",
";",
"char",
"c",
";",
"while",
"(",
... | 获得最后一个文件路径分隔符的位置
@param filePath 文件路径
@return 最后一个文件路径分隔符的位置 | [
"获得最后一个文件路径分隔符的位置"
] | bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/io/FileUtil.java#L1465-L1477 | train | Returns the index of the last file separator in the given path. | [
30522,
2270,
10763,
20014,
2197,
22254,
10288,
11253,
3366,
28689,
4263,
1006,
5164,
5371,
15069,
1007,
1063,
2065,
1006,
2358,
22134,
4014,
1012,
3475,
12184,
27718,
2100,
1006,
5371,
15069,
1007,
1007,
1063,
20014,
1045,
1027,
5371,
15069,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
apache/flink | flink-runtime/src/main/java/org/apache/flink/runtime/highavailability/nonha/embedded/EmbeddedHaServices.java | EmbeddedHaServices.close | @Override
public void close() throws Exception {
synchronized (lock) {
if (!isShutDown()) {
// stop all job manager leader services
for (EmbeddedLeaderService service : jobManagerLeaderServices.values()) {
service.shutdown();
}
jobManagerLeaderServices.clear();
resourceManagerLeaderServi... | java | @Override
public void close() throws Exception {
synchronized (lock) {
if (!isShutDown()) {
// stop all job manager leader services
for (EmbeddedLeaderService service : jobManagerLeaderServices.values()) {
service.shutdown();
}
jobManagerLeaderServices.clear();
resourceManagerLeaderServi... | [
"@",
"Override",
"public",
"void",
"close",
"(",
")",
"throws",
"Exception",
"{",
"synchronized",
"(",
"lock",
")",
"{",
"if",
"(",
"!",
"isShutDown",
"(",
")",
")",
"{",
"// stop all job manager leader services",
"for",
"(",
"EmbeddedLeaderService",
"service",
... | ------------------------------------------------------------------------ | [
"------------------------------------------------------------------------"
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/highavailability/nonha/embedded/EmbeddedHaServices.java#L160-L177 | train | Closes the cluster. | [
30522,
1030,
2058,
15637,
2270,
11675,
2485,
1006,
1007,
11618,
6453,
1063,
25549,
1006,
5843,
1007,
1063,
2065,
1006,
999,
26354,
6979,
2102,
7698,
1006,
1007,
1007,
1063,
1013,
1013,
2644,
2035,
3105,
3208,
3003,
2578,
2005,
1006,
11157,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
apache/spark | sql/hive-thriftserver/src/main/java/org/apache/hive/service/cli/session/HiveSessionImpl.java | HiveSessionImpl.release | protected synchronized void release(boolean userAccess) {
SessionState.detachSession();
if (ThreadWithGarbageCleanup.currentThread() instanceof ThreadWithGarbageCleanup) {
ThreadWithGarbageCleanup currentThread =
(ThreadWithGarbageCleanup) ThreadWithGarbageCleanup.currentThread();
currentT... | java | protected synchronized void release(boolean userAccess) {
SessionState.detachSession();
if (ThreadWithGarbageCleanup.currentThread() instanceof ThreadWithGarbageCleanup) {
ThreadWithGarbageCleanup currentThread =
(ThreadWithGarbageCleanup) ThreadWithGarbageCleanup.currentThread();
currentT... | [
"protected",
"synchronized",
"void",
"release",
"(",
"boolean",
"userAccess",
")",
"{",
"SessionState",
".",
"detachSession",
"(",
")",
";",
"if",
"(",
"ThreadWithGarbageCleanup",
".",
"currentThread",
"(",
")",
"instanceof",
"ThreadWithGarbageCleanup",
")",
"{",
... | 1. We'll remove the ThreadLocal SessionState as this thread might now serve
other requests.
2. We'll cache the ThreadLocal RawStore object for this background thread for an orderly cleanup
when this thread is garbage collected later.
@see org.apache.hive.service.server.ThreadWithGarbageCleanup#finalize() | [
"1",
".",
"We",
"ll",
"remove",
"the",
"ThreadLocal",
"SessionState",
"as",
"this",
"thread",
"might",
"now",
"serve",
"other",
"requests",
".",
"2",
".",
"We",
"ll",
"cache",
"the",
"ThreadLocal",
"RawStore",
"object",
"for",
"this",
"background",
"thread",... | 25ee0474f47d9c30d6f553a7892d9549f91071cf | https://github.com/apache/spark/blob/25ee0474f47d9c30d6f553a7892d9549f91071cf/sql/hive-thriftserver/src/main/java/org/apache/hive/service/cli/session/HiveSessionImpl.java#L372-L387 | train | Release the session. | [
30522,
5123,
25549,
11675,
2713,
1006,
22017,
20898,
5310,
6305,
9623,
2015,
1007,
1063,
6521,
12259,
1012,
20010,
6776,
8583,
10992,
1006,
1007,
1025,
2065,
1006,
11689,
24415,
6843,
16078,
8586,
20898,
6279,
1012,
2783,
2705,
16416,
2094,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
apache/flink | flink-streaming-java/src/main/java/org/apache/flink/streaming/api/datastream/WindowedStream.java | WindowedStream.aggregate | @PublicEvolving
public <ACC, V, R> SingleOutputStreamOperator<R> aggregate(
AggregateFunction<T, ACC, V> aggregateFunction,
WindowFunction<V, R, K, W> windowFunction,
TypeInformation<ACC> accumulatorType,
TypeInformation<R> resultType) {
checkNotNull(aggregateFunction, "aggregateFunction");
checkNotNu... | java | @PublicEvolving
public <ACC, V, R> SingleOutputStreamOperator<R> aggregate(
AggregateFunction<T, ACC, V> aggregateFunction,
WindowFunction<V, R, K, W> windowFunction,
TypeInformation<ACC> accumulatorType,
TypeInformation<R> resultType) {
checkNotNull(aggregateFunction, "aggregateFunction");
checkNotNu... | [
"@",
"PublicEvolving",
"public",
"<",
"ACC",
",",
"V",
",",
"R",
">",
"SingleOutputStreamOperator",
"<",
"R",
">",
"aggregate",
"(",
"AggregateFunction",
"<",
"T",
",",
"ACC",
",",
"V",
">",
"aggregateFunction",
",",
"WindowFunction",
"<",
"V",
",",
"R",
... | 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 aggregate function. This means
tha... | [
"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/WindowedStream.java#L791-L851 | train | Creates an operator that aggregates the contents of the input stream using the given window function and accumulator type. | [
30522,
1030,
2270,
6777,
4747,
6455,
2270,
1026,
16222,
1010,
1058,
1010,
1054,
1028,
2309,
5833,
18780,
21422,
25918,
8844,
1026,
1054,
1028,
9572,
1006,
9572,
11263,
27989,
1026,
1056,
1010,
16222,
1010,
1058,
1028,
9572,
11263,
27989,
10... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
apache/flink | flink-table/flink-table-planner-blink/src/main/java/org/apache/calcite/avatica/util/DateTimeUtils.java | DateTimeUtils.firstMondayOfFirstWeek | private static long firstMondayOfFirstWeek(int year) {
final long janFirst = ymdToJulian(year, 1, 1);
final long janFirstDow = floorMod(janFirst + 1, 7); // sun=0, sat=6
return janFirst + (11 - janFirstDow) % 7 - 3;
} | java | private static long firstMondayOfFirstWeek(int year) {
final long janFirst = ymdToJulian(year, 1, 1);
final long janFirstDow = floorMod(janFirst + 1, 7); // sun=0, sat=6
return janFirst + (11 - janFirstDow) % 7 - 3;
} | [
"private",
"static",
"long",
"firstMondayOfFirstWeek",
"(",
"int",
"year",
")",
"{",
"final",
"long",
"janFirst",
"=",
"ymdToJulian",
"(",
"year",
",",
"1",
",",
"1",
")",
";",
"final",
"long",
"janFirstDow",
"=",
"floorMod",
"(",
"janFirst",
"+",
"1",
"... | Returns the first day of the first week of a year.
Per ISO-8601 it is the Monday of the week that contains Jan 4,
or equivalently, it is a Monday between Dec 29 and Jan 4.
Sometimes it is in the year before the given year. | [
"Returns",
"the",
"first",
"day",
"of",
"the",
"first",
"week",
"of",
"a",
"year",
".",
"Per",
"ISO",
"-",
"8601",
"it",
"is",
"the",
"Monday",
"of",
"the",
"week",
"that",
"contains",
"Jan",
"4",
"or",
"equivalently",
"it",
"is",
"a",
"Monday",
"bet... | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-table/flink-table-planner-blink/src/main/java/org/apache/calcite/avatica/util/DateTimeUtils.java#L931-L935 | train | Get the first Monday of the first week of the given year. | [
30522,
2797,
10763,
2146,
2034,
11442,
28852,
26989,
12096,
28075,
1006,
20014,
2095,
1007,
1063,
2345,
2146,
5553,
8873,
12096,
1027,
1061,
26876,
3406,
9103,
15204,
1006,
2095,
1010,
1015,
1010,
1015,
1007,
1025,
2345,
2146,
5553,
8873,
1... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
apache/flink | flink-core/src/main/java/org/apache/flink/api/java/typeutils/TypeExtractor.java | TypeExtractor.createHadoopWritableTypeInfo | public static <T> TypeInformation<T> createHadoopWritableTypeInfo(Class<T> clazz) {
checkNotNull(clazz);
Class<?> typeInfoClass;
try {
typeInfoClass = Class.forName(HADOOP_WRITABLE_TYPEINFO_CLASS, false, TypeExtractor.class.getClassLoader());
}
catch (ClassNotFoundException e) {
throw new RuntimeExcept... | java | public static <T> TypeInformation<T> createHadoopWritableTypeInfo(Class<T> clazz) {
checkNotNull(clazz);
Class<?> typeInfoClass;
try {
typeInfoClass = Class.forName(HADOOP_WRITABLE_TYPEINFO_CLASS, false, TypeExtractor.class.getClassLoader());
}
catch (ClassNotFoundException e) {
throw new RuntimeExcept... | [
"public",
"static",
"<",
"T",
">",
"TypeInformation",
"<",
"T",
">",
"createHadoopWritableTypeInfo",
"(",
"Class",
"<",
"T",
">",
"clazz",
")",
"{",
"checkNotNull",
"(",
"clazz",
")",
";",
"Class",
"<",
"?",
">",
"typeInfoClass",
";",
"try",
"{",
"typeIn... | visible for testing | [
"visible",
"for",
"testing"
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-core/src/main/java/org/apache/flink/api/java/typeutils/TypeExtractor.java#L2074-L2099 | train | Creates a Hadoop Writable TypeInformation for the given class. | [
30522,
2270,
10763,
1026,
1056,
1028,
2828,
2378,
14192,
3370,
1026,
1056,
1028,
3443,
16102,
18589,
13088,
6590,
3468,
13874,
2378,
14876,
1006,
2465,
1026,
1056,
1028,
18856,
10936,
2480,
1007,
1063,
4638,
17048,
11231,
3363,
1006,
18856,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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.execute | public static int execute(Connection conn, String sql, Object... params) throws SQLException {
PreparedStatement ps = null;
try {
ps = StatementUtil.prepareStatement(conn, sql, params);
return ps.executeUpdate();
} finally {
DbUtil.close(ps);
}
} | java | public static int execute(Connection conn, String sql, Object... params) throws SQLException {
PreparedStatement ps = null;
try {
ps = StatementUtil.prepareStatement(conn, sql, params);
return ps.executeUpdate();
} finally {
DbUtil.close(ps);
}
} | [
"public",
"static",
"int",
"execute",
"(",
"Connection",
"conn",
",",
"String",
"sql",
",",
"Object",
"...",
"params",
")",
"throws",
"SQLException",
"{",
"PreparedStatement",
"ps",
"=",
"null",
";",
"try",
"{",
"ps",
"=",
"StatementUtil",
".",
"prepareState... | 执行非查询语句<br>
语句包括 插入、更新、删除<br>
此方法不会关闭Connection
@param conn 数据库连接对象
@param sql SQL
@param params 参数
@return 影响的行数
@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#L53-L61 | train | Execute a SQL statement. | [
30522,
2270,
10763,
20014,
15389,
1006,
4434,
9530,
2078,
1010,
5164,
29296,
1010,
4874,
1012,
1012,
1012,
11498,
5244,
1007,
11618,
29296,
10288,
24422,
1063,
4810,
9153,
18532,
4765,
8827,
1027,
19701,
1025,
3046,
1063,
8827,
1027,
4861,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
looly/hutool | hutool-extra/src/main/java/cn/hutool/extra/template/engine/enjoy/EnjoyEngine.java | EnjoyEngine.getTemplate | @Override
public Template getTemplate(String resource) {
if(ObjectUtil.equal(ResourceMode.STRING, this.resourceMode)) {
return EnjoyTemplate.wrap(this.engine.getTemplateByString(resource));
}
return EnjoyTemplate.wrap(this.engine.getTemplate(resource));
} | java | @Override
public Template getTemplate(String resource) {
if(ObjectUtil.equal(ResourceMode.STRING, this.resourceMode)) {
return EnjoyTemplate.wrap(this.engine.getTemplateByString(resource));
}
return EnjoyTemplate.wrap(this.engine.getTemplate(resource));
} | [
"@",
"Override",
"public",
"Template",
"getTemplate",
"(",
"String",
"resource",
")",
"{",
"if",
"(",
"ObjectUtil",
".",
"equal",
"(",
"ResourceMode",
".",
"STRING",
",",
"this",
".",
"resourceMode",
")",
")",
"{",
"return",
"EnjoyTemplate",
".",
"wrap",
"... | --------------------------------------------------------------------------------- Constructor end | [
"---------------------------------------------------------------------------------",
"Constructor",
"end"
] | bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-extra/src/main/java/cn/hutool/extra/template/engine/enjoy/EnjoyEngine.java#L54-L60 | train | Override the method to get the Template object for the given resource. | [
30522,
1030,
2058,
15637,
2270,
23561,
2131,
18532,
15725,
1006,
5164,
7692,
1007,
1063,
2065,
1006,
4874,
21823,
2140,
1012,
5020,
1006,
7692,
5302,
3207,
1012,
5164,
1010,
2023,
1012,
7692,
5302,
3207,
1007,
1007,
1063,
2709,
5959,
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... |
apache/flink | flink-java/src/main/java/org/apache/flink/api/java/ExecutionEnvironment.java | ExecutionEnvironment.fromParallelCollection | public <X> DataSource<X> fromParallelCollection(SplittableIterator<X> iterator, Class<X> type) {
return fromParallelCollection(iterator, TypeExtractor.getForClass(type));
} | java | public <X> DataSource<X> fromParallelCollection(SplittableIterator<X> iterator, Class<X> type) {
return fromParallelCollection(iterator, TypeExtractor.getForClass(type));
} | [
"public",
"<",
"X",
">",
"DataSource",
"<",
"X",
">",
"fromParallelCollection",
"(",
"SplittableIterator",
"<",
"X",
">",
"iterator",
",",
"Class",
"<",
"X",
">",
"type",
")",
"{",
"return",
"fromParallelCollection",
"(",
"iterator",
",",
"TypeExtractor",
".... | Creates a new data set that contains elements in the iterator. The iterator is splittable, allowing the
framework to create a parallel data source that returns the elements in the iterator.
<p>Because the iterator will remain unmodified until the actual execution happens, the type of data
returned by the iterator must... | [
"Creates",
"a",
"new",
"data",
"set",
"that",
"contains",
"elements",
"in",
"the",
"iterator",
".",
"The",
"iterator",
"is",
"splittable",
"allowing",
"the",
"framework",
"to",
"create",
"a",
"parallel",
"data",
"source",
"that",
"returns",
"the",
"elements",
... | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-java/src/main/java/org/apache/flink/api/java/ExecutionEnvironment.java#L760-L762 | train | Creates a DataSource from a parallel collection of data sources. | [
30522,
2270,
1026,
1060,
1028,
2951,
6499,
3126,
3401,
1026,
1060,
1028,
2013,
28689,
6216,
22499,
6216,
7542,
1006,
3975,
10880,
21646,
8844,
1026,
1060,
1028,
2009,
6906,
4263,
1010,
2465,
1026,
1060,
1028,
2828,
1007,
1063,
2709,
2013,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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-http/src/main/java/cn/hutool/http/webservice/SoapClient.java | SoapClient.setCharset | public SoapClient setCharset(Charset charset) {
this.charset = charset;
try {
this.message.setProperty(SOAPMessage.CHARACTER_SET_ENCODING, this.charset.toString());
this.message.setProperty(SOAPMessage.WRITE_XML_DECLARATION, "true");
} catch (SOAPException e) {
// ignore
}
return this;
... | java | public SoapClient setCharset(Charset charset) {
this.charset = charset;
try {
this.message.setProperty(SOAPMessage.CHARACTER_SET_ENCODING, this.charset.toString());
this.message.setProperty(SOAPMessage.WRITE_XML_DECLARATION, "true");
} catch (SOAPException e) {
// ignore
}
return this;
... | [
"public",
"SoapClient",
"setCharset",
"(",
"Charset",
"charset",
")",
"{",
"this",
".",
"charset",
"=",
"charset",
";",
"try",
"{",
"this",
".",
"message",
".",
"setProperty",
"(",
"SOAPMessage",
".",
"CHARACTER_SET_ENCODING",
",",
"this",
".",
"charset",
".... | 设置编码
@param charset 编码
@return this | [
"设置编码"
] | bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-http/src/main/java/cn/hutool/http/webservice/SoapClient.java#L147-L157 | train | Sets the character set encoding for the SOAP message. | [
30522,
2270,
7815,
20464,
11638,
2275,
7507,
22573,
2102,
1006,
25869,
13462,
25869,
13462,
1007,
1063,
30524,
1006,
7815,
7834,
3736,
3351,
1012,
2839,
1035,
2275,
1035,
17181,
1010,
2023,
1012,
25869,
13462,
1012,
2000,
3367,
4892,
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/resourcemanager/slotmanager/SlotManager.java | SlotManager.registerSlot | private void registerSlot(
SlotID slotId,
AllocationID allocationId,
JobID jobId,
ResourceProfile resourceProfile,
TaskExecutorConnection taskManagerConnection) {
if (slots.containsKey(slotId)) {
// remove the old slot first
removeSlot(slotId);
}
final TaskManagerSlot slot = createAndRegist... | java | private void registerSlot(
SlotID slotId,
AllocationID allocationId,
JobID jobId,
ResourceProfile resourceProfile,
TaskExecutorConnection taskManagerConnection) {
if (slots.containsKey(slotId)) {
// remove the old slot first
removeSlot(slotId);
}
final TaskManagerSlot slot = createAndRegist... | [
"private",
"void",
"registerSlot",
"(",
"SlotID",
"slotId",
",",
"AllocationID",
"allocationId",
",",
"JobID",
"jobId",
",",
"ResourceProfile",
"resourceProfile",
",",
"TaskExecutorConnection",
"taskManagerConnection",
")",
"{",
"if",
"(",
"slots",
".",
"containsKey",... | Registers a slot for the given task manager at the slot manager. The slot is identified by
the given slot id. The given resource profile defines the available resources for the slot.
The task manager connection can be used to communicate with the task manager.
@param slotId identifying the slot on the task manager
@pa... | [
"Registers",
"a",
"slot",
"for",
"the",
"given",
"task",
"manager",
"at",
"the",
"slot",
"manager",
".",
"The",
"slot",
"is",
"identified",
"by",
"the",
"given",
"slot",
"id",
".",
"The",
"given",
"resource",
"profile",
"defines",
"the",
"available",
"reso... | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/resourcemanager/slotmanager/SlotManager.java#L538-L573 | train | Registers a slot with the TaskManager. | [
30522,
2797,
11675,
18687,
10994,
1006,
10453,
3593,
10453,
3593,
1010,
16169,
3593,
16169,
3593,
1010,
3105,
3593,
3105,
3593,
1010,
7692,
21572,
8873,
2571,
7692,
21572,
8873,
2571,
1010,
4708,
10288,
8586,
16161,
29566,
10087,
7542,
4708,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
apache/flink | flink-table/flink-table-runtime-blink/src/main/java/org/apache/flink/table/dataformat/BinaryString.java | BinaryString.contains | public boolean contains(final BinaryString substring) {
ensureMaterialized();
substring.ensureMaterialized();
if (substring.sizeInBytes == 0) {
return true;
}
int find = SegmentsUtil.find(
segments, offset, sizeInBytes,
substring.segments, substring.offset, substring.sizeInBytes);
return find != -1... | java | public boolean contains(final BinaryString substring) {
ensureMaterialized();
substring.ensureMaterialized();
if (substring.sizeInBytes == 0) {
return true;
}
int find = SegmentsUtil.find(
segments, offset, sizeInBytes,
substring.segments, substring.offset, substring.sizeInBytes);
return find != -1... | [
"public",
"boolean",
"contains",
"(",
"final",
"BinaryString",
"substring",
")",
"{",
"ensureMaterialized",
"(",
")",
";",
"substring",
".",
"ensureMaterialized",
"(",
")",
";",
"if",
"(",
"substring",
".",
"sizeInBytes",
"==",
"0",
")",
"{",
"return",
"true... | Returns whether this contains `substring` or not.
Same to like '%substring%'. | [
"Returns",
"whether",
"this",
"contains",
"substring",
"or",
"not",
".",
"Same",
"to",
"like",
"%substring%",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-table/flink-table-runtime-blink/src/main/java/org/apache/flink/table/dataformat/BinaryString.java#L550-L560 | train | Checks if this string contains the substring. | [
30522,
2270,
22017,
20898,
3397,
1006,
2345,
12441,
3367,
4892,
4942,
3367,
4892,
1007,
1063,
5676,
8585,
14482,
3550,
1006,
1007,
1025,
4942,
3367,
4892,
1012,
5676,
8585,
14482,
3550,
1006,
1007,
1025,
2065,
1006,
4942,
3367,
4892,
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/lang/Assert.java | Assert.isNull | public static void isNull(Object object, String errorMsgTemplate, Object... params) throws IllegalArgumentException {
if (object != null) {
throw new IllegalArgumentException(StrUtil.format(errorMsgTemplate, params));
}
} | java | public static void isNull(Object object, String errorMsgTemplate, Object... params) throws IllegalArgumentException {
if (object != null) {
throw new IllegalArgumentException(StrUtil.format(errorMsgTemplate, params));
}
} | [
"public",
"static",
"void",
"isNull",
"(",
"Object",
"object",
",",
"String",
"errorMsgTemplate",
",",
"Object",
"...",
"params",
")",
"throws",
"IllegalArgumentException",
"{",
"if",
"(",
"object",
"!=",
"null",
")",
"{",
"throw",
"new",
"IllegalArgumentExcepti... | 断言对象是否为{@code null} ,如果不为{@code null} 抛出{@link IllegalArgumentException} 异常
<pre class="code">
Assert.isNull(value, "The value must be null");
</pre>
@param object 被检查的对象
@param errorMsgTemplate 消息模板,变量使用{}表示
@param params 参数列表
@throws IllegalArgumentException if the object is not {@code null} | [
"断言对象是否为",
"{",
"@code",
"null",
"}",
",如果不为",
"{",
"@code",
"null",
"}",
"抛出",
"{",
"@link",
"IllegalArgumentException",
"}",
"异常"
] | bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/lang/Assert.java#L95-L99 | train | Checks if object is null. | [
30522,
2270,
10763,
11675,
3475,
18083,
1006,
4874,
4874,
1010,
5164,
7561,
5244,
13512,
6633,
15725,
1010,
4874,
1012,
1012,
1012,
11498,
5244,
1007,
11618,
6206,
2906,
22850,
15781,
2595,
24422,
1063,
2065,
1006,
4874,
999,
1027,
19701,
1... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
looly/hutool | hutool-db/src/main/java/cn/hutool/db/DaoTemplate.java | DaoTemplate.del | public <T> int del(Entity where) throws SQLException {
if (CollectionUtil.isEmpty(where)) {
return 0;
}
return db.del(fixEntity(where));
} | java | public <T> int del(Entity where) throws SQLException {
if (CollectionUtil.isEmpty(where)) {
return 0;
}
return db.del(fixEntity(where));
} | [
"public",
"<",
"T",
">",
"int",
"del",
"(",
"Entity",
"where",
")",
"throws",
"SQLException",
"{",
"if",
"(",
"CollectionUtil",
".",
"isEmpty",
"(",
"where",
")",
")",
"{",
"return",
"0",
";",
"}",
"return",
"db",
".",
"del",
"(",
"fixEntity",
"(",
... | 删除
@param <T> 主键类型
@param where 删除条件,当条件为空时,返回0(防止误删全表)
@return 删除行数
@throws SQLException SQL执行异常 | [
"删除"
] | bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-db/src/main/java/cn/hutool/db/DaoTemplate.java#L152-L157 | train | Delete an entity from the database. | [
30522,
2270,
1026,
1056,
1028,
20014,
3972,
1006,
9178,
2073,
1007,
11618,
29296,
30524,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
netty/netty | codec-http2/src/main/java/io/netty/handler/codec/http2/Http2ConnectionHandler.java | Http2ConnectionHandler.onHttpClientUpgrade | public void onHttpClientUpgrade() throws Http2Exception {
if (connection().isServer()) {
throw connectionError(PROTOCOL_ERROR, "Client-side HTTP upgrade requested for a server");
}
if (!prefaceSent()) {
// If the preface was not sent yet it most likely means the handler w... | java | public void onHttpClientUpgrade() throws Http2Exception {
if (connection().isServer()) {
throw connectionError(PROTOCOL_ERROR, "Client-side HTTP upgrade requested for a server");
}
if (!prefaceSent()) {
// If the preface was not sent yet it most likely means the handler w... | [
"public",
"void",
"onHttpClientUpgrade",
"(",
")",
"throws",
"Http2Exception",
"{",
"if",
"(",
"connection",
"(",
")",
".",
"isServer",
"(",
")",
")",
"{",
"throw",
"connectionError",
"(",
"PROTOCOL_ERROR",
",",
"\"Client-side HTTP upgrade requested for a server\"",
... | Handles the client-side (cleartext) upgrade from HTTP to HTTP/2.
Reserves local stream 1 for the HTTP/2 response. | [
"Handles",
"the",
"client",
"-",
"side",
"(",
"cleartext",
")",
"upgrade",
"from",
"HTTP",
"to",
"HTTP",
"/",
"2",
".",
"Reserves",
"local",
"stream",
"1",
"for",
"the",
"HTTP",
"/",
"2",
"response",
"."
] | ba06eafa1c1824bd154f1a380019e7ea2edf3c4c | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/codec-http2/src/main/java/io/netty/handler/codec/http2/Http2ConnectionHandler.java#L143-L158 | train | Called when an HTTP upgrade is received. | [
30522,
2270,
11675,
2006,
11039,
25856,
20464,
11638,
6279,
24170,
1006,
1007,
11618,
8299,
2475,
10288,
24422,
1063,
2065,
1006,
4434,
1006,
1007,
1012,
26354,
2121,
6299,
1006,
1007,
1007,
1063,
5466,
4434,
2121,
29165,
1006,
8778,
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... |
apache/flink | flink-runtime/src/main/java/org/apache/flink/runtime/state/SharedStateRegistry.java | SharedStateRegistry.registerReference | public Result registerReference(SharedStateRegistryKey registrationKey, StreamStateHandle state) {
Preconditions.checkNotNull(state);
StreamStateHandle scheduledStateDeletion = null;
SharedStateRegistry.SharedStateEntry entry;
synchronized (registeredStates) {
Preconditions.checkState(open, "Attempt to r... | java | public Result registerReference(SharedStateRegistryKey registrationKey, StreamStateHandle state) {
Preconditions.checkNotNull(state);
StreamStateHandle scheduledStateDeletion = null;
SharedStateRegistry.SharedStateEntry entry;
synchronized (registeredStates) {
Preconditions.checkState(open, "Attempt to r... | [
"public",
"Result",
"registerReference",
"(",
"SharedStateRegistryKey",
"registrationKey",
",",
"StreamStateHandle",
"state",
")",
"{",
"Preconditions",
".",
"checkNotNull",
"(",
"state",
")",
";",
"StreamStateHandle",
"scheduledStateDeletion",
"=",
"null",
";",
"Shared... | Register a reference to the given shared state in the registry.
This does the following: We check if the state handle is actually new by the
registrationKey. If it is new, we register it with a reference count of 1. If there is
already a state handle registered under the given key, we dispose the given "new" state
hand... | [
"Register",
"a",
"reference",
"to",
"the",
"given",
"shared",
"state",
"in",
"the",
"registry",
".",
"This",
"does",
"the",
"following",
":",
"We",
"check",
"if",
"the",
"state",
"handle",
"is",
"actually",
"new",
"by",
"the",
"registrationKey",
".",
"If",... | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/state/SharedStateRegistry.java#L85-L123 | train | Registers a reference to a shared state. | [
30522,
2270,
2765,
4236,
2890,
25523,
1006,
4207,
9153,
3334,
13910,
2923,
2854,
14839,
8819,
14839,
1010,
9199,
12259,
11774,
2571,
2110,
1007,
1063,
3653,
8663,
20562,
30524,
4443,
1025,
25549,
1006,
5068,
9153,
4570,
1007,
1063,
3653,
86... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
netty/netty | resolver-dns/src/main/java/io/netty/resolver/dns/DnsNameResolver.java | DnsNameResolver.doResolveAll | protected void doResolveAll(String inetHost,
DnsRecord[] additionals,
Promise<List<InetAddress>> promise,
DnsCache resolveCache) throws Exception {
if (inetHost == null || inetHost.isEmpty()) {
// If an e... | java | protected void doResolveAll(String inetHost,
DnsRecord[] additionals,
Promise<List<InetAddress>> promise,
DnsCache resolveCache) throws Exception {
if (inetHost == null || inetHost.isEmpty()) {
// If an e... | [
"protected",
"void",
"doResolveAll",
"(",
"String",
"inetHost",
",",
"DnsRecord",
"[",
"]",
"additionals",
",",
"Promise",
"<",
"List",
"<",
"InetAddress",
">",
">",
"promise",
",",
"DnsCache",
"resolveCache",
")",
"throws",
"Exception",
"{",
"if",
"(",
"ine... | Hook designed for extensibility so one can pass a different cache on each resolution attempt
instead of using the global one. | [
"Hook",
"designed",
"for",
"extensibility",
"so",
"one",
"can",
"pass",
"a",
"different",
"cache",
"on",
"each",
"resolution",
"attempt",
"instead",
"of",
"using",
"the",
"global",
"one",
"."
] | ba06eafa1c1824bd154f1a380019e7ea2edf3c4c | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/resolver-dns/src/main/java/io/netty/resolver/dns/DnsNameResolver.java#L932-L959 | train | Resolve all the dns records. | [
30522,
5123,
11675,
2079,
6072,
4747,
3726,
8095,
1006,
5164,
1999,
11031,
14122,
1010,
1040,
3619,
2890,
27108,
2094,
1031,
1033,
3176,
2015,
1010,
4872,
1026,
2862,
1026,
1999,
12928,
14141,
8303,
1028,
1028,
4872,
1010,
1040,
3619,
3540,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
apache/spark | sql/hive-thriftserver/src/gen/java/org/apache/hive/service/cli/thrift/TByteColumn.java | TByteColumn.isSet | public boolean isSet(_Fields field) {
if (field == null) {
throw new IllegalArgumentException();
}
switch (field) {
case VALUES:
return isSetValues();
case NULLS:
return isSetNulls();
}
throw new IllegalStateException();
} | java | public boolean isSet(_Fields field) {
if (field == null) {
throw new IllegalArgumentException();
}
switch (field) {
case VALUES:
return isSetValues();
case NULLS:
return isSetNulls();
}
throw new IllegalStateException();
} | [
"public",
"boolean",
"isSet",
"(",
"_Fields",
"field",
")",
"{",
"if",
"(",
"field",
"==",
"null",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
")",
";",
"}",
"switch",
"(",
"field",
")",
"{",
"case",
"VALUES",
":",
"return",
"isSetValues",... | Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise | [
"Returns",
"true",
"if",
"field",
"corresponding",
"to",
"fieldID",
"is",
"set",
"(",
"has",
"been",
"assigned",
"a",
"value",
")",
"and",
"false",
"otherwise"
] | 25ee0474f47d9c30d6f553a7892d9549f91071cf | https://github.com/apache/spark/blob/25ee0474f47d9c30d6f553a7892d9549f91071cf/sql/hive-thriftserver/src/gen/java/org/apache/hive/service/cli/thrift/TByteColumn.java#L266-L278 | train | Checks if field is set to a value of a CRA S Grammar. | [
30522,
2270,
22017,
20898,
26354,
3388,
1006,
1035,
4249,
2492,
1007,
1063,
2065,
1006,
2492,
1027,
1027,
19701,
1007,
1063,
5466,
2047,
6206,
2906,
22850,
15781,
2595,
24422,
1006,
1007,
1025,
1065,
6942,
1006,
2492,
1007,
1063,
2553,
5300... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
apache/flink | flink-table/flink-table-runtime-blink/src/main/java/org/apache/flink/table/util/SegmentsUtil.java | SegmentsUtil.getBytes | public static byte[] getBytes(MemorySegment[] segments, int baseOffset, int sizeInBytes) {
// avoid copy if `base` is `byte[]`
if (segments.length == 1) {
byte[] heapMemory = segments[0].getHeapMemory();
if (baseOffset == 0
&& heapMemory != null
&& heapMemory.length == sizeInBytes) {
return heapMe... | java | public static byte[] getBytes(MemorySegment[] segments, int baseOffset, int sizeInBytes) {
// avoid copy if `base` is `byte[]`
if (segments.length == 1) {
byte[] heapMemory = segments[0].getHeapMemory();
if (baseOffset == 0
&& heapMemory != null
&& heapMemory.length == sizeInBytes) {
return heapMe... | [
"public",
"static",
"byte",
"[",
"]",
"getBytes",
"(",
"MemorySegment",
"[",
"]",
"segments",
",",
"int",
"baseOffset",
",",
"int",
"sizeInBytes",
")",
"{",
"// avoid copy if `base` is `byte[]`",
"if",
"(",
"segments",
".",
"length",
"==",
"1",
")",
"{",
"by... | Maybe not copied, if want copy, please use copyTo. | [
"Maybe",
"not",
"copied",
"if",
"want",
"copy",
"please",
"use",
"copyTo",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-table/flink-table-runtime-blink/src/main/java/org/apache/flink/table/util/SegmentsUtil.java#L284-L302 | train | Get the bytes from the given segments. | [
30522,
2270,
10763,
24880,
1031,
1033,
2131,
3762,
4570,
1006,
3638,
3366,
21693,
4765,
1031,
1033,
9214,
1010,
20014,
2918,
27475,
3388,
1010,
20014,
2946,
2378,
3762,
4570,
1007,
1063,
1013,
1013,
4468,
6100,
2065,
1036,
2918,
1036,
2003,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/TransportFrameDecoder.java | TransportFrameDecoder.nextBufferForFrame | private ByteBuf nextBufferForFrame(int bytesToRead) {
ByteBuf buf = buffers.getFirst();
ByteBuf frame;
if (buf.readableBytes() > bytesToRead) {
frame = buf.retain().readSlice(bytesToRead);
totalSize -= bytesToRead;
} else {
frame = buf;
buffers.removeFirst();
totalSize -= ... | java | private ByteBuf nextBufferForFrame(int bytesToRead) {
ByteBuf buf = buffers.getFirst();
ByteBuf frame;
if (buf.readableBytes() > bytesToRead) {
frame = buf.retain().readSlice(bytesToRead);
totalSize -= bytesToRead;
} else {
frame = buf;
buffers.removeFirst();
totalSize -= ... | [
"private",
"ByteBuf",
"nextBufferForFrame",
"(",
"int",
"bytesToRead",
")",
"{",
"ByteBuf",
"buf",
"=",
"buffers",
".",
"getFirst",
"(",
")",
";",
"ByteBuf",
"frame",
";",
"if",
"(",
"buf",
".",
"readableBytes",
"(",
")",
">",
"bytesToRead",
")",
"{",
"f... | Takes the first buffer in the internal list, and either adjust it to fit in the frame
(by taking a slice out of it) or remove it from the internal list. | [
"Takes",
"the",
"first",
"buffer",
"in",
"the",
"internal",
"list",
"and",
"either",
"adjust",
"it",
"to",
"fit",
"in",
"the",
"frame",
"(",
"by",
"taking",
"a",
"slice",
"out",
"of",
"it",
")",
"or",
"remove",
"it",
"from",
"the",
"internal",
"list",
... | 25ee0474f47d9c30d6f553a7892d9549f91071cf | https://github.com/apache/spark/blob/25ee0474f47d9c30d6f553a7892d9549f91071cf/common/network-common/src/main/java/org/apache/spark/network/util/TransportFrameDecoder.java#L200-L214 | train | Returns the next frame of the buffer that contains the specified number of bytes. | [
30522,
2797,
24880,
8569,
2546,
2279,
8569,
12494,
29278,
15643,
1006,
20014,
27507,
19277,
4215,
1007,
1063,
24880,
8569,
30524,
1012,
9631,
13231,
1006,
27507,
19277,
4215,
1007,
1025,
21948,
4697,
1011,
1027,
27507,
19277,
4215,
1025,
1065... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
hankcs/HanLP | src/main/java/com/hankcs/hanlp/collection/dartsclone/DoubleArray.java | DoubleArray.build | public void build(byte[][] keys, int[] values)
{
Keyset keyset = new Keyset(keys, values);
DoubleArrayBuilder builder = new DoubleArrayBuilder();
builder.build(keyset);
_array = builder.copy();
} | java | public void build(byte[][] keys, int[] values)
{
Keyset keyset = new Keyset(keys, values);
DoubleArrayBuilder builder = new DoubleArrayBuilder();
builder.build(keyset);
_array = builder.copy();
} | [
"public",
"void",
"build",
"(",
"byte",
"[",
"]",
"[",
"]",
"keys",
",",
"int",
"[",
"]",
"values",
")",
"{",
"Keyset",
"keyset",
"=",
"new",
"Keyset",
"(",
"keys",
",",
"values",
")",
";",
"DoubleArrayBuilder",
"builder",
"=",
"new",
"DoubleArrayBuild... | 构建
@param keys 字节形式的键
@param values 值 | [
"构建"
] | a538d0722ab2e4980a9dcd9ea40324fc3ddba7ce | https://github.com/hankcs/HanLP/blob/a538d0722ab2e4980a9dcd9ea40324fc3ddba7ce/src/main/java/com/hankcs/hanlp/collection/dartsclone/DoubleArray.java#L32-L39 | train | Build a single record set from the given keys and values. | [
30522,
2270,
11675,
3857,
1006,
24880,
1031,
1033,
1031,
1033,
6309,
1010,
20014,
1031,
1033,
5300,
1007,
1063,
6309,
30524,
1007,
1025,
3313,
2906,
9447,
8569,
23891,
2099,
12508,
1027,
2047,
3313,
2906,
9447,
8569,
23891,
2099,
1006,
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-poi/src/main/java/cn/hutool/poi/excel/ExcelBase.java | ExcelBase.getOrCreateCellStyle | public CellStyle getOrCreateCellStyle(int x, int y) {
final Cell cell = getOrCreateCell(x, y);
CellStyle cellStyle = cell.getCellStyle();
if (null == cellStyle) {
cellStyle = this.workbook.createCellStyle();
cell.setCellStyle(cellStyle);
}
return cellStyle;
} | java | public CellStyle getOrCreateCellStyle(int x, int y) {
final Cell cell = getOrCreateCell(x, y);
CellStyle cellStyle = cell.getCellStyle();
if (null == cellStyle) {
cellStyle = this.workbook.createCellStyle();
cell.setCellStyle(cellStyle);
}
return cellStyle;
} | [
"public",
"CellStyle",
"getOrCreateCellStyle",
"(",
"int",
"x",
",",
"int",
"y",
")",
"{",
"final",
"Cell",
"cell",
"=",
"getOrCreateCell",
"(",
"x",
",",
"y",
")",
";",
"CellStyle",
"cellStyle",
"=",
"cell",
".",
"getCellStyle",
"(",
")",
";",
"if",
"... | 为指定单元格获取或者创建样式,返回样式后可以设置样式内容
@param x X坐标,从0计数,既列号
@param y Y坐标,从0计数,既行号
@return {@link CellStyle}
@since 4.1.4 | [
"为指定单元格获取或者创建样式,返回样式后可以设置样式内容"
] | bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-poi/src/main/java/cn/hutool/poi/excel/ExcelBase.java#L199-L207 | train | Gets the cell style of the specified coordinates. | [
30522,
2270,
4442,
27983,
2131,
2953,
16748,
3686,
29109,
4877,
27983,
1006,
20014,
1060,
1010,
20014,
1061,
1007,
1063,
2345,
3526,
3526,
1027,
2131,
2953,
16748,
3686,
29109,
2140,
1006,
1060,
1010,
1061,
1007,
1025,
4442,
27983,
4442,
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... |
apache/flink | flink-streaming-java/src/main/java/org/apache/flink/streaming/api/datastream/AllWindowedStream.java | AllWindowedStream.min | public SingleOutputStreamOperator<T> min(String field) {
return aggregate(new ComparableAggregator<>(field, input.getType(), AggregationFunction.AggregationType.MIN, false, input.getExecutionConfig()));
} | java | public SingleOutputStreamOperator<T> min(String field) {
return aggregate(new ComparableAggregator<>(field, input.getType(), AggregationFunction.AggregationType.MIN, false, input.getExecutionConfig()));
} | [
"public",
"SingleOutputStreamOperator",
"<",
"T",
">",
"min",
"(",
"String",
"field",
")",
"{",
"return",
"aggregate",
"(",
"new",
"ComparableAggregator",
"<>",
"(",
"field",
",",
"input",
".",
"getType",
"(",
")",
",",
"AggregationFunction",
".",
"Aggregation... | Applies an aggregation that that gives the minimum value of the pojo data
stream at the given field expression for every window.
<p>A field expression is either the name of a public field or a getter method with
parentheses of the {@link DataStream}S underlying type. A dot can be used to drill down into
objects, as in... | [
"Applies",
"an",
"aggregation",
"that",
"that",
"gives",
"the",
"minimum",
"value",
"of",
"the",
"pojo",
"data",
"stream",
"at",
"the",
"given",
"field",
"expression",
"for",
"every",
"window",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-streaming-java/src/main/java/org/apache/flink/streaming/api/datastream/AllWindowedStream.java#L1419-L1421 | train | Applies an aggregation that aggregates values by comparing their field values to the minimum value of the stream. | [
30522,
2270,
2309,
5833,
18780,
21422,
25918,
8844,
1026,
1056,
1028,
8117,
1006,
5164,
2492,
1007,
1063,
2709,
9572,
1006,
2047,
12435,
8490,
17603,
20697,
2953,
1026,
1028,
1006,
2492,
1010,
7953,
1012,
2131,
13874,
1006,
1007,
1010,
2804... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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.readUtf8Lines | public static void readUtf8Lines(InputStream in, LineHandler lineHandler) throws IORuntimeException {
readLines(in, CharsetUtil.CHARSET_UTF_8, lineHandler);
} | java | public static void readUtf8Lines(InputStream in, LineHandler lineHandler) throws IORuntimeException {
readLines(in, CharsetUtil.CHARSET_UTF_8, lineHandler);
} | [
"public",
"static",
"void",
"readUtf8Lines",
"(",
"InputStream",
"in",
",",
"LineHandler",
"lineHandler",
")",
"throws",
"IORuntimeException",
"{",
"readLines",
"(",
"in",
",",
"CharsetUtil",
".",
"CHARSET_UTF_8",
",",
"lineHandler",
")",
";",
"}"
] | 按行读取UTF-8编码数据,针对每行的数据做处理
@param in {@link InputStream}
@param lineHandler 行处理接口,实现handle方法用于编辑一行的数据后入到指定地方
@throws IORuntimeException IO异常
@since 3.1.1 | [
"按行读取UTF",
"-",
"8编码数据,针对每行的数据做处理"
] | bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/io/IoUtil.java#L689-L691 | train | Reads the UTF - 8 lines from the given input stream. | [
30522,
2270,
10763,
11675,
3191,
4904,
2546,
2620,
12735,
1006,
20407,
25379,
1999,
1010,
2240,
11774,
3917,
2240,
11774,
3917,
1007,
11618,
22834,
15532,
7292,
10288,
24422,
1063,
3191,
12735,
1006,
1999,
1010,
25869,
13462,
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... |
apache/incubator-shardingsphere | sharding-transaction/sharding-transaction-core/src/main/java/org/apache/shardingsphere/transaction/ShardingTransactionManagerEngine.java | ShardingTransactionManagerEngine.close | public void close() throws Exception {
for (Entry<TransactionType, ShardingTransactionManager> entry : transactionManagerMap.entrySet()) {
entry.getValue().close();
}
} | java | public void close() throws Exception {
for (Entry<TransactionType, ShardingTransactionManager> entry : transactionManagerMap.entrySet()) {
entry.getValue().close();
}
} | [
"public",
"void",
"close",
"(",
")",
"throws",
"Exception",
"{",
"for",
"(",
"Entry",
"<",
"TransactionType",
",",
"ShardingTransactionManager",
">",
"entry",
":",
"transactionManagerMap",
".",
"entrySet",
"(",
")",
")",
"{",
"entry",
".",
"getValue",
"(",
"... | Close sharding transaction managers.
@throws Exception exception | [
"Close",
"sharding",
"transaction",
"managers",
"."
] | f88fd29fc345dfb31fdce12e9e96cbfa0fd2402d | https://github.com/apache/incubator-shardingsphere/blob/f88fd29fc345dfb31fdce12e9e96cbfa0fd2402d/sharding-transaction/sharding-transaction-core/src/main/java/org/apache/shardingsphere/transaction/ShardingTransactionManagerEngine.java#L103-L107 | train | Close all sharding transaction managers. | [
30522,
2270,
11675,
2485,
1006,
1007,
11618,
6453,
1063,
2005,
1006,
4443,
1026,
12598,
13874,
1010,
21146,
17080,
3070,
6494,
3619,
18908,
3258,
24805,
4590,
1028,
4443,
1024,
12598,
24805,
4590,
2863,
2361,
1012,
4443,
13462,
1006,
1007,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
apache/flink | flink-java/src/main/java/org/apache/flink/api/java/DataSet.java | DataSet.rightOuterJoin | public <R> JoinOperatorSetsBase<T, R> rightOuterJoin(DataSet<R> other) {
return new JoinOperatorSetsBase<>(this, other, JoinHint.OPTIMIZER_CHOOSES, JoinType.RIGHT_OUTER);
} | java | public <R> JoinOperatorSetsBase<T, R> rightOuterJoin(DataSet<R> other) {
return new JoinOperatorSetsBase<>(this, other, JoinHint.OPTIMIZER_CHOOSES, JoinType.RIGHT_OUTER);
} | [
"public",
"<",
"R",
">",
"JoinOperatorSetsBase",
"<",
"T",
",",
"R",
">",
"rightOuterJoin",
"(",
"DataSet",
"<",
"R",
">",
"other",
")",
"{",
"return",
"new",
"JoinOperatorSetsBase",
"<>",
"(",
"this",
",",
"other",
",",
"JoinHint",
".",
"OPTIMIZER_CHOOSES... | Initiates a Right Outer Join transformation.
<p>An Outer Join transformation joins two elements of two
{@link DataSet DataSets} on key equality and provides multiple ways to combine
joining elements into one DataSet.
<p>Elements of the <b>right</b> DataSet (i.e. {@code other}) that do not have a matching
element on {... | [
"Initiates",
"a",
"Right",
"Outer",
"Join",
"transformation",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-java/src/main/java/org/apache/flink/api/java/DataSet.java#L895-L897 | train | Create a JoinOperatorSetsBase for the right outer join of this DataSet and other DataSet. | [
30522,
2270,
1026,
1054,
1028,
3693,
25918,
18926,
8454,
15058,
1026,
1056,
1010,
1054,
1028,
2157,
5833,
2121,
5558,
2378,
1006,
2951,
13462,
1026,
1054,
1028,
2060,
1007,
1063,
2709,
2047,
3693,
25918,
18926,
8454,
15058,
1026,
1028,
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/bean/BeanUtil.java | BeanUtil.getBeanDesc | public static BeanDesc getBeanDesc(Class<?> clazz) {
BeanDesc beanDesc = BeanDescCache.INSTANCE.getBeanDesc(clazz);
if (null == beanDesc) {
beanDesc = new BeanDesc(clazz);
BeanDescCache.INSTANCE.putBeanDesc(clazz, beanDesc);
}
return beanDesc;
} | java | public static BeanDesc getBeanDesc(Class<?> clazz) {
BeanDesc beanDesc = BeanDescCache.INSTANCE.getBeanDesc(clazz);
if (null == beanDesc) {
beanDesc = new BeanDesc(clazz);
BeanDescCache.INSTANCE.putBeanDesc(clazz, beanDesc);
}
return beanDesc;
} | [
"public",
"static",
"BeanDesc",
"getBeanDesc",
"(",
"Class",
"<",
"?",
">",
"clazz",
")",
"{",
"BeanDesc",
"beanDesc",
"=",
"BeanDescCache",
".",
"INSTANCE",
".",
"getBeanDesc",
"(",
"clazz",
")",
";",
"if",
"(",
"null",
"==",
"beanDesc",
")",
"{",
"bean... | 获取{@link BeanDesc} Bean描述信息
@param clazz Bean类
@return {@link BeanDesc}
@since 3.1.2 | [
"获取",
"{",
"@link",
"BeanDesc",
"}",
"Bean描述信息"
] | bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/bean/BeanUtil.java#L151-L158 | train | Gets the BeanDesc for the given class. | [
30522,
2270,
10763,
14068,
6155,
2278,
2131,
4783,
5685,
2229,
2278,
1006,
2465,
1026,
1029,
30524,
1063,
14068,
6155,
2278,
14068,
6155,
2278,
1027,
14068,
6155,
16665,
5403,
1012,
6013,
1012,
2131,
4783,
5685,
2229,
2278,
1006,
18856,
109... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
netty/netty | resolver-dns/src/main/java/io/netty/resolver/dns/DnsNameResolver.java | DnsNameResolver.resolveAll | public final Future<List<InetAddress>> resolveAll(String inetHost, Iterable<DnsRecord> additionals) {
return resolveAll(inetHost, additionals, executor().<List<InetAddress>>newPromise());
} | java | public final Future<List<InetAddress>> resolveAll(String inetHost, Iterable<DnsRecord> additionals) {
return resolveAll(inetHost, additionals, executor().<List<InetAddress>>newPromise());
} | [
"public",
"final",
"Future",
"<",
"List",
"<",
"InetAddress",
">",
">",
"resolveAll",
"(",
"String",
"inetHost",
",",
"Iterable",
"<",
"DnsRecord",
">",
"additionals",
")",
"{",
"return",
"resolveAll",
"(",
"inetHost",
",",
"additionals",
",",
"executor",
"(... | Resolves the specified host name and port into a list of address.
@param inetHost the name to resolve
@param additionals additional records ({@code OPT})
@return the list of the address as the result of the resolution | [
"Resolves",
"the",
"specified",
"host",
"name",
"and",
"port",
"into",
"a",
"list",
"of",
"address",
"."
] | ba06eafa1c1824bd154f1a380019e7ea2edf3c4c | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/resolver-dns/src/main/java/io/netty/resolver/dns/DnsNameResolver.java#L670-L672 | train | Resolves all dns records from the given IP address. | [
30522,
2270,
2345,
2925,
1026,
2862,
1026,
1999,
12928,
14141,
8303,
1028,
1028,
10663,
8095,
1006,
5164,
1999,
11031,
14122,
1010,
2009,
6906,
3468,
1026,
1040,
3619,
2890,
27108,
2094,
1028,
3176,
2015,
1007,
1063,
30524,
1010,
4654,
8586... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
apache/spark | sql/hive-thriftserver/src/gen/java/org/apache/hive/service/cli/thrift/TRowSet.java | TRowSet.isSet | public boolean isSet(_Fields field) {
if (field == null) {
throw new IllegalArgumentException();
}
switch (field) {
case START_ROW_OFFSET:
return isSetStartRowOffset();
case ROWS:
return isSetRows();
case COLUMNS:
return isSetColumns();
}
throw new IllegalStateEx... | java | public boolean isSet(_Fields field) {
if (field == null) {
throw new IllegalArgumentException();
}
switch (field) {
case START_ROW_OFFSET:
return isSetStartRowOffset();
case ROWS:
return isSetRows();
case COLUMNS:
return isSetColumns();
}
throw new IllegalStateEx... | [
"public",
"boolean",
"isSet",
"(",
"_Fields",
"field",
")",
"{",
"if",
"(",
"field",
"==",
"null",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
")",
";",
"}",
"switch",
"(",
"field",
")",
"{",
"case",
"START_ROW_OFFSET",
":",
"return",
"isS... | Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise | [
"Returns",
"true",
"if",
"field",
"corresponding",
"to",
"fieldID",
"is",
"set",
"(",
"has",
"been",
"assigned",
"a",
"value",
")",
"and",
"false",
"otherwise"
] | 25ee0474f47d9c30d6f553a7892d9549f91071cf | https://github.com/apache/spark/blob/25ee0474f47d9c30d6f553a7892d9549f91071cf/sql/hive-thriftserver/src/gen/java/org/apache/hive/service/cli/thrift/TRowSet.java#L324-L338 | train | Checks if the specified field is set to a value of a CRA S Grammar. | [
30522,
2270,
22017,
20898,
26354,
3388,
1006,
1035,
4249,
2492,
1007,
1063,
2065,
1006,
2492,
1027,
1027,
19701,
1007,
1063,
5466,
2047,
6206,
2906,
22850,
15781,
2595,
24422,
1006,
1007,
1025,
1065,
6942,
1006,
2492,
1007,
1063,
2553,
2707... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
hankcs/HanLP | src/main/java/com/hankcs/hanlp/dictionary/CoreSynonymDictionary.java | CoreSynonymDictionary.similarity | public static double similarity(String A, String B)
{
long distance = distance(A, B);
if (distance > dictionary.getMaxSynonymItemIdDistance()) return 0.0;
return (dictionary.getMaxSynonymItemIdDistance() - distance) / (double) dictionary.getMaxSynonymItemIdDistance();
} | java | public static double similarity(String A, String B)
{
long distance = distance(A, B);
if (distance > dictionary.getMaxSynonymItemIdDistance()) return 0.0;
return (dictionary.getMaxSynonymItemIdDistance() - distance) / (double) dictionary.getMaxSynonymItemIdDistance();
} | [
"public",
"static",
"double",
"similarity",
"(",
"String",
"A",
",",
"String",
"B",
")",
"{",
"long",
"distance",
"=",
"distance",
"(",
"A",
",",
"B",
")",
";",
"if",
"(",
"distance",
">",
"dictionary",
".",
"getMaxSynonymItemIdDistance",
"(",
")",
")",
... | 计算两个单词之间的相似度,0表示不相似,1表示完全相似
@param A
@param B
@return | [
"计算两个单词之间的相似度,0表示不相似,1表示完全相似"
] | a538d0722ab2e4980a9dcd9ea40324fc3ddba7ce | https://github.com/hankcs/HanLP/blob/a538d0722ab2e4980a9dcd9ea40324fc3ddba7ce/src/main/java/com/hankcs/hanlp/dictionary/CoreSynonymDictionary.java#L104-L110 | train | Returns the similarity of two words. | [
30522,
2270,
10763,
3313,
14402,
1006,
5164,
1037,
1010,
5164,
1038,
1007,
1063,
2146,
3292,
1027,
3292,
1006,
1037,
1010,
1038,
1007,
1025,
2065,
1006,
3292,
1028,
9206,
1012,
2131,
17848,
6508,
8540,
24335,
4221,
4328,
14141,
23137,
3401,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
networknt/light-4j | security/src/main/java/com/networknt/security/JwtIssuer.java | JwtIssuer.getJwt | public static String getJwt(JwtClaims claims) throws JoseException {
String jwt;
RSAPrivateKey privateKey = (RSAPrivateKey) getPrivateKey(
jwtConfig.getKey().getFilename(), (String)secretConfig.get(JWT_PRIVATE_KEY_PASSWORD), jwtConfig.getKey().getKeyName());
// A JWT is a JWS an... | java | public static String getJwt(JwtClaims claims) throws JoseException {
String jwt;
RSAPrivateKey privateKey = (RSAPrivateKey) getPrivateKey(
jwtConfig.getKey().getFilename(), (String)secretConfig.get(JWT_PRIVATE_KEY_PASSWORD), jwtConfig.getKey().getKeyName());
// A JWT is a JWS an... | [
"public",
"static",
"String",
"getJwt",
"(",
"JwtClaims",
"claims",
")",
"throws",
"JoseException",
"{",
"String",
"jwt",
";",
"RSAPrivateKey",
"privateKey",
"=",
"(",
"RSAPrivateKey",
")",
"getPrivateKey",
"(",
"jwtConfig",
".",
"getKey",
"(",
")",
".",
"getF... | A static method that generate JWT token from JWT claims object
@param claims JwtClaims object
@return A string represents jwt token
@throws JoseException JoseException | [
"A",
"static",
"method",
"that",
"generate",
"JWT",
"token",
"from",
"JWT",
"claims",
"object"
] | 2a60257c60663684c8f6dc8b5ea3cf184e534db6 | https://github.com/networknt/light-4j/blob/2a60257c60663684c8f6dc8b5ea3cf184e534db6/security/src/main/java/com/networknt/security/JwtIssuer.java#L53-L92 | train | Returns the JWT for the given claims | [
30522,
2270,
10763,
5164,
2131,
3501,
26677,
1006,
1046,
26677,
25154,
2015,
4447,
1007,
11618,
4560,
10288,
24422,
1063,
5164,
1046,
26677,
1025,
12667,
9331,
3089,
16952,
14839,
2797,
14839,
1027,
1006,
12667,
9331,
3089,
16952,
14839,
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... |
netty/netty | codec-http/src/main/java/io/netty/handler/codec/http/multipart/HttpPostRequestEncoder.java | HttpPostRequestEncoder.addBodyHttpData | public void addBodyHttpData(InterfaceHttpData data) throws ErrorDataEncoderException {
if (headerFinalized) {
throw new ErrorDataEncoderException("Cannot add value once finalized");
}
bodyListDatas.add(checkNotNull(data, "data"));
if (!isMultipart) {
if (data inst... | java | public void addBodyHttpData(InterfaceHttpData data) throws ErrorDataEncoderException {
if (headerFinalized) {
throw new ErrorDataEncoderException("Cannot add value once finalized");
}
bodyListDatas.add(checkNotNull(data, "data"));
if (!isMultipart) {
if (data inst... | [
"public",
"void",
"addBodyHttpData",
"(",
"InterfaceHttpData",
"data",
")",
"throws",
"ErrorDataEncoderException",
"{",
"if",
"(",
"headerFinalized",
")",
"{",
"throw",
"new",
"ErrorDataEncoderException",
"(",
"\"Cannot add value once finalized\"",
")",
";",
"}",
"bodyL... | Add the InterfaceHttpData to the Body list
@throws NullPointerException
for data
@throws ErrorDataEncoderException
if the encoding is in error or if the finalize were already done | [
"Add",
"the",
"InterfaceHttpData",
"to",
"the",
"Body",
"list"
] | ba06eafa1c1824bd154f1a380019e7ea2edf3c4c | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/codec-http/src/main/java/io/netty/handler/codec/http/multipart/HttpPostRequestEncoder.java#L447-L720 | train | Add a body data to the response. | [
30522,
2270,
11675,
5587,
23684,
11039,
25856,
2850,
2696,
1006,
8278,
11039,
25856,
2850,
2696,
2951,
1007,
11618,
7561,
2850,
2696,
2368,
16044,
2890,
2595,
24422,
1063,
2065,
1006,
20346,
16294,
11475,
5422,
1007,
1063,
5466,
2047,
7561,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
apache/flink | flink-table/flink-table-runtime-blink/src/main/java/org/apache/flink/table/util/SegmentsUtil.java | SegmentsUtil.getFloat | public static float getFloat(MemorySegment[] segments, int offset) {
if (inFirstSegment(segments, offset, 4)) {
return segments[0].getFloat(offset);
} else {
return getFloatMultiSegments(segments, offset);
}
} | java | public static float getFloat(MemorySegment[] segments, int offset) {
if (inFirstSegment(segments, offset, 4)) {
return segments[0].getFloat(offset);
} else {
return getFloatMultiSegments(segments, offset);
}
} | [
"public",
"static",
"float",
"getFloat",
"(",
"MemorySegment",
"[",
"]",
"segments",
",",
"int",
"offset",
")",
"{",
"if",
"(",
"inFirstSegment",
"(",
"segments",
",",
"offset",
",",
"4",
")",
")",
"{",
"return",
"segments",
"[",
"0",
"]",
".",
"getFlo... | get float from segments.
@param segments target segments.
@param offset value offset. | [
"get",
"float",
"from",
"segments",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-table/flink-table-runtime-blink/src/main/java/org/apache/flink/table/util/SegmentsUtil.java#L852-L858 | train | get float from segments. | [
30522,
2270,
10763,
14257,
2131,
10258,
16503,
1006,
3638,
3366,
21693,
4765,
1031,
1033,
9214,
1010,
20014,
16396,
1007,
1063,
2065,
1006,
1999,
8873,
12096,
3366,
21693,
4765,
1006,
9214,
1010,
16396,
1010,
1018,
1007,
1007,
1063,
2709,
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-connectors/flink-connector-kafka-0.11/src/main/java/org/apache/flink/streaming/connectors/kafka/internal/FlinkKafkaProducer.java | FlinkKafkaProducer.flushNewPartitions | private void flushNewPartitions() {
LOG.info("Flushing new partitions");
TransactionalRequestResult result = enqueueNewPartitions();
Object sender = getValue(kafkaProducer, "sender");
invoke(sender, "wakeup");
result.await();
} | java | private void flushNewPartitions() {
LOG.info("Flushing new partitions");
TransactionalRequestResult result = enqueueNewPartitions();
Object sender = getValue(kafkaProducer, "sender");
invoke(sender, "wakeup");
result.await();
} | [
"private",
"void",
"flushNewPartitions",
"(",
")",
"{",
"LOG",
".",
"info",
"(",
"\"Flushing new partitions\"",
")",
";",
"TransactionalRequestResult",
"result",
"=",
"enqueueNewPartitions",
"(",
")",
";",
"Object",
"sender",
"=",
"getValue",
"(",
"kafkaProducer",
... | Besides committing {@link org.apache.kafka.clients.producer.KafkaProducer#commitTransaction} is also adding new
partitions to the transaction. flushNewPartitions method is moving this logic to pre-commit/flush, to make
resumeTransaction simpler. Otherwise resumeTransaction would require to restore state of the not yet ... | [
"Besides",
"committing",
"{"
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-connectors/flink-connector-kafka-0.11/src/main/java/org/apache/flink/streaming/connectors/kafka/internal/FlinkKafkaProducer.java#L243-L249 | train | Flush all new partitions. | [
30522,
2797,
11675,
13862,
2638,
2860,
19362,
3775,
9285,
1006,
1007,
1063,
8833,
1012,
18558,
1006,
1000,
23519,
2047,
13571,
2015,
1000,
1007,
1025,
12598,
2389,
2890,
15500,
6072,
11314,
2765,
1027,
4372,
4226,
24997,
7974,
19362,
3775,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
apache/flink | flink-core/src/main/java/org/apache/flink/api/java/typeutils/ObjectArrayTypeInfo.java | ObjectArrayTypeInfo.getInfoFor | @PublicEvolving
public static <T, C> ObjectArrayTypeInfo<T, C> getInfoFor(Class<T> arrayClass, TypeInformation<C> componentInfo) {
checkNotNull(arrayClass);
checkNotNull(componentInfo);
checkArgument(arrayClass.isArray(), "Class " + arrayClass + " must be an array.");
return new ObjectArrayTypeInfo<T, C>(arra... | java | @PublicEvolving
public static <T, C> ObjectArrayTypeInfo<T, C> getInfoFor(Class<T> arrayClass, TypeInformation<C> componentInfo) {
checkNotNull(arrayClass);
checkNotNull(componentInfo);
checkArgument(arrayClass.isArray(), "Class " + arrayClass + " must be an array.");
return new ObjectArrayTypeInfo<T, C>(arra... | [
"@",
"PublicEvolving",
"public",
"static",
"<",
"T",
",",
"C",
">",
"ObjectArrayTypeInfo",
"<",
"T",
",",
"C",
">",
"getInfoFor",
"(",
"Class",
"<",
"T",
">",
"arrayClass",
",",
"TypeInformation",
"<",
"C",
">",
"componentInfo",
")",
"{",
"checkNotNull",
... | -------------------------------------------------------------------------------------------- | [
"--------------------------------------------------------------------------------------------"
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-core/src/main/java/org/apache/flink/api/java/typeutils/ObjectArrayTypeInfo.java#L130-L137 | train | Gets the type information for an object array type. | [
30522,
1030,
2270,
6777,
4747,
6455,
2270,
10763,
1026,
1056,
1010,
1039,
1028,
4874,
2906,
9447,
13874,
2378,
14876,
1026,
1056,
1010,
1039,
1028,
2131,
2378,
14876,
29278,
1006,
2465,
1026,
1056,
1028,
9140,
26266,
1010,
2828,
2378,
14192... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
netty/netty | transport-native-epoll/src/main/java/io/netty/channel/epoll/EpollSocketChannelConfig.java | EpollSocketChannelConfig.setTcpCork | public EpollSocketChannelConfig setTcpCork(boolean tcpCork) {
try {
((EpollSocketChannel) channel).socket.setTcpCork(tcpCork);
return this;
} catch (IOException e) {
throw new ChannelException(e);
}
} | java | public EpollSocketChannelConfig setTcpCork(boolean tcpCork) {
try {
((EpollSocketChannel) channel).socket.setTcpCork(tcpCork);
return this;
} catch (IOException e) {
throw new ChannelException(e);
}
} | [
"public",
"EpollSocketChannelConfig",
"setTcpCork",
"(",
"boolean",
"tcpCork",
")",
"{",
"try",
"{",
"(",
"(",
"EpollSocketChannel",
")",
"channel",
")",
".",
"socket",
".",
"setTcpCork",
"(",
"tcpCork",
")",
";",
"return",
"this",
";",
"}",
"catch",
"(",
... | Set the {@code TCP_CORK} option on the socket. See {@code man 7 tcp} for more details. | [
"Set",
"the",
"{"
] | ba06eafa1c1824bd154f1a380019e7ea2edf3c4c | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/transport-native-epoll/src/main/java/io/netty/channel/epoll/EpollSocketChannelConfig.java#L388-L395 | train | Sets the TCP cork flag. | [
30522,
2270,
4958,
14511,
6499,
19869,
10649,
20147,
22499,
2078,
8873,
2290,
2275,
13535,
15042,
2953,
2243,
1006,
22017,
20898,
22975,
15042,
2953,
2243,
1007,
1063,
3046,
1063,
1006,
1006,
4958,
14511,
6499,
19869,
10649,
20147,
2140,
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-table/flink-table-api-java/src/main/java/org/apache/flink/table/catalog/GenericInMemoryCatalog.java | GenericInMemoryCatalog.validatePartitionedTable | private CatalogTable validatePartitionedTable(ObjectPath tablePath)
throws TableNotExistException, TableNotPartitionedException {
CatalogBaseTable baseTable = getTable(tablePath);
if (!(baseTable instanceof CatalogTable)) {
throw new CatalogException(
String.format("%s in Catalog %s is not a CatalogTable... | java | private CatalogTable validatePartitionedTable(ObjectPath tablePath)
throws TableNotExistException, TableNotPartitionedException {
CatalogBaseTable baseTable = getTable(tablePath);
if (!(baseTable instanceof CatalogTable)) {
throw new CatalogException(
String.format("%s in Catalog %s is not a CatalogTable... | [
"private",
"CatalogTable",
"validatePartitionedTable",
"(",
"ObjectPath",
"tablePath",
")",
"throws",
"TableNotExistException",
",",
"TableNotPartitionedException",
"{",
"CatalogBaseTable",
"baseTable",
"=",
"getTable",
"(",
"tablePath",
")",
";",
"if",
"(",
"!",
"(",
... | Validate the partitioned table. | [
"Validate",
"the",
"partitioned",
"table",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-table/flink-table-api-java/src/main/java/org/apache/flink/table/catalog/GenericInMemoryCatalog.java#L493-L510 | train | Validate the partitioned table. | [
30522,
2797,
12105,
10880,
9398,
3686,
19362,
3775,
3508,
2098,
10880,
1006,
4874,
15069,
2795,
15069,
1007,
11618,
2795,
22074,
9048,
13473,
2595,
24422,
1010,
2795,
17048,
19362,
3775,
3508,
14728,
2595,
24422,
1063,
12105,
15058,
10880,
29... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
looly/hutool | hutool-core/src/main/java/cn/hutool/core/date/DateUtil.java | DateUtil.formatBetween | public static String formatBetween(Date beginDate, Date endDate) {
return formatBetween(between(beginDate, endDate, DateUnit.MS));
} | java | public static String formatBetween(Date beginDate, Date endDate) {
return formatBetween(between(beginDate, endDate, DateUnit.MS));
} | [
"public",
"static",
"String",
"formatBetween",
"(",
"Date",
"beginDate",
",",
"Date",
"endDate",
")",
"{",
"return",
"formatBetween",
"(",
"between",
"(",
"beginDate",
",",
"endDate",
",",
"DateUnit",
".",
"MS",
")",
")",
";",
"}"
] | 格式化日期间隔输出,精确到毫秒
@param beginDate 起始日期
@param endDate 结束日期
@return XX天XX小时XX分XX秒
@since 3.0.1 | [
"格式化日期间隔输出,精确到毫秒"
] | bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/date/DateUtil.java#L1330-L1332 | train | Formats a date range in MS - notation. | [
30522,
2270,
10763,
5164,
4289,
20915,
28394,
2078,
1006,
3058,
4088,
13701,
1010,
3058,
2203,
13701,
1007,
1063,
2709,
4289,
20915,
28394,
2078,
1006,
2090,
1006,
4088,
13701,
1010,
2203,
13701,
1010,
3058,
19496,
2102,
1012,
5796,
1007,
1... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
apache/flink | flink-table/flink-table-api-java/src/main/java/org/apache/flink/table/operations/OperationExpressionsUtils.java | OperationExpressionsUtils.extractNames | public static List<Optional<String>> extractNames(List<Expression> expressions) {
return expressions.stream().map(OperationExpressionsUtils::extractName).collect(Collectors.toList());
} | java | public static List<Optional<String>> extractNames(List<Expression> expressions) {
return expressions.stream().map(OperationExpressionsUtils::extractName).collect(Collectors.toList());
} | [
"public",
"static",
"List",
"<",
"Optional",
"<",
"String",
">",
">",
"extractNames",
"(",
"List",
"<",
"Expression",
">",
"expressions",
")",
"{",
"return",
"expressions",
".",
"stream",
"(",
")",
".",
"map",
"(",
"OperationExpressionsUtils",
"::",
"extract... | Extracts names from given expressions if they have one. Expressions that have names are:
<ul>
<li>{@link FieldReferenceExpression}</li>
<li>{@link TableReferenceExpression}</li>
<li>{@link LocalReferenceExpression}</li>
<li>{@link org.apache.flink.table.expressions.BuiltInFunctionDefinitions#AS}</li>
</ul>
@param expr... | [
"Extracts",
"names",
"from",
"given",
"expressions",
"if",
"they",
"have",
"one",
".",
"Expressions",
"that",
"have",
"names",
"are",
":",
"<ul",
">",
"<li",
">",
"{",
"@link",
"FieldReferenceExpression",
"}",
"<",
"/",
"li",
">",
"<li",
">",
"{",
"@link... | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-table/flink-table-api-java/src/main/java/org/apache/flink/table/operations/OperationExpressionsUtils.java#L124-L126 | train | Extract names from a list of expressions. | [
30522,
2270,
10763,
2862,
1026,
11887,
1026,
5164,
1028,
1028,
14817,
18442,
2015,
1006,
2862,
1026,
3670,
1028,
11423,
1007,
1063,
2709,
11423,
1012,
5460,
1006,
1007,
1012,
4949,
1006,
3169,
10288,
20110,
8496,
21823,
4877,
1024,
1024,
14... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
apache/flink | flink-streaming-java/src/main/java/org/apache/flink/streaming/api/datastream/DataStream.java | DataStream.partitionCustom | public <K> DataStream<T> partitionCustom(Partitioner<K> partitioner, KeySelector<T, K> keySelector) {
return setConnectionType(new CustomPartitionerWrapper<>(clean(partitioner),
clean(keySelector)));
} | java | public <K> DataStream<T> partitionCustom(Partitioner<K> partitioner, KeySelector<T, K> keySelector) {
return setConnectionType(new CustomPartitionerWrapper<>(clean(partitioner),
clean(keySelector)));
} | [
"public",
"<",
"K",
">",
"DataStream",
"<",
"T",
">",
"partitionCustom",
"(",
"Partitioner",
"<",
"K",
">",
"partitioner",
",",
"KeySelector",
"<",
"T",
",",
"K",
">",
"keySelector",
")",
"{",
"return",
"setConnectionType",
"(",
"new",
"CustomPartitionerWrap... | Partitions a DataStream on the key returned by the selector, using a custom partitioner.
This method takes the key selector to get the key to partition on, and a partitioner that
accepts the key type.
<p>Note: This method works only on single field keys, i.e. the selector cannot return tuples
of fields.
@param partit... | [
"Partitions",
"a",
"DataStream",
"on",
"the",
"key",
"returned",
"by",
"the",
"selector",
"using",
"a",
"custom",
"partitioner",
".",
"This",
"method",
"takes",
"the",
"key",
"selector",
"to",
"get",
"the",
"key",
"to",
"partition",
"on",
"and",
"a",
"part... | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-streaming-java/src/main/java/org/apache/flink/streaming/api/datastream/DataStream.java#L391-L394 | train | Partition a DataStream using a custom partitioner and key selector. | [
30522,
2270,
1026,
1047,
1028,
2951,
21422,
1026,
1056,
1028,
13571,
7874,
20389,
1006,
13571,
2121,
1026,
1047,
1028,
13571,
2121,
1010,
6309,
12260,
16761,
1026,
1056,
1010,
1047,
1028,
6309,
12260,
16761,
1007,
1063,
2709,
2275,
8663,
26... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
apache/flink | flink-java/src/main/java/org/apache/flink/api/java/utils/ParameterTool.java | ParameterTool.get | public String get(String key, String defaultValue) {
addToDefaults(key, defaultValue);
String value = get(key);
if (value == null) {
return defaultValue;
} else {
return value;
}
} | java | public String get(String key, String defaultValue) {
addToDefaults(key, defaultValue);
String value = get(key);
if (value == null) {
return defaultValue;
} else {
return value;
}
} | [
"public",
"String",
"get",
"(",
"String",
"key",
",",
"String",
"defaultValue",
")",
"{",
"addToDefaults",
"(",
"key",
",",
"defaultValue",
")",
";",
"String",
"value",
"=",
"get",
"(",
"key",
")",
";",
"if",
"(",
"value",
"==",
"null",
")",
"{",
"re... | Returns the String value for the given key.
If the key does not exist it will return the given default value. | [
"Returns",
"the",
"String",
"value",
"for",
"the",
"given",
"key",
".",
"If",
"the",
"key",
"does",
"not",
"exist",
"it",
"will",
"return",
"the",
"given",
"default",
"value",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-java/src/main/java/org/apache/flink/api/java/utils/ParameterTool.java#L260-L268 | train | Get the value for the given key. | [
30522,
2270,
5164,
2131,
1006,
5164,
3145,
1010,
5164,
12398,
10175,
5657,
1007,
1063,
5587,
3406,
3207,
7011,
11314,
2015,
1006,
3145,
1010,
12398,
10175,
5657,
1007,
1025,
5164,
3643,
1027,
2131,
1006,
3145,
1007,
1025,
2065,
1006,
3643,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
looly/hutool | hutool-crypto/src/main/java/cn/hutool/crypto/BCUtil.java | BCUtil.decodeECPoint | public static PublicKey decodeECPoint(byte[] encodeByte, String curveName) {
final ECNamedCurveParameterSpec namedSpec = ECNamedCurveTable.getParameterSpec(curveName);
final ECCurve curve = namedSpec.getCurve();
final EllipticCurve ecCurve = new EllipticCurve(//
new ECFieldFp(curve.getField().getCharacter... | java | public static PublicKey decodeECPoint(byte[] encodeByte, String curveName) {
final ECNamedCurveParameterSpec namedSpec = ECNamedCurveTable.getParameterSpec(curveName);
final ECCurve curve = namedSpec.getCurve();
final EllipticCurve ecCurve = new EllipticCurve(//
new ECFieldFp(curve.getField().getCharacter... | [
"public",
"static",
"PublicKey",
"decodeECPoint",
"(",
"byte",
"[",
"]",
"encodeByte",
",",
"String",
"curveName",
")",
"{",
"final",
"ECNamedCurveParameterSpec",
"namedSpec",
"=",
"ECNamedCurveTable",
".",
"getParameterSpec",
"(",
"curveName",
")",
";",
"final",
... | 解码恢复EC压缩公钥,支持Base64和Hex编码,(基于BouncyCastle)<br>
见:https://www.cnblogs.com/xinzhao/p/8963724.html
@param encodeByte 压缩公钥
@param curveName EC曲线名,例如{@link KeyUtil#SM2_DEFAULT_CURVE}
@since 4.4.4 | [
"解码恢复EC压缩公钥",
"支持Base64和Hex编码",
"(基于BouncyCastle)<br",
">",
"见:https",
":",
"//",
"www",
".",
"cnblogs",
".",
"com",
"/",
"xinzhao",
"/",
"p",
"/",
"8963724",
".",
"html"
] | bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-crypto/src/main/java/cn/hutool/crypto/BCUtil.java#L70-L89 | train | Decodes an EC point from a byte array. | [
30522,
2270,
10763,
2270,
14839,
21933,
26095,
21906,
25785,
1006,
24880,
1031,
1033,
4372,
16044,
3762,
2618,
1010,
5164,
7774,
18442,
1007,
1063,
2345,
14925,
18442,
16409,
3126,
3726,
28689,
22828,
13102,
8586,
2315,
13102,
8586,
1027,
149... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/concurrent/FutureUtils.java | FutureUtils.supplyAsync | public static <T> CompletableFuture<T> supplyAsync(SupplierWithException<T, ?> supplier, Executor executor) {
return CompletableFuture.supplyAsync(
() -> {
try {
return supplier.get();
} catch (Throwable e) {
throw new CompletionException(e);
}
},
executor);
} | java | public static <T> CompletableFuture<T> supplyAsync(SupplierWithException<T, ?> supplier, Executor executor) {
return CompletableFuture.supplyAsync(
() -> {
try {
return supplier.get();
} catch (Throwable e) {
throw new CompletionException(e);
}
},
executor);
} | [
"public",
"static",
"<",
"T",
">",
"CompletableFuture",
"<",
"T",
">",
"supplyAsync",
"(",
"SupplierWithException",
"<",
"T",
",",
"?",
">",
"supplier",
",",
"Executor",
"executor",
")",
"{",
"return",
"CompletableFuture",
".",
"supplyAsync",
"(",
"(",
")",
... | Returns a future which is completed with the result of the {@link SupplierWithException}.
@param supplier to provide the future's value
@param executor to execute the supplier
@param <T> type of the result
@return Future which is completed with the value of the supplier | [
"Returns",
"a",
"future",
"which",
"is",
"completed",
"with",
"the",
"result",
"of",
"the",
"{",
"@link",
"SupplierWithException",
"}",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/concurrent/FutureUtils.java#L764-L774 | train | Supply a CompletableFuture that is asynchronously completed with an exception. | [
30522,
2270,
10763,
1026,
1056,
1028,
4012,
10814,
10880,
11263,
11244,
1026,
1056,
1028,
4425,
3022,
6038,
2278,
1006,
17024,
24415,
10288,
24422,
1026,
1056,
1010,
1029,
1028,
17024,
1010,
4654,
8586,
16161,
2099,
4654,
8586,
16161,
2099,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
apache/spark | common/network-shuffle/src/main/java/org/apache/spark/network/shuffle/OneForOneBlockFetcher.java | OneForOneBlockFetcher.failRemainingBlocks | private void failRemainingBlocks(String[] failedBlockIds, Throwable e) {
for (String blockId : failedBlockIds) {
try {
listener.onBlockFetchFailure(blockId, e);
} catch (Exception e2) {
logger.error("Error in block fetch failure callback", e2);
}
}
} | java | private void failRemainingBlocks(String[] failedBlockIds, Throwable e) {
for (String blockId : failedBlockIds) {
try {
listener.onBlockFetchFailure(blockId, e);
} catch (Exception e2) {
logger.error("Error in block fetch failure callback", e2);
}
}
} | [
"private",
"void",
"failRemainingBlocks",
"(",
"String",
"[",
"]",
"failedBlockIds",
",",
"Throwable",
"e",
")",
"{",
"for",
"(",
"String",
"blockId",
":",
"failedBlockIds",
")",
"{",
"try",
"{",
"listener",
".",
"onBlockFetchFailure",
"(",
"blockId",
",",
"... | Invokes the "onBlockFetchFailure" callback for every listed block id. | [
"Invokes",
"the",
"onBlockFetchFailure",
"callback",
"for",
"every",
"listed",
"block",
"id",
"."
] | 25ee0474f47d9c30d6f553a7892d9549f91071cf | https://github.com/apache/spark/blob/25ee0474f47d9c30d6f553a7892d9549f91071cf/common/network-shuffle/src/main/java/org/apache/spark/network/shuffle/OneForOneBlockFetcher.java#L145-L153 | train | Fail remaining blocks. | [
30522,
2797,
11675,
8246,
28578,
8113,
2075,
23467,
2015,
1006,
5164,
1031,
1033,
3478,
23467,
9821,
1010,
5466,
3085,
1041,
1007,
1063,
2005,
1006,
5164,
3796,
3593,
1024,
3478,
23467,
9821,
1007,
1063,
3046,
1063,
19373,
1012,
2006,
23467... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
looly/hutool | hutool-core/src/main/java/cn/hutool/core/util/ReflectUtil.java | ReflectUtil.getMethodByNameIgnoreCase | public static Method getMethodByNameIgnoreCase(Class<?> clazz, String methodName) throws SecurityException {
return getMethodByName(clazz, true, methodName);
} | java | public static Method getMethodByNameIgnoreCase(Class<?> clazz, String methodName) throws SecurityException {
return getMethodByName(clazz, true, methodName);
} | [
"public",
"static",
"Method",
"getMethodByNameIgnoreCase",
"(",
"Class",
"<",
"?",
">",
"clazz",
",",
"String",
"methodName",
")",
"throws",
"SecurityException",
"{",
"return",
"getMethodByName",
"(",
"clazz",
",",
"true",
",",
"methodName",
")",
";",
"}"
] | 按照方法名查找指定方法名的方法,只返回匹配到的第一个方法,如果找不到对应的方法则返回<code>null</code>
<p>
此方法只检查方法名是否一致(忽略大小写),并不检查参数的一致性。
</p>
@param clazz 类,如果为{@code null}返回{@code null}
@param methodName 方法名,如果为空字符串返回{@code null}
@return 方法
@throws SecurityException 无权访问抛出异常
@since 4.3.2 | [
"按照方法名查找指定方法名的方法,只返回匹配到的第一个方法,如果找不到对应的方法则返回<code",
">",
"null<",
"/",
"code",
">"
] | bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/util/ReflectUtil.java#L498-L500 | train | Get a Method object by name ignoring case. | [
30522,
2270,
10763,
4118,
2131,
11368,
6806,
18939,
18279,
26432,
26745,
2890,
18382,
1006,
2465,
1026,
1029,
1028,
18856,
10936,
2480,
1010,
5164,
4118,
18442,
1007,
11618,
3036,
10288,
24422,
1063,
2709,
2131,
11368,
6806,
18939,
18279,
416... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/thread/ThreadUtil.java | ThreadUtil.newThread | public static Thread newThread(Runnable runnable, String name, boolean isDeamon) {
final Thread t = new Thread(null, runnable, name);
t.setDaemon(isDeamon);
return t;
} | java | public static Thread newThread(Runnable runnable, String name, boolean isDeamon) {
final Thread t = new Thread(null, runnable, name);
t.setDaemon(isDeamon);
return t;
} | [
"public",
"static",
"Thread",
"newThread",
"(",
"Runnable",
"runnable",
",",
"String",
"name",
",",
"boolean",
"isDeamon",
")",
"{",
"final",
"Thread",
"t",
"=",
"new",
"Thread",
"(",
"null",
",",
"runnable",
",",
"name",
")",
";",
"t",
".",
"setDaemon",... | 创建新线程
@param runnable {@link Runnable}
@param name 线程名
@param isDeamon 是否守护线程
@return {@link Thread}
@since 4.1.2 | [
"创建新线程"
] | bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/thread/ThreadUtil.java#L196-L200 | train | Creates a new thread with the specified name and a Runnable. | [
30522,
2270,
10763,
11689,
25597,
28362,
4215,
1006,
2448,
22966,
2448,
22966,
1010,
5164,
2171,
1010,
22017,
20898,
2003,
3207,
22591,
2078,
1007,
1063,
2345,
11689,
1056,
1027,
2047,
11689,
1006,
19701,
1010,
2448,
22966,
1010,
2171,
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-clients/src/main/java/org/apache/flink/client/cli/CliFrontendParser.java | CliFrontendParser.mergeOptions | public static Options mergeOptions(@Nullable Options optionsA, @Nullable Options optionsB) {
final Options resultOptions = new Options();
if (optionsA != null) {
for (Option option : optionsA.getOptions()) {
resultOptions.addOption(option);
}
}
if (optionsB != null) {
for (Option option : optionsB... | java | public static Options mergeOptions(@Nullable Options optionsA, @Nullable Options optionsB) {
final Options resultOptions = new Options();
if (optionsA != null) {
for (Option option : optionsA.getOptions()) {
resultOptions.addOption(option);
}
}
if (optionsB != null) {
for (Option option : optionsB... | [
"public",
"static",
"Options",
"mergeOptions",
"(",
"@",
"Nullable",
"Options",
"optionsA",
",",
"@",
"Nullable",
"Options",
"optionsB",
")",
"{",
"final",
"Options",
"resultOptions",
"=",
"new",
"Options",
"(",
")",
";",
"if",
"(",
"optionsA",
"!=",
"null",... | Merges the given {@link Options} into a new Options object.
@param optionsA options to merge, can be null if none
@param optionsB options to merge, can be null if none
@return | [
"Merges",
"the",
"given",
"{",
"@link",
"Options",
"}",
"into",
"a",
"new",
"Options",
"object",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-clients/src/main/java/org/apache/flink/client/cli/CliFrontendParser.java#L445-L460 | train | Merges two options. | [
30522,
2270,
10763,
7047,
13590,
7361,
9285,
1006,
1030,
19701,
3085,
7047,
7047,
2050,
1010,
1030,
19701,
3085,
7047,
7047,
2497,
1007,
1063,
2345,
7047,
2765,
7361,
9285,
1027,
2047,
7047,
1006,
1007,
1025,
2065,
1006,
7047,
2050,
999,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
spring-projects/spring-boot | spring-boot-project/spring-boot-cli/src/main/java/org/springframework/boot/cli/command/CommandRunner.java | CommandRunner.runAndHandleErrors | public int runAndHandleErrors(String... args) {
String[] argsWithoutDebugFlags = removeDebugFlags(args);
boolean debug = argsWithoutDebugFlags.length != args.length;
if (debug) {
System.setProperty("debug", "true");
}
try {
ExitStatus result = run(argsWithoutDebugFlags);
// The caller will hang up if... | java | public int runAndHandleErrors(String... args) {
String[] argsWithoutDebugFlags = removeDebugFlags(args);
boolean debug = argsWithoutDebugFlags.length != args.length;
if (debug) {
System.setProperty("debug", "true");
}
try {
ExitStatus result = run(argsWithoutDebugFlags);
// The caller will hang up if... | [
"public",
"int",
"runAndHandleErrors",
"(",
"String",
"...",
"args",
")",
"{",
"String",
"[",
"]",
"argsWithoutDebugFlags",
"=",
"removeDebugFlags",
"(",
"args",
")",
";",
"boolean",
"debug",
"=",
"argsWithoutDebugFlags",
".",
"length",
"!=",
"args",
".",
"len... | Run the appropriate and handle and errors.
@param args the input arguments
@return a return status code (non boot is used to indicate an error) | [
"Run",
"the",
"appropriate",
"and",
"handle",
"and",
"errors",
"."
] | 0b27f7c70e164b2b1a96477f1d9c1acba56790c1 | https://github.com/spring-projects/spring-boot/blob/0b27f7c70e164b2b1a96477f1d9c1acba56790c1/spring-boot-project/spring-boot-cli/src/main/java/org/springframework/boot/cli/command/CommandRunner.java#L164-L185 | train | Run the command and handle errors. | [
30522,
2270,
20014,
2448,
5685,
11774,
10559,
18933,
2869,
1006,
5164,
1012,
1012,
1012,
12098,
5620,
1007,
1063,
5164,
1031,
1033,
12098,
5620,
24415,
5833,
3207,
8569,
25708,
17802,
2015,
1027,
3718,
15878,
15916,
10258,
26454,
1006,
12098,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/Rowtime.java | Rowtime.watermarksPeriodicBounded | public Rowtime watermarksPeriodicBounded(long delay) {
internalProperties.putString(ROWTIME_WATERMARKS_TYPE, ROWTIME_WATERMARKS_TYPE_VALUE_PERIODIC_BOUNDED);
internalProperties.putLong(ROWTIME_WATERMARKS_DELAY, delay);
return this;
} | java | public Rowtime watermarksPeriodicBounded(long delay) {
internalProperties.putString(ROWTIME_WATERMARKS_TYPE, ROWTIME_WATERMARKS_TYPE_VALUE_PERIODIC_BOUNDED);
internalProperties.putLong(ROWTIME_WATERMARKS_DELAY, delay);
return this;
} | [
"public",
"Rowtime",
"watermarksPeriodicBounded",
"(",
"long",
"delay",
")",
"{",
"internalProperties",
".",
"putString",
"(",
"ROWTIME_WATERMARKS_TYPE",
",",
"ROWTIME_WATERMARKS_TYPE_VALUE_PERIODIC_BOUNDED",
")",
";",
"internalProperties",
".",
"putLong",
"(",
"ROWTIME_WAT... | Sets a built-in watermark strategy for rowtime attributes which are out-of-order by a bounded
time interval.
<p>Emits watermarks which are the maximum observed timestamp minus the specified delay.
@param delay delay in milliseconds | [
"Sets",
"a",
"built",
"-",
"in",
"watermark",
"strategy",
"for",
"rowtime",
"attributes",
"which",
"are",
"out",
"-",
"of",
"-",
"order",
"by",
"a",
"bounded",
"time",
"interval",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-table/flink-table-common/src/main/java/org/apache/flink/table/descriptors/Rowtime.java#L110-L114 | train | Sets the watermarks period to be bounded. | [
30522,
2270,
5216,
7292,
2300,
27373,
4842,
3695,
14808,
15494,
2098,
1006,
2146,
8536,
1007,
1063,
4722,
21572,
4842,
7368,
1012,
8509,
18886,
3070,
1006,
5216,
7292,
1035,
2300,
27373,
1035,
2828,
1010,
5216,
7292,
1035,
2300,
27373,
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... |
apache/flink | flink-core/src/main/java/org/apache/flink/api/java/typeutils/TypeExtractor.java | TypeExtractor.getTypeInfoFactory | @Internal
public static <OUT> TypeInfoFactory<OUT> getTypeInfoFactory(Type t) {
final Class<?> factoryClass;
if (registeredTypeInfoFactories.containsKey(t)) {
factoryClass = registeredTypeInfoFactories.get(t);
}
else {
if (!isClassType(t) || !typeToClass(t).isAnnotationPresent(TypeInfo.class)) {
retu... | java | @Internal
public static <OUT> TypeInfoFactory<OUT> getTypeInfoFactory(Type t) {
final Class<?> factoryClass;
if (registeredTypeInfoFactories.containsKey(t)) {
factoryClass = registeredTypeInfoFactories.get(t);
}
else {
if (!isClassType(t) || !typeToClass(t).isAnnotationPresent(TypeInfo.class)) {
retu... | [
"@",
"Internal",
"public",
"static",
"<",
"OUT",
">",
"TypeInfoFactory",
"<",
"OUT",
">",
"getTypeInfoFactory",
"(",
"Type",
"t",
")",
"{",
"final",
"Class",
"<",
"?",
">",
"factoryClass",
";",
"if",
"(",
"registeredTypeInfoFactories",
".",
"containsKey",
"(... | Returns the type information factory for a type using the factory registry or annotations. | [
"Returns",
"the",
"type",
"information",
"factory",
"for",
"a",
"type",
"using",
"the",
"factory",
"registry",
"or",
"annotations",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-core/src/main/java/org/apache/flink/api/java/typeutils/TypeExtractor.java#L1519-L1539 | train | Gets the type info factory. | [
30522,
1030,
4722,
2270,
10763,
1026,
2041,
1028,
2828,
2378,
14876,
21450,
1026,
2041,
1028,
2131,
13874,
2378,
14876,
21450,
1006,
2828,
1056,
1007,
1063,
2345,
2465,
1026,
1029,
1028,
4713,
26266,
1025,
2065,
1006,
5068,
13874,
2378,
148... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
netty/netty | handler/src/main/java/io/netty/handler/ssl/SslContext.java | SslContext.newHandler | public SslHandler newHandler(ByteBufAllocator alloc, Executor delegatedTaskExecutor) {
return newHandler(alloc, startTls, delegatedTaskExecutor);
} | java | public SslHandler newHandler(ByteBufAllocator alloc, Executor delegatedTaskExecutor) {
return newHandler(alloc, startTls, delegatedTaskExecutor);
} | [
"public",
"SslHandler",
"newHandler",
"(",
"ByteBufAllocator",
"alloc",
",",
"Executor",
"delegatedTaskExecutor",
")",
"{",
"return",
"newHandler",
"(",
"alloc",
",",
"startTls",
",",
"delegatedTaskExecutor",
")",
";",
"}"
] | Creates a new {@link SslHandler}.
<p>If {@link SslProvider#OPENSSL_REFCNT} is used then the returned {@link SslHandler} will release the engine
that is wrapped. If the returned {@link SslHandler} is not inserted into a pipeline then you may leak native
memory!
<p><b>Beware</b>: the underlying generated {@link SSLEngine... | [
"Creates",
"a",
"new",
"{"
] | ba06eafa1c1824bd154f1a380019e7ea2edf3c4c | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/handler/src/main/java/io/netty/handler/ssl/SslContext.java#L924-L926 | train | Create a new SslHandler. | [
30522,
2270,
7020,
2140,
11774,
3917,
2047,
11774,
3917,
1006,
24880,
8569,
13976,
24755,
4263,
2035,
10085,
1010,
4654,
8586,
16161,
2099,
11849,
11927,
19895,
10288,
8586,
16161,
2099,
1007,
1063,
2709,
2047,
11774,
3917,
1006,
2035,
10085,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/AbstractUdfOperator.java | AbstractUdfOperator.setBroadcastVariables | public <T> void setBroadcastVariables(Map<String, Operator<T>> inputs) {
this.broadcastInputs.clear();
this.broadcastInputs.putAll(inputs);
} | java | public <T> void setBroadcastVariables(Map<String, Operator<T>> inputs) {
this.broadcastInputs.clear();
this.broadcastInputs.putAll(inputs);
} | [
"public",
"<",
"T",
">",
"void",
"setBroadcastVariables",
"(",
"Map",
"<",
"String",
",",
"Operator",
"<",
"T",
">",
">",
"inputs",
")",
"{",
"this",
".",
"broadcastInputs",
".",
"clear",
"(",
")",
";",
"this",
".",
"broadcastInputs",
".",
"putAll",
"(... | Clears all previous broadcast inputs and binds the given inputs as
broadcast variables of this operator.
@param inputs The {@code<name, root>} pairs to be set as broadcast inputs. | [
"Clears",
"all",
"previous",
"broadcast",
"inputs",
"and",
"binds",
"the",
"given",
"inputs",
"as",
"broadcast",
"variables",
"of",
"this",
"operator",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-core/src/main/java/org/apache/flink/api/common/operators/AbstractUdfOperator.java#L112-L115 | train | Sets the broadcast variables. | [
30522,
2270,
1026,
1056,
1028,
11675,
2275,
12618,
4215,
10526,
10755,
19210,
2015,
1006,
4949,
1026,
5164,
1010,
6872,
1026,
1056,
1028,
1028,
20407,
1007,
1063,
2023,
1012,
3743,
2378,
18780,
2015,
1012,
3154,
1006,
1007,
1025,
2023,
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... |
hankcs/HanLP | src/main/java/com/hankcs/hanlp/corpus/document/sentence/Sentence.java | Sentence.translateCompoundWordLabels | public Sentence translateCompoundWordLabels()
{
for (IWord word : wordList)
{
if (word instanceof CompoundWord)
word.setLabel(PartOfSpeechTagDictionary.translate(word.getLabel()));
}
return this;
} | java | public Sentence translateCompoundWordLabels()
{
for (IWord word : wordList)
{
if (word instanceof CompoundWord)
word.setLabel(PartOfSpeechTagDictionary.translate(word.getLabel()));
}
return this;
} | [
"public",
"Sentence",
"translateCompoundWordLabels",
"(",
")",
"{",
"for",
"(",
"IWord",
"word",
":",
"wordList",
")",
"{",
"if",
"(",
"word",
"instanceof",
"CompoundWord",
")",
"word",
".",
"setLabel",
"(",
"PartOfSpeechTagDictionary",
".",
"translate",
"(",
... | 按照 PartOfSpeechTagDictionary 指定的映射表将复合词词语词性翻译过去
@return | [
"按照",
"PartOfSpeechTagDictionary",
"指定的映射表将复合词词语词性翻译过去"
] | a538d0722ab2e4980a9dcd9ea40324fc3ddba7ce | https://github.com/hankcs/HanLP/blob/a538d0722ab2e4980a9dcd9ea40324fc3ddba7ce/src/main/java/com/hankcs/hanlp/corpus/document/sentence/Sentence.java#L170-L178 | train | Translate the label of the compound words in this sentence. | [
30522,
2270,
6251,
17637,
9006,
6873,
8630,
18351,
20470,
9050,
1006,
1007,
1063,
2005,
1006,
1045,
18351,
2773,
1024,
2773,
9863,
1007,
1063,
2065,
1006,
2773,
6013,
11253,
7328,
18351,
1007,
2773,
1012,
2275,
20470,
2884,
1006,
2112,
1125... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
apache/flink | flink-libraries/flink-gelly/src/main/java/org/apache/flink/graph/Graph.java | Graph.addEdge | public Graph<K, VV, EV> addEdge(Vertex<K, VV> source, Vertex<K, VV> target, EV edgeValue) {
Graph<K, VV, EV> partialGraph = fromCollection(Arrays.asList(source, target),
Collections.singletonList(new Edge<>(source.f0, target.f0, edgeValue)),
this.context);
return this.union(partialGraph);
} | java | public Graph<K, VV, EV> addEdge(Vertex<K, VV> source, Vertex<K, VV> target, EV edgeValue) {
Graph<K, VV, EV> partialGraph = fromCollection(Arrays.asList(source, target),
Collections.singletonList(new Edge<>(source.f0, target.f0, edgeValue)),
this.context);
return this.union(partialGraph);
} | [
"public",
"Graph",
"<",
"K",
",",
"VV",
",",
"EV",
">",
"addEdge",
"(",
"Vertex",
"<",
"K",
",",
"VV",
">",
"source",
",",
"Vertex",
"<",
"K",
",",
"VV",
">",
"target",
",",
"EV",
"edgeValue",
")",
"{",
"Graph",
"<",
"K",
",",
"VV",
",",
"EV"... | Adds the given edge to the graph. If the source and target vertices do
not exist in the graph, they will also be added.
@param source the source vertex of the edge
@param target the target vertex of the edge
@param edgeValue the edge value
@return the new graph containing the existing vertices and edges plus the
newly... | [
"Adds",
"the",
"given",
"edge",
"to",
"the",
"graph",
".",
"If",
"the",
"source",
"and",
"target",
"vertices",
"do",
"not",
"exist",
"in",
"the",
"graph",
"they",
"will",
"also",
"be",
"added",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-libraries/flink-gelly/src/main/java/org/apache/flink/graph/Graph.java#L1415-L1420 | train | Add an edge between two vertices. | [
30522,
2270,
10629,
1026,
1047,
1010,
1058,
2615,
1010,
23408,
1028,
2794,
3351,
1006,
19449,
1026,
1047,
1010,
1058,
2615,
1028,
3120,
1010,
19449,
1026,
1047,
1010,
1058,
2615,
1028,
4539,
1010,
23408,
3341,
10175,
5657,
1007,
1063,
10629... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
spring-projects/spring-boot | spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/jdbc/DataSourceProperties.java | DataSourceProperties.determineUrl | public String determineUrl() {
if (StringUtils.hasText(this.url)) {
return this.url;
}
String databaseName = determineDatabaseName();
String url = (databaseName != null)
? this.embeddedDatabaseConnection.getUrl(databaseName) : null;
if (!StringUtils.hasText(url)) {
throw new DataSourceBeanCreationEx... | java | public String determineUrl() {
if (StringUtils.hasText(this.url)) {
return this.url;
}
String databaseName = determineDatabaseName();
String url = (databaseName != null)
? this.embeddedDatabaseConnection.getUrl(databaseName) : null;
if (!StringUtils.hasText(url)) {
throw new DataSourceBeanCreationEx... | [
"public",
"String",
"determineUrl",
"(",
")",
"{",
"if",
"(",
"StringUtils",
".",
"hasText",
"(",
"this",
".",
"url",
")",
")",
"{",
"return",
"this",
".",
"url",
";",
"}",
"String",
"databaseName",
"=",
"determineDatabaseName",
"(",
")",
";",
"String",
... | Determine the url to use based on this configuration and the environment.
@return the url to use
@since 1.4.0 | [
"Determine",
"the",
"url",
"to",
"use",
"based",
"on",
"this",
"configuration",
"and",
"the",
"environment",
"."
] | 0b27f7c70e164b2b1a96477f1d9c1acba56790c1 | https://github.com/spring-projects/spring-boot/blob/0b27f7c70e164b2b1a96477f1d9c1acba56790c1/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/jdbc/DataSourceProperties.java#L275-L288 | train | Determine the url to use for the jdbc connection. | [
30522,
2270,
5164,
5646,
3126,
2140,
1006,
1007,
1063,
2065,
1006,
5164,
21823,
4877,
1012,
24748,
18413,
1006,
2023,
1012,
24471,
2140,
1007,
1007,
1063,
2709,
2023,
1012,
24471,
2140,
1025,
1065,
5164,
7809,
18442,
1027,
4340,
6790,
15058... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
apache/flink | flink-core/src/main/java/org/apache/flink/util/IOUtils.java | IOUtils.closeAllQuietly | public static void closeAllQuietly(Iterable<? extends AutoCloseable> closeables) {
if (null != closeables) {
for (AutoCloseable closeable : closeables) {
closeQuietly(closeable);
}
}
} | java | public static void closeAllQuietly(Iterable<? extends AutoCloseable> closeables) {
if (null != closeables) {
for (AutoCloseable closeable : closeables) {
closeQuietly(closeable);
}
}
} | [
"public",
"static",
"void",
"closeAllQuietly",
"(",
"Iterable",
"<",
"?",
"extends",
"AutoCloseable",
">",
"closeables",
")",
"{",
"if",
"(",
"null",
"!=",
"closeables",
")",
"{",
"for",
"(",
"AutoCloseable",
"closeable",
":",
"closeables",
")",
"{",
"closeQ... | Closes all elements in the iterable with closeQuietly(). | [
"Closes",
"all",
"elements",
"in",
"the",
"iterable",
"with",
"closeQuietly",
"()",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-core/src/main/java/org/apache/flink/util/IOUtils.java#L247-L253 | train | Close all AutoCloseables ignoring exceptions. | [
30522,
2270,
10763,
11675,
2485,
8095,
15549,
3388,
2135,
1006,
2009,
6906,
3468,
1026,
1029,
8908,
8285,
20464,
9232,
3085,
1028,
2485,
3085,
2015,
1007,
1063,
2065,
1006,
19701,
999,
1027,
2485,
3085,
2015,
1007,
1063,
2005,
1006,
8285,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
netty/netty | buffer/src/main/java/io/netty/buffer/PoolSubpage.java | PoolSubpage.allocate | long allocate() {
if (elemSize == 0) {
return toHandle(0);
}
if (numAvail == 0 || !doNotDestroy) {
return -1;
}
final int bitmapIdx = getNextAvail();
int q = bitmapIdx >>> 6;
int r = bitmapIdx & 63;
assert (bitmap[q] >>> r & 1) ==... | java | long allocate() {
if (elemSize == 0) {
return toHandle(0);
}
if (numAvail == 0 || !doNotDestroy) {
return -1;
}
final int bitmapIdx = getNextAvail();
int q = bitmapIdx >>> 6;
int r = bitmapIdx & 63;
assert (bitmap[q] >>> r & 1) ==... | [
"long",
"allocate",
"(",
")",
"{",
"if",
"(",
"elemSize",
"==",
"0",
")",
"{",
"return",
"toHandle",
"(",
"0",
")",
";",
"}",
"if",
"(",
"numAvail",
"==",
"0",
"||",
"!",
"doNotDestroy",
")",
"{",
"return",
"-",
"1",
";",
"}",
"final",
"int",
"... | Returns the bitmap index of the subpage allocation. | [
"Returns",
"the",
"bitmap",
"index",
"of",
"the",
"subpage",
"allocation",
"."
] | ba06eafa1c1824bd154f1a380019e7ea2edf3c4c | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/buffer/src/main/java/io/netty/buffer/PoolSubpage.java#L80-L100 | train | Allocate a new instance of a class from the pool. | [
30522,
2146,
2035,
24755,
2618,
1006,
1007,
1063,
2065,
1006,
3449,
6633,
5332,
4371,
1027,
1027,
1014,
1007,
1063,
2709,
2000,
11774,
2571,
1006,
1014,
1007,
1025,
1065,
2065,
1006,
16371,
2863,
3567,
4014,
1027,
1027,
1014,
1064,
1064,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
apache/flink | flink-connectors/flink-connector-kinesis/src/main/java/org/apache/flink/streaming/connectors/kinesis/util/KinesisConfigUtil.java | KinesisConfigUtil.validateConsumerConfiguration | public static void validateConsumerConfiguration(Properties config) {
checkNotNull(config, "config can not be null");
validateAwsConfiguration(config);
if (!(config.containsKey(AWSConfigConstants.AWS_REGION) ^ config.containsKey(ConsumerConfigConstants.AWS_ENDPOINT))) {
// per validation in AwsClientBuilder
... | java | public static void validateConsumerConfiguration(Properties config) {
checkNotNull(config, "config can not be null");
validateAwsConfiguration(config);
if (!(config.containsKey(AWSConfigConstants.AWS_REGION) ^ config.containsKey(ConsumerConfigConstants.AWS_ENDPOINT))) {
// per validation in AwsClientBuilder
... | [
"public",
"static",
"void",
"validateConsumerConfiguration",
"(",
"Properties",
"config",
")",
"{",
"checkNotNull",
"(",
"config",
",",
"\"config can not be null\"",
")",
";",
"validateAwsConfiguration",
"(",
"config",
")",
";",
"if",
"(",
"!",
"(",
"config",
".",... | Validate configuration properties for {@link FlinkKinesisConsumer}. | [
"Validate",
"configuration",
"properties",
"for",
"{"
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-connectors/flink-connector-kinesis/src/main/java/org/apache/flink/streaming/connectors/kinesis/util/KinesisConfigUtil.java#L85-L174 | train | Validate the consumer configuration. | [
30522,
2270,
10763,
11675,
9398,
3686,
8663,
23545,
29566,
2078,
8873,
27390,
3370,
1006,
5144,
9530,
8873,
2290,
1007,
1063,
4638,
17048,
11231,
3363,
1006,
9530,
8873,
2290,
1010,
1000,
9530,
8873,
2290,
2064,
2025,
2022,
19701,
1000,
100... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
apache/spark | common/network-yarn/src/main/java/org/apache/spark/network/yarn/YarnShuffleService.java | YarnShuffleService.serviceInit | @Override
protected void serviceInit(Configuration conf) throws Exception {
_conf = conf;
boolean stopOnFailure = conf.getBoolean(STOP_ON_FAILURE_KEY, DEFAULT_STOP_ON_FAILURE);
try {
// In case this NM was killed while there were running spark applications, we need to restore
// lost state f... | java | @Override
protected void serviceInit(Configuration conf) throws Exception {
_conf = conf;
boolean stopOnFailure = conf.getBoolean(STOP_ON_FAILURE_KEY, DEFAULT_STOP_ON_FAILURE);
try {
// In case this NM was killed while there were running spark applications, we need to restore
// lost state f... | [
"@",
"Override",
"protected",
"void",
"serviceInit",
"(",
"Configuration",
"conf",
")",
"throws",
"Exception",
"{",
"_conf",
"=",
"conf",
";",
"boolean",
"stopOnFailure",
"=",
"conf",
".",
"getBoolean",
"(",
"STOP_ON_FAILURE_KEY",
",",
"DEFAULT_STOP_ON_FAILURE",
"... | Start the shuffle server with the given configuration. | [
"Start",
"the",
"shuffle",
"server",
"with",
"the",
"given",
"configuration",
"."
] | 25ee0474f47d9c30d6f553a7892d9549f91071cf | https://github.com/apache/spark/blob/25ee0474f47d9c30d6f553a7892d9549f91071cf/common/network-yarn/src/main/java/org/apache/spark/network/yarn/YarnShuffleService.java#L156-L217 | train | This method is called by the service init method. | [
30522,
1030,
2058,
15637,
5123,
11675,
2326,
5498,
2102,
1006,
9563,
9530,
2546,
1007,
11618,
6453,
1063,
1035,
9530,
2546,
1027,
9530,
2546,
1025,
22017,
20898,
2644,
2239,
7011,
4014,
5397,
1027,
9530,
2546,
1012,
2131,
5092,
9890,
2319,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
apache/spark | sql/hive-thriftserver/src/main/java/org/apache/hive/service/cli/HiveSQLException.java | HiveSQLException.toTStatus | public TStatus toTStatus() {
// TODO: convert sqlState, etc.
TStatus tStatus = new TStatus(TStatusCode.ERROR_STATUS);
tStatus.setSqlState(getSQLState());
tStatus.setErrorCode(getErrorCode());
tStatus.setErrorMessage(getMessage());
tStatus.setInfoMessages(toString(this));
return tStatus;
} | java | public TStatus toTStatus() {
// TODO: convert sqlState, etc.
TStatus tStatus = new TStatus(TStatusCode.ERROR_STATUS);
tStatus.setSqlState(getSQLState());
tStatus.setErrorCode(getErrorCode());
tStatus.setErrorMessage(getMessage());
tStatus.setInfoMessages(toString(this));
return tStatus;
} | [
"public",
"TStatus",
"toTStatus",
"(",
")",
"{",
"// TODO: convert sqlState, etc.",
"TStatus",
"tStatus",
"=",
"new",
"TStatus",
"(",
"TStatusCode",
".",
"ERROR_STATUS",
")",
";",
"tStatus",
".",
"setSqlState",
"(",
"getSQLState",
"(",
")",
")",
";",
"tStatus",
... | Converts current object to a {@link TStatus} object
@return a {@link TStatus} object | [
"Converts",
"current",
"object",
"to",
"a",
"{"
] | 25ee0474f47d9c30d6f553a7892d9549f91071cf | https://github.com/apache/spark/blob/25ee0474f47d9c30d6f553a7892d9549f91071cf/sql/hive-thriftserver/src/main/java/org/apache/hive/service/cli/HiveSQLException.java#L116-L124 | train | Converts this object to a TStatus object. | [
30522,
2270,
24529,
29336,
2271,
2000,
3215,
29336,
2271,
1006,
1007,
1063,
1013,
1013,
28681,
2080,
1024,
10463,
29296,
9153,
2618,
1010,
4385,
1012,
24529,
29336,
2271,
24529,
29336,
2271,
1027,
2047,
24529,
29336,
2271,
1006,
24529,
29336,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
looly/hutool | hutool-setting/src/main/java/cn/hutool/setting/Setting.java | Setting.containsKey | @Override
public boolean containsKey(Object key) {
return this.groupedMap.containsKey(DEFAULT_GROUP, Convert.toStr(key));
} | java | @Override
public boolean containsKey(Object key) {
return this.groupedMap.containsKey(DEFAULT_GROUP, Convert.toStr(key));
} | [
"@",
"Override",
"public",
"boolean",
"containsKey",
"(",
"Object",
"key",
")",
"{",
"return",
"this",
".",
"groupedMap",
".",
"containsKey",
"(",
"DEFAULT_GROUP",
",",
"Convert",
".",
"toStr",
"(",
"key",
")",
")",
";",
"}"
] | 默认分组(空分组)中是否包含指定key对应的值
@param key 键
@return 默认分组中是否包含指定key对应的值 | [
"默认分组(空分组)中是否包含指定key对应的值"
] | bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-setting/src/main/java/cn/hutool/setting/Setting.java#L527-L530 | train | Returns true if the specified key is in the default group. | [
30522,
1030,
2058,
15637,
2270,
22017,
20898,
3397,
14839,
1006,
4874,
3145,
1007,
1063,
2709,
2023,
1012,
15131,
2863,
2361,
1012,
3397,
14839,
1006,
12398,
1035,
2177,
1010,
10463,
1012,
2000,
3367,
2099,
1006,
3145,
1007,
1007,
1025,
106... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
netty/netty | codec-http2/src/main/java/io/netty/handler/codec/http2/HpackEncoder.java | HpackEncoder.encodeInteger | private static void encodeInteger(ByteBuf out, int mask, int n, long i) {
assert n >= 0 && n <= 8 : "N: " + n;
int nbits = 0xFF >>> (8 - n);
if (i < nbits) {
out.writeByte((int) (mask | i));
} else {
out.writeByte(mask | nbits);
long length = i - nbits... | java | private static void encodeInteger(ByteBuf out, int mask, int n, long i) {
assert n >= 0 && n <= 8 : "N: " + n;
int nbits = 0xFF >>> (8 - n);
if (i < nbits) {
out.writeByte((int) (mask | i));
} else {
out.writeByte(mask | nbits);
long length = i - nbits... | [
"private",
"static",
"void",
"encodeInteger",
"(",
"ByteBuf",
"out",
",",
"int",
"mask",
",",
"int",
"n",
",",
"long",
"i",
")",
"{",
"assert",
"n",
">=",
"0",
"&&",
"n",
"<=",
"8",
":",
"\"N: \"",
"+",
"n",
";",
"int",
"nbits",
"=",
"0xFF",
">>>... | Encode integer according to <a href="https://tools.ietf.org/html/rfc7541#section-5.1">Section 5.1</a>. | [
"Encode",
"integer",
"according",
"to",
"<a",
"href",
"=",
"https",
":",
"//",
"tools",
".",
"ietf",
".",
"org",
"/",
"html",
"/",
"rfc7541#section",
"-",
"5",
".",
"1",
">",
"Section",
"5",
".",
"1<",
"/",
"a",
">",
"."
] | ba06eafa1c1824bd154f1a380019e7ea2edf3c4c | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/codec-http2/src/main/java/io/netty/handler/codec/http2/HpackEncoder.java#L234-L247 | train | Encode a single integer in a byte buffer. | [
30522,
2797,
10763,
11675,
4372,
16044,
18447,
26320,
1006,
24880,
8569,
2546,
2041,
1010,
20014,
7308,
1010,
20014,
1050,
1010,
2146,
1045,
1007,
1063,
20865,
1050,
1028,
1027,
1014,
1004,
1004,
1050,
1026,
1027,
1022,
1024,
1000,
1050,
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/spark | common/unsafe/src/main/java/org/apache/spark/unsafe/types/UTF8String.java | UTF8String.rpad | public UTF8String rpad(int len, UTF8String pad) {
int spaces = len - this.numChars(); // number of char need to pad
if (spaces <= 0 || pad.numBytes() == 0) {
// no padding at all, return the substring of the current string
return substring(0, len);
} else {
int padChars = pad.numChars();
... | java | public UTF8String rpad(int len, UTF8String pad) {
int spaces = len - this.numChars(); // number of char need to pad
if (spaces <= 0 || pad.numBytes() == 0) {
// no padding at all, return the substring of the current string
return substring(0, len);
} else {
int padChars = pad.numChars();
... | [
"public",
"UTF8String",
"rpad",
"(",
"int",
"len",
",",
"UTF8String",
"pad",
")",
"{",
"int",
"spaces",
"=",
"len",
"-",
"this",
".",
"numChars",
"(",
")",
";",
"// number of char need to pad",
"if",
"(",
"spaces",
"<=",
"0",
"||",
"pad",
".",
"numBytes"... | Returns str, right-padded with pad to a length of len
For example:
('hi', 5, '??') => 'hi???'
('hi', 1, '??') => 'h' | [
"Returns",
"str",
"right",
"-",
"padded",
"with",
"pad",
"to",
"a",
"length",
"of",
"len",
"For",
"example",
":",
"(",
"hi",
"5",
"??",
")",
"=",
">",
";",
"hi???",
"(",
"hi",
"1",
"??",
")",
"=",
">",
";",
"h"
] | 25ee0474f47d9c30d6f553a7892d9549f91071cf | https://github.com/apache/spark/blob/25ee0474f47d9c30d6f553a7892d9549f91071cf/common/unsafe/src/main/java/org/apache/spark/unsafe/types/UTF8String.java#L821-L845 | train | Returns a new string of length len with the specified padding string. | [
30522,
2270,
21183,
2546,
2620,
3367,
4892,
1054,
15455,
1006,
20014,
18798,
1010,
21183,
2546,
2620,
3367,
4892,
11687,
1007,
1063,
20014,
7258,
1027,
18798,
1011,
2023,
1012,
16371,
12458,
8167,
2015,
1006,
1007,
1025,
1013,
1013,
2193,
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/URLUtil.java | URLUtil.getReader | public static BufferedReader getReader(URL url, Charset charset) {
return IoUtil.getReader(getStream(url), charset);
} | java | public static BufferedReader getReader(URL url, Charset charset) {
return IoUtil.getReader(getStream(url), charset);
} | [
"public",
"static",
"BufferedReader",
"getReader",
"(",
"URL",
"url",
",",
"Charset",
"charset",
")",
"{",
"return",
"IoUtil",
".",
"getReader",
"(",
"getStream",
"(",
"url",
")",
",",
"charset",
")",
";",
"}"
] | 获得Reader
@param url {@link URL}
@param charset 编码
@return {@link BufferedReader}
@since 3.2.1 | [
"获得Reader"
] | bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/util/URLUtil.java#L523-L525 | train | Get a buffered reader for the given URL. | [
30522,
2270,
10763,
17698,
2098,
16416,
4063,
2131,
16416,
4063,
1006,
24471,
2140,
24471,
2140,
1010,
25869,
13462,
25869,
13462,
1007,
1063,
2709,
22834,
21823,
2140,
1012,
2131,
16416,
4063,
1006,
4152,
25379,
1006,
24471,
2140,
1007,
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/img/ImgUtil.java | ImgUtil.writeJpg | public static void writeJpg(Image image, OutputStream out) throws IORuntimeException {
write(image, IMAGE_TYPE_JPG, out);
} | java | public static void writeJpg(Image image, OutputStream out) throws IORuntimeException {
write(image, IMAGE_TYPE_JPG, out);
} | [
"public",
"static",
"void",
"writeJpg",
"(",
"Image",
"image",
",",
"OutputStream",
"out",
")",
"throws",
"IORuntimeException",
"{",
"write",
"(",
"image",
",",
"IMAGE_TYPE_JPG",
",",
"out",
")",
";",
"}"
] | 写出图像为JPG格式
@param image {@link Image}
@param out 写出到的目标流
@throws IORuntimeException IO异常
@since 4.0.10 | [
"写出图像为JPG格式"
] | bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/img/ImgUtil.java#L1377-L1379 | train | Write a JPG image to an OutputStream. | [
30522,
2270,
10763,
11675,
4339,
3501,
26952,
1006,
3746,
3746,
1010,
27852,
25379,
2041,
1007,
11618,
22834,
15532,
7292,
10288,
24422,
1063,
4339,
1006,
3746,
1010,
3746,
1035,
2828,
1035,
16545,
2290,
1010,
2041,
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... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
apache/flink | flink-libraries/flink-gelly/src/main/java/org/apache/flink/graph/pregel/VertexCentricIteration.java | VertexCentricIteration.createResult | @Override
public DataSet<Vertex<K, VV>> createResult() {
if (this.initialVertices == null) {
throw new IllegalStateException("The input data set has not been set.");
}
// prepare the type information
TypeInformation<K> keyType = ((TupleTypeInfo<?>) initialVertices.getType()).getTypeAt(0);
TypeInformation... | java | @Override
public DataSet<Vertex<K, VV>> createResult() {
if (this.initialVertices == null) {
throw new IllegalStateException("The input data set has not been set.");
}
// prepare the type information
TypeInformation<K> keyType = ((TupleTypeInfo<?>) initialVertices.getType()).getTypeAt(0);
TypeInformation... | [
"@",
"Override",
"public",
"DataSet",
"<",
"Vertex",
"<",
"K",
",",
"VV",
">",
">",
"createResult",
"(",
")",
"{",
"if",
"(",
"this",
".",
"initialVertices",
"==",
"null",
")",
"{",
"throw",
"new",
"IllegalStateException",
"(",
"\"The input data set has not ... | Creates the operator that represents this vertex-centric graph computation.
<p>The Pregel iteration is mapped to delta iteration as follows.
The solution set consists of the set of active vertices and the workset contains the set of messages
send to vertices during the previous superstep. Initially, the workset contai... | [
"Creates",
"the",
"operator",
"that",
"represents",
"this",
"vertex",
"-",
"centric",
"graph",
"computation",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-libraries/flink-gelly/src/main/java/org/apache/flink/graph/pregel/VertexCentricIteration.java#L150-L223 | train | Creates the result set. | [
30522,
1030,
2058,
15637,
30524,
17389,
2595,
24422,
1006,
1000,
1996,
7953,
2951,
2275,
2038,
2025,
2042,
2275,
1012,
1000,
1007,
1025,
1065,
1013,
1013,
7374,
1996,
2828,
2592,
2828,
2378,
14192,
3370,
1026,
1047,
1028,
3145,
13874,
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/flink | flink-streaming-java/src/main/java/org/apache/flink/streaming/api/datastream/AllWindowedStream.java | AllWindowedStream.process | @PublicEvolving
public <R> SingleOutputStreamOperator<R> process(ProcessAllWindowFunction<T, R, W> function) {
String callLocation = Utils.getCallLocationName();
function = input.getExecutionEnvironment().clean(function);
TypeInformation<R> resultType = getProcessAllWindowFunctionReturnType(function, getInputTyp... | java | @PublicEvolving
public <R> SingleOutputStreamOperator<R> process(ProcessAllWindowFunction<T, R, W> function) {
String callLocation = Utils.getCallLocationName();
function = input.getExecutionEnvironment().clean(function);
TypeInformation<R> resultType = getProcessAllWindowFunctionReturnType(function, getInputTyp... | [
"@",
"PublicEvolving",
"public",
"<",
"R",
">",
"SingleOutputStreamOperator",
"<",
"R",
">",
"process",
"(",
"ProcessAllWindowFunction",
"<",
"T",
",",
"R",
",",
"W",
">",
"function",
")",
"{",
"String",
"callLocation",
"=",
"Utils",
".",
"getCallLocationName"... | Applies the given window function to each window. The window function is called for each
evaluation of the window. The output of the window function is
interpreted as a regular non-windowed stream.
<p>Note that this function requires that all data in the windows is buffered until the window
is evaluated, as the functi... | [
"Applies",
"the",
"given",
"window",
"function",
"to",
"each",
"window",
".",
"The",
"window",
"function",
"is",
"called",
"for",
"each",
"evaluation",
"of",
"the",
"window",
".",
"The",
"output",
"of",
"the",
"window",
"function",
"is",
"interpreted",
"as",... | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-streaming-java/src/main/java/org/apache/flink/streaming/api/datastream/AllWindowedStream.java#L1090-L1096 | train | Process all window function. | [
30522,
1030,
2270,
6777,
4747,
6455,
2270,
1026,
1054,
1028,
2309,
5833,
18780,
21422,
25918,
8844,
1026,
1054,
1028,
2832,
1006,
2832,
8095,
11101,
5004,
11263,
27989,
1026,
1056,
1010,
1054,
1010,
1059,
1028,
3853,
1007,
1063,
5164,
2655,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
apache/flink | flink-runtime/src/main/java/org/apache/flink/runtime/checkpoint/CheckpointCoordinator.java | CheckpointCoordinator.restoreSavepoint | public boolean restoreSavepoint(
String savepointPointer,
boolean allowNonRestored,
Map<JobVertexID, ExecutionJobVertex> tasks,
ClassLoader userClassLoader) throws Exception {
Preconditions.checkNotNull(savepointPointer, "The savepoint path cannot be null.");
LOG.info("Starting job {} from savepoint {... | java | public boolean restoreSavepoint(
String savepointPointer,
boolean allowNonRestored,
Map<JobVertexID, ExecutionJobVertex> tasks,
ClassLoader userClassLoader) throws Exception {
Preconditions.checkNotNull(savepointPointer, "The savepoint path cannot be null.");
LOG.info("Starting job {} from savepoint {... | [
"public",
"boolean",
"restoreSavepoint",
"(",
"String",
"savepointPointer",
",",
"boolean",
"allowNonRestored",
",",
"Map",
"<",
"JobVertexID",
",",
"ExecutionJobVertex",
">",
"tasks",
",",
"ClassLoader",
"userClassLoader",
")",
"throws",
"Exception",
"{",
"Preconditi... | Restore the state with given savepoint.
@param savepointPointer The pointer to the savepoint.
@param allowNonRestored True if allowing checkpoint state that cannot be
mapped to any job vertex in tasks.
@param tasks Map of job vertices to restore. State for these
vertices is restored via
{@link Execution#set... | [
"Restore",
"the",
"state",
"with",
"given",
"savepoint",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/checkpoint/CheckpointCoordinator.java#L1144-L1170 | train | Restores the state of a savepoint. | [
30522,
2270,
22017,
20898,
9239,
3736,
3726,
8400,
1006,
5164,
3828,
8400,
8400,
2121,
1010,
22017,
20898,
3499,
8540,
28533,
19574,
1010,
4949,
1026,
3105,
16874,
10288,
3593,
1010,
7781,
5558,
2497,
16874,
10288,
1028,
8518,
1010,
2465,
1... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
apache/flink | flink-connectors/flink-hadoop-compatibility/src/main/java/org/apache/flink/api/java/hadoop/mapreduce/HadoopInputFormatBase.java | HadoopInputFormatBase.writeObject | private void writeObject(ObjectOutputStream out) throws IOException {
super.write(out);
out.writeUTF(this.mapreduceInputFormat.getClass().getName());
out.writeUTF(this.keyClass.getName());
out.writeUTF(this.valueClass.getName());
this.configuration.write(out);
} | java | private void writeObject(ObjectOutputStream out) throws IOException {
super.write(out);
out.writeUTF(this.mapreduceInputFormat.getClass().getName());
out.writeUTF(this.keyClass.getName());
out.writeUTF(this.valueClass.getName());
this.configuration.write(out);
} | [
"private",
"void",
"writeObject",
"(",
"ObjectOutputStream",
"out",
")",
"throws",
"IOException",
"{",
"super",
".",
"write",
"(",
"out",
")",
";",
"out",
".",
"writeUTF",
"(",
"this",
".",
"mapreduceInputFormat",
".",
"getClass",
"(",
")",
".",
"getName",
... | -------------------------------------------------------------------------------------------- | [
"--------------------------------------------------------------------------------------------"
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-connectors/flink-hadoop-compatibility/src/main/java/org/apache/flink/api/java/hadoop/mapreduce/HadoopInputFormatBase.java#L282-L288 | train | Write the object. | [
30522,
2797,
11675,
4339,
16429,
20614,
1006,
4874,
5833,
18780,
21422,
2041,
1007,
11618,
22834,
10288,
24422,
1063,
3565,
1012,
4339,
1006,
2041,
1007,
1025,
2041,
1012,
4339,
4904,
2546,
1006,
2023,
1012,
4949,
5596,
18796,
2378,
18780,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
netty/netty | codec-http2/src/main/java/io/netty/handler/codec/http2/HpackEncoder.java | HpackEncoder.encodeHeader | private void encodeHeader(ByteBuf out, CharSequence name, CharSequence value, boolean sensitive, long headerSize) {
// If the header value is sensitive then it must never be indexed
if (sensitive) {
int nameIndex = getNameIndex(name);
encodeLiteral(out, name, value, IndexType.NEV... | java | private void encodeHeader(ByteBuf out, CharSequence name, CharSequence value, boolean sensitive, long headerSize) {
// If the header value is sensitive then it must never be indexed
if (sensitive) {
int nameIndex = getNameIndex(name);
encodeLiteral(out, name, value, IndexType.NEV... | [
"private",
"void",
"encodeHeader",
"(",
"ByteBuf",
"out",
",",
"CharSequence",
"name",
",",
"CharSequence",
"value",
",",
"boolean",
"sensitive",
",",
"long",
"headerSize",
")",
"{",
"// If the header value is sensitive then it must never be indexed",
"if",
"(",
"sensit... | Encode the header field into the header block.
<strong>The given {@link CharSequence}s must be immutable!</strong> | [
"Encode",
"the",
"header",
"field",
"into",
"the",
"header",
"block",
"."
] | ba06eafa1c1824bd154f1a380019e7ea2edf3c4c | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/codec-http2/src/main/java/io/netty/handler/codec/http2/HpackEncoder.java#L143-L186 | train | Encode a single header. | [
30522,
2797,
11675,
4372,
16044,
4974,
2121,
1006,
24880,
8569,
2546,
2041,
1010,
25869,
3366,
4226,
5897,
2171,
1010,
25869,
3366,
4226,
5897,
3643,
1010,
22017,
20898,
7591,
1010,
2146,
20346,
5332,
4371,
1007,
1063,
1013,
1013,
2065,
199... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/RootDumper.java | RootDumper.dumpRequest | public void dumpRequest(Map<String, Object> result) {
if(!dumpConfig.isRequestEnabled()) { return; }
Map<String, Object> requestResult = new LinkedHashMap<>();
for(IRequestDumpable dumper: dumperFactory.createRequestDumpers(dumpConfig, exchange)) {
if(dumper.isApplicableForRequest()... | java | public void dumpRequest(Map<String, Object> result) {
if(!dumpConfig.isRequestEnabled()) { return; }
Map<String, Object> requestResult = new LinkedHashMap<>();
for(IRequestDumpable dumper: dumperFactory.createRequestDumpers(dumpConfig, exchange)) {
if(dumper.isApplicableForRequest()... | [
"public",
"void",
"dumpRequest",
"(",
"Map",
"<",
"String",
",",
"Object",
">",
"result",
")",
"{",
"if",
"(",
"!",
"dumpConfig",
".",
"isRequestEnabled",
"(",
")",
")",
"{",
"return",
";",
"}",
"Map",
"<",
"String",
",",
"Object",
">",
"requestResult"... | create dumpers that can dump http request info, and put http request info into Map<String, Object> result
@param result a Map<String, Object> to put http request info to | [
"create",
"dumpers",
"that",
"can",
"dump",
"http",
"request",
"info",
"and",
"put",
"http",
"request",
"info",
"into",
"Map<String",
"Object",
">",
"result"
] | 2a60257c60663684c8f6dc8b5ea3cf184e534db6 | https://github.com/networknt/light-4j/blob/2a60257c60663684c8f6dc8b5ea3cf184e534db6/dump/src/main/java/com/networknt/dump/RootDumper.java#L43-L53 | train | Dump request information. | [
30522,
2270,
11675,
15653,
2890,
15500,
1006,
4949,
1026,
5164,
1010,
4874,
1028,
2765,
1007,
1063,
2065,
1006,
999,
15653,
8663,
8873,
2290,
1012,
2003,
2890,
15500,
8189,
23242,
1006,
1007,
1007,
1063,
2709,
1025,
1065,
4949,
1026,
5164,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
apache/flink | flink-runtime/src/main/java/org/apache/flink/runtime/checkpoint/CheckpointStatsTracker.java | CheckpointStatsTracker.createSnapshot | public CheckpointStatsSnapshot createSnapshot() {
CheckpointStatsSnapshot snapshot = latestSnapshot;
// Only create a new snapshot if dirty and no update in progress,
// because we don't want to block the coordinator.
if (dirty && statsReadWriteLock.tryLock()) {
try {
// Create a new snapshot
snapsh... | java | public CheckpointStatsSnapshot createSnapshot() {
CheckpointStatsSnapshot snapshot = latestSnapshot;
// Only create a new snapshot if dirty and no update in progress,
// because we don't want to block the coordinator.
if (dirty && statsReadWriteLock.tryLock()) {
try {
// Create a new snapshot
snapsh... | [
"public",
"CheckpointStatsSnapshot",
"createSnapshot",
"(",
")",
"{",
"CheckpointStatsSnapshot",
"snapshot",
"=",
"latestSnapshot",
";",
"// Only create a new snapshot if dirty and no update in progress,",
"// because we don't want to block the coordinator.",
"if",
"(",
"dirty",
"&&"... | Creates a new snapshot of the available stats.
@return The latest statistics snapshot. | [
"Creates",
"a",
"new",
"snapshot",
"of",
"the",
"available",
"stats",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/checkpoint/CheckpointStatsTracker.java#L157-L180 | train | Creates a snapshot of the current checkpoint stats. | [
30522,
2270,
26520,
9153,
3215,
2015,
2532,
4523,
12326,
9005,
2532,
4523,
12326,
1006,
1007,
1063,
26520,
9153,
3215,
2015,
2532,
4523,
12326,
20057,
12326,
1027,
6745,
2015,
2532,
4523,
12326,
1025,
1013,
1013,
2069,
3443,
1037,
2047,
200... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
apache/flink | flink-table/flink-table-runtime-blink/src/main/java/org/apache/flink/table/runtime/hashtable/BinaryHashBucketArea.java | BinaryHashBucketArea.appendRecordAndInsert | boolean appendRecordAndInsert(BinaryRow record, int hashCode) throws IOException {
final int posHashCode = findBucket(hashCode);
// get the bucket for the given hash code
final int bucketArrayPos = posHashCode >> table.bucketsPerSegmentBits;
final int bucketInSegmentPos = (posHashCode & table.bucketsPerSegmentM... | java | boolean appendRecordAndInsert(BinaryRow record, int hashCode) throws IOException {
final int posHashCode = findBucket(hashCode);
// get the bucket for the given hash code
final int bucketArrayPos = posHashCode >> table.bucketsPerSegmentBits;
final int bucketInSegmentPos = (posHashCode & table.bucketsPerSegmentM... | [
"boolean",
"appendRecordAndInsert",
"(",
"BinaryRow",
"record",
",",
"int",
"hashCode",
")",
"throws",
"IOException",
"{",
"final",
"int",
"posHashCode",
"=",
"findBucket",
"(",
"hashCode",
")",
";",
"// get the bucket for the given hash code",
"final",
"int",
"bucket... | Append record and insert to bucket. | [
"Append",
"record",
"and",
"insert",
"to",
"bucket",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-table/flink-table-runtime-blink/src/main/java/org/apache/flink/table/runtime/hashtable/BinaryHashBucketArea.java#L448-L470 | train | Append a record to the build buffer and insert it into the build buffer. | [
30522,
22017,
20898,
10439,
10497,
2890,
27108,
7847,
8718,
8043,
2102,
1006,
12441,
10524,
2501,
1010,
20014,
23325,
16044,
1007,
11618,
22834,
10288,
24422,
1063,
2345,
20014,
13433,
7377,
4095,
16044,
1027,
2424,
24204,
3388,
1006,
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-streaming-java/src/main/java/org/apache/flink/streaming/api/environment/StreamExecutionEnvironment.java | StreamExecutionEnvironment.fromElements | @SafeVarargs
public final <OUT> DataStreamSource<OUT> fromElements(Class<OUT> type, OUT... data) {
if (data.length == 0) {
throw new IllegalArgumentException("fromElements needs at least one element as argument");
}
TypeInformation<OUT> typeInfo;
try {
typeInfo = TypeExtractor.getForClass(type);
}
c... | java | @SafeVarargs
public final <OUT> DataStreamSource<OUT> fromElements(Class<OUT> type, OUT... data) {
if (data.length == 0) {
throw new IllegalArgumentException("fromElements needs at least one element as argument");
}
TypeInformation<OUT> typeInfo;
try {
typeInfo = TypeExtractor.getForClass(type);
}
c... | [
"@",
"SafeVarargs",
"public",
"final",
"<",
"OUT",
">",
"DataStreamSource",
"<",
"OUT",
">",
"fromElements",
"(",
"Class",
"<",
"OUT",
">",
"type",
",",
"OUT",
"...",
"data",
")",
"{",
"if",
"(",
"data",
".",
"length",
"==",
"0",
")",
"{",
"throw",
... | Creates a new data set that contains the given elements. The framework will determine the type according to the
based type user supplied. The elements should be the same or be the subclass to the based type.
The sequence of elements must not be empty.
Note that this operation will result in a non-parallel data stream s... | [
"Creates",
"a",
"new",
"data",
"set",
"that",
"contains",
"the",
"given",
"elements",
".",
"The",
"framework",
"will",
"determine",
"the",
"type",
"according",
"to",
"the",
"based",
"type",
"user",
"supplied",
".",
"The",
"elements",
"should",
"be",
"the",
... | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-streaming-java/src/main/java/org/apache/flink/streaming/api/environment/StreamExecutionEnvironment.java#L732-L748 | train | Creates a data stream from a collection of elements. | [
30522,
1030,
3647,
24516,
10623,
2015,
2270,
2345,
1026,
2041,
1028,
2951,
21422,
6499,
3126,
3401,
1026,
2041,
1028,
2013,
12260,
8163,
1006,
2465,
1026,
2041,
1028,
2828,
1010,
2041,
1012,
1012,
1012,
2951,
1007,
1063,
2065,
1006,
2951,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/EscapeUtil.java | EscapeUtil.unescapeHtml4 | public static String unescapeHtml4(String html) {
Html4Unescape unescape = new Html4Unescape();
return unescape.replace(html).toString();
} | java | public static String unescapeHtml4(String html) {
Html4Unescape unescape = new Html4Unescape();
return unescape.replace(html).toString();
} | [
"public",
"static",
"String",
"unescapeHtml4",
"(",
"String",
"html",
")",
"{",
"Html4Unescape",
"unescape",
"=",
"new",
"Html4Unescape",
"(",
")",
";",
"return",
"unescape",
".",
"replace",
"(",
"html",
")",
".",
"toString",
"(",
")",
";",
"}"
] | 反转义HTML4中的特殊字符
@param html HTML文本
@return 转义后的文本
@since 4.1.5 | [
"反转义HTML4中的特殊字符"
] | bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/util/EscapeUtil.java#L34-L37 | train | Unescape HTML 4 | [
30522,
2270,
10763,
5164,
16655,
15782,
5051,
11039,
19968,
2549,
1006,
5164,
16129,
1007,
1063,
16129,
2549,
26639,
19464,
16655,
15782,
5051,
1027,
2047,
16129,
2549,
26639,
19464,
1006,
1007,
1025,
2709,
16655,
15782,
5051,
1012,
5672,
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-core/src/main/java/org/apache/flink/core/memory/MemorySegment.java | MemorySegment.putShortBigEndian | public final void putShortBigEndian(int index, short value) {
if (LITTLE_ENDIAN) {
putShort(index, Short.reverseBytes(value));
} else {
putShort(index, value);
}
} | java | public final void putShortBigEndian(int index, short value) {
if (LITTLE_ENDIAN) {
putShort(index, Short.reverseBytes(value));
} else {
putShort(index, value);
}
} | [
"public",
"final",
"void",
"putShortBigEndian",
"(",
"int",
"index",
",",
"short",
"value",
")",
"{",
"if",
"(",
"LITTLE_ENDIAN",
")",
"{",
"putShort",
"(",
"index",
",",
"Short",
".",
"reverseBytes",
"(",
"value",
")",
")",
";",
"}",
"else",
"{",
"put... | Writes the given short integer value (16 bit, 2 bytes) to the given position in big-endian
byte order. This method's speed depends on the system's native byte order, and it
is possibly slower than {@link #putShort(int, short)}. For most cases (such as
transient storage in memory or serialization for I/O and network),
i... | [
"Writes",
"the",
"given",
"short",
"integer",
"value",
"(",
"16",
"bit",
"2",
"bytes",
")",
"to",
"the",
"given",
"position",
"in",
"big",
"-",
"endian",
"byte",
"order",
".",
"This",
"method",
"s",
"speed",
"depends",
"on",
"the",
"system",
"s",
"nati... | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-core/src/main/java/org/apache/flink/core/memory/MemorySegment.java#L668-L674 | train | Puts a short value into the buffer at the given index in big - endian order. | [
30522,
2270,
2345,
11675,
8509,
27794,
5638,
6914,
11692,
1006,
20014,
5950,
1010,
2460,
3643,
1007,
1063,
2065,
1006,
2210,
1035,
2203,
2937,
1007,
1063,
8509,
27794,
1006,
5950,
1010,
2460,
1012,
7901,
3762,
4570,
1006,
3643,
1007,
1007,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
looly/hutool | hutool-core/src/main/java/cn/hutool/core/util/ZipUtil.java | ZipUtil.getZipOutputStream | private static ZipOutputStream getZipOutputStream(File zipFile, Charset charset) {
return getZipOutputStream(FileUtil.getOutputStream(zipFile), charset);
} | java | private static ZipOutputStream getZipOutputStream(File zipFile, Charset charset) {
return getZipOutputStream(FileUtil.getOutputStream(zipFile), charset);
} | [
"private",
"static",
"ZipOutputStream",
"getZipOutputStream",
"(",
"File",
"zipFile",
",",
"Charset",
"charset",
")",
"{",
"return",
"getZipOutputStream",
"(",
"FileUtil",
".",
"getOutputStream",
"(",
"zipFile",
")",
",",
"charset",
")",
";",
"}"
] | 获得 {@link ZipOutputStream}
@param zipFile 压缩文件
@param charset 编码
@return {@link ZipOutputStream} | [
"获得",
"{",
"@link",
"ZipOutputStream",
"}"
] | bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/util/ZipUtil.java#L746-L748 | train | Returns a ZipOutputStream for the given file. | [
30522,
2797,
10763,
14101,
5833,
18780,
21422,
2131,
5831,
6873,
4904,
18780,
21422,
1006,
5371,
14101,
8873,
2571,
1010,
25869,
13462,
25869,
13462,
1007,
1063,
2709,
2131,
5831,
6873,
4904,
18780,
21422,
1006,
5371,
21823,
2140,
1012,
2131,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
SeleniumHQ/selenium | java/server/src/org/openqa/selenium/remote/server/log/SessionLogsToFileRepository.java | SessionLogsToFileRepository.createLogFileAndAddToMap | public void createLogFileAndAddToMap(SessionId sessionId) throws IOException {
File rcLogFile;
// create logFile;
rcLogFile = File.createTempFile(sessionId.toString(), ".rclog");
rcLogFile.deleteOnExit();
LogFile logFile = new LogFile(rcLogFile.getAbsolutePath());
sessionToLogFileMap.put(session... | java | public void createLogFileAndAddToMap(SessionId sessionId) throws IOException {
File rcLogFile;
// create logFile;
rcLogFile = File.createTempFile(sessionId.toString(), ".rclog");
rcLogFile.deleteOnExit();
LogFile logFile = new LogFile(rcLogFile.getAbsolutePath());
sessionToLogFileMap.put(session... | [
"public",
"void",
"createLogFileAndAddToMap",
"(",
"SessionId",
"sessionId",
")",
"throws",
"IOException",
"{",
"File",
"rcLogFile",
";",
"// create logFile;",
"rcLogFile",
"=",
"File",
".",
"createTempFile",
"(",
"sessionId",
".",
"toString",
"(",
")",
",",
"\".r... | This creates log file object which represents logs in file form. This opens ObjectOutputStream
which is used to write logRecords to log file and opens a ObjectInputStream which is used to
read logRecords from the file.
@param sessionId session-id for the log file entry needs to be created.
@throws IOException file i/o... | [
"This",
"creates",
"log",
"file",
"object",
"which",
"represents",
"logs",
"in",
"file",
"form",
".",
"This",
"opens",
"ObjectOutputStream",
"which",
"is",
"used",
"to",
"write",
"logRecords",
"to",
"log",
"file",
"and",
"opens",
"a",
"ObjectInputStream",
"whi... | 7af172729f17b20269c8ca4ea6f788db48616535 | https://github.com/SeleniumHQ/selenium/blob/7af172729f17b20269c8ca4ea6f788db48616535/java/server/src/org/openqa/selenium/remote/server/log/SessionLogsToFileRepository.java#L49-L56 | train | Create a log file and add it to the sessionToLogFileMap. | [
30522,
2270,
11675,
3443,
21197,
8873,
20898,
14697,
11927,
9626,
2361,
1006,
5219,
3593,
5219,
3593,
1007,
11618,
22834,
10288,
24422,
1063,
5371,
22110,
21197,
8873,
2571,
1025,
1013,
1013,
3443,
8833,
8873,
2571,
1025,
22110,
21197,
8873,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
looly/hutool | hutool-setting/src/main/java/cn/hutool/setting/AbsSetting.java | AbsSetting.getStrings | public String[] getStrings(String key, String group) {
return getStrings(key, group, DEFAULT_DELIMITER);
} | java | public String[] getStrings(String key, String group) {
return getStrings(key, group, DEFAULT_DELIMITER);
} | [
"public",
"String",
"[",
"]",
"getStrings",
"(",
"String",
"key",
",",
"String",
"group",
")",
"{",
"return",
"getStrings",
"(",
"key",
",",
"group",
",",
"DEFAULT_DELIMITER",
")",
";",
"}"
] | 获得数组型
@param key 属性名
@param group 分组名
@return 属性值 | [
"获得数组型"
] | bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-setting/src/main/java/cn/hutool/setting/AbsSetting.java#L124-L126 | train | Returns an array of strings from the specified key and group. | [
30522,
2270,
5164,
1031,
1033,
4152,
18886,
3070,
2015,
1006,
5164,
3145,
1010,
5164,
2177,
1007,
1063,
2709,
4152,
18886,
3070,
2015,
1006,
3145,
1010,
2177,
1010,
12398,
1035,
3972,
27605,
3334,
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... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
hankcs/HanLP | src/main/java/com/hankcs/hanlp/dependency/nnparser/NeuralNetworkParser.java | NeuralNetworkParser.get_basic_features | void get_basic_features(final Context ctx,
final List<Integer> forms,
final List<Integer> postags,
final List<Integer> deprels,
List<Integer> features)
{
PUSH(features, FORM(forms, ctx.S0));
... | java | void get_basic_features(final Context ctx,
final List<Integer> forms,
final List<Integer> postags,
final List<Integer> deprels,
List<Integer> features)
{
PUSH(features, FORM(forms, ctx.S0));
... | [
"void",
"get_basic_features",
"(",
"final",
"Context",
"ctx",
",",
"final",
"List",
"<",
"Integer",
">",
"forms",
",",
"final",
"List",
"<",
"Integer",
">",
"postags",
",",
"final",
"List",
"<",
"Integer",
">",
"deprels",
",",
"List",
"<",
"Integer",
">"... | 获取基本特征
@param ctx 上下文
@param forms 单词
@param postags 词性
@param deprels 依存
@param features 输出特征的储存位置 | [
"获取基本特征"
] | a538d0722ab2e4980a9dcd9ea40324fc3ddba7ce | https://github.com/hankcs/HanLP/blob/a538d0722ab2e4980a9dcd9ea40324fc3ddba7ce/src/main/java/com/hankcs/hanlp/dependency/nnparser/NeuralNetworkParser.java#L673-L727 | train | Get the basic features. | [
30522,
11675,
2131,
1035,
3937,
1035,
2838,
1006,
2345,
6123,
14931,
2595,
1010,
2345,
2862,
1026,
16109,
1028,
3596,
1010,
2345,
2862,
1026,
16109,
1028,
2695,
26454,
1010,
2345,
2862,
1026,
16109,
1028,
2139,
28139,
4877,
1010,
2862,
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... |
looly/hutool | hutool-core/src/main/java/cn/hutool/core/util/ReflectUtil.java | ReflectUtil.getConstructor | @SuppressWarnings("unchecked")
public static <T> Constructor<T> getConstructor(Class<T> clazz, Class<?>... parameterTypes) {
if (null == clazz) {
return null;
}
final Constructor<?>[] constructors = getConstructors(clazz);
Class<?>[] pts;
for (Constructor<?> constructor : constructors) {
pts ... | java | @SuppressWarnings("unchecked")
public static <T> Constructor<T> getConstructor(Class<T> clazz, Class<?>... parameterTypes) {
if (null == clazz) {
return null;
}
final Constructor<?>[] constructors = getConstructors(clazz);
Class<?>[] pts;
for (Constructor<?> constructor : constructors) {
pts ... | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"static",
"<",
"T",
">",
"Constructor",
"<",
"T",
">",
"getConstructor",
"(",
"Class",
"<",
"T",
">",
"clazz",
",",
"Class",
"<",
"?",
">",
"...",
"parameterTypes",
")",
"{",
"if",
"(",
"nul... | 查找类中的指定参数的构造方法,如果找到构造方法,会自动设置可访问为true
@param <T> 对象类型
@param clazz 类
@param parameterTypes 参数类型,只要任何一个参数是指定参数的父类或接口或相等即可,此参数可以不传
@return 构造方法,如果未找到返回null | [
"查找类中的指定参数的构造方法,如果找到构造方法,会自动设置可访问为true"
] | bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/util/ReflectUtil.java#L42-L59 | train | Gets the first constructor that is assignable from the given parameter types. | [
30522,
1030,
16081,
9028,
5582,
2015,
1006,
1000,
4895,
5403,
18141,
1000,
1007,
2270,
10763,
1026,
1056,
1028,
9570,
2953,
1026,
1056,
1028,
2131,
8663,
3367,
6820,
16761,
1006,
2465,
1026,
1056,
1028,
18856,
10936,
2480,
1010,
2465,
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... |
spring-projects/spring-boot | spring-boot-project/spring-boot-tools/spring-boot-loader/src/main/java/org/springframework/boot/loader/Launcher.java | Launcher.createClassLoader | protected ClassLoader createClassLoader(List<Archive> archives) throws Exception {
List<URL> urls = new ArrayList<>(archives.size());
for (Archive archive : archives) {
urls.add(archive.getUrl());
}
return createClassLoader(urls.toArray(new URL[0]));
} | java | protected ClassLoader createClassLoader(List<Archive> archives) throws Exception {
List<URL> urls = new ArrayList<>(archives.size());
for (Archive archive : archives) {
urls.add(archive.getUrl());
}
return createClassLoader(urls.toArray(new URL[0]));
} | [
"protected",
"ClassLoader",
"createClassLoader",
"(",
"List",
"<",
"Archive",
">",
"archives",
")",
"throws",
"Exception",
"{",
"List",
"<",
"URL",
">",
"urls",
"=",
"new",
"ArrayList",
"<>",
"(",
"archives",
".",
"size",
"(",
")",
")",
";",
"for",
"(",
... | Create a classloader for the specified archives.
@param archives the archives
@return the classloader
@throws Exception if the classloader cannot be created | [
"Create",
"a",
"classloader",
"for",
"the",
"specified",
"archives",
"."
] | 0b27f7c70e164b2b1a96477f1d9c1acba56790c1 | https://github.com/spring-projects/spring-boot/blob/0b27f7c70e164b2b1a96477f1d9c1acba56790c1/spring-boot-project/spring-boot-tools/spring-boot-loader/src/main/java/org/springframework/boot/loader/Launcher.java#L59-L65 | train | Creates a class loader for the given list of archives. | [
30522,
5123,
2465,
11066,
2121,
3443,
26266,
11066,
2121,
1006,
2862,
1026,
8756,
1028,
8264,
1007,
11618,
6453,
1063,
2862,
1026,
24471,
2140,
1028,
24471,
4877,
1027,
2047,
9140,
9863,
1026,
1028,
1006,
8264,
1012,
2946,
1006,
1007,
1007,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
looly/hutool | hutool-core/src/main/java/cn/hutool/core/util/ReUtil.java | ReUtil.extractMultiAndDelPre | public static String extractMultiAndDelPre(String regex, Holder<CharSequence> contentHolder, String template) {
if (null == contentHolder || null == regex || null == template) {
return null;
}
// Pattern pattern = Pattern.compile(regex, Pattern.DOTALL);
final Pattern pattern = PatternPool.get(regex, P... | java | public static String extractMultiAndDelPre(String regex, Holder<CharSequence> contentHolder, String template) {
if (null == contentHolder || null == regex || null == template) {
return null;
}
// Pattern pattern = Pattern.compile(regex, Pattern.DOTALL);
final Pattern pattern = PatternPool.get(regex, P... | [
"public",
"static",
"String",
"extractMultiAndDelPre",
"(",
"String",
"regex",
",",
"Holder",
"<",
"CharSequence",
">",
"contentHolder",
",",
"String",
"template",
")",
"{",
"if",
"(",
"null",
"==",
"contentHolder",
"||",
"null",
"==",
"regex",
"||",
"null",
... | 从content中匹配出多个值并根据template生成新的字符串<br>
例如:<br>
content 2013年5月 pattern (.*?)年(.*?)月 template: $1-$2 return 2013-5
@param regex 匹配正则字符串
@param contentHolder 被匹配的内容的Holder,value为内容正文,经过这个方法的原文将被去掉匹配之前的内容
@param template 生成内容模板,变量 $1 表示group1的内容,以此类推
@return 按照template拼接后的字符串 | [
"从content中匹配出多个值并根据template生成新的字符串<br",
">",
"例如:<br",
">",
"content",
"2013年5月",
"pattern",
"(",
".",
"*",
"?",
")",
"年",
"(",
".",
"*",
"?",
")",
"月",
"template:",
"$1",
"-",
"$2",
"return",
"2013",
"-",
"5"
] | bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/util/ReUtil.java#L260-L268 | train | Extract a multi - and del - pre string from a Holder and a template. | [
30522,
2270,
10763,
5164,
14817,
12274,
7096,
2937,
14141,
2884,
28139,
1006,
5164,
19723,
10288,
1010,
9111,
1026,
25869,
3366,
4226,
5897,
1028,
4180,
14528,
1010,
5164,
23561,
1007,
1063,
2065,
1006,
19701,
1027,
1027,
4180,
14528,
1064,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/RestServerEndpointConfiguration.java | RestServerEndpointConfiguration.fromConfiguration | public static RestServerEndpointConfiguration fromConfiguration(Configuration config) throws ConfigurationException {
Preconditions.checkNotNull(config);
final String restAddress = Preconditions.checkNotNull(config.getString(RestOptions.ADDRESS),
"%s must be set",
RestOptions.ADDRESS.key());
final String ... | java | public static RestServerEndpointConfiguration fromConfiguration(Configuration config) throws ConfigurationException {
Preconditions.checkNotNull(config);
final String restAddress = Preconditions.checkNotNull(config.getString(RestOptions.ADDRESS),
"%s must be set",
RestOptions.ADDRESS.key());
final String ... | [
"public",
"static",
"RestServerEndpointConfiguration",
"fromConfiguration",
"(",
"Configuration",
"config",
")",
"throws",
"ConfigurationException",
"{",
"Preconditions",
".",
"checkNotNull",
"(",
"config",
")",
";",
"final",
"String",
"restAddress",
"=",
"Preconditions",... | Creates and returns a new {@link RestServerEndpointConfiguration} from the given {@link Configuration}.
@param config configuration from which the REST server endpoint configuration should be created from
@return REST server endpoint configuration
@throws ConfigurationException if SSL was configured incorrectly | [
"Creates",
"and",
"returns",
"a",
"new",
"{",
"@link",
"RestServerEndpointConfiguration",
"}",
"from",
"the",
"given",
"{",
"@link",
"Configuration",
"}",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/rest/RestServerEndpointConfiguration.java#L147-L186 | train | Creates a new RestServerEndpointConfiguration from the given configuration. | [
30522,
2270,
10763,
16626,
2121,
28943,
4859,
8400,
8663,
8873,
27390,
3370,
2013,
8663,
8873,
27390,
3370,
1006,
9563,
9530,
8873,
2290,
1007,
11618,
9563,
10288,
24422,
1063,
3653,
8663,
20562,
2015,
1012,
4638,
17048,
11231,
3363,
1006,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
apache/flink | flink-runtime/src/main/java/org/apache/flink/runtime/rpc/RpcEndpoint.java | RpcEndpoint.callAsync | protected <V> CompletableFuture<V> callAsync(Callable<V> callable, Time timeout) {
return rpcServer.callAsync(callable, timeout);
} | java | protected <V> CompletableFuture<V> callAsync(Callable<V> callable, Time timeout) {
return rpcServer.callAsync(callable, timeout);
} | [
"protected",
"<",
"V",
">",
"CompletableFuture",
"<",
"V",
">",
"callAsync",
"(",
"Callable",
"<",
"V",
">",
"callable",
",",
"Time",
"timeout",
")",
"{",
"return",
"rpcServer",
".",
"callAsync",
"(",
"callable",
",",
"timeout",
")",
";",
"}"
] | Execute the callable in the main thread of the underlying RPC service, returning a future for
the result of the callable. If the callable is not completed within the given timeout, then
the future will be failed with a {@link TimeoutException}.
@param callable Callable to be executed in the main thread of the underlyi... | [
"Execute",
"the",
"callable",
"in",
"the",
"main",
"thread",
"of",
"the",
"underlying",
"RPC",
"service",
"returning",
"a",
"future",
"for",
"the",
"result",
"of",
"the",
"callable",
".",
"If",
"the",
"callable",
"is",
"not",
"completed",
"within",
"the",
... | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/rpc/RpcEndpoint.java#L299-L301 | train | Call a callable asynchronously. | [
30522,
5123,
1026,
1058,
1028,
4012,
10814,
10880,
11263,
11244,
1026,
1058,
1028,
2655,
3022,
6038,
2278,
1006,
2655,
3085,
1026,
1058,
1028,
2655,
3085,
1010,
2051,
2051,
5833,
1007,
1063,
2709,
1054,
15042,
8043,
6299,
1012,
2655,
3022,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
apache/flink | flink-streaming-java/src/main/java/org/apache/flink/streaming/api/graph/StreamGraph.java | StreamGraph.addVirtualSelectNode | public void addVirtualSelectNode(Integer originalId, Integer virtualId, List<String> selectedNames) {
if (virtualSelectNodes.containsKey(virtualId)) {
throw new IllegalStateException("Already has virtual select node with id " + virtualId);
}
virtualSelectNodes.put(virtualId,
new Tuple2<Integer, List<Stri... | java | public void addVirtualSelectNode(Integer originalId, Integer virtualId, List<String> selectedNames) {
if (virtualSelectNodes.containsKey(virtualId)) {
throw new IllegalStateException("Already has virtual select node with id " + virtualId);
}
virtualSelectNodes.put(virtualId,
new Tuple2<Integer, List<Stri... | [
"public",
"void",
"addVirtualSelectNode",
"(",
"Integer",
"originalId",
",",
"Integer",
"virtualId",
",",
"List",
"<",
"String",
">",
"selectedNames",
")",
"{",
"if",
"(",
"virtualSelectNodes",
".",
"containsKey",
"(",
"virtualId",
")",
")",
"{",
"throw",
"new... | Adds a new virtual node that is used to connect a downstream vertex to only the outputs
with the selected names.
<p>When adding an edge from the virtual node to a downstream node the connection will be made
to the original node, only with the selected names given here.
@param originalId ID of the node that should be ... | [
"Adds",
"a",
"new",
"virtual",
"node",
"that",
"is",
"used",
"to",
"connect",
"a",
"downstream",
"vertex",
"to",
"only",
"the",
"outputs",
"with",
"the",
"selected",
"names",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-streaming-java/src/main/java/org/apache/flink/streaming/api/graph/StreamGraph.java#L290-L298 | train | Add a virtual select node. | [
30522,
2270,
11675,
5587,
21663,
26302,
4877,
12260,
6593,
3630,
3207,
1006,
16109,
2434,
3593,
1010,
16109,
7484,
3593,
1010,
2862,
1026,
5164,
1028,
3479,
18442,
2015,
1007,
1063,
2065,
1006,
7484,
11246,
22471,
3630,
6155,
1012,
3397,
14... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
apache/flink | flink-connectors/flink-connector-kafka/src/main/java/org/apache/flink/streaming/connectors/kafka/FlinkKafkaProducer.java | FlinkKafkaProducer.beginTransaction | @Override
protected FlinkKafkaProducer.KafkaTransactionState beginTransaction() throws FlinkKafkaException {
switch (semantic) {
case EXACTLY_ONCE:
FlinkKafkaInternalProducer<byte[], byte[]> producer = createTransactionalProducer();
producer.beginTransaction();
return new FlinkKafkaProducer.KafkaTrans... | java | @Override
protected FlinkKafkaProducer.KafkaTransactionState beginTransaction() throws FlinkKafkaException {
switch (semantic) {
case EXACTLY_ONCE:
FlinkKafkaInternalProducer<byte[], byte[]> producer = createTransactionalProducer();
producer.beginTransaction();
return new FlinkKafkaProducer.KafkaTrans... | [
"@",
"Override",
"protected",
"FlinkKafkaProducer",
".",
"KafkaTransactionState",
"beginTransaction",
"(",
")",
"throws",
"FlinkKafkaException",
"{",
"switch",
"(",
"semantic",
")",
"{",
"case",
"EXACTLY_ONCE",
":",
"FlinkKafkaInternalProducer",
"<",
"byte",
"[",
"]",... | ------------------- Logic for handling checkpoint flushing -------------------------- // | [
"-------------------",
"Logic",
"for",
"handling",
"checkpoint",
"flushing",
"--------------------------",
"//"
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-connectors/flink-connector-kafka/src/main/java/org/apache/flink/streaming/connectors/kafka/FlinkKafkaProducer.java#L686-L704 | train | Override beginTransaction to create a transactional producer. | [
30522,
1030,
2058,
15637,
5123,
13109,
19839,
2912,
24316,
9331,
14127,
18796,
2099,
1012,
10556,
24316,
4017,
5521,
3736,
22014,
12259,
4088,
6494,
3619,
18908,
3258,
1006,
1007,
11618,
13109,
19839,
2912,
24316,
6679,
2595,
24422,
1063,
694... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
netty/netty | codec-http2/src/main/java/io/netty/handler/codec/http2/AbstractHttp2ConnectionHandlerBuilder.java | AbstractHttp2ConnectionHandlerBuilder.connection | protected B connection(Http2Connection connection) {
enforceConstraint("connection", "maxReservedStreams", maxReservedStreams);
enforceConstraint("connection", "server", isServer);
enforceConstraint("connection", "codec", decoder);
enforceConstraint("connection", "codec", encoder);
... | java | protected B connection(Http2Connection connection) {
enforceConstraint("connection", "maxReservedStreams", maxReservedStreams);
enforceConstraint("connection", "server", isServer);
enforceConstraint("connection", "codec", decoder);
enforceConstraint("connection", "codec", encoder);
... | [
"protected",
"B",
"connection",
"(",
"Http2Connection",
"connection",
")",
"{",
"enforceConstraint",
"(",
"\"connection\"",
",",
"\"maxReservedStreams\"",
",",
"maxReservedStreams",
")",
";",
"enforceConstraint",
"(",
"\"connection\"",
",",
"\"server\"",
",",
"isServer"... | Sets the {@link Http2Connection} to use. | [
"Sets",
"the",
"{"
] | ba06eafa1c1824bd154f1a380019e7ea2edf3c4c | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/codec-http2/src/main/java/io/netty/handler/codec/http2/AbstractHttp2ConnectionHandlerBuilder.java#L222-L231 | train | Sets the connection. | [
30522,
5123,
1038,
4434,
1006,
8299,
2475,
8663,
2638,
7542,
4434,
1007,
1063,
16306,
8663,
20528,
18447,
1006,
1000,
4434,
1000,
1010,
1000,
4098,
6072,
25944,
21422,
2015,
1000,
1010,
4098,
6072,
25944,
21422,
2015,
1007,
1025,
16306,
866... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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.run | protected void run(String[] args) throws Exception {
LOG.info("Running 'run' command.");
final Options commandOptions = CliFrontendParser.getRunCommandOptions();
final Options commandLineOptions = CliFrontendParser.mergeOptions(commandOptions, customCommandLineOptions);
final CommandLine commandLine = CliFro... | java | protected void run(String[] args) throws Exception {
LOG.info("Running 'run' command.");
final Options commandOptions = CliFrontendParser.getRunCommandOptions();
final Options commandLineOptions = CliFrontendParser.mergeOptions(commandOptions, customCommandLineOptions);
final CommandLine commandLine = CliFro... | [
"protected",
"void",
"run",
"(",
"String",
"[",
"]",
"args",
")",
"throws",
"Exception",
"{",
"LOG",
".",
"info",
"(",
"\"Running 'run' command.\"",
")",
";",
"final",
"Options",
"commandOptions",
"=",
"CliFrontendParser",
".",
"getRunCommandOptions",
"(",
")",
... | Executions the run action.
@param args Command line arguments for the run action. | [
"Executions",
"the",
"run",
"action",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-clients/src/main/java/org/apache/flink/client/cli/CliFrontend.java#L171-L208 | train | Run the command. | [
30522,
5123,
11675,
2448,
1006,
5164,
1031,
1033,
12098,
5620,
1007,
11618,
6453,
1063,
8833,
1012,
18558,
1006,
1000,
2770,
1005,
2448,
1005,
3094,
1012,
1000,
1007,
1025,
2345,
7047,
15054,
16790,
2015,
1027,
18856,
10128,
4948,
6528,
189... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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.