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

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

Introduction

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

Prototype

public static <T> T construct(String classname, String readable) throws ConfigurationException 

Source Link

Document

Constructs an instance of the given class, which must have a no-arg or default constructor.

Usage

From source file:com.dse.pig.udfs.AbstractCassandraStorage.java

License:Apache License

@Override
public InputFormat getInputFormat() throws IOException {
    try {//from   w w  w .  j  a  va  2  s .  co  m
        return FBUtilities.construct(inputFormatClass, "inputformat");
    } catch (ConfigurationException e) {
        throw new IOException(e);
    }
}

From source file:com.dse.pig.udfs.AbstractCassandraStorage.java

License:Apache License

/** output format */
public OutputFormat getOutputFormat() throws IOException {
    try {/*from   w  w w  .  j a v  a  2s. c  o m*/
        return FBUtilities.construct(outputFormatClass, "outputformat");
    } catch (ConfigurationException e) {
        throw new IOException(e);
    }
}

From source file:com.knewton.mapreduce.SSTableRecordReader.java

License:Apache License

/**
 * Get an instance of a partitioner.// w  w  w.  ja v a2s. c  o m
 *
 * @param conf The configuration object
 * @return Instantiated partitioner object.
 */
private <T> T getConfPartitioner(Configuration conf) {
    String partitionerStr = conf.get(PropertyConstants.PARTITIONER.txt);

    try {
        return FBUtilities.construct(partitionerStr, "partitioner");
    } catch (ConfigurationException ce) {
        String msg = String.format("Can't construct partitioner from %s", partitionerStr);
        throw new IllegalArgumentException(msg, ce);
    }
}

From source file:com.tuplejump.calliope.hadoop.ConfigHelper.java

License:Apache License

private static IPartitioner newPartitioner(String partitionerClassName) throws ConfigurationException {
    if (!partitionerClassName.contains("."))
        partitionerClassName = "org.apache.cassandra.dht." + partitionerClassName;

    IPartitioner partitioner = FBUtilities.construct(partitionerClassName, "partitioner");

    return partitioner;
}