Package org.easycassandra.persistence.cassandra

Source Code of org.easycassandra.persistence.cassandra.CountQueryAsync

package org.easycassandra.persistence.cassandra;

import com.datastax.driver.core.ConsistencyLevel;
import com.datastax.driver.core.ResultSetFuture;
import com.datastax.driver.core.Session;
import com.datastax.driver.core.querybuilder.Select;

/**
* count using async process.
* @author otaviojava
*/
class CountQueryAsync extends CountQuery {

    public CountQueryAsync(String keySpace) {
        super(keySpace);
    }

    public void countAsync(Class<?> bean, Session session,
            ConsistencyLevel consistency, ResultAsyncCallBack<Long> resultCallBack) {
        Select select = prepareCount(bean, consistency);
        ResultSetFuture resultSet = session.executeAsync(select);
        AsyncResult.INSTANCE.runCount(resultCallBack, resultSet);

    }

}
TOP

Related Classes of org.easycassandra.persistence.cassandra.CountQueryAsync

TOP
Copyright © 2018 www.massapi.com. 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.