refs #579: Use Persistence to persist Scheduled Task configuration on smart-executor

https://support.d4science.org/issues/579

git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/vre-management/smart-executor@119470 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
Luca Frosini 2015-10-07 08:28:17 +00:00
parent af20689c68
commit f81ffa5377
1 changed files with 12 additions and 9 deletions

View File

@ -208,11 +208,9 @@ public class CouchDBPersistenceConnector extends SmartExecutorPersistenceConnect
startKey.add(scope);
ArrayNode endKey = new ObjectMapper().createArrayNode();
endKey.add(scope);
String pluginName = pluginDeclaration.getName();
if(pluginName!=null && pluginName.compareTo("")!=0){
startKey.add(pluginName);
endKey.add(pluginName);
if(pluginDeclaration!=null && pluginDeclaration.getName()!=null && pluginDeclaration.getName().compareTo("")!=0){
startKey.add(pluginDeclaration.getName());
endKey.add(pluginDeclaration.getName());
query = query.viewName(PLUGIN_STATE_VIEW_ABANDONED);
}else{
query = query.viewName(PLUGIN_STATE);
@ -224,15 +222,20 @@ public class CouchDBPersistenceConnector extends SmartExecutorPersistenceConnect
if(iterationNumber != LAST){
startKey.add(iterationNumber);
endKey.add(iterationNumber);
}
// Adding time interval
startKey.add(1);
endKey.add("{}");
startKey.add(1);
endKey.add("{}");
}else{
// Adding time interval
startKey.add(1);
endKey.add("{}");
}
query.startKey(startKey);
query.endKey(endKey);
query.reduce(false);
PluginState pluginState = null;
ViewResult viewResult = query(query);
for (ViewResult.Row row : viewResult) {