Example usage for org.apache.cassandra.utils FBUtilities newPartitioner

List of usage examples for org.apache.cassandra.utils FBUtilities newPartitioner

Introduction

In this page you can find the example usage for org.apache.cassandra.utils FBUtilities newPartitioner.

Prototype

public static IPartitioner newPartitioner(String partitionerClassName) throws ConfigurationException 

Source Link

Usage

From source file:andromache.config.CassandraConfigHelper.java

License:Apache License

public static IPartitioner getInputPartitioner(Configuration conf) {
    try {//  w w  w .j a v  a  2s .c om
        return FBUtilities.newPartitioner(conf.get(INPUT_PARTITIONER_CONFIG));
    } catch (ConfigurationException e) {
        throw new RuntimeException(e);
    }
}

From source file:andromache.config.CassandraConfigHelper.java

License:Apache License

public static IPartitioner getOutputPartitioner(Configuration conf) {
    try {//from   w ww  .  ja  v  a2  s.  c  o m
        return FBUtilities.newPartitioner(conf.get(OUTPUT_PARTITIONER_CONFIG));
    } catch (ConfigurationException e) {
        throw new RuntimeException(e);
    }
}

From source file:com.facebook.presto.cassandra.CassandraTokenSplitManager.java

License:Apache License

@Inject
public CassandraTokenSplitManager(CassandraThriftConnectionFactory connectionFactory,
        @ForCassandra ExecutorService executor, CassandraClientConfig config) {
    this.cassandraThriftClient = new CassandraThriftClient(
            checkNotNull(connectionFactory, "connectionFactory is null"));
    this.executor = checkNotNull(executor, "executor is null");
    this.splitSize = config.getSplitSize();
    try {/*from w  ww .j  av  a2s.  co  m*/
        this.partitioner = FBUtilities.newPartitioner(config.getPartitioner());
    } catch (ConfigurationException e) {
        throw new RuntimeException(e);
    }
}

From source file:org.janusgraph.diskstorage.cassandra.astyanax.AstyanaxStoreManager.java

License:Apache License

@Override
public IPartitioner getCassandraPartitioner() throws BackendException {
    Cluster cl = clusterContext.getClient();
    try {/*from w  w  w. j a v a2  s .  c  o  m*/
        return FBUtilities.newPartitioner(cl.describePartitioner());
    } catch (ConnectionException e) {
        throw new TemporaryBackendException(e);
    } catch (ConfigurationException e) {
        throw new PermanentBackendException(e);
    }
}

From source file:org.janusgraph.diskstorage.cassandra.thrift.CassandraThriftStoreManager.java

License:Apache License

@Override
public IPartitioner getCassandraPartitioner() throws BackendException {
    CTConnection conn = null;//from  www  .  j a  v a2 s .c o m
    try {
        conn = pool.borrowObject(SYSTEM_KS);
        return FBUtilities.newPartitioner(conn.getClient().describe_partitioner());
    } catch (Exception e) {
        throw new TemporaryBackendException(e);
    } finally {
        pool.returnObjectUnsafe(SYSTEM_KS, conn);
    }
}

From source file:org.pingles.cascading.cassandra.hadoop.ConfigHelper.java

License:Apache License

public static IPartitioner getPartitioner(Configuration conf) {
    try {/*from w  w  w.j av a 2  s  .c  o  m*/
        return FBUtilities.newPartitioner(conf.get(PARTITIONER_CONFIG));
    } catch (ConfigurationException e) {
        throw new RuntimeException(e);
    }
}