Lucio Lelii 6 years ago
parent cd43b8f199
commit 8aa6871b5d

@ -90,6 +90,7 @@ public class QueryCache<T> implements Serializable{
fos = new FileOutputStream(file);
deflater = new DeflaterOutputStream(fos, new Deflater(Deflater.BEST_COMPRESSION, true));
writer = new ObjectOutputStream(deflater);
logger.debug("file created {}",file.getAbsolutePath());
} catch (Exception e) {
if (file!=null)
file.delete();
@ -117,6 +118,7 @@ public class QueryCache<T> implements Serializable{
@SuppressWarnings("unchecked")
public void getAll(ObjectWriter<T> writer){
logger.debug("file to open is {} ",file==null?null:file.getAbsolutePath());
try(FileInputStream fis = new FileInputStream(file); InflaterInputStream iis = new InflaterInputStream(fis, new Inflater(true)); ObjectInputStream ois =new ObjectInputStream(iis) ){
String obj = null;
while (( obj = (String)ois.readObject())!=null && writer.isAlive())

@ -59,7 +59,6 @@ public class Executor {
public String getResultLink(@PathParam("jobKey") String jobKey) throws InvalidIdentifierException {
String node;
String jobId;
try{
node = extractNode(jobKey);
jobId = extractId(jobKey);
@ -216,22 +215,25 @@ public class Executor {
}
private static String extractNode(String key) throws IdNotValidException{
String[] splitted = key.split("\\|\\|");
logger.trace("id arrived is {}", key );
String[] splitted = key.split("_");
if (splitted.length==2)
return splitted[0];
else throw new IdNotValidException();
}
private static String extractId(String key) throws IdNotValidException{
String[] splitted = key.split("\\|\\|");
logger.trace("id arrived is {}", key );
String[] splitted = key.split("_");
if (splitted.length==2)
return splitted[1];
else throw new IdNotValidException();
}
private String createKey(String id){
logger.trace("id arrived is {}", id );
String node = cxt.container().profile(HostingNode.class).id();
return node+"||"+id;
return node+"_"+id;
}
/*
private Executor remoteJobCall(String riId) throws InvalidIdentifierException{

Loading…
Cancel
Save