Search in sources :

Example 26 with ConfigurationException

use of org.apache.cassandra.config.ConfigurationException in project eiger by wlloyd.

the class CassandraStorage method getValidatorMap.

private Map<ByteBuffer, AbstractType> getValidatorMap(CfDef cfDef) throws IOException {
    Map<ByteBuffer, AbstractType> validators = new HashMap<ByteBuffer, AbstractType>();
    for (ColumnDef cd : cfDef.getColumn_metadata()) {
        if (cd.getValidation_class() != null && !cd.getValidation_class().isEmpty()) {
            AbstractType validator = null;
            try {
                validator = TypeParser.parse(cd.getValidation_class());
                validators.put(cd.name, validator);
            } catch (ConfigurationException e) {
                throw new IOException(e);
            }
        }
    }
    return validators;
}
Also used : ConfigurationException(org.apache.cassandra.config.ConfigurationException) IOException(java.io.IOException) ByteBuffer(java.nio.ByteBuffer)

Aggregations

ConfigurationException (org.apache.cassandra.config.ConfigurationException)26 IOException (java.io.IOException)10 ByteBuffer (java.nio.ByteBuffer)6 HashMap (java.util.HashMap)4 InvalidRequestException (org.apache.cassandra.thrift.InvalidRequestException)4 Map (java.util.Map)3 CFMetaData (org.apache.cassandra.config.CFMetaData)3 AbstractType (org.apache.cassandra.db.marshal.AbstractType)3 File (java.io.File)2 URL (java.net.URL)2 ArrayList (java.util.ArrayList)2 UUID (java.util.UUID)2 ExecutionException (java.util.concurrent.ExecutionException)2 Future (java.util.concurrent.Future)2 QueryPath (org.apache.cassandra.db.filter.QueryPath)2 Migration (org.apache.cassandra.db.migration.Migration)2 ByteArrayOutputStream (java.io.ByteArrayOutputStream)1 DataInputStream (java.io.DataInputStream)1 IOError (java.io.IOError)1 InputStream (java.io.InputStream)1