@Test(expected=TimeoutException.class) public void testFutureTrackGetTimeout() throws InterruptedException, ExecutionException, TimeoutException { HazeltaskTask<String> work = new HazeltaskTask<String>(workOneId, "group-1", null, (Callable<?>)null); DistributedFuture<String, String> future = tracker.createFuture(work); Assert.assertEquals(future.get(10, TimeUnit.MILLISECONDS), "Yay!"); }
@SuppressWarnings("unchecked") public <T> DistributedFuture<GROUP, T> createFuture(HazeltaskTask<GROUP> task) { DistributedFuture<GROUP, T> future = new DistributedFuture<GROUP, T>(topologyService, task.getGroup(), task.getId()); this.futures.put(task.getId(), (DistributedFuture<GROUP, Serializable>) future); return future; }
DistributedFutureTracker implements MessageListener<TaskResponse<Serializable>> { @SuppressWarnings("unchecked") public <T> DistributedFuture<GROUP, T> createFuture(HazeltaskTask<GROUP> task) { DistributedFuture<GROUP, T> future = new DistributedFuture<GROUP, T>(topologyService, task.getGroup(), task.getId()); this.futures.put(task.getId(), (DistributedFuture<GROUP, Serializable>) future); return future; } }
DistributedFutureTracker implements MessageListener<TaskResponse<Serializable>> { @SuppressWarnings("unchecked") public <T> DistributedFuture<GROUP, T> createFuture(HazeltaskTask<GROUP> task) { DistributedFuture<GROUP, T> future = new DistributedFuture<GROUP, T>(topologyService, task.getGroup(), task.getId()); this.futures.put(task.getId(), (DistributedFuture<GROUP, Serializable>) future); return future; } DistributedFutureTracker(final IExecutorTopologyService<GROUP> topologyService, ExecutorMetrics metrics, ExecutorConfig<GROUP> config); }
DistributedFutureTracker implements MessageListener<TaskResponse<Serializable>> { @SuppressWarnings("unchecked") public <T> DistributedFuture<GROUP, T> createFuture(HazeltaskTask<GROUP> task) { DistributedFuture<GROUP, T> future = new DistributedFuture<GROUP, T>(topologyService, task.getGroup(), task.getId()); this.futures.put(task.getId(), (DistributedFuture<GROUP, Serializable>) future); return future; } DistributedFutureTracker(final IExecutorTopologyService<GROUP> topologyService, ExecutorMetrics metrics, ExecutorConfig<GROUP> config); @SuppressWarnings("unchecked") DistributedFuture<GROUP, T> createFuture(HazeltaskTask<GROUP> task); Set<UUID> getTrackedTaskIds(); @Override void onMessage(Message<TaskResponse<Serializable>> message); void errorFuture(UUID taskId, Exception e); int size(); }
DistributedFutureTracker implements MessageListener<TaskResponse<Serializable>> { @SuppressWarnings("unchecked") public <T> DistributedFuture<GROUP, T> createFuture(HazeltaskTask<GROUP> task) { DistributedFuture<GROUP, T> future = new DistributedFuture<GROUP, T>(topologyService, task.getGroup(), task.getId()); this.futures.put(task.getId(), (DistributedFuture<GROUP, Serializable>) future); return future; } DistributedFutureTracker(final IExecutorTopologyService<GROUP> topologyService, ExecutorMetrics metrics, ExecutorConfig<GROUP> config); @SuppressWarnings("unchecked") DistributedFuture<GROUP, T> createFuture(HazeltaskTask<GROUP> task); Set<UUID> getTrackedTaskIds(); @Override void onMessage(Message<TaskResponse<Serializable>> message); void errorFuture(UUID taskId, Exception e); int size();  }