logger.log(Level.WARNING, "no client for node: " + node);
return;
}
- final Map<String, Request> identifierRequests = new HashMap<String, Request>();
+ final Map<String, Request> identifierRequests = Collections.synchronizedMap(new HashMap<String, Request>());
nodeRequests.put(node, identifierRequests);
HighLevelCallback<RequestListResult> requestListCallback = highLevelClient.getRequests();
requestListCallback.addHighLevelCallbackListener(new HighLevelCallbackListener<RequestListResult>() {
return;
}
for (RequestResult requestResult: requestListResult) {
- String identifier = requestResult.getIdentifier();
- if (identifierRequests.containsKey(identifier)) {
- continue;
- }
- Request request = new Request(node, identifier);
- identifierRequests.put(requestResult.getIdentifier(), request);
- /* TODO - fill request */
- fireRequestAdded(request);
+ String identifier = requestResult.getIdentifier();
+ logger.log(Level.FINER, "got identifier: " + identifier);
+ if (identifierRequests.containsKey(identifier)) {
+ continue;
+ }
+ Request request = new Request(node, identifier);
+ identifierRequests.put(requestResult.getIdentifier(), request);
+ /* TODO - fill request */
+ fireRequestAdded(request);
}
}
});
Map<String, Request> identifierRequests = nodeRequests.get(node);
if (identifierRequests == null) {
logger.warning("got node without request map: " + node);
- return;
+ identifierRequests = Collections.synchronizedMap(new HashMap<String, Request>());
+ nodeRequests.put(node, identifierRequests);
}
Request request = identifierRequests.get(identifier);
- if (request == null) {
- logger.warning("got progress for unknown request: " + identifier);
- return;
- }
+ if (request == null) {
+ logger.warning("got progress for unknown request: " + identifier);
+ request = new Request(node, identifier);
+ identifierRequests.put(identifier, request);
+ fireRequestAdded(request);
+ }
request.setTotalBlocks(highLevelProgress.getTotalBlocks());
request.setRequiredBlocks(highLevelProgress.getRequiredBlocks());
request.setSuccessfulBlocks(highLevelProgress.getSuccessfulBlocks());