Java 类com.datastax.driver.core.CloseFuture 实例源码

项目:dropwizard-dsegraph    文件:DseGraphManaged.java   
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);
    }
}
项目:dropwizard-cassandra    文件:CassandraManager.java   
@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();
    }
}
项目:newts    文件:CassandraSessionImpl.java   
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);
        }
    };

}
项目:brave-cassandra    文件:TracingSession.java   
@Override public CloseFuture closeAsync() {
  return delegate.closeAsync();
}
项目:ibm-performance-monitor    文件:ProfiledSession.java   
@Override
public CloseFuture closeAsync() {
    return session.closeAsync();
}
项目:cassandra-loader    文件:EnhancedSession.java   
public CloseFuture closeAsync() {
    return session.closeAsync();
}
项目:jesterj    文件:CassandraSupport.java   
@Override
public CloseFuture closeAsync() {
  throw new UnsupportedOperationException("Do not close the sessions handed out from CassandraSupport");
}
项目:Troilus    文件:SessionReplacedTest.java   
public CloseFuture closeAsync() {
    return sessionRef.get().closeAsync();
}