repo
stringlengths
7
58
path
stringlengths
12
218
func_name
stringlengths
3
140
original_string
stringlengths
73
34.1k
language
stringclasses
1 value
code
stringlengths
73
34.1k
code_tokens
list
docstring
stringlengths
3
16k
docstring_tokens
list
sha
stringlengths
40
40
url
stringlengths
105
339
partition
stringclasses
1 value
eBay/parallec
src/main/java/io/parallec/core/ParallelTask.java
ParallelTask.generateTaskId
public String generateTaskId() { final String uuid = UUID.randomUUID().toString().substring(0, 12); int size = this.targetHostMeta == null ? 0 : this.targetHostMeta .getHosts().size(); return "PT_" + size + "_" + PcDateUtils.getNowDateTimeStrConciseNoZone() + "_" ...
java
public String generateTaskId() { final String uuid = UUID.randomUUID().toString().substring(0, 12); int size = this.targetHostMeta == null ? 0 : this.targetHostMeta .getHosts().size(); return "PT_" + size + "_" + PcDateUtils.getNowDateTimeStrConciseNoZone() + "_" ...
[ "public", "String", "generateTaskId", "(", ")", "{", "final", "String", "uuid", "=", "UUID", ".", "randomUUID", "(", ")", ".", "toString", "(", ")", ".", "substring", "(", "0", ",", "12", ")", ";", "int", "size", "=", "this", ".", "targetHostMeta", "...
Gen job id. @return the string
[ "Gen", "job", "id", "." ]
1b4f1628f34fedfb06b24c33a5372d64d3df0952
https://github.com/eBay/parallec/blob/1b4f1628f34fedfb06b24c33a5372d64d3df0952/src/main/java/io/parallec/core/ParallelTask.java#L521-L527
train
eBay/parallec
src/main/java/io/parallec/core/ParallelTask.java
ParallelTask.getProgress
public Double getProgress() { if (state.equals(ParallelTaskState.IN_PROGRESS)) { if (requestNum != 0) { return 100.0 * ((double) responsedNum / (double) requestNumActual); } else { return 0.0; } } if (state.equals(ParallelTask...
java
public Double getProgress() { if (state.equals(ParallelTaskState.IN_PROGRESS)) { if (requestNum != 0) { return 100.0 * ((double) responsedNum / (double) requestNumActual); } else { return 0.0; } } if (state.equals(ParallelTask...
[ "public", "Double", "getProgress", "(", ")", "{", "if", "(", "state", ".", "equals", "(", "ParallelTaskState", ".", "IN_PROGRESS", ")", ")", "{", "if", "(", "requestNum", "!=", "0", ")", "{", "return", "100.0", "*", "(", "(", "double", ")", "responsedN...
Gets the progress. @return the progress
[ "Gets", "the", "progress", "." ]
1b4f1628f34fedfb06b24c33a5372d64d3df0952
https://github.com/eBay/parallec/blob/1b4f1628f34fedfb06b24c33a5372d64d3df0952/src/main/java/io/parallec/core/ParallelTask.java#L534-L556
train
eBay/parallec
src/main/java/io/parallec/core/ParallelTask.java
ParallelTask.getAggregateResultFullSummary
public Map<String, SetAndCount> getAggregateResultFullSummary() { Map<String, SetAndCount> summaryMap = new ConcurrentHashMap<String, SetAndCount>(); for (Entry<String, LinkedHashSet<String>> entry : aggregateResultMap .entrySet()) { summaryMap.put(entry.getKey(), new SetAn...
java
public Map<String, SetAndCount> getAggregateResultFullSummary() { Map<String, SetAndCount> summaryMap = new ConcurrentHashMap<String, SetAndCount>(); for (Entry<String, LinkedHashSet<String>> entry : aggregateResultMap .entrySet()) { summaryMap.put(entry.getKey(), new SetAn...
[ "public", "Map", "<", "String", ",", "SetAndCount", ">", "getAggregateResultFullSummary", "(", ")", "{", "Map", "<", "String", ",", "SetAndCount", ">", "summaryMap", "=", "new", "ConcurrentHashMap", "<", "String", ",", "SetAndCount", ">", "(", ")", ";", "for...
Aggregate results to see the status code distribution with target hosts. @return the aggregateResultMap
[ "Aggregate", "results", "to", "see", "the", "status", "code", "distribution", "with", "target", "hosts", "." ]
1b4f1628f34fedfb06b24c33a5372d64d3df0952
https://github.com/eBay/parallec/blob/1b4f1628f34fedfb06b24c33a5372d64d3df0952/src/main/java/io/parallec/core/ParallelTask.java#L865-L875
train
eBay/parallec
src/main/java/io/parallec/core/ParallelTask.java
ParallelTask.getAggregateResultCountSummary
public Map<String, Integer> getAggregateResultCountSummary() { Map<String, Integer> summaryMap = new LinkedHashMap<String, Integer>(); for (Entry<String, LinkedHashSet<String>> entry : aggregateResultMap .entrySet()) { summaryMap.put(entry.getKey(), entry.getValue().size())...
java
public Map<String, Integer> getAggregateResultCountSummary() { Map<String, Integer> summaryMap = new LinkedHashMap<String, Integer>(); for (Entry<String, LinkedHashSet<String>> entry : aggregateResultMap .entrySet()) { summaryMap.put(entry.getKey(), entry.getValue().size())...
[ "public", "Map", "<", "String", ",", "Integer", ">", "getAggregateResultCountSummary", "(", ")", "{", "Map", "<", "String", ",", "Integer", ">", "summaryMap", "=", "new", "LinkedHashMap", "<", "String", ",", "Integer", ">", "(", ")", ";", "for", "(", "En...
Gets the aggregate result count summary. only list the counts for brief understanding @return the aggregate result count summary
[ "Gets", "the", "aggregate", "result", "count", "summary", ".", "only", "list", "the", "counts", "for", "brief", "understanding" ]
1b4f1628f34fedfb06b24c33a5372d64d3df0952
https://github.com/eBay/parallec/blob/1b4f1628f34fedfb06b24c33a5372d64d3df0952/src/main/java/io/parallec/core/ParallelTask.java#L892-L902
train
eBay/parallec
src/main/java/io/parallec/core/monitor/MonitorProvider.java
MonitorProvider.getJVMMemoryUsage
public PerformUsage getJVMMemoryUsage() { int mb = 1024 * 1024; Runtime rt = Runtime.getRuntime(); PerformUsage usage = new PerformUsage(); usage.totalMemory = (double) rt.totalMemory() / mb; usage.freeMemory = (double) rt.freeMemory() / mb; usage.usedMemory = (double) rt...
java
public PerformUsage getJVMMemoryUsage() { int mb = 1024 * 1024; Runtime rt = Runtime.getRuntime(); PerformUsage usage = new PerformUsage(); usage.totalMemory = (double) rt.totalMemory() / mb; usage.freeMemory = (double) rt.freeMemory() / mb; usage.usedMemory = (double) rt...
[ "public", "PerformUsage", "getJVMMemoryUsage", "(", ")", "{", "int", "mb", "=", "1024", "*", "1024", ";", "Runtime", "rt", "=", "Runtime", ".", "getRuntime", "(", ")", ";", "PerformUsage", "usage", "=", "new", "PerformUsage", "(", ")", ";", "usage", ".",...
Gets the JVM memory usage. @return the JVM memory usage
[ "Gets", "the", "JVM", "memory", "usage", "." ]
1b4f1628f34fedfb06b24c33a5372d64d3df0952
https://github.com/eBay/parallec/blob/1b4f1628f34fedfb06b24c33a5372d64d3df0952/src/main/java/io/parallec/core/monitor/MonitorProvider.java#L69-L83
train
eBay/parallec
src/main/java/io/parallec/core/monitor/MonitorProvider.java
MonitorProvider.getThreadDump
public ThreadInfo[] getThreadDump() { ThreadMXBean threadMxBean = ManagementFactory.getThreadMXBean(); return threadMxBean.dumpAllThreads(true, true); }
java
public ThreadInfo[] getThreadDump() { ThreadMXBean threadMxBean = ManagementFactory.getThreadMXBean(); return threadMxBean.dumpAllThreads(true, true); }
[ "public", "ThreadInfo", "[", "]", "getThreadDump", "(", ")", "{", "ThreadMXBean", "threadMxBean", "=", "ManagementFactory", ".", "getThreadMXBean", "(", ")", ";", "return", "threadMxBean", ".", "dumpAllThreads", "(", "true", ",", "true", ")", ";", "}" ]
Gets the thread dump. @return the thread dump
[ "Gets", "the", "thread", "dump", "." ]
1b4f1628f34fedfb06b24c33a5372d64d3df0952
https://github.com/eBay/parallec/blob/1b4f1628f34fedfb06b24c33a5372d64d3df0952/src/main/java/io/parallec/core/monitor/MonitorProvider.java#L90-L93
train
eBay/parallec
src/main/java/io/parallec/core/monitor/MonitorProvider.java
MonitorProvider.getThreadUsage
public ThreadUsage getThreadUsage() { ThreadMXBean threadMxBean = ManagementFactory.getThreadMXBean(); ThreadUsage threadUsage = new ThreadUsage(); long[] threadIds = threadMxBean.getAllThreadIds(); threadUsage.liveThreadCount = threadIds.length; for (long tId : threadIds) { ...
java
public ThreadUsage getThreadUsage() { ThreadMXBean threadMxBean = ManagementFactory.getThreadMXBean(); ThreadUsage threadUsage = new ThreadUsage(); long[] threadIds = threadMxBean.getAllThreadIds(); threadUsage.liveThreadCount = threadIds.length; for (long tId : threadIds) { ...
[ "public", "ThreadUsage", "getThreadUsage", "(", ")", "{", "ThreadMXBean", "threadMxBean", "=", "ManagementFactory", ".", "getThreadMXBean", "(", ")", ";", "ThreadUsage", "threadUsage", "=", "new", "ThreadUsage", "(", ")", ";", "long", "[", "]", "threadIds", "=",...
Gets the thread usage. @return the thread usage
[ "Gets", "the", "thread", "usage", "." ]
1b4f1628f34fedfb06b24c33a5372d64d3df0952
https://github.com/eBay/parallec/blob/1b4f1628f34fedfb06b24c33a5372d64d3df0952/src/main/java/io/parallec/core/monitor/MonitorProvider.java#L109-L124
train
eBay/parallec
src/main/java/io/parallec/core/monitor/MonitorProvider.java
MonitorProvider.getHealthMemory
public String getHealthMemory() { StringBuilder sb = new StringBuilder(); sb.append("Logging JVM Stats\n"); MonitorProvider mp = MonitorProvider.getInstance(); PerformUsage perf = mp.getJVMMemoryUsage(); sb.append(perf.toString()); if (perf.memoryUsagePercent >= THRESHOL...
java
public String getHealthMemory() { StringBuilder sb = new StringBuilder(); sb.append("Logging JVM Stats\n"); MonitorProvider mp = MonitorProvider.getInstance(); PerformUsage perf = mp.getJVMMemoryUsage(); sb.append(perf.toString()); if (perf.memoryUsagePercent >= THRESHOL...
[ "public", "String", "getHealthMemory", "(", ")", "{", "StringBuilder", "sb", "=", "new", "StringBuilder", "(", ")", ";", "sb", ".", "append", "(", "\"Logging JVM Stats\\n\"", ")", ";", "MonitorProvider", "mp", "=", "MonitorProvider", ".", "getInstance", "(", "...
Gets the health memory. @return the health memory
[ "Gets", "the", "health", "memory", "." ]
1b4f1628f34fedfb06b24c33a5372d64d3df0952
https://github.com/eBay/parallec/blob/1b4f1628f34fedfb06b24c33a5372d64d3df0952/src/main/java/io/parallec/core/monitor/MonitorProvider.java#L131-L154
train
eBay/parallec
src/main/java/io/parallec/core/resources/HttpClientStore.java
HttpClientStore.shutdown
public void shutdown() { for (Entry<HttpClientType, AsyncHttpClient> entry : map.entrySet()) { AsyncHttpClient client = entry.getValue(); if (client != null) client.close(); } }
java
public void shutdown() { for (Entry<HttpClientType, AsyncHttpClient> entry : map.entrySet()) { AsyncHttpClient client = entry.getValue(); if (client != null) client.close(); } }
[ "public", "void", "shutdown", "(", ")", "{", "for", "(", "Entry", "<", "HttpClientType", ",", "AsyncHttpClient", ">", "entry", ":", "map", ".", "entrySet", "(", ")", ")", "{", "AsyncHttpClient", "client", "=", "entry", ".", "getValue", "(", ")", ";", "...
Shutdown each AHC client in the map.
[ "Shutdown", "each", "AHC", "client", "in", "the", "map", "." ]
1b4f1628f34fedfb06b24c33a5372d64d3df0952
https://github.com/eBay/parallec/blob/1b4f1628f34fedfb06b24c33a5372d64d3df0952/src/main/java/io/parallec/core/resources/HttpClientStore.java#L91-L99
train
eBay/parallec
src/main/java/io/parallec/core/taskbuilder/targethosts/TargetHostsBuilder.java
TargetHostsBuilder.getContentFromPath
private String getContentFromPath(String sourcePath, HostsSourceType sourceType) throws IOException { String res = ""; if (sourceType == HostsSourceType.LOCAL_FILE) { res = PcFileNetworkIoUtils.readFileContentToString(sourcePath); } else if (sourceType == HostsSourceTyp...
java
private String getContentFromPath(String sourcePath, HostsSourceType sourceType) throws IOException { String res = ""; if (sourceType == HostsSourceType.LOCAL_FILE) { res = PcFileNetworkIoUtils.readFileContentToString(sourcePath); } else if (sourceType == HostsSourceTyp...
[ "private", "String", "getContentFromPath", "(", "String", "sourcePath", ",", "HostsSourceType", "sourceType", ")", "throws", "IOException", "{", "String", "res", "=", "\"\"", ";", "if", "(", "sourceType", "==", "HostsSourceType", ".", "LOCAL_FILE", ")", "{", "re...
note that for read from file, this will just load all to memory. not fit if need to read a very large file. However for getting the host name. normally it is fine. for reading large file, should use iostream. @param sourcePath the source path @param sourceType the source type @return the content from path @throws IOE...
[ "note", "that", "for", "read", "from", "file", "this", "will", "just", "load", "all", "to", "memory", ".", "not", "fit", "if", "need", "to", "read", "a", "very", "large", "file", ".", "However", "for", "getting", "the", "host", "name", ".", "normally",...
1b4f1628f34fedfb06b24c33a5372d64d3df0952
https://github.com/eBay/parallec/blob/1b4f1628f34fedfb06b24c33a5372d64d3df0952/src/main/java/io/parallec/core/taskbuilder/targethosts/TargetHostsBuilder.java#L60-L72
train
eBay/parallec
src/main/java/io/parallec/core/taskbuilder/targethosts/TargetHostsBuilder.java
TargetHostsBuilder.setTargetHostsFromLineByLineText
@Override public List<String> setTargetHostsFromLineByLineText(String sourcePath, HostsSourceType sourceType) throws TargetHostsLoadException { List<String> targetHosts = new ArrayList<String>(); try { String content = getContentFromPath(sourcePath, sourceType); ...
java
@Override public List<String> setTargetHostsFromLineByLineText(String sourcePath, HostsSourceType sourceType) throws TargetHostsLoadException { List<String> targetHosts = new ArrayList<String>(); try { String content = getContentFromPath(sourcePath, sourceType); ...
[ "@", "Override", "public", "List", "<", "String", ">", "setTargetHostsFromLineByLineText", "(", "String", "sourcePath", ",", "HostsSourceType", "sourceType", ")", "throws", "TargetHostsLoadException", "{", "List", "<", "String", ">", "targetHosts", "=", "new", "Arra...
get target hosts from line by line. @param sourcePath the source path @param sourceType the source type @return the list @throws TargetHostsLoadException the target hosts load exception
[ "get", "target", "hosts", "from", "line", "by", "line", "." ]
1b4f1628f34fedfb06b24c33a5372d64d3df0952
https://github.com/eBay/parallec/blob/1b4f1628f34fedfb06b24c33a5372d64d3df0952/src/main/java/io/parallec/core/taskbuilder/targethosts/TargetHostsBuilder.java#L155-L172
train
eBay/parallec
src/main/java/io/parallec/core/actor/UdpWorker.java
UdpWorker.bootStrapUdpClient
public ConnectionlessBootstrap bootStrapUdpClient() throws HttpRequestCreateException { ConnectionlessBootstrap udpClient = null; try { // Configure the client. udpClient = new ConnectionlessBootstrap(udpMeta.getChannelFactory()); udpClient.setPipeline(...
java
public ConnectionlessBootstrap bootStrapUdpClient() throws HttpRequestCreateException { ConnectionlessBootstrap udpClient = null; try { // Configure the client. udpClient = new ConnectionlessBootstrap(udpMeta.getChannelFactory()); udpClient.setPipeline(...
[ "public", "ConnectionlessBootstrap", "bootStrapUdpClient", "(", ")", "throws", "HttpRequestCreateException", "{", "ConnectionlessBootstrap", "udpClient", "=", "null", ";", "try", "{", "// Configure the client.", "udpClient", "=", "new", "ConnectionlessBootstrap", "(", "udpM...
Creates the udpClient with proper handler. @return the bound request builder @throws HttpRequestCreateException the http request create exception
[ "Creates", "the", "udpClient", "with", "proper", "handler", "." ]
1b4f1628f34fedfb06b24c33a5372d64d3df0952
https://github.com/eBay/parallec/blob/1b4f1628f34fedfb06b24c33a5372d64d3df0952/src/main/java/io/parallec/core/actor/UdpWorker.java#L126-L147
train
eBay/parallec
src/main/java/io/parallec/core/ParallelClient.java
ParallelClient.initialize
public void initialize() { if (isClosed.get()) { logger.info("Initialing Parallel Client Resources: actor system, HttpClientStore, Task Manager ...."); ActorConfig.createAndGetActorSystem(); httpClientStore.init(); tcpSshPingResourceStore.init(); isClo...
java
public void initialize() { if (isClosed.get()) { logger.info("Initialing Parallel Client Resources: actor system, HttpClientStore, Task Manager ...."); ActorConfig.createAndGetActorSystem(); httpClientStore.init(); tcpSshPingResourceStore.init(); isClo...
[ "public", "void", "initialize", "(", ")", "{", "if", "(", "isClosed", ".", "get", "(", ")", ")", "{", "logger", ".", "info", "(", "\"Initialing Parallel Client Resources: actor system, HttpClientStore, Task Manager ....\"", ")", ";", "ActorConfig", ".", "createAndGetA...
Initialize. create the httpClientStore, tcpClientStore
[ "Initialize", ".", "create", "the", "httpClientStore", "tcpClientStore" ]
1b4f1628f34fedfb06b24c33a5372d64d3df0952
https://github.com/eBay/parallec/blob/1b4f1628f34fedfb06b24c33a5372d64d3df0952/src/main/java/io/parallec/core/ParallelClient.java#L111-L122
train
eBay/parallec
src/main/java/io/parallec/core/ParallelClient.java
ParallelClient.reinitIfClosed
public void reinitIfClosed() { if (isClosed.get()) { logger.info("External Resource was released. Now Re-initializing resources ..."); ActorConfig.createAndGetActorSystem(); httpClientStore.reinit(); tcpSshPingResourceStore.reinit(); try { ...
java
public void reinitIfClosed() { if (isClosed.get()) { logger.info("External Resource was released. Now Re-initializing resources ..."); ActorConfig.createAndGetActorSystem(); httpClientStore.reinit(); tcpSshPingResourceStore.reinit(); try { ...
[ "public", "void", "reinitIfClosed", "(", ")", "{", "if", "(", "isClosed", ".", "get", "(", ")", ")", "{", "logger", ".", "info", "(", "\"External Resource was released. Now Re-initializing resources ...\"", ")", ";", "ActorConfig", ".", "createAndGetActorSystem", "(...
Auto re-initialize external resourced if resources have been already released.
[ "Auto", "re", "-", "initialize", "external", "resourced", "if", "resources", "have", "been", "already", "released", "." ]
1b4f1628f34fedfb06b24c33a5372d64d3df0952
https://github.com/eBay/parallec/blob/1b4f1628f34fedfb06b24c33a5372d64d3df0952/src/main/java/io/parallec/core/ParallelClient.java#L158-L175
train
eBay/parallec
src/main/java/io/parallec/core/ParallelClient.java
ParallelClient.prepareSsh
public ParallelTaskBuilder prepareSsh() { reinitIfClosed(); ParallelTaskBuilder cb = new ParallelTaskBuilder(); cb.setProtocol(RequestProtocol.SSH); return cb; }
java
public ParallelTaskBuilder prepareSsh() { reinitIfClosed(); ParallelTaskBuilder cb = new ParallelTaskBuilder(); cb.setProtocol(RequestProtocol.SSH); return cb; }
[ "public", "ParallelTaskBuilder", "prepareSsh", "(", ")", "{", "reinitIfClosed", "(", ")", ";", "ParallelTaskBuilder", "cb", "=", "new", "ParallelTaskBuilder", "(", ")", ";", "cb", ".", "setProtocol", "(", "RequestProtocol", ".", "SSH", ")", ";", "return", "cb"...
Prepare a parallel SSH Task. @return the parallel task builder
[ "Prepare", "a", "parallel", "SSH", "Task", "." ]
1b4f1628f34fedfb06b24c33a5372d64d3df0952
https://github.com/eBay/parallec/blob/1b4f1628f34fedfb06b24c33a5372d64d3df0952/src/main/java/io/parallec/core/ParallelClient.java#L182-L187
train
eBay/parallec
src/main/java/io/parallec/core/ParallelClient.java
ParallelClient.preparePing
public ParallelTaskBuilder preparePing() { reinitIfClosed(); ParallelTaskBuilder cb = new ParallelTaskBuilder(); cb.setProtocol(RequestProtocol.PING); return cb; }
java
public ParallelTaskBuilder preparePing() { reinitIfClosed(); ParallelTaskBuilder cb = new ParallelTaskBuilder(); cb.setProtocol(RequestProtocol.PING); return cb; }
[ "public", "ParallelTaskBuilder", "preparePing", "(", ")", "{", "reinitIfClosed", "(", ")", ";", "ParallelTaskBuilder", "cb", "=", "new", "ParallelTaskBuilder", "(", ")", ";", "cb", ".", "setProtocol", "(", "RequestProtocol", ".", "PING", ")", ";", "return", "c...
Prepare a parallel PING Task. @return the parallel task builder
[ "Prepare", "a", "parallel", "PING", "Task", "." ]
1b4f1628f34fedfb06b24c33a5372d64d3df0952
https://github.com/eBay/parallec/blob/1b4f1628f34fedfb06b24c33a5372d64d3df0952/src/main/java/io/parallec/core/ParallelClient.java#L194-L199
train
eBay/parallec
src/main/java/io/parallec/core/ParallelClient.java
ParallelClient.prepareTcp
public ParallelTaskBuilder prepareTcp(String command) { reinitIfClosed(); ParallelTaskBuilder cb = new ParallelTaskBuilder(); cb.setProtocol(RequestProtocol.TCP); cb.getTcpMeta().setCommand(command); return cb; }
java
public ParallelTaskBuilder prepareTcp(String command) { reinitIfClosed(); ParallelTaskBuilder cb = new ParallelTaskBuilder(); cb.setProtocol(RequestProtocol.TCP); cb.getTcpMeta().setCommand(command); return cb; }
[ "public", "ParallelTaskBuilder", "prepareTcp", "(", "String", "command", ")", "{", "reinitIfClosed", "(", ")", ";", "ParallelTaskBuilder", "cb", "=", "new", "ParallelTaskBuilder", "(", ")", ";", "cb", ".", "setProtocol", "(", "RequestProtocol", ".", "TCP", ")", ...
Prepare a parallel TCP Task. @param command the command @return the parallel task builder
[ "Prepare", "a", "parallel", "TCP", "Task", "." ]
1b4f1628f34fedfb06b24c33a5372d64d3df0952
https://github.com/eBay/parallec/blob/1b4f1628f34fedfb06b24c33a5372d64d3df0952/src/main/java/io/parallec/core/ParallelClient.java#L208-L214
train
eBay/parallec
src/main/java/io/parallec/core/ParallelClient.java
ParallelClient.prepareUdp
public ParallelTaskBuilder prepareUdp(String command) { reinitIfClosed(); ParallelTaskBuilder cb = new ParallelTaskBuilder(); cb.setProtocol(RequestProtocol.UDP); cb.getUdpMeta().setCommand(command); return cb; }
java
public ParallelTaskBuilder prepareUdp(String command) { reinitIfClosed(); ParallelTaskBuilder cb = new ParallelTaskBuilder(); cb.setProtocol(RequestProtocol.UDP); cb.getUdpMeta().setCommand(command); return cb; }
[ "public", "ParallelTaskBuilder", "prepareUdp", "(", "String", "command", ")", "{", "reinitIfClosed", "(", ")", ";", "ParallelTaskBuilder", "cb", "=", "new", "ParallelTaskBuilder", "(", ")", ";", "cb", ".", "setProtocol", "(", "RequestProtocol", ".", "UDP", ")", ...
Prepare a parallel UDP Task. @param command the command @return the parallel task builder
[ "Prepare", "a", "parallel", "UDP", "Task", "." ]
1b4f1628f34fedfb06b24c33a5372d64d3df0952
https://github.com/eBay/parallec/blob/1b4f1628f34fedfb06b24c33a5372d64d3df0952/src/main/java/io/parallec/core/ParallelClient.java#L223-L229
train
eBay/parallec
src/main/java/io/parallec/core/ParallelClient.java
ParallelClient.prepareHttpGet
public ParallelTaskBuilder prepareHttpGet(String url) { reinitIfClosed(); ParallelTaskBuilder cb = new ParallelTaskBuilder(); cb.getHttpMeta().setHttpMethod(HttpMethod.GET); cb.getHttpMeta().setRequestUrlPostfix(url); return cb; }
java
public ParallelTaskBuilder prepareHttpGet(String url) { reinitIfClosed(); ParallelTaskBuilder cb = new ParallelTaskBuilder(); cb.getHttpMeta().setHttpMethod(HttpMethod.GET); cb.getHttpMeta().setRequestUrlPostfix(url); return cb; }
[ "public", "ParallelTaskBuilder", "prepareHttpGet", "(", "String", "url", ")", "{", "reinitIfClosed", "(", ")", ";", "ParallelTaskBuilder", "cb", "=", "new", "ParallelTaskBuilder", "(", ")", ";", "cb", ".", "getHttpMeta", "(", ")", ".", "setHttpMethod", "(", "H...
Prepare a parallel HTTP GET Task. @param url the UrlPostfix: e.g. in http://localhost:8080/index.html.,the url is "/index.html" @return the parallel task builder
[ "Prepare", "a", "parallel", "HTTP", "GET", "Task", "." ]
1b4f1628f34fedfb06b24c33a5372d64d3df0952
https://github.com/eBay/parallec/blob/1b4f1628f34fedfb06b24c33a5372d64d3df0952/src/main/java/io/parallec/core/ParallelClient.java#L238-L246
train
eBay/parallec
src/main/java/io/parallec/core/ParallelClient.java
ParallelClient.prepareHttpPost
public ParallelTaskBuilder prepareHttpPost(String url) { reinitIfClosed(); ParallelTaskBuilder cb = new ParallelTaskBuilder(); cb.getHttpMeta().setHttpMethod(HttpMethod.POST); cb.getHttpMeta().setRequestUrlPostfix(url); return cb; }
java
public ParallelTaskBuilder prepareHttpPost(String url) { reinitIfClosed(); ParallelTaskBuilder cb = new ParallelTaskBuilder(); cb.getHttpMeta().setHttpMethod(HttpMethod.POST); cb.getHttpMeta().setRequestUrlPostfix(url); return cb; }
[ "public", "ParallelTaskBuilder", "prepareHttpPost", "(", "String", "url", ")", "{", "reinitIfClosed", "(", ")", ";", "ParallelTaskBuilder", "cb", "=", "new", "ParallelTaskBuilder", "(", ")", ";", "cb", ".", "getHttpMeta", "(", ")", ".", "setHttpMethod", "(", "...
Prepare a parallel HTTP POST Task. @param url the UrlPostfix: e.g. in http://localhost:8080/index.html.,the url is "/index.html" @return the parallel task builder
[ "Prepare", "a", "parallel", "HTTP", "POST", "Task", "." ]
1b4f1628f34fedfb06b24c33a5372d64d3df0952
https://github.com/eBay/parallec/blob/1b4f1628f34fedfb06b24c33a5372d64d3df0952/src/main/java/io/parallec/core/ParallelClient.java#L255-L261
train
eBay/parallec
src/main/java/io/parallec/core/ParallelClient.java
ParallelClient.prepareHttpDelete
public ParallelTaskBuilder prepareHttpDelete(String url) { reinitIfClosed(); ParallelTaskBuilder cb = new ParallelTaskBuilder(); cb.getHttpMeta().setHttpMethod(HttpMethod.DELETE); cb.getHttpMeta().setRequestUrlPostfix(url); return cb; }
java
public ParallelTaskBuilder prepareHttpDelete(String url) { reinitIfClosed(); ParallelTaskBuilder cb = new ParallelTaskBuilder(); cb.getHttpMeta().setHttpMethod(HttpMethod.DELETE); cb.getHttpMeta().setRequestUrlPostfix(url); return cb; }
[ "public", "ParallelTaskBuilder", "prepareHttpDelete", "(", "String", "url", ")", "{", "reinitIfClosed", "(", ")", ";", "ParallelTaskBuilder", "cb", "=", "new", "ParallelTaskBuilder", "(", ")", ";", "cb", ".", "getHttpMeta", "(", ")", ".", "setHttpMethod", "(", ...
Prepare a parallel HTTP DELETE Task. @param url the UrlPostfix: e.g. in http://localhost:8080/index.html.,the url is "/index.html" @return the parallel task builder
[ "Prepare", "a", "parallel", "HTTP", "DELETE", "Task", "." ]
1b4f1628f34fedfb06b24c33a5372d64d3df0952
https://github.com/eBay/parallec/blob/1b4f1628f34fedfb06b24c33a5372d64d3df0952/src/main/java/io/parallec/core/ParallelClient.java#L270-L277
train
eBay/parallec
src/main/java/io/parallec/core/ParallelClient.java
ParallelClient.prepareHttpPut
public ParallelTaskBuilder prepareHttpPut(String url) { reinitIfClosed(); ParallelTaskBuilder cb = new ParallelTaskBuilder(); cb.getHttpMeta().setHttpMethod(HttpMethod.PUT); cb.getHttpMeta().setRequestUrlPostfix(url); return cb; }
java
public ParallelTaskBuilder prepareHttpPut(String url) { reinitIfClosed(); ParallelTaskBuilder cb = new ParallelTaskBuilder(); cb.getHttpMeta().setHttpMethod(HttpMethod.PUT); cb.getHttpMeta().setRequestUrlPostfix(url); return cb; }
[ "public", "ParallelTaskBuilder", "prepareHttpPut", "(", "String", "url", ")", "{", "reinitIfClosed", "(", ")", ";", "ParallelTaskBuilder", "cb", "=", "new", "ParallelTaskBuilder", "(", ")", ";", "cb", ".", "getHttpMeta", "(", ")", ".", "setHttpMethod", "(", "H...
Prepare a parallel HTTP PUT Task. @param url the UrlPostfix: e.g. in http://localhost:8080/index.html.,the url is "/index.html" @return the parallel task builder
[ "Prepare", "a", "parallel", "HTTP", "PUT", "Task", "." ]
1b4f1628f34fedfb06b24c33a5372d64d3df0952
https://github.com/eBay/parallec/blob/1b4f1628f34fedfb06b24c33a5372d64d3df0952/src/main/java/io/parallec/core/ParallelClient.java#L286-L293
train
eBay/parallec
src/main/java/io/parallec/core/ParallelClient.java
ParallelClient.prepareHttpHead
public ParallelTaskBuilder prepareHttpHead(String url) { reinitIfClosed(); ParallelTaskBuilder cb = new ParallelTaskBuilder(); cb.getHttpMeta().setHttpMethod(HttpMethod.HEAD); cb.getHttpMeta().setRequestUrlPostfix(url); return cb; }
java
public ParallelTaskBuilder prepareHttpHead(String url) { reinitIfClosed(); ParallelTaskBuilder cb = new ParallelTaskBuilder(); cb.getHttpMeta().setHttpMethod(HttpMethod.HEAD); cb.getHttpMeta().setRequestUrlPostfix(url); return cb; }
[ "public", "ParallelTaskBuilder", "prepareHttpHead", "(", "String", "url", ")", "{", "reinitIfClosed", "(", ")", ";", "ParallelTaskBuilder", "cb", "=", "new", "ParallelTaskBuilder", "(", ")", ";", "cb", ".", "getHttpMeta", "(", ")", ".", "setHttpMethod", "(", "...
Prepare a parallel HTTP HEAD Task. @param url the UrlPostfix: e.g. in http://localhost:8080/index.html.,the url is "/index.html" @return the parallel task builder
[ "Prepare", "a", "parallel", "HTTP", "HEAD", "Task", "." ]
1b4f1628f34fedfb06b24c33a5372d64d3df0952
https://github.com/eBay/parallec/blob/1b4f1628f34fedfb06b24c33a5372d64d3df0952/src/main/java/io/parallec/core/ParallelClient.java#L302-L308
train
eBay/parallec
src/main/java/io/parallec/core/ParallelClient.java
ParallelClient.prepareHttpOptions
public ParallelTaskBuilder prepareHttpOptions(String url) { reinitIfClosed(); ParallelTaskBuilder cb = new ParallelTaskBuilder(); cb.getHttpMeta().setHttpMethod(HttpMethod.OPTIONS); cb.getHttpMeta().setRequestUrlPostfix(url); return cb; }
java
public ParallelTaskBuilder prepareHttpOptions(String url) { reinitIfClosed(); ParallelTaskBuilder cb = new ParallelTaskBuilder(); cb.getHttpMeta().setHttpMethod(HttpMethod.OPTIONS); cb.getHttpMeta().setRequestUrlPostfix(url); return cb; }
[ "public", "ParallelTaskBuilder", "prepareHttpOptions", "(", "String", "url", ")", "{", "reinitIfClosed", "(", ")", ";", "ParallelTaskBuilder", "cb", "=", "new", "ParallelTaskBuilder", "(", ")", ";", "cb", ".", "getHttpMeta", "(", ")", ".", "setHttpMethod", "(", ...
Prepare a parallel HTTP OPTION Task. @param url the UrlPostfix: e.g. in http://localhost:8080/index.html.,the url is "/index.html" @return the parallel task builder
[ "Prepare", "a", "parallel", "HTTP", "OPTION", "Task", "." ]
1b4f1628f34fedfb06b24c33a5372d64d3df0952
https://github.com/eBay/parallec/blob/1b4f1628f34fedfb06b24c33a5372d64d3df0952/src/main/java/io/parallec/core/ParallelClient.java#L317-L324
train
eBay/parallec
src/main/java/io/parallec/core/actor/ExecutionManager.java
ExecutionManager.cancelRequestAndWorkers
@SuppressWarnings("deprecation") private void cancelRequestAndWorkers() { for (ActorRef worker : workers.values()) { if (worker != null && !worker.isTerminated()) { worker.tell(OperationWorkerMsgType.CANCEL, getSelf()); } } logger.info("ExecutionMana...
java
@SuppressWarnings("deprecation") private void cancelRequestAndWorkers() { for (ActorRef worker : workers.values()) { if (worker != null && !worker.isTerminated()) { worker.tell(OperationWorkerMsgType.CANCEL, getSelf()); } } logger.info("ExecutionMana...
[ "@", "SuppressWarnings", "(", "\"deprecation\"", ")", "private", "void", "cancelRequestAndWorkers", "(", ")", "{", "for", "(", "ActorRef", "worker", ":", "workers", ".", "values", "(", ")", ")", "{", "if", "(", "worker", "!=", "null", "&&", "!", "worker", ...
Cancel request and workers.
[ "Cancel", "request", "and", "workers", "." ]
1b4f1628f34fedfb06b24c33a5372d64d3df0952
https://github.com/eBay/parallec/blob/1b4f1628f34fedfb06b24c33a5372d64d3df0952/src/main/java/io/parallec/core/actor/ExecutionManager.java#L688-L699
train
eBay/parallec
src/main/java/io/parallec/core/actor/ExecutionManager.java
ExecutionManager.cancelRequestAndWorkerOnHost
@SuppressWarnings("deprecation") private void cancelRequestAndWorkerOnHost(List<String> targetHosts) { List<String> validTargetHosts = new ArrayList<String>(workers.keySet()); validTargetHosts.retainAll(targetHosts); logger.info("targetHosts for cancel: Total: {}" + " Valid ...
java
@SuppressWarnings("deprecation") private void cancelRequestAndWorkerOnHost(List<String> targetHosts) { List<String> validTargetHosts = new ArrayList<String>(workers.keySet()); validTargetHosts.retainAll(targetHosts); logger.info("targetHosts for cancel: Total: {}" + " Valid ...
[ "@", "SuppressWarnings", "(", "\"deprecation\"", ")", "private", "void", "cancelRequestAndWorkerOnHost", "(", "List", "<", "String", ">", "targetHosts", ")", "{", "List", "<", "String", ">", "validTargetHosts", "=", "new", "ArrayList", "<", "String", ">", "(", ...
Cancel request and worker on host. @param targetHosts the target hosts
[ "Cancel", "request", "and", "worker", "on", "host", "." ]
1b4f1628f34fedfb06b24c33a5372d64d3df0952
https://github.com/eBay/parallec/blob/1b4f1628f34fedfb06b24c33a5372d64d3df0952/src/main/java/io/parallec/core/actor/ExecutionManager.java#L707-L732
train
eBay/parallec
src/main/java/io/parallec/core/commander/workflow/ssh/SshProvider.java
SshProvider.startSshSessionAndObtainSession
public Session startSshSessionAndObtainSession() { Session session = null; try { JSch jsch = new JSch(); if (sshMeta.getSshLoginType() == SshLoginType.KEY) { String workingDir = System.getProperty("user.dir"); String privKeyAbsPath = workingDir ...
java
public Session startSshSessionAndObtainSession() { Session session = null; try { JSch jsch = new JSch(); if (sshMeta.getSshLoginType() == SshLoginType.KEY) { String workingDir = System.getProperty("user.dir"); String privKeyAbsPath = workingDir ...
[ "public", "Session", "startSshSessionAndObtainSession", "(", ")", "{", "Session", "session", "=", "null", ";", "try", "{", "JSch", "jsch", "=", "new", "JSch", "(", ")", ";", "if", "(", "sshMeta", ".", "getSshLoginType", "(", ")", "==", "SshLoginType", ".",...
Start ssh session and obtain session. @return the session
[ "Start", "ssh", "session", "and", "obtain", "session", "." ]
1b4f1628f34fedfb06b24c33a5372d64d3df0952
https://github.com/eBay/parallec/blob/1b4f1628f34fedfb06b24c33a5372d64d3df0952/src/main/java/io/parallec/core/commander/workflow/ssh/SshProvider.java#L114-L151
train
eBay/parallec
src/main/java/io/parallec/core/commander/workflow/ssh/SshProvider.java
SshProvider.sessionConnectGenerateChannel
public Channel sessionConnectGenerateChannel(Session session) throws JSchException { // set timeout session.connect(sshMeta.getSshConnectionTimeoutMillis()); ChannelExec channel = (ChannelExec) session.openChannel("exec"); channel.setCommand(sshMeta.getCommandLine()); ...
java
public Channel sessionConnectGenerateChannel(Session session) throws JSchException { // set timeout session.connect(sshMeta.getSshConnectionTimeoutMillis()); ChannelExec channel = (ChannelExec) session.openChannel("exec"); channel.setCommand(sshMeta.getCommandLine()); ...
[ "public", "Channel", "sessionConnectGenerateChannel", "(", "Session", "session", ")", "throws", "JSchException", "{", "// set timeout", "session", ".", "connect", "(", "sshMeta", ".", "getSshConnectionTimeoutMillis", "(", ")", ")", ";", "ChannelExec", "channel", "=", ...
Session connect generate channel. @param session the session @return the channel @throws JSchException the j sch exception
[ "Session", "connect", "generate", "channel", "." ]
1b4f1628f34fedfb06b24c33a5372d64d3df0952
https://github.com/eBay/parallec/blob/1b4f1628f34fedfb06b24c33a5372d64d3df0952/src/main/java/io/parallec/core/commander/workflow/ssh/SshProvider.java#L162-L193
train
eBay/parallec
src/main/java/io/parallec/core/commander/workflow/ssh/SshProvider.java
SshProvider.genErrorResponse
public ResponseOnSingeRequest genErrorResponse(Exception t) { ResponseOnSingeRequest sshResponse = new ResponseOnSingeRequest(); String displayError = PcErrorMsgUtils.replaceErrorMsg(t.toString()); sshResponse.setStackTrace(PcStringUtils.printStackTrace(t)); sshResponse.setErrorMessage(...
java
public ResponseOnSingeRequest genErrorResponse(Exception t) { ResponseOnSingeRequest sshResponse = new ResponseOnSingeRequest(); String displayError = PcErrorMsgUtils.replaceErrorMsg(t.toString()); sshResponse.setStackTrace(PcStringUtils.printStackTrace(t)); sshResponse.setErrorMessage(...
[ "public", "ResponseOnSingeRequest", "genErrorResponse", "(", "Exception", "t", ")", "{", "ResponseOnSingeRequest", "sshResponse", "=", "new", "ResponseOnSingeRequest", "(", ")", ";", "String", "displayError", "=", "PcErrorMsgUtils", ".", "replaceErrorMsg", "(", "t", "...
Gen error response. @param t the t @return the response on single request
[ "Gen", "error", "response", "." ]
1b4f1628f34fedfb06b24c33a5372d64d3df0952
https://github.com/eBay/parallec/blob/1b4f1628f34fedfb06b24c33a5372d64d3df0952/src/main/java/io/parallec/core/commander/workflow/ssh/SshProvider.java#L257-L271
train
eBay/parallec
src/main/java/io/parallec/core/commander/workflow/InternalDataProvider.java
InternalDataProvider.genNodeDataMap
public void genNodeDataMap(ParallelTask task) { TargetHostMeta targetHostMeta = task.getTargetHostMeta(); HttpMeta httpMeta = task.getHttpMeta(); String entityBody = httpMeta.getEntityBody(); String requestContent = HttpMeta .replaceDefaultFullRequestContent(entityBody)...
java
public void genNodeDataMap(ParallelTask task) { TargetHostMeta targetHostMeta = task.getTargetHostMeta(); HttpMeta httpMeta = task.getHttpMeta(); String entityBody = httpMeta.getEntityBody(); String requestContent = HttpMeta .replaceDefaultFullRequestContent(entityBody)...
[ "public", "void", "genNodeDataMap", "(", "ParallelTask", "task", ")", "{", "TargetHostMeta", "targetHostMeta", "=", "task", ".", "getTargetHostMeta", "(", ")", ";", "HttpMeta", "httpMeta", "=", "task", ".", "getHttpMeta", "(", ")", ";", "String", "entityBody", ...
Generate node data map. @param task the job info
[ "Generate", "node", "data", "map", "." ]
1b4f1628f34fedfb06b24c33a5372d64d3df0952
https://github.com/eBay/parallec/blob/1b4f1628f34fedfb06b24c33a5372d64d3df0952/src/main/java/io/parallec/core/commander/workflow/InternalDataProvider.java#L64-L80
train
eBay/parallec
src/main/java/io/parallec/core/commander/workflow/InternalDataProvider.java
InternalDataProvider.filterUnsafeOrUnnecessaryRequest
public void filterUnsafeOrUnnecessaryRequest( Map<String, NodeReqResponse> nodeDataMapValidSource, Map<String, NodeReqResponse> nodeDataMapValidSafe) { for (Entry<String, NodeReqResponse> entry : nodeDataMapValidSource .entrySet()) { String hostName = entry....
java
public void filterUnsafeOrUnnecessaryRequest( Map<String, NodeReqResponse> nodeDataMapValidSource, Map<String, NodeReqResponse> nodeDataMapValidSafe) { for (Entry<String, NodeReqResponse> entry : nodeDataMapValidSource .entrySet()) { String hostName = entry....
[ "public", "void", "filterUnsafeOrUnnecessaryRequest", "(", "Map", "<", "String", ",", "NodeReqResponse", ">", "nodeDataMapValidSource", ",", "Map", "<", "String", ",", "NodeReqResponse", ">", "nodeDataMapValidSafe", ")", "{", "for", "(", "Entry", "<", "String", ",...
Filter unsafe or unnecessary request. @param nodeDataMapValidSource the node data map valid source @param nodeDataMapValidSafe the node data map valid safe
[ "Filter", "unsafe", "or", "unnecessary", "request", "." ]
1b4f1628f34fedfb06b24c33a5372d64d3df0952
https://github.com/eBay/parallec/blob/1b4f1628f34fedfb06b24c33a5372d64d3df0952/src/main/java/io/parallec/core/commander/workflow/InternalDataProvider.java#L90-L122
train
eBay/parallec
src/main/java/io/parallec/core/actor/TcpWorker.java
TcpWorker.bootStrapTcpClient
public ClientBootstrap bootStrapTcpClient() throws HttpRequestCreateException { ClientBootstrap tcpClient = null; try { // Configure the client. tcpClient = new ClientBootstrap(tcpMeta.getChannelFactory()); // Configure the pipeline factory. ...
java
public ClientBootstrap bootStrapTcpClient() throws HttpRequestCreateException { ClientBootstrap tcpClient = null; try { // Configure the client. tcpClient = new ClientBootstrap(tcpMeta.getChannelFactory()); // Configure the pipeline factory. ...
[ "public", "ClientBootstrap", "bootStrapTcpClient", "(", ")", "throws", "HttpRequestCreateException", "{", "ClientBootstrap", "tcpClient", "=", "null", ";", "try", "{", "// Configure the client.", "tcpClient", "=", "new", "ClientBootstrap", "(", "tcpMeta", ".", "getChann...
Creates the tcpClient with proper handler. @return the bound request builder @throws HttpRequestCreateException the http request create exception
[ "Creates", "the", "tcpClient", "with", "proper", "handler", "." ]
1b4f1628f34fedfb06b24c33a5372d64d3df0952
https://github.com/eBay/parallec/blob/1b4f1628f34fedfb06b24c33a5372d64d3df0952/src/main/java/io/parallec/core/actor/TcpWorker.java#L127-L154
train
eBay/parallec
src/main/java/io/parallec/core/actor/TcpWorker.java
TcpWorker.reply
private void reply(final String response, final boolean error, final String errorMessage, final String stackTrace, final String statusCode, final int statusCodeInt) { if (!sentReply) { //must update sentReply first to avoid duplicated msg. s...
java
private void reply(final String response, final boolean error, final String errorMessage, final String stackTrace, final String statusCode, final int statusCodeInt) { if (!sentReply) { //must update sentReply first to avoid duplicated msg. s...
[ "private", "void", "reply", "(", "final", "String", "response", ",", "final", "boolean", "error", ",", "final", "String", "errorMessage", ",", "final", "String", "stackTrace", ",", "final", "String", "statusCode", ",", "final", "int", "statusCodeInt", ")", "{"...
First close the connection. Then reply. @param response the response @param error the error @param errorMessage the error message @param stackTrace the stack trace @param statusCode the status code @param statusCodeInt the status code int
[ "First", "close", "the", "connection", ".", "Then", "reply", "." ]
1b4f1628f34fedfb06b24c33a5372d64d3df0952
https://github.com/eBay/parallec/blob/1b4f1628f34fedfb06b24c33a5372d64d3df0952/src/main/java/io/parallec/core/actor/TcpWorker.java#L304-L328
train
eBay/parallec
src/main/java/io/parallec/core/FilterRegex.java
FilterRegex.stringMatcherByPattern
public static String stringMatcherByPattern(String input, String patternStr) { String output = PcConstants.SYSTEM_FAIL_MATCH_REGEX; // 20140105: fix the NPE issue if (patternStr == null) { logger.error("patternStr is NULL! (Expected when the aggregation rule is not defined at " ...
java
public static String stringMatcherByPattern(String input, String patternStr) { String output = PcConstants.SYSTEM_FAIL_MATCH_REGEX; // 20140105: fix the NPE issue if (patternStr == null) { logger.error("patternStr is NULL! (Expected when the aggregation rule is not defined at " ...
[ "public", "static", "String", "stringMatcherByPattern", "(", "String", "input", ",", "String", "patternStr", ")", "{", "String", "output", "=", "PcConstants", ".", "SYSTEM_FAIL_MATCH_REGEX", ";", "// 20140105: fix the NPE issue", "if", "(", "patternStr", "==", "null",...
this remove the linebreak. @param input the input @param patternStr the pattern str @return the string
[ "this", "remove", "the", "linebreak", "." ]
1b4f1628f34fedfb06b24c33a5372d64d3df0952
https://github.com/eBay/parallec/blob/1b4f1628f34fedfb06b24c33a5372d64d3df0952/src/main/java/io/parallec/core/FilterRegex.java#L65-L94
train
eBay/parallec
src/main/java/io/parallec/core/task/ParallelTaskManager.java
ParallelTaskManager.initTaskSchedulerIfNot
public synchronized void initTaskSchedulerIfNot() { if (scheduler == null) { scheduler = Executors .newSingleThreadScheduledExecutor(DaemonThreadFactory .getInstance()); CapacityAwareTaskScheduler runner = new CapacityAwareTaskScheduler();...
java
public synchronized void initTaskSchedulerIfNot() { if (scheduler == null) { scheduler = Executors .newSingleThreadScheduledExecutor(DaemonThreadFactory .getInstance()); CapacityAwareTaskScheduler runner = new CapacityAwareTaskScheduler();...
[ "public", "synchronized", "void", "initTaskSchedulerIfNot", "(", ")", "{", "if", "(", "scheduler", "==", "null", ")", "{", "scheduler", "=", "Executors", ".", "newSingleThreadScheduledExecutor", "(", "DaemonThreadFactory", ".", "getInstance", "(", ")", ")", ";", ...
as it is daemon thread TODO when release external resources should shutdown the scheduler.
[ "as", "it", "is", "daemon", "thread" ]
1b4f1628f34fedfb06b24c33a5372d64d3df0952
https://github.com/eBay/parallec/blob/1b4f1628f34fedfb06b24c33a5372d64d3df0952/src/main/java/io/parallec/core/task/ParallelTaskManager.java#L107-L121
train
eBay/parallec
src/main/java/io/parallec/core/task/ParallelTaskManager.java
ParallelTaskManager.shutdownTaskScheduler
public synchronized void shutdownTaskScheduler(){ if (scheduler != null && !scheduler.isShutdown()) { scheduler.shutdown(); logger.info("shutdowned the task scheduler. No longer accepting new tasks"); scheduler = null; } }
java
public synchronized void shutdownTaskScheduler(){ if (scheduler != null && !scheduler.isShutdown()) { scheduler.shutdown(); logger.info("shutdowned the task scheduler. No longer accepting new tasks"); scheduler = null; } }
[ "public", "synchronized", "void", "shutdownTaskScheduler", "(", ")", "{", "if", "(", "scheduler", "!=", "null", "&&", "!", "scheduler", ".", "isShutdown", "(", ")", ")", "{", "scheduler", ".", "shutdown", "(", ")", ";", "logger", ".", "info", "(", "\"shu...
Shutdown task scheduler.
[ "Shutdown", "task", "scheduler", "." ]
1b4f1628f34fedfb06b24c33a5372d64d3df0952
https://github.com/eBay/parallec/blob/1b4f1628f34fedfb06b24c33a5372d64d3df0952/src/main/java/io/parallec/core/task/ParallelTaskManager.java#L126-L132
train
eBay/parallec
src/main/java/io/parallec/core/task/ParallelTaskManager.java
ParallelTaskManager.getTaskFromInProgressMap
public ParallelTask getTaskFromInProgressMap(String jobId) { if (!inprogressTaskMap.containsKey(jobId)) return null; return inprogressTaskMap.get(jobId); }
java
public ParallelTask getTaskFromInProgressMap(String jobId) { if (!inprogressTaskMap.containsKey(jobId)) return null; return inprogressTaskMap.get(jobId); }
[ "public", "ParallelTask", "getTaskFromInProgressMap", "(", "String", "jobId", ")", "{", "if", "(", "!", "inprogressTaskMap", ".", "containsKey", "(", "jobId", ")", ")", "return", "null", ";", "return", "inprogressTaskMap", ".", "get", "(", "jobId", ")", ";", ...
Gets the task from in progress map. @param jobId the job id @return the task from in progress map
[ "Gets", "the", "task", "from", "in", "progress", "map", "." ]
1b4f1628f34fedfb06b24c33a5372d64d3df0952
https://github.com/eBay/parallec/blob/1b4f1628f34fedfb06b24c33a5372d64d3df0952/src/main/java/io/parallec/core/task/ParallelTaskManager.java#L141-L145
train
eBay/parallec
src/main/java/io/parallec/core/task/ParallelTaskManager.java
ParallelTaskManager.getTotalUsedCapacity
public int getTotalUsedCapacity() { int totalCapacity = 0; for (Entry<String, ParallelTask> entry : inprogressTaskMap.entrySet()) { ParallelTask task = entry.getValue(); if (task != null) totalCapacity += task.capacityUsed(); } return totalCapacit...
java
public int getTotalUsedCapacity() { int totalCapacity = 0; for (Entry<String, ParallelTask> entry : inprogressTaskMap.entrySet()) { ParallelTask task = entry.getValue(); if (task != null) totalCapacity += task.capacityUsed(); } return totalCapacit...
[ "public", "int", "getTotalUsedCapacity", "(", ")", "{", "int", "totalCapacity", "=", "0", ";", "for", "(", "Entry", "<", "String", ",", "ParallelTask", ">", "entry", ":", "inprogressTaskMap", ".", "entrySet", "(", ")", ")", "{", "ParallelTask", "task", "="...
get current total used capacity. @return the total used capacity
[ "get", "current", "total", "used", "capacity", "." ]
1b4f1628f34fedfb06b24c33a5372d64d3df0952
https://github.com/eBay/parallec/blob/1b4f1628f34fedfb06b24c33a5372d64d3df0952/src/main/java/io/parallec/core/task/ParallelTaskManager.java#L152-L161
train
eBay/parallec
src/main/java/io/parallec/core/task/ParallelTaskManager.java
ParallelTaskManager.cleanWaitTaskQueue
public synchronized void cleanWaitTaskQueue() { for (ParallelTask task : waitQ) { task.setState(ParallelTaskState.COMPLETED_WITH_ERROR); task.getTaskErrorMetas().add( new TaskErrorMeta(TaskErrorType.USER_CANCELED, "NA")); logger.info( ...
java
public synchronized void cleanWaitTaskQueue() { for (ParallelTask task : waitQ) { task.setState(ParallelTaskState.COMPLETED_WITH_ERROR); task.getTaskErrorMetas().add( new TaskErrorMeta(TaskErrorType.USER_CANCELED, "NA")); logger.info( ...
[ "public", "synchronized", "void", "cleanWaitTaskQueue", "(", ")", "{", "for", "(", "ParallelTask", "task", ":", "waitQ", ")", "{", "task", ".", "setState", "(", "ParallelTaskState", ".", "COMPLETED_WITH_ERROR", ")", ";", "task", ".", "getTaskErrorMetas", "(", ...
Clean wait task queue.
[ "Clean", "wait", "task", "queue", "." ]
1b4f1628f34fedfb06b24c33a5372d64d3df0952
https://github.com/eBay/parallec/blob/1b4f1628f34fedfb06b24c33a5372d64d3df0952/src/main/java/io/parallec/core/task/ParallelTaskManager.java#L206-L219
train
eBay/parallec
src/main/java/io/parallec/core/task/ParallelTaskManager.java
ParallelTaskManager.removeTaskFromWaitQ
public synchronized boolean removeTaskFromWaitQ(ParallelTask taskTobeRemoved) { boolean removed = false; for (ParallelTask task : waitQ) { if (task.getTaskId() == taskTobeRemoved.getTaskId()) { task.setState(ParallelTaskState.COMPLETED_WITH_ERROR); task.getTa...
java
public synchronized boolean removeTaskFromWaitQ(ParallelTask taskTobeRemoved) { boolean removed = false; for (ParallelTask task : waitQ) { if (task.getTaskId() == taskTobeRemoved.getTaskId()) { task.setState(ParallelTaskState.COMPLETED_WITH_ERROR); task.getTa...
[ "public", "synchronized", "boolean", "removeTaskFromWaitQ", "(", "ParallelTask", "taskTobeRemoved", ")", "{", "boolean", "removed", "=", "false", ";", "for", "(", "ParallelTask", "task", ":", "waitQ", ")", "{", "if", "(", "task", ".", "getTaskId", "(", ")", ...
Removes the task from wait q. @param taskTobeRemoved the task tobe removed @return true, if successful
[ "Removes", "the", "task", "from", "wait", "q", "." ]
1b4f1628f34fedfb06b24c33a5372d64d3df0952
https://github.com/eBay/parallec/blob/1b4f1628f34fedfb06b24c33a5372d64d3df0952/src/main/java/io/parallec/core/task/ParallelTaskManager.java#L228-L244
train
eBay/parallec
src/main/java/io/parallec/core/task/ParallelTaskManager.java
ParallelTaskManager.generateUpdateExecuteTask
public ResponseFromManager generateUpdateExecuteTask(ParallelTask task) { // add to map now; as can only pass final ParallelTaskManager.getInstance().addTaskToInProgressMap( task.getTaskId(), task); logger.info("Added task {} to the running inprogress map...", ta...
java
public ResponseFromManager generateUpdateExecuteTask(ParallelTask task) { // add to map now; as can only pass final ParallelTaskManager.getInstance().addTaskToInProgressMap( task.getTaskId(), task); logger.info("Added task {} to the running inprogress map...", ta...
[ "public", "ResponseFromManager", "generateUpdateExecuteTask", "(", "ParallelTask", "task", ")", "{", "// add to map now; as can only pass final", "ParallelTaskManager", ".", "getInstance", "(", ")", ".", "addTaskToInProgressMap", "(", "task", ".", "getTaskId", "(", ")", "...
key function to execute a parallel task. @param task the parallel task @return the batch response from manager
[ "key", "function", "to", "execute", "a", "parallel", "task", "." ]
1b4f1628f34fedfb06b24c33a5372d64d3df0952
https://github.com/eBay/parallec/blob/1b4f1628f34fedfb06b24c33a5372d64d3df0952/src/main/java/io/parallec/core/task/ParallelTaskManager.java#L252-L306
train
eBay/parallec
src/main/java/io/parallec/core/task/ParallelTaskManager.java
ParallelTaskManager.sendTaskToExecutionManager
@SuppressWarnings("deprecation") public ResponseFromManager sendTaskToExecutionManager(ParallelTask task) { ResponseFromManager commandResponseFromManager = null; ActorRef executionManager = null; try { // Start new job logger.info("!!STARTED sendAgentCommandToManage...
java
@SuppressWarnings("deprecation") public ResponseFromManager sendTaskToExecutionManager(ParallelTask task) { ResponseFromManager commandResponseFromManager = null; ActorRef executionManager = null; try { // Start new job logger.info("!!STARTED sendAgentCommandToManage...
[ "@", "SuppressWarnings", "(", "\"deprecation\"", ")", "public", "ResponseFromManager", "sendTaskToExecutionManager", "(", "ParallelTask", "task", ")", "{", "ResponseFromManager", "commandResponseFromManager", "=", "null", ";", "ActorRef", "executionManager", "=", "null", ...
Send parallel task to execution manager. @param task the parallel task @return the batch response from manager
[ "Send", "parallel", "task", "to", "execution", "manager", "." ]
1b4f1628f34fedfb06b24c33a5372d64d3df0952
https://github.com/eBay/parallec/blob/1b4f1628f34fedfb06b24c33a5372d64d3df0952/src/main/java/io/parallec/core/task/ParallelTaskManager.java#L334-L386
train
eBay/parallec
src/main/java/io/parallec/core/util/PcFileNetworkIoUtils.java
PcFileNetworkIoUtils.isFileExist
public static boolean isFileExist(String filePath) { File f = new File(filePath); return f.exists() && !f.isDirectory(); }
java
public static boolean isFileExist(String filePath) { File f = new File(filePath); return f.exists() && !f.isDirectory(); }
[ "public", "static", "boolean", "isFileExist", "(", "String", "filePath", ")", "{", "File", "f", "=", "new", "File", "(", "filePath", ")", ";", "return", "f", ".", "exists", "(", ")", "&&", "!", "f", ".", "isDirectory", "(", ")", ";", "}" ]
Checks if is file exist. @param filePath the file path @return true, if is file exist
[ "Checks", "if", "is", "file", "exist", "." ]
1b4f1628f34fedfb06b24c33a5372d64d3df0952
https://github.com/eBay/parallec/blob/1b4f1628f34fedfb06b24c33a5372d64d3df0952/src/main/java/io/parallec/core/util/PcFileNetworkIoUtils.java#L84-L89
train
eBay/parallec
src/main/java/io/parallec/core/util/PcFileNetworkIoUtils.java
PcFileNetworkIoUtils.readFileContentToString
public static String readFileContentToString(String filePath) throws IOException { String content = ""; content = Files.toString(new File(filePath), Charsets.UTF_8); return content; }
java
public static String readFileContentToString(String filePath) throws IOException { String content = ""; content = Files.toString(new File(filePath), Charsets.UTF_8); return content; }
[ "public", "static", "String", "readFileContentToString", "(", "String", "filePath", ")", "throws", "IOException", "{", "String", "content", "=", "\"\"", ";", "content", "=", "Files", ".", "toString", "(", "new", "File", "(", "filePath", ")", ",", "Charsets", ...
Read file content to string. @param filePath the file path @return the string @throws IOException Signals that an I/O exception has occurred.
[ "Read", "file", "content", "to", "string", "." ]
1b4f1628f34fedfb06b24c33a5372d64d3df0952
https://github.com/eBay/parallec/blob/1b4f1628f34fedfb06b24c33a5372d64d3df0952/src/main/java/io/parallec/core/util/PcFileNetworkIoUtils.java#L100-L105
train
eBay/parallec
src/main/java/io/parallec/core/util/PcFileNetworkIoUtils.java
PcFileNetworkIoUtils.readStringFromUrlGeneric
public static String readStringFromUrlGeneric(String url) throws IOException { InputStream is = null; URL urlObj = null; String responseString = PcConstants.NA; try { urlObj = new URL(url); URLConnection con = urlObj.openConnection(); con....
java
public static String readStringFromUrlGeneric(String url) throws IOException { InputStream is = null; URL urlObj = null; String responseString = PcConstants.NA; try { urlObj = new URL(url); URLConnection con = urlObj.openConnection(); con....
[ "public", "static", "String", "readStringFromUrlGeneric", "(", "String", "url", ")", "throws", "IOException", "{", "InputStream", "is", "=", "null", ";", "URL", "urlObj", "=", "null", ";", "String", "responseString", "=", "PcConstants", ".", "NA", ";", "try", ...
Read string from url generic. @param url the url @return the string @throws IOException Signals that an I/O exception has occurred.
[ "Read", "string", "from", "url", "generic", "." ]
1b4f1628f34fedfb06b24c33a5372d64d3df0952
https://github.com/eBay/parallec/blob/1b4f1628f34fedfb06b24c33a5372d64d3df0952/src/main/java/io/parallec/core/util/PcFileNetworkIoUtils.java#L116-L142
train
eBay/parallec
src/main/java/io/parallec/core/commander/workflow/VarReplacementProvider.java
VarReplacementProvider.updateRequestByAddingReplaceVarPair
public void updateRequestByAddingReplaceVarPair( ParallelTask task, String replaceVarKey, String replaceVarValue) { Map<String, NodeReqResponse> taskResult = task.getParallelTaskResult(); for (Entry<String, NodeReqResponse> entry : taskResult.entrySet()) { NodeReqResponse nodeR...
java
public void updateRequestByAddingReplaceVarPair( ParallelTask task, String replaceVarKey, String replaceVarValue) { Map<String, NodeReqResponse> taskResult = task.getParallelTaskResult(); for (Entry<String, NodeReqResponse> entry : taskResult.entrySet()) { NodeReqResponse nodeR...
[ "public", "void", "updateRequestByAddingReplaceVarPair", "(", "ParallelTask", "task", ",", "String", "replaceVarKey", ",", "String", "replaceVarValue", ")", "{", "Map", "<", "String", ",", "NodeReqResponse", ">", "taskResult", "=", "task", ".", "getParallelTaskResult"...
GENERIC!!! HELPER FUNCION FOR REPLACEMENT update the var: DYNAMIC REPLACEMENT of VAR. Every task must have matching command data and task result @param task the task @param replaceVarKey the replace var key @param replaceVarValue the replace var value
[ "GENERIC!!!", "HELPER", "FUNCION", "FOR", "REPLACEMENT" ]
1b4f1628f34fedfb06b24c33a5372d64d3df0952
https://github.com/eBay/parallec/blob/1b4f1628f34fedfb06b24c33a5372d64d3df0952/src/main/java/io/parallec/core/commander/workflow/VarReplacementProvider.java#L140-L157
train
eBay/parallec
src/main/java/io/parallec/core/actor/ActorConfig.java
ActorConfig.createAndGetActorSystem
public static ActorSystem createAndGetActorSystem() { if (actorSystem == null || actorSystem.isTerminated()) { actorSystem = ActorSystem.create(PcConstants.ACTOR_SYSTEM, conf); } return actorSystem; }
java
public static ActorSystem createAndGetActorSystem() { if (actorSystem == null || actorSystem.isTerminated()) { actorSystem = ActorSystem.create(PcConstants.ACTOR_SYSTEM, conf); } return actorSystem; }
[ "public", "static", "ActorSystem", "createAndGetActorSystem", "(", ")", "{", "if", "(", "actorSystem", "==", "null", "||", "actorSystem", ".", "isTerminated", "(", ")", ")", "{", "actorSystem", "=", "ActorSystem", ".", "create", "(", "PcConstants", ".", "ACTOR...
Create and get actor system. @return the actor system
[ "Create", "and", "get", "actor", "system", "." ]
1b4f1628f34fedfb06b24c33a5372d64d3df0952
https://github.com/eBay/parallec/blob/1b4f1628f34fedfb06b24c33a5372d64d3df0952/src/main/java/io/parallec/core/actor/ActorConfig.java#L57-L62
train
eBay/parallec
src/main/java/io/parallec/core/actor/ActorConfig.java
ActorConfig.shutDownActorSystemForce
public static void shutDownActorSystemForce() { if (!actorSystem.isTerminated()) { logger.info("shutting down actor system..."); actorSystem.shutdown(); actorSystem.awaitTermination(timeOutDuration); logger.info("Actor system has been shut down."); } else ...
java
public static void shutDownActorSystemForce() { if (!actorSystem.isTerminated()) { logger.info("shutting down actor system..."); actorSystem.shutdown(); actorSystem.awaitTermination(timeOutDuration); logger.info("Actor system has been shut down."); } else ...
[ "public", "static", "void", "shutDownActorSystemForce", "(", ")", "{", "if", "(", "!", "actorSystem", ".", "isTerminated", "(", ")", ")", "{", "logger", ".", "info", "(", "\"shutting down actor system...\"", ")", ";", "actorSystem", ".", "shutdown", "(", ")", ...
Shut down actor system force.
[ "Shut", "down", "actor", "system", "force", "." ]
1b4f1628f34fedfb06b24c33a5372d64d3df0952
https://github.com/eBay/parallec/blob/1b4f1628f34fedfb06b24c33a5372d64d3df0952/src/main/java/io/parallec/core/actor/ActorConfig.java#L73-L83
train
eBay/parallec
src/main/java/io/parallec/core/resources/TcpUdpSshPingResourceStore.java
TcpUdpSshPingResourceStore.init
public synchronized void init() { channelFactory = new NioClientSocketChannelFactory( Executors.newCachedThreadPool(), Executors.newCachedThreadPool()); datagramChannelFactory = new NioDatagramChannelFactory( Executors.newCachedThreadPool()); tim...
java
public synchronized void init() { channelFactory = new NioClientSocketChannelFactory( Executors.newCachedThreadPool(), Executors.newCachedThreadPool()); datagramChannelFactory = new NioDatagramChannelFactory( Executors.newCachedThreadPool()); tim...
[ "public", "synchronized", "void", "init", "(", ")", "{", "channelFactory", "=", "new", "NioClientSocketChannelFactory", "(", "Executors", ".", "newCachedThreadPool", "(", ")", ",", "Executors", ".", "newCachedThreadPool", "(", ")", ")", ";", "datagramChannelFactory"...
Initialize; cached threadpool is safe as it is releasing resources automatically if idle
[ "Initialize", ";", "cached", "threadpool", "is", "safe", "as", "it", "is", "releasing", "resources", "automatically", "if", "idle" ]
1b4f1628f34fedfb06b24c33a5372d64d3df0952
https://github.com/eBay/parallec/blob/1b4f1628f34fedfb06b24c33a5372d64d3df0952/src/main/java/io/parallec/core/resources/TcpUdpSshPingResourceStore.java#L68-L77
train
eBay/parallec
src/main/java/io/parallec/core/util/PcErrorMsgUtils.java
PcErrorMsgUtils.replaceErrorMsg
public static String replaceErrorMsg(String origMsg) { String replaceMsg = origMsg; for (ERROR_TYPE errorType : ERROR_TYPE.values()) { if (origMsg == null) { replaceMsg = PcConstants.NA; return replaceMsg; } if (origMsg.contains(erro...
java
public static String replaceErrorMsg(String origMsg) { String replaceMsg = origMsg; for (ERROR_TYPE errorType : ERROR_TYPE.values()) { if (origMsg == null) { replaceMsg = PcConstants.NA; return replaceMsg; } if (origMsg.contains(erro...
[ "public", "static", "String", "replaceErrorMsg", "(", "String", "origMsg", ")", "{", "String", "replaceMsg", "=", "origMsg", ";", "for", "(", "ERROR_TYPE", "errorType", ":", "ERROR_TYPE", ".", "values", "(", ")", ")", "{", "if", "(", "origMsg", "==", "null...
Replace error msg. @param origMsg the orig msg @return the string
[ "Replace", "error", "msg", "." ]
1b4f1628f34fedfb06b24c33a5372d64d3df0952
https://github.com/eBay/parallec/blob/1b4f1628f34fedfb06b24c33a5372d64d3df0952/src/main/java/io/parallec/core/util/PcErrorMsgUtils.java#L53-L72
train
eBay/parallec
src/main/java/io/parallec/core/resources/AsyncHttpClientFactoryEmbed.java
AsyncHttpClientFactoryEmbed.disableCertificateVerification
private void disableCertificateVerification() throws KeyManagementException, NoSuchAlgorithmException { // Create a trust manager that does not validate certificate chains final TrustManager[] trustAllCerts = new TrustManager[] { new CustomTrustManager() }; // Install the all-trusti...
java
private void disableCertificateVerification() throws KeyManagementException, NoSuchAlgorithmException { // Create a trust manager that does not validate certificate chains final TrustManager[] trustAllCerts = new TrustManager[] { new CustomTrustManager() }; // Install the all-trusti...
[ "private", "void", "disableCertificateVerification", "(", ")", "throws", "KeyManagementException", ",", "NoSuchAlgorithmException", "{", "// Create a trust manager that does not validate certificate chains", "final", "TrustManager", "[", "]", "trustAllCerts", "=", "new", "TrustMa...
Disable certificate verification. @throws KeyManagementException the key management exception @throws NoSuchAlgorithmException the no such algorithm exception
[ "Disable", "certificate", "verification", "." ]
1b4f1628f34fedfb06b24c33a5372d64d3df0952
https://github.com/eBay/parallec/blob/1b4f1628f34fedfb06b24c33a5372d64d3df0952/src/main/java/io/parallec/core/resources/AsyncHttpClientFactoryEmbed.java#L128-L147
train
eBay/parallec
src/main/java/io/parallec/core/bean/HttpMeta.java
HttpMeta.replaceFullRequestContent
public static String replaceFullRequestContent( String requestContentTemplate, String replacementString) { return (requestContentTemplate.replace( PcConstants.COMMAND_VAR_DEFAULT_REQUEST_CONTENT, replacementString)); }
java
public static String replaceFullRequestContent( String requestContentTemplate, String replacementString) { return (requestContentTemplate.replace( PcConstants.COMMAND_VAR_DEFAULT_REQUEST_CONTENT, replacementString)); }
[ "public", "static", "String", "replaceFullRequestContent", "(", "String", "requestContentTemplate", ",", "String", "replacementString", ")", "{", "return", "(", "requestContentTemplate", ".", "replace", "(", "PcConstants", ".", "COMMAND_VAR_DEFAULT_REQUEST_CONTENT", ",", ...
Replace full request content. @param requestContentTemplate the request content template @param replacementString the replacement string @return the string
[ "Replace", "full", "request", "content", "." ]
1b4f1628f34fedfb06b24c33a5372d64d3df0952
https://github.com/eBay/parallec/blob/1b4f1628f34fedfb06b24c33a5372d64d3df0952/src/main/java/io/parallec/core/bean/HttpMeta.java#L249-L254
train
windup/windup
reporting/api/src/main/java/org/jboss/windup/reporting/freemarker/problemsummary/ProblemSummary.java
ProblemSummary.addFile
public void addFile(String description, FileModel fileModel) { Map<FileModel, ProblemFileSummary> files = addDescription(description); if (files.containsKey(fileModel)) { files.get(fileModel).addOccurrence(); } else { files.put(fileModel, new ProblemFileSumma...
java
public void addFile(String description, FileModel fileModel) { Map<FileModel, ProblemFileSummary> files = addDescription(description); if (files.containsKey(fileModel)) { files.get(fileModel).addOccurrence(); } else { files.put(fileModel, new ProblemFileSumma...
[ "public", "void", "addFile", "(", "String", "description", ",", "FileModel", "fileModel", ")", "{", "Map", "<", "FileModel", ",", "ProblemFileSummary", ">", "files", "=", "addDescription", "(", "description", ")", ";", "if", "(", "files", ".", "containsKey", ...
Adds a file with the provided description.
[ "Adds", "a", "file", "with", "the", "provided", "description", "." ]
6668f09e7f012d24a0b4212ada8809417225b2ad
https://github.com/windup/windup/blob/6668f09e7f012d24a0b4212ada8809417225b2ad/reporting/api/src/main/java/org/jboss/windup/reporting/freemarker/problemsummary/ProblemSummary.java#L144-L154
train
windup/windup
rules-java/api/src/main/java/org/jboss/windup/rules/apps/java/decompiler/ClassFilePreDecompilationScan.java
ClassFilePreDecompilationScan.shouldIgnore
private boolean shouldIgnore(String typeReference) { typeReference = typeReference.replace('/', '.').replace('\\', '.'); return JavaClassIgnoreResolver.singletonInstance().matches(typeReference); }
java
private boolean shouldIgnore(String typeReference) { typeReference = typeReference.replace('/', '.').replace('\\', '.'); return JavaClassIgnoreResolver.singletonInstance().matches(typeReference); }
[ "private", "boolean", "shouldIgnore", "(", "String", "typeReference", ")", "{", "typeReference", "=", "typeReference", ".", "replace", "(", "'", "'", ",", "'", "'", ")", ".", "replace", "(", "'", "'", ",", "'", "'", ")", ";", "return", "JavaClassIgnoreRe...
This method is called on every reference that is in the .class file. @param typeReference @return
[ "This", "method", "is", "called", "on", "every", "reference", "that", "is", "in", "the", ".", "class", "file", "." ]
6668f09e7f012d24a0b4212ada8809417225b2ad
https://github.com/windup/windup/blob/6668f09e7f012d24a0b4212ada8809417225b2ad/rules-java/api/src/main/java/org/jboss/windup/rules/apps/java/decompiler/ClassFilePreDecompilationScan.java#L176-L180
train
windup/windup
reporting/api/src/main/java/org/jboss/windup/reporting/config/classification/Classification.java
Classification.resolvePayload
@Override public FileModel resolvePayload(GraphRewrite event, EvaluationContext context, WindupVertexFrame payload) { checkVariableName(event, context); if (payload instanceof FileReferenceModel) { return ((FileReferenceModel) payload).getFile(); } if (payload...
java
@Override public FileModel resolvePayload(GraphRewrite event, EvaluationContext context, WindupVertexFrame payload) { checkVariableName(event, context); if (payload instanceof FileReferenceModel) { return ((FileReferenceModel) payload).getFile(); } if (payload...
[ "@", "Override", "public", "FileModel", "resolvePayload", "(", "GraphRewrite", "event", ",", "EvaluationContext", "context", ",", "WindupVertexFrame", "payload", ")", "{", "checkVariableName", "(", "event", ",", "context", ")", ";", "if", "(", "payload", "instance...
Set the payload to the fileModel of the given instance even though the variable is not directly referencing it. This is mainly to simplify the creation of the rule, when the FileModel itself is not being iterated but just a model referencing it.
[ "Set", "the", "payload", "to", "the", "fileModel", "of", "the", "given", "instance", "even", "though", "the", "variable", "is", "not", "directly", "referencing", "it", ".", "This", "is", "mainly", "to", "simplify", "the", "creation", "of", "the", "rule", "...
6668f09e7f012d24a0b4212ada8809417225b2ad
https://github.com/windup/windup/blob/6668f09e7f012d24a0b4212ada8809417225b2ad/reporting/api/src/main/java/org/jboss/windup/reporting/config/classification/Classification.java#L102-L115
train
windup/windup
reporting/api/src/main/java/org/jboss/windup/reporting/freemarker/FreeMarkerOperation.java
FreeMarkerOperation.create
public static FreeMarkerOperation create(Furnace furnace, String templatePath, String outputFilename, String... varNames) { return new FreeMarkerOperation(furnace, templatePath, outputFilename, varNames); }
java
public static FreeMarkerOperation create(Furnace furnace, String templatePath, String outputFilename, String... varNames) { return new FreeMarkerOperation(furnace, templatePath, outputFilename, varNames); }
[ "public", "static", "FreeMarkerOperation", "create", "(", "Furnace", "furnace", ",", "String", "templatePath", ",", "String", "outputFilename", ",", "String", "...", "varNames", ")", "{", "return", "new", "FreeMarkerOperation", "(", "furnace", ",", "templatePath", ...
Create a FreeMarkerOperation with the provided furnace instance template path, and varNames. The variables in varNames will be provided to the template, and a new ReportModel will be created with these variables attached.
[ "Create", "a", "FreeMarkerOperation", "with", "the", "provided", "furnace", "instance", "template", "path", "and", "varNames", "." ]
6668f09e7f012d24a0b4212ada8809417225b2ad
https://github.com/windup/windup/blob/6668f09e7f012d24a0b4212ada8809417225b2ad/reporting/api/src/main/java/org/jboss/windup/reporting/freemarker/FreeMarkerOperation.java#L52-L56
train
windup/windup
rules-java/api/src/main/java/org/jboss/windup/rules/apps/java/scan/operation/UnzipArchiveToOutputFolder.java
UnzipArchiveToOutputFolder.recurseAndAddFiles
private void recurseAndAddFiles(GraphRewrite event, EvaluationContext context, Path tempFolder, FileService fileService, ArchiveModel archiveModel, FileModel parentFileModel, boolean subArchivesOnly) { checkCancelled(event); int numberAdded = 0; ...
java
private void recurseAndAddFiles(GraphRewrite event, EvaluationContext context, Path tempFolder, FileService fileService, ArchiveModel archiveModel, FileModel parentFileModel, boolean subArchivesOnly) { checkCancelled(event); int numberAdded = 0; ...
[ "private", "void", "recurseAndAddFiles", "(", "GraphRewrite", "event", ",", "EvaluationContext", "context", ",", "Path", "tempFolder", ",", "FileService", "fileService", ",", "ArchiveModel", "archiveModel", ",", "FileModel", "parentFileModel", ",", "boolean", "subArchiv...
Recurses the given folder and adds references to these files to the graph as FileModels. We don't set the parent file model in the case of the initial children, as the direct parent is really the archive itself. For example for file "root.zip/pom.xml" - the parent for pom.xml is root.zip, not the directory temporary d...
[ "Recurses", "the", "given", "folder", "and", "adds", "references", "to", "these", "files", "to", "the", "graph", "as", "FileModels", "." ]
6668f09e7f012d24a0b4212ada8809417225b2ad
https://github.com/windup/windup/blob/6668f09e7f012d24a0b4212ada8809417225b2ad/rules-java/api/src/main/java/org/jboss/windup/rules/apps/java/scan/operation/UnzipArchiveToOutputFolder.java#L158-L241
train
windup/windup
rules-java/api/src/main/java/org/jboss/windup/rules/apps/java/reporting/freemarker/RenderLinkDirective.java
RenderLinkDirective.renderAsLI
private void renderAsLI(Writer writer, ProjectModel project, Iterator<Link> links, boolean wrap) throws IOException { if (!links.hasNext()) return; if (wrap) writer.append("<ul>"); while (links.hasNext()) { Link link = links.next(); wr...
java
private void renderAsLI(Writer writer, ProjectModel project, Iterator<Link> links, boolean wrap) throws IOException { if (!links.hasNext()) return; if (wrap) writer.append("<ul>"); while (links.hasNext()) { Link link = links.next(); wr...
[ "private", "void", "renderAsLI", "(", "Writer", "writer", ",", "ProjectModel", "project", ",", "Iterator", "<", "Link", ">", "links", ",", "boolean", "wrap", ")", "throws", "IOException", "{", "if", "(", "!", "links", ".", "hasNext", "(", ")", ")", "retu...
Renders in LI tags, Wraps with UL tags optionally.
[ "Renders", "in", "LI", "tags", "Wraps", "with", "UL", "tags", "optionally", "." ]
6668f09e7f012d24a0b4212ada8809417225b2ad
https://github.com/windup/windup/blob/6668f09e7f012d24a0b4212ada8809417225b2ad/rules-java/api/src/main/java/org/jboss/windup/rules/apps/java/reporting/freemarker/RenderLinkDirective.java#L246-L262
train
windup/windup
reporting/api/src/main/java/org/jboss/windup/reporting/rules/CreateApplicationReportIndexRuleProvider.java
CreateApplicationReportIndexRuleProvider.createApplicationReportIndex
private ApplicationReportIndexModel createApplicationReportIndex(GraphContext context, ProjectModel applicationProjectModel) { ApplicationReportIndexService applicationReportIndexService = new ApplicationReportIndexService(context); ApplicationReportIndexModel index = applicationRepo...
java
private ApplicationReportIndexModel createApplicationReportIndex(GraphContext context, ProjectModel applicationProjectModel) { ApplicationReportIndexService applicationReportIndexService = new ApplicationReportIndexService(context); ApplicationReportIndexModel index = applicationRepo...
[ "private", "ApplicationReportIndexModel", "createApplicationReportIndex", "(", "GraphContext", "context", ",", "ProjectModel", "applicationProjectModel", ")", "{", "ApplicationReportIndexService", "applicationReportIndexService", "=", "new", "ApplicationReportIndexService", "(", "c...
Create the index and associate it with all project models in the Application
[ "Create", "the", "index", "and", "associate", "it", "with", "all", "project", "models", "in", "the", "Application" ]
6668f09e7f012d24a0b4212ada8809417225b2ad
https://github.com/windup/windup/blob/6668f09e7f012d24a0b4212ada8809417225b2ad/reporting/api/src/main/java/org/jboss/windup/reporting/rules/CreateApplicationReportIndexRuleProvider.java#L69-L78
train
windup/windup
reporting/api/src/main/java/org/jboss/windup/reporting/rules/CreateApplicationReportIndexRuleProvider.java
CreateApplicationReportIndexRuleProvider.addAllProjectModels
private void addAllProjectModels(ApplicationReportIndexModel navIdx, ProjectModel projectModel) { navIdx.addProjectModel(projectModel); for (ProjectModel childProject : projectModel.getChildProjects()) { if (!Iterators.asSet(navIdx.getProjectModels()).contains(childProject)) ...
java
private void addAllProjectModels(ApplicationReportIndexModel navIdx, ProjectModel projectModel) { navIdx.addProjectModel(projectModel); for (ProjectModel childProject : projectModel.getChildProjects()) { if (!Iterators.asSet(navIdx.getProjectModels()).contains(childProject)) ...
[ "private", "void", "addAllProjectModels", "(", "ApplicationReportIndexModel", "navIdx", ",", "ProjectModel", "projectModel", ")", "{", "navIdx", ".", "addProjectModel", "(", "projectModel", ")", ";", "for", "(", "ProjectModel", "childProject", ":", "projectModel", "."...
Attach all project models within the application to the index. This will make it easy to navigate from the projectModel to the application index.
[ "Attach", "all", "project", "models", "within", "the", "application", "to", "the", "index", ".", "This", "will", "make", "it", "easy", "to", "navigate", "from", "the", "projectModel", "to", "the", "application", "index", "." ]
6668f09e7f012d24a0b4212ada8809417225b2ad
https://github.com/windup/windup/blob/6668f09e7f012d24a0b4212ada8809417225b2ad/reporting/api/src/main/java/org/jboss/windup/reporting/rules/CreateApplicationReportIndexRuleProvider.java#L84-L92
train
windup/windup
utils/src/main/java/org/jboss/windup/util/ProgressEstimate.java
ProgressEstimate.getTimeRemainingInMillis
public long getTimeRemainingInMillis() { long batchTime = System.currentTimeMillis() - startTime; double timePerIteration = (double) batchTime / (double) worked.get(); return (long) (timePerIteration * (total - worked.get())); }
java
public long getTimeRemainingInMillis() { long batchTime = System.currentTimeMillis() - startTime; double timePerIteration = (double) batchTime / (double) worked.get(); return (long) (timePerIteration * (total - worked.get())); }
[ "public", "long", "getTimeRemainingInMillis", "(", ")", "{", "long", "batchTime", "=", "System", ".", "currentTimeMillis", "(", ")", "-", "startTime", ";", "double", "timePerIteration", "=", "(", "double", ")", "batchTime", "/", "(", "double", ")", "worked", ...
Gets the estimated time remaining in milliseconds based upon the total number of work units, the start time, and how many units have been done so far. This should not be called before any work units have been done.
[ "Gets", "the", "estimated", "time", "remaining", "in", "milliseconds", "based", "upon", "the", "total", "number", "of", "work", "units", "the", "start", "time", "and", "how", "many", "units", "have", "been", "done", "so", "far", "." ]
6668f09e7f012d24a0b4212ada8809417225b2ad
https://github.com/windup/windup/blob/6668f09e7f012d24a0b4212ada8809417225b2ad/utils/src/main/java/org/jboss/windup/util/ProgressEstimate.java#L55-L60
train
windup/windup
graph/api/src/main/java/org/jboss/windup/graph/service/ArchiveService.java
ArchiveService.getChildFile
public FileModel getChildFile(ArchiveModel archiveModel, String filePath) { filePath = FilenameUtils.separatorsToUnix(filePath); StringTokenizer stk = new StringTokenizer(filePath, "/"); FileModel currentFileModel = archiveModel; while (stk.hasMoreTokens() && currentFileModel != nul...
java
public FileModel getChildFile(ArchiveModel archiveModel, String filePath) { filePath = FilenameUtils.separatorsToUnix(filePath); StringTokenizer stk = new StringTokenizer(filePath, "/"); FileModel currentFileModel = archiveModel; while (stk.hasMoreTokens() && currentFileModel != nul...
[ "public", "FileModel", "getChildFile", "(", "ArchiveModel", "archiveModel", ",", "String", "filePath", ")", "{", "filePath", "=", "FilenameUtils", ".", "separatorsToUnix", "(", "filePath", ")", ";", "StringTokenizer", "stk", "=", "new", "StringTokenizer", "(", "fi...
Finds the file at the provided path within the archive. Eg, getChildFile(ArchiveModel, "/META-INF/MANIFEST.MF") will return a {@link FileModel} if a file named /META-INF/MANIFEST.MF exists within the archive @return Returns the located {@link FileModel} or null if no file with this path could be located
[ "Finds", "the", "file", "at", "the", "provided", "path", "within", "the", "archive", "." ]
6668f09e7f012d24a0b4212ada8809417225b2ad
https://github.com/windup/windup/blob/6668f09e7f012d24a0b4212ada8809417225b2ad/graph/api/src/main/java/org/jboss/windup/graph/service/ArchiveService.java#L50-L63
train
windup/windup
config/impl/src/main/java/org/jboss/windup/config/loader/RuleProviderSorter.java
RuleProviderSorter.sort
private void sort() { DefaultDirectedWeightedGraph<RuleProvider, DefaultEdge> graph = new DefaultDirectedWeightedGraph<>( DefaultEdge.class); for (RuleProvider provider : providers) { graph.addVertex(provider); } addProviderRelationships(grap...
java
private void sort() { DefaultDirectedWeightedGraph<RuleProvider, DefaultEdge> graph = new DefaultDirectedWeightedGraph<>( DefaultEdge.class); for (RuleProvider provider : providers) { graph.addVertex(provider); } addProviderRelationships(grap...
[ "private", "void", "sort", "(", ")", "{", "DefaultDirectedWeightedGraph", "<", "RuleProvider", ",", "DefaultEdge", ">", "graph", "=", "new", "DefaultDirectedWeightedGraph", "<>", "(", "DefaultEdge", ".", "class", ")", ";", "for", "(", "RuleProvider", "provider", ...
Perform the entire sort operation
[ "Perform", "the", "entire", "sort", "operation" ]
6668f09e7f012d24a0b4212ada8809417225b2ad
https://github.com/windup/windup/blob/6668f09e7f012d24a0b4212ada8809417225b2ad/config/impl/src/main/java/org/jboss/windup/config/loader/RuleProviderSorter.java#L85-L115
train
windup/windup
config/impl/src/main/java/org/jboss/windup/config/loader/RuleProviderSorter.java
RuleProviderSorter.checkForCycles
private void checkForCycles(DefaultDirectedWeightedGraph<RuleProvider, DefaultEdge> graph) { CycleDetector<RuleProvider, DefaultEdge> cycleDetector = new CycleDetector<>(graph); if (cycleDetector.detectCycles()) { // if we have cycles, then try to throw an exception with some us...
java
private void checkForCycles(DefaultDirectedWeightedGraph<RuleProvider, DefaultEdge> graph) { CycleDetector<RuleProvider, DefaultEdge> cycleDetector = new CycleDetector<>(graph); if (cycleDetector.detectCycles()) { // if we have cycles, then try to throw an exception with some us...
[ "private", "void", "checkForCycles", "(", "DefaultDirectedWeightedGraph", "<", "RuleProvider", ",", "DefaultEdge", ">", "graph", ")", "{", "CycleDetector", "<", "RuleProvider", ",", "DefaultEdge", ">", "cycleDetector", "=", "new", "CycleDetector", "<>", "(", "graph"...
Use the jgrapht cycle checker to detect any cycles in the provided dependency graph.
[ "Use", "the", "jgrapht", "cycle", "checker", "to", "detect", "any", "cycles", "in", "the", "provided", "dependency", "graph", "." ]
6668f09e7f012d24a0b4212ada8809417225b2ad
https://github.com/windup/windup/blob/6668f09e7f012d24a0b4212ada8809417225b2ad/config/impl/src/main/java/org/jboss/windup/config/loader/RuleProviderSorter.java#L267-L287
train
windup/windup
rules-java/api/src/main/java/org/jboss/windup/rules/apps/java/scan/operation/RecurseDirectoryAndAddFiles.java
RecurseDirectoryAndAddFiles.recurseAndAddFiles
private void recurseAndAddFiles(GraphRewrite event, FileService fileService, WindupJavaConfigurationService javaConfigurationService, FileModel file) { if (javaConfigurationService.checkIfIgnored(event, file)) return; String filePath = file.getFilePath(); File fileReference = ne...
java
private void recurseAndAddFiles(GraphRewrite event, FileService fileService, WindupJavaConfigurationService javaConfigurationService, FileModel file) { if (javaConfigurationService.checkIfIgnored(event, file)) return; String filePath = file.getFilePath(); File fileReference = ne...
[ "private", "void", "recurseAndAddFiles", "(", "GraphRewrite", "event", ",", "FileService", "fileService", ",", "WindupJavaConfigurationService", "javaConfigurationService", ",", "FileModel", "file", ")", "{", "if", "(", "javaConfigurationService", ".", "checkIfIgnored", "...
Recurses the given folder and creates the FileModels vertices for the child files to the graph.
[ "Recurses", "the", "given", "folder", "and", "creates", "the", "FileModels", "vertices", "for", "the", "child", "files", "to", "the", "graph", "." ]
6668f09e7f012d24a0b4212ada8809417225b2ad
https://github.com/windup/windup/blob/6668f09e7f012d24a0b4212ada8809417225b2ad/rules-java/api/src/main/java/org/jboss/windup/rules/apps/java/scan/operation/RecurseDirectoryAndAddFiles.java#L51-L81
train
windup/windup
utils/src/main/java/org/jboss/windup/util/Checks.java
Checks.checkFileOrDirectoryToBeRead
public static void checkFileOrDirectoryToBeRead(File fileOrDir, String fileDesc) { if (fileOrDir == null) throw new IllegalArgumentException(fileDesc + " must not be null."); if (!fileOrDir.exists()) throw new IllegalArgumentException(fileDesc + " does not exist: " + fileOrDi...
java
public static void checkFileOrDirectoryToBeRead(File fileOrDir, String fileDesc) { if (fileOrDir == null) throw new IllegalArgumentException(fileDesc + " must not be null."); if (!fileOrDir.exists()) throw new IllegalArgumentException(fileDesc + " does not exist: " + fileOrDi...
[ "public", "static", "void", "checkFileOrDirectoryToBeRead", "(", "File", "fileOrDir", ",", "String", "fileDesc", ")", "{", "if", "(", "fileOrDir", "==", "null", ")", "throw", "new", "IllegalArgumentException", "(", "fileDesc", "+", "\" must not be null.\"", ")", "...
Throws if the given file is null, is not a file or directory, or is an empty directory.
[ "Throws", "if", "the", "given", "file", "is", "null", "is", "not", "a", "file", "or", "directory", "or", "is", "an", "empty", "directory", "." ]
6668f09e7f012d24a0b4212ada8809417225b2ad
https://github.com/windup/windup/blob/6668f09e7f012d24a0b4212ada8809417225b2ad/utils/src/main/java/org/jboss/windup/util/Checks.java#L45-L58
train
windup/windup
utils/src/main/java/org/jboss/windup/util/furnace/FurnaceClasspathScanner.java
FurnaceClasspathScanner.scan
public List<URL> scan(Predicate<String> filter) { List<URL> discoveredURLs = new ArrayList<>(128); // For each Forge addon... for (Addon addon : furnace.getAddonRegistry().getAddons(AddonFilters.allStarted())) { List<String> filteredResourcePaths = filterAddonResources(a...
java
public List<URL> scan(Predicate<String> filter) { List<URL> discoveredURLs = new ArrayList<>(128); // For each Forge addon... for (Addon addon : furnace.getAddonRegistry().getAddons(AddonFilters.allStarted())) { List<String> filteredResourcePaths = filterAddonResources(a...
[ "public", "List", "<", "URL", ">", "scan", "(", "Predicate", "<", "String", ">", "filter", ")", "{", "List", "<", "URL", ">", "discoveredURLs", "=", "new", "ArrayList", "<>", "(", "128", ")", ";", "// For each Forge addon...", "for", "(", "Addon", "addon...
Scans all Forge addons for files accepted by given filter.
[ "Scans", "all", "Forge", "addons", "for", "files", "accepted", "by", "given", "filter", "." ]
6668f09e7f012d24a0b4212ada8809417225b2ad
https://github.com/windup/windup/blob/6668f09e7f012d24a0b4212ada8809417225b2ad/utils/src/main/java/org/jboss/windup/util/furnace/FurnaceClasspathScanner.java#L76-L92
train
windup/windup
utils/src/main/java/org/jboss/windup/util/furnace/FurnaceClasspathScanner.java
FurnaceClasspathScanner.scanClasses
public List<Class<?>> scanClasses(Predicate<String> filter) { List<Class<?>> discoveredClasses = new ArrayList<>(128); // For each Forge addon... for (Addon addon : furnace.getAddonRegistry().getAddons(AddonFilters.allStarted())) { List<String> discoveredFileNames = filt...
java
public List<Class<?>> scanClasses(Predicate<String> filter) { List<Class<?>> discoveredClasses = new ArrayList<>(128); // For each Forge addon... for (Addon addon : furnace.getAddonRegistry().getAddons(AddonFilters.allStarted())) { List<String> discoveredFileNames = filt...
[ "public", "List", "<", "Class", "<", "?", ">", ">", "scanClasses", "(", "Predicate", "<", "String", ">", "filter", ")", "{", "List", "<", "Class", "<", "?", ">", ">", "discoveredClasses", "=", "new", "ArrayList", "<>", "(", "128", ")", ";", "// For e...
Scans all Forge addons for classes accepted by given filter. TODO: Could be refactored - scan() is almost the same.
[ "Scans", "all", "Forge", "addons", "for", "classes", "accepted", "by", "given", "filter", "." ]
6668f09e7f012d24a0b4212ada8809417225b2ad
https://github.com/windup/windup/blob/6668f09e7f012d24a0b4212ada8809417225b2ad/utils/src/main/java/org/jboss/windup/util/furnace/FurnaceClasspathScanner.java#L99-L124
train
windup/windup
utils/src/main/java/org/jboss/windup/util/furnace/FurnaceClasspathScanner.java
FurnaceClasspathScanner.filterAddonResources
public List<String> filterAddonResources(Addon addon, Predicate<String> filter) { List<String> discoveredFileNames = new ArrayList<>(); List<File> addonResources = addon.getRepository().getAddonResources(addon.getId()); for (File addonFile : addonResources) { if (addonFil...
java
public List<String> filterAddonResources(Addon addon, Predicate<String> filter) { List<String> discoveredFileNames = new ArrayList<>(); List<File> addonResources = addon.getRepository().getAddonResources(addon.getId()); for (File addonFile : addonResources) { if (addonFil...
[ "public", "List", "<", "String", ">", "filterAddonResources", "(", "Addon", "addon", ",", "Predicate", "<", "String", ">", "filter", ")", "{", "List", "<", "String", ">", "discoveredFileNames", "=", "new", "ArrayList", "<>", "(", ")", ";", "List", "<", "...
Returns a list of files in given addon passing given filter.
[ "Returns", "a", "list", "of", "files", "in", "given", "addon", "passing", "given", "filter", "." ]
6668f09e7f012d24a0b4212ada8809417225b2ad
https://github.com/windup/windup/blob/6668f09e7f012d24a0b4212ada8809417225b2ad/utils/src/main/java/org/jboss/windup/util/furnace/FurnaceClasspathScanner.java#L129-L141
train
windup/windup
utils/src/main/java/org/jboss/windup/util/furnace/FurnaceClasspathScanner.java
FurnaceClasspathScanner.handleArchiveByFile
private void handleArchiveByFile(Predicate<String> filter, File archive, List<String> discoveredFiles) { try { try (ZipFile zip = new ZipFile(archive)) { Enumeration<? extends ZipEntry> entries = zip.entries(); while (entries.h...
java
private void handleArchiveByFile(Predicate<String> filter, File archive, List<String> discoveredFiles) { try { try (ZipFile zip = new ZipFile(archive)) { Enumeration<? extends ZipEntry> entries = zip.entries(); while (entries.h...
[ "private", "void", "handleArchiveByFile", "(", "Predicate", "<", "String", ">", "filter", ",", "File", "archive", ",", "List", "<", "String", ">", "discoveredFiles", ")", "{", "try", "{", "try", "(", "ZipFile", "zip", "=", "new", "ZipFile", "(", "archive",...
Scans given archive for files passing given filter, adds the results into given list.
[ "Scans", "given", "archive", "for", "files", "passing", "given", "filter", "adds", "the", "results", "into", "given", "list", "." ]
6668f09e7f012d24a0b4212ada8809417225b2ad
https://github.com/windup/windup/blob/6668f09e7f012d24a0b4212ada8809417225b2ad/utils/src/main/java/org/jboss/windup/util/furnace/FurnaceClasspathScanner.java#L146-L167
train
windup/windup
utils/src/main/java/org/jboss/windup/util/furnace/FurnaceClasspathScanner.java
FurnaceClasspathScanner.handleDirectory
private void handleDirectory(final Predicate<String> filter, final File rootDir, final List<String> discoveredFiles) { try { new DirectoryWalker<String>() { private Path startDir; public void walk() throws IOException { ...
java
private void handleDirectory(final Predicate<String> filter, final File rootDir, final List<String> discoveredFiles) { try { new DirectoryWalker<String>() { private Path startDir; public void walk() throws IOException { ...
[ "private", "void", "handleDirectory", "(", "final", "Predicate", "<", "String", ">", "filter", ",", "final", "File", "rootDir", ",", "final", "List", "<", "String", ">", "discoveredFiles", ")", "{", "try", "{", "new", "DirectoryWalker", "<", "String", ">", ...
Scans given directory for files passing given filter, adds the results into given list.
[ "Scans", "given", "directory", "for", "files", "passing", "given", "filter", "adds", "the", "results", "into", "given", "list", "." ]
6668f09e7f012d24a0b4212ada8809417225b2ad
https://github.com/windup/windup/blob/6668f09e7f012d24a0b4212ada8809417225b2ad/utils/src/main/java/org/jboss/windup/util/furnace/FurnaceClasspathScanner.java#L172-L200
train
windup/windup
rules-java-project/addon/src/main/java/org/jboss/windup/project/condition/Project.java
Project.dependsOnArtifact
public static Project dependsOnArtifact(Artifact artifact) { Project project = new Project(); project.artifact = artifact; return project; }
java
public static Project dependsOnArtifact(Artifact artifact) { Project project = new Project(); project.artifact = artifact; return project; }
[ "public", "static", "Project", "dependsOnArtifact", "(", "Artifact", "artifact", ")", "{", "Project", "project", "=", "new", "Project", "(", ")", ";", "project", ".", "artifact", "=", "artifact", ";", "return", "project", ";", "}" ]
Specify the Artifact for which the condition should search for. @param artifact @return
[ "Specify", "the", "Artifact", "for", "which", "the", "condition", "should", "search", "for", "." ]
6668f09e7f012d24a0b4212ada8809417225b2ad
https://github.com/windup/windup/blob/6668f09e7f012d24a0b4212ada8809417225b2ad/rules-java-project/addon/src/main/java/org/jboss/windup/project/condition/Project.java#L43-L48
train
windup/windup
utils/src/main/java/org/jboss/windup/util/Util.java
Util.getSingle
public static final <T> T getSingle( Iterable<T> it ) { if( ! it.iterator().hasNext() ) return null; final Iterator<T> iterator = it.iterator(); T o = iterator.next(); if(iterator.hasNext()) throw new IllegalStateException("Found multiple items in iterator over "...
java
public static final <T> T getSingle( Iterable<T> it ) { if( ! it.iterator().hasNext() ) return null; final Iterator<T> iterator = it.iterator(); T o = iterator.next(); if(iterator.hasNext()) throw new IllegalStateException("Found multiple items in iterator over "...
[ "public", "static", "final", "<", "T", ">", "T", "getSingle", "(", "Iterable", "<", "T", ">", "it", ")", "{", "if", "(", "!", "it", ".", "iterator", "(", ")", ".", "hasNext", "(", ")", ")", "return", "null", ";", "final", "Iterator", "<", "T", ...
Returns a single item from the Iterator. If there's none, returns null. If there are more, throws an IllegalStateException. @throws IllegalStateException
[ "Returns", "a", "single", "item", "from", "the", "Iterator", ".", "If", "there", "s", "none", "returns", "null", ".", "If", "there", "are", "more", "throws", "an", "IllegalStateException", "." ]
6668f09e7f012d24a0b4212ada8809417225b2ad
https://github.com/windup/windup/blob/6668f09e7f012d24a0b4212ada8809417225b2ad/utils/src/main/java/org/jboss/windup/util/Util.java#L24-L34
train
windup/windup
rules-xml/api/src/main/java/org/jboss/windup/rules/apps/xml/operation/xslt/XSLTTransformation.java
XSLTTransformation.perform
@Override public void perform(GraphRewrite event, EvaluationContext context) { checkVariableName(event, context); WindupVertexFrame payload = resolveVariable(event, getVariableName()); if (payload instanceof FileReferenceModel) { FileModel file = ((FileReferenceModel)...
java
@Override public void perform(GraphRewrite event, EvaluationContext context) { checkVariableName(event, context); WindupVertexFrame payload = resolveVariable(event, getVariableName()); if (payload instanceof FileReferenceModel) { FileModel file = ((FileReferenceModel)...
[ "@", "Override", "public", "void", "perform", "(", "GraphRewrite", "event", ",", "EvaluationContext", "context", ")", "{", "checkVariableName", "(", "event", ",", "context", ")", ";", "WindupVertexFrame", "payload", "=", "resolveVariable", "(", "event", ",", "ge...
Set the payload to the fileModel of the given instance even though the variable is not directly of it's type. This is mainly to simplify the creation of the rule, when the FileModel itself is not being iterated but just a model referencing it.
[ "Set", "the", "payload", "to", "the", "fileModel", "of", "the", "given", "instance", "even", "though", "the", "variable", "is", "not", "directly", "of", "it", "s", "type", ".", "This", "is", "mainly", "to", "simplify", "the", "creation", "of", "the", "ru...
6668f09e7f012d24a0b4212ada8809417225b2ad
https://github.com/windup/windup/blob/6668f09e7f012d24a0b4212ada8809417225b2ad/rules-xml/api/src/main/java/org/jboss/windup/rules/apps/xml/operation/xslt/XSLTTransformation.java#L124-L139
train
windup/windup
rules-java-project/addon/src/main/java/org/jboss/windup/project/condition/ProjectFrom.java
ProjectFrom.dependsOnArtifact
public Project dependsOnArtifact(Artifact artifact) { Project project = new Project(); project.setArtifact(artifact); project.setInputVariablesName(inputVarName); return project; }
java
public Project dependsOnArtifact(Artifact artifact) { Project project = new Project(); project.setArtifact(artifact); project.setInputVariablesName(inputVarName); return project; }
[ "public", "Project", "dependsOnArtifact", "(", "Artifact", "artifact", ")", "{", "Project", "project", "=", "new", "Project", "(", ")", ";", "project", ".", "setArtifact", "(", "artifact", ")", ";", "project", ".", "setInputVariablesName", "(", "inputVarName", ...
Specify the artifact configuration to be searched for @param artifact configured artifact object @return
[ "Specify", "the", "artifact", "configuration", "to", "be", "searched", "for" ]
6668f09e7f012d24a0b4212ada8809417225b2ad
https://github.com/windup/windup/blob/6668f09e7f012d24a0b4212ada8809417225b2ad/rules-java-project/addon/src/main/java/org/jboss/windup/project/condition/ProjectFrom.java#L21-L27
train
windup/windup
rules-java-ee/addon/src/main/java/org/jboss/windup/rules/apps/javaee/service/JmsDestinationService.java
JmsDestinationService.getTypeFromClass
public static JmsDestinationType getTypeFromClass(String aClass) { if (StringUtils.equals(aClass, "javax.jms.Queue") || StringUtils.equals(aClass, "javax.jms.QueueConnectionFactory")) { return JmsDestinationType.QUEUE; } else if (StringUtils.equals(aClass, "javax.jms.Topi...
java
public static JmsDestinationType getTypeFromClass(String aClass) { if (StringUtils.equals(aClass, "javax.jms.Queue") || StringUtils.equals(aClass, "javax.jms.QueueConnectionFactory")) { return JmsDestinationType.QUEUE; } else if (StringUtils.equals(aClass, "javax.jms.Topi...
[ "public", "static", "JmsDestinationType", "getTypeFromClass", "(", "String", "aClass", ")", "{", "if", "(", "StringUtils", ".", "equals", "(", "aClass", ",", "\"javax.jms.Queue\"", ")", "||", "StringUtils", ".", "equals", "(", "aClass", ",", "\"javax.jms.QueueConn...
Gets JmsDestinationType from java class name Returns null for unrecognized class
[ "Gets", "JmsDestinationType", "from", "java", "class", "name" ]
6668f09e7f012d24a0b4212ada8809417225b2ad
https://github.com/windup/windup/blob/6668f09e7f012d24a0b4212ada8809417225b2ad/rules-java-ee/addon/src/main/java/org/jboss/windup/rules/apps/javaee/service/JmsDestinationService.java#L75-L89
train
windup/windup
config/api/src/main/java/org/jboss/windup/config/operation/iteration/AbstractIterationOperation.java
AbstractIterationOperation.checkVariableName
protected void checkVariableName(GraphRewrite event, EvaluationContext context) { if (variableName == null) { setVariableName(Iteration.getPayloadVariableName(event, context)); } }
java
protected void checkVariableName(GraphRewrite event, EvaluationContext context) { if (variableName == null) { setVariableName(Iteration.getPayloadVariableName(event, context)); } }
[ "protected", "void", "checkVariableName", "(", "GraphRewrite", "event", ",", "EvaluationContext", "context", ")", "{", "if", "(", "variableName", "==", "null", ")", "{", "setVariableName", "(", "Iteration", ".", "getPayloadVariableName", "(", "event", ",", "contex...
Check the variable name and if not set, set it with the singleton variable name being on the top of the stack.
[ "Check", "the", "variable", "name", "and", "if", "not", "set", "set", "it", "with", "the", "singleton", "variable", "name", "being", "on", "the", "top", "of", "the", "stack", "." ]
6668f09e7f012d24a0b4212ada8809417225b2ad
https://github.com/windup/windup/blob/6668f09e7f012d24a0b4212ada8809417225b2ad/config/api/src/main/java/org/jboss/windup/config/operation/iteration/AbstractIterationOperation.java#L77-L83
train
windup/windup
java-ast/addon/src/main/java/org/jboss/windup/ast/java/ASTProcessor.java
ASTProcessor.analyze
public static List<ClassReference> analyze(WildcardImportResolver importResolver, Set<String> libraryPaths, Set<String> sourcePaths, Path sourceFile) { ASTParser parser = ASTParser.newParser(AST.JLS11); parser.setEnvironment(libraryPaths.toArray(new String[libraryPaths.size()]), sour...
java
public static List<ClassReference> analyze(WildcardImportResolver importResolver, Set<String> libraryPaths, Set<String> sourcePaths, Path sourceFile) { ASTParser parser = ASTParser.newParser(AST.JLS11); parser.setEnvironment(libraryPaths.toArray(new String[libraryPaths.size()]), sour...
[ "public", "static", "List", "<", "ClassReference", ">", "analyze", "(", "WildcardImportResolver", "importResolver", ",", "Set", "<", "String", ">", "libraryPaths", ",", "Set", "<", "String", ">", "sourcePaths", ",", "Path", "sourceFile", ")", "{", "ASTParser", ...
Parses the provided file, using the given libraryPaths and sourcePaths as context. The libraries may be either jar files or references to directories containing class files. The sourcePaths must be a reference to the top level directory for sources (eg, for a file src/main/java/org/example/Foo.java, the source path wo...
[ "Parses", "the", "provided", "file", "using", "the", "given", "libraryPaths", "and", "sourcePaths", "as", "context", ".", "The", "libraries", "may", "be", "either", "jar", "files", "or", "references", "to", "directories", "containing", "class", "files", "." ]
6668f09e7f012d24a0b4212ada8809417225b2ad
https://github.com/windup/windup/blob/6668f09e7f012d24a0b4212ada8809417225b2ad/java-ast/addon/src/main/java/org/jboss/windup/ast/java/ASTProcessor.java#L41-L66
train
windup/windup
graph/api/src/main/java/org/jboss/windup/graph/GraphUtil.java
GraphUtil.vertexAsString
public static final String vertexAsString(Vertex vertex, int depth, String withEdgesOfLabel) { StringBuilder sb = new StringBuilder(); vertexAsString(vertex, depth, withEdgesOfLabel, sb, 0, new HashSet<>()); return sb.toString(); }
java
public static final String vertexAsString(Vertex vertex, int depth, String withEdgesOfLabel) { StringBuilder sb = new StringBuilder(); vertexAsString(vertex, depth, withEdgesOfLabel, sb, 0, new HashSet<>()); return sb.toString(); }
[ "public", "static", "final", "String", "vertexAsString", "(", "Vertex", "vertex", ",", "int", "depth", ",", "String", "withEdgesOfLabel", ")", "{", "StringBuilder", "sb", "=", "new", "StringBuilder", "(", ")", ";", "vertexAsString", "(", "vertex", ",", "depth"...
Formats a vertex using it's properties. Debugging purposes.
[ "Formats", "a", "vertex", "using", "it", "s", "properties", ".", "Debugging", "purposes", "." ]
6668f09e7f012d24a0b4212ada8809417225b2ad
https://github.com/windup/windup/blob/6668f09e7f012d24a0b4212ada8809417225b2ad/graph/api/src/main/java/org/jboss/windup/graph/GraphUtil.java#L21-L26
train
windup/windup
rules-java/api/src/main/java/org/jboss/windup/rules/apps/mavenize/MavenizationService.java
MavenizationService.normalizeDirName
private static String normalizeDirName(String name) { if(name == null) return null; return name.toLowerCase().replaceAll("[^a-zA-Z0-9]", "-"); }
java
private static String normalizeDirName(String name) { if(name == null) return null; return name.toLowerCase().replaceAll("[^a-zA-Z0-9]", "-"); }
[ "private", "static", "String", "normalizeDirName", "(", "String", "name", ")", "{", "if", "(", "name", "==", "null", ")", "return", "null", ";", "return", "name", ".", "toLowerCase", "(", ")", ".", "replaceAll", "(", "\"[^a-zA-Z0-9]\"", ",", "\"-\"", ")", ...
Normalizes the name so it can be used as Maven artifactId or groupId.
[ "Normalizes", "the", "name", "so", "it", "can", "be", "used", "as", "Maven", "artifactId", "or", "groupId", "." ]
6668f09e7f012d24a0b4212ada8809417225b2ad
https://github.com/windup/windup/blob/6668f09e7f012d24a0b4212ada8809417225b2ad/rules-java/api/src/main/java/org/jboss/windup/rules/apps/mavenize/MavenizationService.java#L249-L254
train
windup/windup
rules-java/api/src/main/java/org/jboss/windup/rules/apps/mavenize/MavenizationService.java
MavenizationService.guessPackaging
private static String guessPackaging(ProjectModel projectModel) { String projectType = projectModel.getProjectType(); if (projectType != null) return projectType; LOG.warning("WINDUP-983 getProjectType() returned null for: " + projectModel.getRootFileModel().getPrettyPath()); ...
java
private static String guessPackaging(ProjectModel projectModel) { String projectType = projectModel.getProjectType(); if (projectType != null) return projectType; LOG.warning("WINDUP-983 getProjectType() returned null for: " + projectModel.getRootFileModel().getPrettyPath()); ...
[ "private", "static", "String", "guessPackaging", "(", "ProjectModel", "projectModel", ")", "{", "String", "projectType", "=", "projectModel", ".", "getProjectType", "(", ")", ";", "if", "(", "projectType", "!=", "null", ")", "return", "projectType", ";", "LOG", ...
Tries to guess the packaging of the archive - whether it's an EAR, WAR, JAR. Maybe not needed as we can rely on the suffix?
[ "Tries", "to", "guess", "the", "packaging", "of", "the", "archive", "-", "whether", "it", "s", "an", "EAR", "WAR", "JAR", ".", "Maybe", "not", "needed", "as", "we", "can", "rely", "on", "the", "suffix?" ]
6668f09e7f012d24a0b4212ada8809417225b2ad
https://github.com/windup/windup/blob/6668f09e7f012d24a0b4212ada8809417225b2ad/rules-java/api/src/main/java/org/jboss/windup/rules/apps/mavenize/MavenizationService.java#L260-L277
train
windup/windup
utils/src/main/java/org/jboss/windup/util/xml/XmlUtil.java
XmlUtil.xpathExists
public static boolean xpathExists(Node document, String xpathExpression, Map<String, String> namespaceMapping) throws XPathException, MarshallingException { Boolean result = (Boolean) executeXPath(document, xpathExpression, namespaceMapping, XPathConstants.BOOLEAN); return result != ...
java
public static boolean xpathExists(Node document, String xpathExpression, Map<String, String> namespaceMapping) throws XPathException, MarshallingException { Boolean result = (Boolean) executeXPath(document, xpathExpression, namespaceMapping, XPathConstants.BOOLEAN); return result != ...
[ "public", "static", "boolean", "xpathExists", "(", "Node", "document", ",", "String", "xpathExpression", ",", "Map", "<", "String", ",", "String", ">", "namespaceMapping", ")", "throws", "XPathException", ",", "MarshallingException", "{", "Boolean", "result", "=",...
Runs the given xpath and returns a boolean result.
[ "Runs", "the", "given", "xpath", "and", "returns", "a", "boolean", "result", "." ]
6668f09e7f012d24a0b4212ada8809417225b2ad
https://github.com/windup/windup/blob/6668f09e7f012d24a0b4212ada8809417225b2ad/utils/src/main/java/org/jboss/windup/util/xml/XmlUtil.java#L137-L142
train
windup/windup
utils/src/main/java/org/jboss/windup/util/xml/XmlUtil.java
XmlUtil.executeXPath
public static Object executeXPath(Node document, String xpathExpression, Map<String, String> namespaceMapping, QName result) throws XPathException, MarshallingException { NamespaceMapContext mapContext = new NamespaceMapContext(namespaceMapping); try { XPathFactor...
java
public static Object executeXPath(Node document, String xpathExpression, Map<String, String> namespaceMapping, QName result) throws XPathException, MarshallingException { NamespaceMapContext mapContext = new NamespaceMapContext(namespaceMapping); try { XPathFactor...
[ "public", "static", "Object", "executeXPath", "(", "Node", "document", ",", "String", "xpathExpression", ",", "Map", "<", "String", ",", "String", ">", "namespaceMapping", ",", "QName", "result", ")", "throws", "XPathException", ",", "MarshallingException", "{", ...
Executes the given xpath and returns the result with the type specified.
[ "Executes", "the", "given", "xpath", "and", "returns", "the", "result", "with", "the", "type", "specified", "." ]
6668f09e7f012d24a0b4212ada8809417225b2ad
https://github.com/windup/windup/blob/6668f09e7f012d24a0b4212ada8809417225b2ad/utils/src/main/java/org/jboss/windup/util/xml/XmlUtil.java#L173-L194
train
windup/windup
rules-java/api/src/main/java/org/jboss/windup/rules/apps/mavenize/ModuleAnalysisHelper.java
ModuleAnalysisHelper.deriveGroupIdFromPackages
String deriveGroupIdFromPackages(ProjectModel projectModel) { Map<Object, Long> pkgsMap = new HashMap<>(); Set<String> pkgs = new HashSet<>(1000); GraphTraversal<Vertex, Vertex> pipeline = new GraphTraversalSource(graphContext.getGraph()).V(projectModel); pkgsMap = pipeline.out(Pro...
java
String deriveGroupIdFromPackages(ProjectModel projectModel) { Map<Object, Long> pkgsMap = new HashMap<>(); Set<String> pkgs = new HashSet<>(1000); GraphTraversal<Vertex, Vertex> pipeline = new GraphTraversalSource(graphContext.getGraph()).V(projectModel); pkgsMap = pipeline.out(Pro...
[ "String", "deriveGroupIdFromPackages", "(", "ProjectModel", "projectModel", ")", "{", "Map", "<", "Object", ",", "Long", ">", "pkgsMap", "=", "new", "HashMap", "<>", "(", ")", ";", "Set", "<", "String", ">", "pkgs", "=", "new", "HashSet", "<>", "(", "100...
Counts the packages prefixes appearing in this project and if some of them make more than half of the total of existing packages, this prefix is returned. Otherwise, returns null. This is just a helper, it isn't something really hard-setting the package. It's something to use if the user didn't specify using --maveniz...
[ "Counts", "the", "packages", "prefixes", "appearing", "in", "this", "project", "and", "if", "some", "of", "them", "make", "more", "than", "half", "of", "the", "total", "of", "existing", "packages", "this", "prefix", "is", "returned", ".", "Otherwise", "retur...
6668f09e7f012d24a0b4212ada8809417225b2ad
https://github.com/windup/windup/blob/6668f09e7f012d24a0b4212ada8809417225b2ad/rules-java/api/src/main/java/org/jboss/windup/rules/apps/mavenize/ModuleAnalysisHelper.java#L87-L117
train
windup/windup
rules-java/api/src/main/java/org/jboss/windup/rules/apps/java/condition/JavaClass.java
JavaClass.at
@Override public JavaClassBuilderAt at(TypeReferenceLocation... locations) { if (locations != null) this.locations = Arrays.asList(locations); return this; }
java
@Override public JavaClassBuilderAt at(TypeReferenceLocation... locations) { if (locations != null) this.locations = Arrays.asList(locations); return this; }
[ "@", "Override", "public", "JavaClassBuilderAt", "at", "(", "TypeReferenceLocation", "...", "locations", ")", "{", "if", "(", "locations", "!=", "null", ")", "this", ".", "locations", "=", "Arrays", ".", "asList", "(", "locations", ")", ";", "return", "this"...
Only match if the TypeReference is at the specified location within the file.
[ "Only", "match", "if", "the", "TypeReference", "is", "at", "the", "specified", "location", "within", "the", "file", "." ]
6668f09e7f012d24a0b4212ada8809417225b2ad
https://github.com/windup/windup/blob/6668f09e7f012d24a0b4212ada8809417225b2ad/rules-java/api/src/main/java/org/jboss/windup/rules/apps/java/condition/JavaClass.java#L135-L141
train
windup/windup
rules-java/api/src/main/java/org/jboss/windup/rules/apps/java/condition/JavaClass.java
JavaClass.as
@Override public ConditionBuilder as(String variable) { Assert.notNull(variable, "Variable name must not be null."); this.setOutputVariablesName(variable); return this; }
java
@Override public ConditionBuilder as(String variable) { Assert.notNull(variable, "Variable name must not be null."); this.setOutputVariablesName(variable); return this; }
[ "@", "Override", "public", "ConditionBuilder", "as", "(", "String", "variable", ")", "{", "Assert", ".", "notNull", "(", "variable", ",", "\"Variable name must not be null.\"", ")", ";", "this", ".", "setOutputVariablesName", "(", "variable", ")", ";", "return", ...
Optionally specify the variable name to use for the output of this condition
[ "Optionally", "specify", "the", "variable", "name", "to", "use", "for", "the", "output", "of", "this", "condition" ]
6668f09e7f012d24a0b4212ada8809417225b2ad
https://github.com/windup/windup/blob/6668f09e7f012d24a0b4212ada8809417225b2ad/rules-java/api/src/main/java/org/jboss/windup/rules/apps/java/condition/JavaClass.java#L146-L152
train
windup/windup
config/api/src/main/java/org/jboss/windup/config/condition/GraphCondition.java
GraphCondition.setResults
protected void setResults(GraphRewrite event, String variable, Iterable<? extends WindupVertexFrame> results) { Variables variables = Variables.instance(event); Iterable<? extends WindupVertexFrame> existingVariables = variables.findVariable(variable, 1); if (existingVariables != null) ...
java
protected void setResults(GraphRewrite event, String variable, Iterable<? extends WindupVertexFrame> results) { Variables variables = Variables.instance(event); Iterable<? extends WindupVertexFrame> existingVariables = variables.findVariable(variable, 1); if (existingVariables != null) ...
[ "protected", "void", "setResults", "(", "GraphRewrite", "event", ",", "String", "variable", ",", "Iterable", "<", "?", "extends", "WindupVertexFrame", ">", "results", ")", "{", "Variables", "variables", "=", "Variables", ".", "instance", "(", "event", ")", ";"...
This sets the variable with the given name to the given value. If there is already a variable with the same name in the top-most stack frame, we will combine them here. This helps in the case of multiple conditions tied together with "or" or "and".
[ "This", "sets", "the", "variable", "with", "the", "given", "name", "to", "the", "given", "value", ".", "If", "there", "is", "already", "a", "variable", "with", "the", "same", "name", "in", "the", "top", "-", "most", "stack", "frame", "we", "will", "com...
6668f09e7f012d24a0b4212ada8809417225b2ad
https://github.com/windup/windup/blob/6668f09e7f012d24a0b4212ada8809417225b2ad/config/api/src/main/java/org/jboss/windup/config/condition/GraphCondition.java#L76-L88
train
windup/windup
config/api/src/main/java/org/jboss/windup/config/phase/RulePhaseFinder.java
RulePhaseFinder.loadPhases
private Map<String, Class<? extends RulePhase>> loadPhases() { Map<String, Class<? extends RulePhase>> phases; phases = new HashMap<>(); Furnace furnace = FurnaceHolder.getFurnace(); for (RulePhase phase : furnace.getAddonRegistry().getServices(RulePhase.class)) { ...
java
private Map<String, Class<? extends RulePhase>> loadPhases() { Map<String, Class<? extends RulePhase>> phases; phases = new HashMap<>(); Furnace furnace = FurnaceHolder.getFurnace(); for (RulePhase phase : furnace.getAddonRegistry().getServices(RulePhase.class)) { ...
[ "private", "Map", "<", "String", ",", "Class", "<", "?", "extends", "RulePhase", ">", ">", "loadPhases", "(", ")", "{", "Map", "<", "String", ",", "Class", "<", "?", "extends", "RulePhase", ">", ">", "phases", ";", "phases", "=", "new", "HashMap", "<...
Loads the currently known phases from Furnace to the map.
[ "Loads", "the", "currently", "known", "phases", "from", "Furnace", "to", "the", "map", "." ]
6668f09e7f012d24a0b4212ada8809417225b2ad
https://github.com/windup/windup/blob/6668f09e7f012d24a0b4212ada8809417225b2ad/config/api/src/main/java/org/jboss/windup/config/phase/RulePhaseFinder.java#L42-L55
train
windup/windup
rules-base/api/src/main/java/org/jboss/windup/rules/files/condition/FileContent.java
FileContent.allInput
private void allInput(List<FileModel> vertices, GraphRewrite event, ParameterStore store) { if (StringUtils.isBlank(getInputVariablesName()) && this.filenamePattern == null) { FileService fileModelService = new FileService(event.getGraphContext()); for (FileModel fileModel : ...
java
private void allInput(List<FileModel> vertices, GraphRewrite event, ParameterStore store) { if (StringUtils.isBlank(getInputVariablesName()) && this.filenamePattern == null) { FileService fileModelService = new FileService(event.getGraphContext()); for (FileModel fileModel : ...
[ "private", "void", "allInput", "(", "List", "<", "FileModel", ">", "vertices", ",", "GraphRewrite", "event", ",", "ParameterStore", "store", ")", "{", "if", "(", "StringUtils", ".", "isBlank", "(", "getInputVariablesName", "(", ")", ")", "&&", "this", ".", ...
Generating the input vertices is quite complex. Therefore there are multiple methods that handles the input vertices based on the attribute specified in specific order. This method generates all the vertices if there is no other way how to handle the input.
[ "Generating", "the", "input", "vertices", "is", "quite", "complex", ".", "Therefore", "there", "are", "multiple", "methods", "that", "handles", "the", "input", "vertices", "based", "on", "the", "attribute", "specified", "in", "specific", "order", ".", "This", ...
6668f09e7f012d24a0b4212ada8809417225b2ad
https://github.com/windup/windup/blob/6668f09e7f012d24a0b4212ada8809417225b2ad/rules-base/api/src/main/java/org/jboss/windup/rules/files/condition/FileContent.java#L330-L340
train
windup/windup
graph/api/src/main/java/org/jboss/windup/graph/service/GraphService.java
GraphService.getById
@Override public T getById(Object id) { return context.getFramed().getFramedVertex(this.type, id); }
java
@Override public T getById(Object id) { return context.getFramed().getFramedVertex(this.type, id); }
[ "@", "Override", "public", "T", "getById", "(", "Object", "id", ")", "{", "return", "context", ".", "getFramed", "(", ")", ".", "getFramedVertex", "(", "this", ".", "type", ",", "id", ")", ";", "}" ]
Returns the vertex with given ID framed into given interface.
[ "Returns", "the", "vertex", "with", "given", "ID", "framed", "into", "given", "interface", "." ]
6668f09e7f012d24a0b4212ada8809417225b2ad
https://github.com/windup/windup/blob/6668f09e7f012d24a0b4212ada8809417225b2ad/graph/api/src/main/java/org/jboss/windup/graph/service/GraphService.java#L187-L191
train
windup/windup
graph/api/src/main/java/org/jboss/windup/graph/service/GraphService.java
GraphService.addTypeToModel
public static <T extends WindupVertexFrame> T addTypeToModel(GraphContext graphContext, WindupVertexFrame frame, Class<T> type) { Vertex vertex = frame.getElement(); graphContext.getGraphTypeManager().addTypeToElement(type, vertex); return graphContext.getFramed().frameElement(vertex, type);...
java
public static <T extends WindupVertexFrame> T addTypeToModel(GraphContext graphContext, WindupVertexFrame frame, Class<T> type) { Vertex vertex = frame.getElement(); graphContext.getGraphTypeManager().addTypeToElement(type, vertex); return graphContext.getFramed().frameElement(vertex, type);...
[ "public", "static", "<", "T", "extends", "WindupVertexFrame", ">", "T", "addTypeToModel", "(", "GraphContext", "graphContext", ",", "WindupVertexFrame", "frame", ",", "Class", "<", "T", ">", "type", ")", "{", "Vertex", "vertex", "=", "frame", ".", "getElement"...
Adds the specified type to this frame, and returns a new object that implements this type.
[ "Adds", "the", "specified", "type", "to", "this", "frame", "and", "returns", "a", "new", "object", "that", "implements", "this", "type", "." ]
6668f09e7f012d24a0b4212ada8809417225b2ad
https://github.com/windup/windup/blob/6668f09e7f012d24a0b4212ada8809417225b2ad/graph/api/src/main/java/org/jboss/windup/graph/service/GraphService.java#L297-L302
train
windup/windup
graph/api/src/main/java/org/jboss/windup/graph/service/GraphService.java
GraphService.removeTypeFromModel
public static <T extends WindupVertexFrame> WindupVertexFrame removeTypeFromModel(GraphContext graphContext, WindupVertexFrame frame, Class<T> type) { Vertex vertex = frame.getElement(); graphContext.getGraphTypeManager().removeTypeFromElement(type, vertex); return graphContext.getFramed().f...
java
public static <T extends WindupVertexFrame> WindupVertexFrame removeTypeFromModel(GraphContext graphContext, WindupVertexFrame frame, Class<T> type) { Vertex vertex = frame.getElement(); graphContext.getGraphTypeManager().removeTypeFromElement(type, vertex); return graphContext.getFramed().f...
[ "public", "static", "<", "T", "extends", "WindupVertexFrame", ">", "WindupVertexFrame", "removeTypeFromModel", "(", "GraphContext", "graphContext", ",", "WindupVertexFrame", "frame", ",", "Class", "<", "T", ">", "type", ")", "{", "Vertex", "vertex", "=", "frame", ...
Removes the specified type from the frame.
[ "Removes", "the", "specified", "type", "from", "the", "frame", "." ]
6668f09e7f012d24a0b4212ada8809417225b2ad
https://github.com/windup/windup/blob/6668f09e7f012d24a0b4212ada8809417225b2ad/graph/api/src/main/java/org/jboss/windup/graph/service/GraphService.java#L307-L312
train
windup/windup
reporting/api/src/main/java/org/jboss/windup/reporting/service/ClassificationServiceCache.java
ClassificationServiceCache.getCache
@SuppressWarnings("unchecked") private static synchronized Map<String, Boolean> getCache(GraphRewrite event) { Map<String, Boolean> result = (Map<String, Boolean>)event.getRewriteContext().get(ClassificationServiceCache.class); if (result == null) { result = Collections.synch...
java
@SuppressWarnings("unchecked") private static synchronized Map<String, Boolean> getCache(GraphRewrite event) { Map<String, Boolean> result = (Map<String, Boolean>)event.getRewriteContext().get(ClassificationServiceCache.class); if (result == null) { result = Collections.synch...
[ "@", "SuppressWarnings", "(", "\"unchecked\"", ")", "private", "static", "synchronized", "Map", "<", "String", ",", "Boolean", ">", "getCache", "(", "GraphRewrite", "event", ")", "{", "Map", "<", "String", ",", "Boolean", ">", "result", "=", "(", "Map", "<...
Keep a cache of items files associated with classification in order to improve performance.
[ "Keep", "a", "cache", "of", "items", "files", "associated", "with", "classification", "in", "order", "to", "improve", "performance", "." ]
6668f09e7f012d24a0b4212ada8809417225b2ad
https://github.com/windup/windup/blob/6668f09e7f012d24a0b4212ada8809417225b2ad/reporting/api/src/main/java/org/jboss/windup/reporting/service/ClassificationServiceCache.java#L25-L35
train
windup/windup
reporting/api/src/main/java/org/jboss/windup/reporting/service/EffortReportService.java
EffortReportService.getEffortLevelDescription
public static String getEffortLevelDescription(Verbosity verbosity, int points) { EffortLevel level = EffortLevel.forPoints(points); switch (verbosity) { case ID: return level.name(); case VERBOSE: return level.getVerboseDescription(); case SH...
java
public static String getEffortLevelDescription(Verbosity verbosity, int points) { EffortLevel level = EffortLevel.forPoints(points); switch (verbosity) { case ID: return level.name(); case VERBOSE: return level.getVerboseDescription(); case SH...
[ "public", "static", "String", "getEffortLevelDescription", "(", "Verbosity", "verbosity", ",", "int", "points", ")", "{", "EffortLevel", "level", "=", "EffortLevel", ".", "forPoints", "(", "points", ")", ";", "switch", "(", "verbosity", ")", "{", "case", "ID",...
Returns the right string representation of the effort level based on given number of points.
[ "Returns", "the", "right", "string", "representation", "of", "the", "effort", "level", "based", "on", "given", "number", "of", "points", "." ]
6668f09e7f012d24a0b4212ada8809417225b2ad
https://github.com/windup/windup/blob/6668f09e7f012d24a0b4212ada8809417225b2ad/reporting/api/src/main/java/org/jboss/windup/reporting/service/EffortReportService.java#L75-L89
train
windup/windup
exec/api/src/main/java/org/jboss/windup/exec/configuration/WindupConfiguration.java
WindupConfiguration.setOptionValue
public WindupConfiguration setOptionValue(String name, Object value) { configurationOptions.put(name, value); return this; }
java
public WindupConfiguration setOptionValue(String name, Object value) { configurationOptions.put(name, value); return this; }
[ "public", "WindupConfiguration", "setOptionValue", "(", "String", "name", ",", "Object", "value", ")", "{", "configurationOptions", ".", "put", "(", "name", ",", "value", ")", ";", "return", "this", ";", "}" ]
Sets a configuration option to the specified value.
[ "Sets", "a", "configuration", "option", "to", "the", "specified", "value", "." ]
6668f09e7f012d24a0b4212ada8809417225b2ad
https://github.com/windup/windup/blob/6668f09e7f012d24a0b4212ada8809417225b2ad/exec/api/src/main/java/org/jboss/windup/exec/configuration/WindupConfiguration.java#L108-L112
train
windup/windup
exec/api/src/main/java/org/jboss/windup/exec/configuration/WindupConfiguration.java
WindupConfiguration.getOptionValue
@SuppressWarnings("unchecked") public <T> T getOptionValue(String name) { return (T) configurationOptions.get(name); }
java
@SuppressWarnings("unchecked") public <T> T getOptionValue(String name) { return (T) configurationOptions.get(name); }
[ "@", "SuppressWarnings", "(", "\"unchecked\"", ")", "public", "<", "T", ">", "T", "getOptionValue", "(", "String", "name", ")", "{", "return", "(", "T", ")", "configurationOptions", ".", "get", "(", "name", ")", ";", "}" ]
Returns the configuration value with the specified name.
[ "Returns", "the", "configuration", "value", "with", "the", "specified", "name", "." ]
6668f09e7f012d24a0b4212ada8809417225b2ad
https://github.com/windup/windup/blob/6668f09e7f012d24a0b4212ada8809417225b2ad/exec/api/src/main/java/org/jboss/windup/exec/configuration/WindupConfiguration.java#L137-L141
train
windup/windup
config/api/src/main/java/org/jboss/windup/config/RuleSubset.java
RuleSubset.logTimeTakenByRuleProvider
private void logTimeTakenByRuleProvider(GraphContext graphContext, Context context, int ruleIndex, int timeTaken) { AbstractRuleProvider ruleProvider = (AbstractRuleProvider) context.get(RuleMetadataType.RULE_PROVIDER); if (ruleProvider == null) return; if (!timeTakenByProvider....
java
private void logTimeTakenByRuleProvider(GraphContext graphContext, Context context, int ruleIndex, int timeTaken) { AbstractRuleProvider ruleProvider = (AbstractRuleProvider) context.get(RuleMetadataType.RULE_PROVIDER); if (ruleProvider == null) return; if (!timeTakenByProvider....
[ "private", "void", "logTimeTakenByRuleProvider", "(", "GraphContext", "graphContext", ",", "Context", "context", ",", "int", "ruleIndex", ",", "int", "timeTaken", ")", "{", "AbstractRuleProvider", "ruleProvider", "=", "(", "AbstractRuleProvider", ")", "context", ".", ...
Logs the time taken by this rule, and attaches this to the total for the RuleProvider
[ "Logs", "the", "time", "taken", "by", "this", "rule", "and", "attaches", "this", "to", "the", "total", "for", "the", "RuleProvider" ]
6668f09e7f012d24a0b4212ada8809417225b2ad
https://github.com/windup/windup/blob/6668f09e7f012d24a0b4212ada8809417225b2ad/config/api/src/main/java/org/jboss/windup/config/RuleSubset.java#L138-L162
train
windup/windup
config/api/src/main/java/org/jboss/windup/config/RuleSubset.java
RuleSubset.logTimeTakenByPhase
private void logTimeTakenByPhase(GraphContext graphContext, Class<? extends RulePhase> phase, int timeTaken) { if (!timeTakenByPhase.containsKey(phase)) { RulePhaseExecutionStatisticsModel model = new GraphService<>(graphContext, RulePhaseExecutionStatisticsModel....
java
private void logTimeTakenByPhase(GraphContext graphContext, Class<? extends RulePhase> phase, int timeTaken) { if (!timeTakenByPhase.containsKey(phase)) { RulePhaseExecutionStatisticsModel model = new GraphService<>(graphContext, RulePhaseExecutionStatisticsModel....
[ "private", "void", "logTimeTakenByPhase", "(", "GraphContext", "graphContext", ",", "Class", "<", "?", "extends", "RulePhase", ">", "phase", ",", "int", "timeTaken", ")", "{", "if", "(", "!", "timeTakenByPhase", ".", "containsKey", "(", "phase", ")", ")", "{...
Logs the time taken by this rule and adds this to the total time taken for this phase
[ "Logs", "the", "time", "taken", "by", "this", "rule", "and", "adds", "this", "to", "the", "total", "time", "taken", "for", "this", "phase" ]
6668f09e7f012d24a0b4212ada8809417225b2ad
https://github.com/windup/windup/blob/6668f09e7f012d24a0b4212ada8809417225b2ad/config/api/src/main/java/org/jboss/windup/config/RuleSubset.java#L167-L186
train
windup/windup
rules-xml/api/src/main/java/org/jboss/windup/rules/apps/xml/condition/XmlFileXPathTransformer.java
XmlFileXPathTransformer.transformXPath
public static String transformXPath(String originalXPath) { // use a list to maintain the multiple joined xqueries (if there are multiple queries joined with the "|" operator) List<StringBuilder> compiledXPaths = new ArrayList<>(1); int frameIdx = -1; boolean inQuote = false; ...
java
public static String transformXPath(String originalXPath) { // use a list to maintain the multiple joined xqueries (if there are multiple queries joined with the "|" operator) List<StringBuilder> compiledXPaths = new ArrayList<>(1); int frameIdx = -1; boolean inQuote = false; ...
[ "public", "static", "String", "transformXPath", "(", "String", "originalXPath", ")", "{", "// use a list to maintain the multiple joined xqueries (if there are multiple queries joined with the \"|\" operator)", "List", "<", "StringBuilder", ">", "compiledXPaths", "=", "new", "Array...
Performs the conversion from standard XPath to xpath with parameterization support.
[ "Performs", "the", "conversion", "from", "standard", "XPath", "to", "xpath", "with", "parameterization", "support", "." ]
6668f09e7f012d24a0b4212ada8809417225b2ad
https://github.com/windup/windup/blob/6668f09e7f012d24a0b4212ada8809417225b2ad/rules-xml/api/src/main/java/org/jboss/windup/rules/apps/xml/condition/XmlFileXPathTransformer.java#L20-L98
train
windup/windup
forks/jdt/src/main/java/org/eclipse/jdt/internal/compiler/Compiler.java
Compiler.accept
@Override public void accept(IBinaryType binaryType, PackageBinding packageBinding, AccessRestriction accessRestriction) { if (this.options.verbose) { this.out.println( Messages.bind(Messages.compilation_loadBinary, new String(binaryType.getName()))); // new Exception("TRACE BI...
java
@Override public void accept(IBinaryType binaryType, PackageBinding packageBinding, AccessRestriction accessRestriction) { if (this.options.verbose) { this.out.println( Messages.bind(Messages.compilation_loadBinary, new String(binaryType.getName()))); // new Exception("TRACE BI...
[ "@", "Override", "public", "void", "accept", "(", "IBinaryType", "binaryType", ",", "PackageBinding", "packageBinding", ",", "AccessRestriction", "accessRestriction", ")", "{", "if", "(", "this", ".", "options", ".", "verbose", ")", "{", "this", ".", "out", "....
Add an additional binary type
[ "Add", "an", "additional", "binary", "type" ]
6668f09e7f012d24a0b4212ada8809417225b2ad
https://github.com/windup/windup/blob/6668f09e7f012d24a0b4212ada8809417225b2ad/forks/jdt/src/main/java/org/eclipse/jdt/internal/compiler/Compiler.java#L313-L323
train