Search in sources :

Example 1 with CassandraMapperException

use of org.apache.sling.cassandra.resource.provider.mapper.CassandraMapperException in project sling by apache.

the class CassandraResource method loadResourceData.

private void loadResourceData(ResourceProvider resourceProvider) {
    CassandraResourceProvider cassandraResourceProvider = (CassandraResourceProvider) resourceProvider;
    try {
        //          TODO ColumnFamilySector is NULL and hence this..
        String cql = cassandraResourceProvider.getCassandraMapperMap().get(columnFamilySector).getCQL(columnFamilySector, remainingPath);
        QueryResult<CqlRows<String, String, String>> results = CassandraResourceProviderUtil.executeQuery(cql, ((CassandraResourceProvider) resourceProvider).getKeyspace(), new StringSerializer());
        populateDataFromResult(results);
        dataLoaded = true;
    } catch (CassandraMapperException e) {
        System.out.println("Error occurred from resource at " + resourcePath + " : " + e.getMessage());
        LOGGER.error("Error occurred from resource at " + resourcePath + " : " + e.getMessage());
    }
}
Also used : CqlRows(me.prettyprint.cassandra.model.CqlRows) CassandraMapperException(org.apache.sling.cassandra.resource.provider.mapper.CassandraMapperException) StringSerializer(me.prettyprint.cassandra.serializers.StringSerializer)

Aggregations

CqlRows (me.prettyprint.cassandra.model.CqlRows)1 StringSerializer (me.prettyprint.cassandra.serializers.StringSerializer)1 CassandraMapperException (org.apache.sling.cassandra.resource.provider.mapper.CassandraMapperException)1