public void stop() throws Exception { LOG.info("Attempting to shutdown TinkerPop cluster connection."); CloseFuture future = cluster.closeAsync(); try { future.get(shutdownTimeout.toMilliseconds(), TimeUnit.MILLISECONDS); } catch (TimeoutException ex) { LOG.warn("Unable to close TinkerPop cluster after {}", shutdownTimeout); } }
@Override public void stop() throws Exception { LOG.debug("Attempting graceful shutdown of Cassandra cluster: {}", cluster.getClusterName()); CloseFuture future = cluster.closeAsync(); try { future.get(shutdownGracePeriod.toMilliseconds(), TimeUnit.MILLISECONDS); } catch (TimeoutException e) { LOG.warn("Cassandra cluster did not close in {}. Forcing it now.", shutdownGracePeriod); future.force(); } }
public Future<Void> shutdown() { final CloseFuture future = m_session.closeAsync(); return new Future<Void>() { @Override public boolean cancel(boolean mayInterruptIfRunning) { return future.cancel(mayInterruptIfRunning); } @Override public boolean isCancelled() { return future.isCancelled(); } @Override public boolean isDone() { return future.isDone(); } @Override public Void get() throws InterruptedException, ExecutionException { return future.get(); } @Override public Void get(long timeout, TimeUnit unit) throws InterruptedException, ExecutionException, TimeoutException { return future.get(timeout, unit); } }; }
@Override public CloseFuture closeAsync() { return delegate.closeAsync(); }
@Override public CloseFuture closeAsync() { return session.closeAsync(); }
public CloseFuture closeAsync() { return session.closeAsync(); }
@Override public CloseFuture closeAsync() { throw new UnsupportedOperationException("Do not close the sessions handed out from CassandraSupport"); }
public CloseFuture closeAsync() { return sessionRef.get().closeAsync(); }