Java 类org.apache.cassandra.thrift.Cassandra.Client 实例源码

项目:presto    文件:CassandraThriftClient.java   
public static void closeQuietly(Client client)
{
    try {
        TProtocol inputProtocol = client.getInputProtocol();
        if (inputProtocol == null) {
            return;
        }
        TTransport transport = inputProtocol.getTransport();
        if (transport == null) {
            return;
        }
        transport.close();
    }
    catch (Exception ignored) {
    }
}
项目:cassandra-maven-plugin    文件:AbstractCqlExecMojo.java   
private CqlResult executeStatement(Client client, String statement) throws ThriftApiExecutionException
{
    ByteBuffer buf = ByteBufferUtil.bytes(statement);
    try
    {
        if (cqlVersion.charAt(0) >= '3')
        {
            return client.execute_cql3_query(buf, Compression.NONE, ConsistencyLevel.ONE);
        } else
        {
            return client.execute_cql_query(buf, Compression.NONE);
        }
    } catch (Exception e)
    {
        getLog().debug(statement);
        throw new ThriftApiExecutionException(e);
    }
}
项目:cassandra-maven-plugin    文件:DropColumnFamiliesMojo.java   
@Override
public void executeOperation(Client client) throws ThriftApiExecutionException
{
    try {
        if ( columnFamilyList != null && columnFamilyList.length > 0 ) 
        {
            for (int i = 0; i < columnFamilyList.length; i++) 
            {
                client.system_drop_column_family(columnFamilyList[i]);
                getLog().info("Dropped column family \"" + columnFamilyList[i] + "\".");
            }
        } 
        else 
        {
            client.system_drop_keyspace(keyspace);
            getLog().info("Dropped keyspace \"" + keyspace + "\".");
        }
    } catch (Exception e) 
    {
        throw new ThriftApiExecutionException(e);
    }
}
项目:presto    文件:CassandraThriftClient.java   
public List<TokenRange> getRangeMap(String keyspace)
{
    Client client = connectionFactory.create();
    try {
        return client.describe_ring(keyspace);
    }
    catch (TException e) {
        throw new RuntimeException(e);
    }
    finally {
        closeQuietly(client);
    }
}
项目:cassandra-maven-plugin    文件:AbstractCqlExecMojo.java   
@Override
void executeOperation(Client client) throws ThriftApiExecutionException
{
    for (String statement : statements)
    {
        if (StringUtils.isNotBlank(statement))
        {
            results.add(executeStatement(client, statement));
        }
    }
}
项目:titan1withtp3.1    文件:CTConnection.java   
public CTConnection(TTransport transport, Client client, CTConnectionFactory.Config cfg) {
    this.transport = transport;
    this.client = client;
    this.cfg = cfg;
}
项目:titan1withtp3.1    文件:CTConnection.java   
public Cassandra.Client getClient() {
    return client;
}
项目:titan1.0.1.kafka    文件:CTConnection.java   
public CTConnection(TTransport transport, Client client, CTConnectionFactory.Config cfg) {
    this.transport = transport;
    this.client = client;
    this.cfg = cfg;
}
项目:titan1.0.1.kafka    文件:CTConnection.java   
public Cassandra.Client getClient() {
    return client;
}
项目:titan0.5.4-hbase1.1.1-custom    文件:CTConnection.java   
public CTConnection(TTransport transport, Client client, CTConnectionFactory.Config cfg) {
    this.transport = transport;
    this.client = client;
    this.cfg = cfg;
}
项目:titan0.5.4-hbase1.1.1-custom    文件:CTConnection.java   
public Cassandra.Client getClient() {
    return client;
}