Package com.datastax.driver.core

Examples of com.datastax.driver.core.ResultSetFuture


    public <T, I> void findByIndexAsync(String indexName, I key, Class<T> bean,
            Session session, ConsistencyLevel consistency,
            ResultAsyncCallBack<List<T>> resultCallBack) {
        QueryBean byKeyBean = createQueryBean(bean, consistency);
        ResultSetFuture result = executeConditions(indexName, key, bean, session, byKeyBean);
        AsyncResult.INSTANCE.runSelect(resultCallBack, result, bean);
    }
View Full Code Here


    }

    protected void handle(QueryGenerator.Request request) {

        final TimerContext timerContext = reporter.latencies.time();
        ResultSetFuture resultSetFuture = request.executeAsync(session);
        Futures.addCallback(resultSetFuture, new FutureCallback<ResultSet>() {
            @Override
            public void onSuccess(final ResultSet result) {
                timerContext.stop();
                reporter.requests.mark();
View Full Code Here

    return rse.extractData(execute(new SessionCallback<ResultSet>() {
      @Override
      public ResultSet doInSession(Session s) throws DataAccessException {
        Statement statement = new SimpleStatement(cql);
        addQueryOptions(statement, options);
        ResultSetFuture rsf = s.executeAsync(statement);
        ResultSet rs = null;
        try {
          rs = rsf.get(timeout, timeUnit);
        } catch (TimeoutException e) {
          throw new QueryTimeoutException("Asyncronous Query Timed Out.", e);
        } catch (InterruptedException e) {
          throw translateExceptionIfPossible(e);
        } catch (ExecutionException e) {
View Full Code Here

    return execute(new SessionCallback<Cancellable>() {
      @Override
      public Cancellable doInSession(Session s) throws DataAccessException {
        Statement statement = new SimpleStatement(cql);
        addQueryOptions(statement, options);
        ResultSetFuture rsf = s.executeAsync(statement);
        rsf.addListener(listener, executor);
        return new ResultSetFutureCancellable(rsf);
      }
    });
  }
View Full Code Here

    return execute(new SessionCallback<Cancellable>() {
      @Override
      public Cancellable doInSession(Session s) throws DataAccessException {
        Statement statement = new SimpleStatement(cql);
        addQueryOptions(statement, options);
        final ResultSetFuture rsf = s.executeAsync(statement);
        Runnable wrapper = new Runnable() {
          @Override
          public void run() {
            listener.onQueryComplete(rsf);
          }
        };
        rsf.addListener(wrapper, executor);
        return new ResultSetFutureCancellable(rsf);
      }
    });
  }
View Full Code Here

        if (options != null) {
          addQueryOptions(q, options);
        }

        final ResultSetFuture rsf = s.executeAsync(q);

        if (listener != null) {
          rsf.addListener(new Runnable() {

            @Override
            public void run() {
              listener.onQueryComplete(rsf);
            }
View Full Code Here

    return execute(new SessionCallback<Cancellable>() {
      @Override
      public Cancellable doInSession(Session s) throws DataAccessException {
        Statement statement = new SimpleStatement(cql);
        final ResultSetFuture rsf = s.executeAsync(statement);
        rsf.addListener(listener, executor);
        return new ResultSetFutureCancellable(rsf);
      }
    });
  }
View Full Code Here

    return execute(new SessionCallback<Cancellable>() {
      @Override
      public Cancellable doInSession(Session s) throws DataAccessException {
        Statement statement = new SimpleStatement(cql);
        final ResultSetFuture rsf = s.executeAsync(statement);
        Runnable wrapper = new Runnable() {
          @Override
          public void run() {
            listener.onQueryComplete(rsf);
          }
        };
        rsf.addListener(wrapper, executor);
        return new ResultSetFutureCancellable(rsf);
      }
    });
  }
View Full Code Here

  public Cancellable executeAsynchronously(final Statement query, final Runnable listener, final Executor executor)
      throws DataAccessException {
    return execute(new SessionCallback<Cancellable>() {
      @Override
      public Cancellable doInSession(Session s) throws DataAccessException {
        final ResultSetFuture rsf = s.executeAsync(query);
        rsf.addListener(listener, executor);
        return new ResultSetFutureCancellable(rsf);
      }
    });
  }
View Full Code Here

      final Executor executor) throws DataAccessException {

    return execute(new SessionCallback<Cancellable>() {
      @Override
      public Cancellable doInSession(Session s) throws DataAccessException {
        final ResultSetFuture rsf = s.executeAsync(query);
        if (listener != null) {
          Runnable wrapper = new Runnable() {
            @Override
            public void run() {
              listener.onQueryComplete(rsf);
            }
          };
          rsf.addListener(wrapper, executor);
        }
        return new ResultSetFutureCancellable(rsf);
      }
    });
  }
View Full Code Here

TOP

Related Classes of com.datastax.driver.core.ResultSetFuture

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.