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

fix name of method

do method getState nonblocking
parent 3b52c823
No related branches found
No related tags found
No related merge requests found
......@@ -26,7 +26,6 @@ import java.util.List;
import java.util.Map;
import java.util.Scanner;
import java.util.concurrent.CompletableFuture;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.Executor;
import java.util.function.Predicate;
import java.util.stream.Collectors;
......@@ -88,12 +87,7 @@ public class BenchmarkJobManager {
}
public JobState getState() {
try {
return getStateAsync(r->r.run()).get();
} catch (InterruptedException | ExecutionException e) {
log.error(e.getMessage(), e);
throw new RuntimeException(e);
}
return getStateAsync(r->r.run()).getNow(JobState.Unknown);
}
public synchronized CompletableFuture<JobState> getStateAsync(Executor executor) {
......
......@@ -212,7 +212,7 @@ public class BenchmarkSPIMController extends BorderPane implements CloseableCont
private void initTable() {
registry = new ObservableBenchmarkJobRegistry(bj -> remove(bj),executorServiceJobState);
setCellValueFactory(0, j -> j.getId() + "");
setCellValueFactoryComplatable(1,
setCellValueFactoryCompletable(1,
j -> j.getStateAsync(executorServiceJobState).thenApply(state -> "" + state));
setCellValueFactory(2, j -> j.getCreationTime().toString());
setCellValueFactory(3, j -> j.getStartTime().toString());
......@@ -230,7 +230,7 @@ public class BenchmarkSPIMController extends BorderPane implements CloseableCont
}
@SuppressWarnings("unchecked")
private void setCellValueFactoryComplatable(int index, Function<BenchmarkJob, CompletableFuture<String>> mapper) {
private void setCellValueFactoryCompletable(int index, Function<BenchmarkJob, CompletableFuture<String>> mapper) {
JavaFXRoutines.setCellValueFactory(jobs, index, mapper);
((TableColumn<ObservableValue<BenchmarkJob>, CompletableFuture<String>>) jobs.getColumns().get(index))
.setCellFactory(
......
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