Skip to content
Snippets Groups Projects
Commit 3b52c823 authored by Jan Kožusznik's avatar Jan Kožusznik
Browse files

Merge branch 'DialogForCompletJOBInfo' into asyncTable

parents 6e85b885 fe42e8a3
No related branches found
No related tags found
No related merge requests found
......@@ -62,7 +62,7 @@ public class Extractor {
}
}
if(valueCollector != null) {
write(pw, collector, valueCollector);;
write(pw, collector, valueCollector);
}
} catch (IOException e) {
log.log(Level.SEVERE, e.getMessage(), e);
......
......@@ -15,10 +15,10 @@ import cz.it4i.fiji.haas_java_client.SynchronizableFileType;
public class HaaSOutputHolderImpl implements HaaSOutputHolder {
@SuppressWarnings("unused")
private static Logger log = LoggerFactory.getLogger(cz.it4i.fiji.haas.HaaSOutputHolderImpl.class);
private final static Logger log = LoggerFactory.getLogger(cz.it4i.fiji.haas.HaaSOutputHolderImpl.class);
private Map<SynchronizableFileType, StringBuilder> results = new HashMap<>();
private HaaSOutputSource source;
private final Map<SynchronizableFileType, StringBuilder> results = new HashMap<>();
private final HaaSOutputSource source;
public HaaSOutputHolderImpl(HaaSOutputSource source) {
this.source = source;
......@@ -38,8 +38,8 @@ public class HaaSOutputHolderImpl implements HaaSOutputHolder {
private synchronized void updateData(List<SynchronizableFileType> types) {
List<JobSynchronizableFile> files = types.stream().map(type -> new JobSynchronizableFile(type,
results.computeIfAbsent(type, x -> new StringBuilder()).length())).collect(Collectors.toList());
List<String> readed = source.getOutput(files);
Streams.zip(types.stream(), readed.stream(),
List<String> readedContent = source.getOutput(files);
Streams.zip(types.stream(), readedContent.stream(),
(type, content) -> (Runnable) (() -> results.get(type).append(content))).forEach(r -> r.run());
}
}
......@@ -80,8 +80,7 @@ public interface JavaFXRoutines {
}
static void initRootAndController(String string, Object parent, boolean setController) {
FXMLLoader fxmlLoader = null;
fxmlLoader = new FXMLLoader(parent.getClass().getResource(string));
FXMLLoader fxmlLoader = new FXMLLoader(parent.getClass().getResource(string));
fxmlLoader.setControllerFactory(c -> {
try {
if (c.equals(parent.getClass())) {
......
......@@ -13,11 +13,11 @@ import java.util.stream.Collectors;
import cz.it4i.fiji.haas_java_client.SynchronizableFileType;
public class SPIMComputationAccessorDecoratorWithTimeout implements SPIMComputationAccessor {
private long intervalForQueryInMs;
private P_ResultCacheHolder<List<String>> outputCache;
private P_ResultCacheHolder<Set<String>> changedFilesCache;
private Map<SynchronizableFileType, Integer> allowedTypesIndices = new HashMap<>();
private List<SynchronizableFileType> allowedTypes = new LinkedList<>();
private final long intervalForQueryInMs;
private final P_ResultCacheHolder<List<String>> outputCache;
private final P_ResultCacheHolder<Set<String>> changedFilesCache;
private final Map<SynchronizableFileType, Integer> allowedTypesIndices = new HashMap<>();
private final List<SynchronizableFileType> allowedTypes = new LinkedList<>();
public SPIMComputationAccessorDecoratorWithTimeout(SPIMComputationAccessor decorated,
Set<SynchronizableFileType> allowedTypes, long intervalForQueryInMs) {
......
......@@ -21,19 +21,18 @@ import javafx.beans.value.ObservableValueBase;
public class HaaSOutputObservableValueRegistry implements Closeable {
@SuppressWarnings("unused")
private static Logger log = LoggerFactory
private final static Logger log = LoggerFactory
.getLogger(cz.it4i.fiji.haas_spim_benchmark.ui.HaaSOutputObservableValueRegistry.class);
private Map<SynchronizableFileType, P_HaaSOutputObservableValue> observable = new HashMap<>();
private List<SynchronizableFileType> types = new LinkedList<>();
private Timer timer;
private HaaSOutputHolder holder;
private final Map<SynchronizableFileType, P_HaaSOutputObservableValue> observable = new HashMap<>();
private final List<SynchronizableFileType> types = new LinkedList<>();
private final Timer timer;
private final HaaSOutputHolder holder;
private long timeout;
public HaaSOutputObservableValueRegistry(HaaSOutputHolder holder, long timeout) {
super();
this.holder = holder;
timer = new Timer();
this.timeout = timeout;
......
......@@ -23,15 +23,18 @@ import cz.it4i.fiji.haas_spim_benchmark.core.BenchmarkJobManager.BenchmarkJob;
public class JobOutputView {
@SuppressWarnings("unused")
private static Logger log = LoggerFactory.getLogger(cz.it4i.fiji.haas_spim_benchmark.ui.JobOutputView.class);
private Timer timer;
private final static Logger log = LoggerFactory.getLogger(cz.it4i.fiji.haas_spim_benchmark.ui.JobOutputView.class);
private final Timer timer;
private final BenchmarkJob job;
private final ExecutorService executor;
private final SynchronizableFileType fileType;
private final Function<BenchmarkJob, String> outputProvider;
private JDialog theDialog;
private JTextArea theText;
private BenchmarkJob job;
private ExecutorService executor;
private long readedChars = 0;
private SynchronizableFileType fileType;
private Function<BenchmarkJob, String> outputProvider;
private long numberOfReadChars = 0;
......@@ -97,8 +100,8 @@ public class JobOutputView {
} else {
output = "This is testing line\n";
}
theText.append(output.substring((int) readedChars));
readedChars = output.length();
theText.append(output.substring((int) numberOfReadChars));
numberOfReadChars = output.length();
theText.setCaretPosition(theText.getDocument().getLength());
});
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment