Search in sources :

Example 6 with HColumn

use of me.prettyprint.hector.api.beans.HColumn in project sling by apache.

the class AccessControlUtil method getACL.

private String[] getACL(String path) throws Exception {
    if (getCassandraSystemNodeACL(path) != null) {
        return getCassandraSystemNodeACL(path);
    }
    String rid = getrowID(path);
    createColumnFamily(ACL_CF, provider.getKeyspace(), new StringSerializer());
    String getAllACEs = "select * from " + ACL_CF + " where KEY = '" + rid + "'";
    QueryResult<CqlRows<String, String, String>> results = CassandraResourceProviderUtil.executeQuery(getAllACEs, provider.getKeyspace(), new StringSerializer());
    String policy = null;
    for (Row<String, String, String> row : ((CqlRows<String, String, String>) results.get()).getList()) {
        for (HColumn column : row.getColumnSlice().getColumns()) {
            if ("policy".equalsIgnoreCase(column.getName().toString()) && column.getValue() != null) {
                policy = column.getValue().toString();
            }
        }
    }
    return policy != null ? policy.split(";") : null;
}
Also used : CqlRows(me.prettyprint.cassandra.model.CqlRows) HColumn(me.prettyprint.hector.api.beans.HColumn) StringSerializer(me.prettyprint.cassandra.serializers.StringSerializer)

Example 7 with HColumn

use of me.prettyprint.hector.api.beans.HColumn in project sling by apache.

the class CassandraResourceProviderUtil method logResults.

public static void logResults(QueryResult<CqlRows<String, String, String>> result) {
    LOGGER.info("############# RESULT ################");
    for (Row<String, String, String> row : ((CqlRows<String, String, String>) result.get()).getList()) {
        for (HColumn column : row.getColumnSlice().getColumns()) {
            LOGGER.info(column.getValue().toString());
        }
        LOGGER.info("------------------------------------------------------------------------------------");
    }
    LOGGER.info("############# RESULT ################");
}
Also used : CqlRows(me.prettyprint.cassandra.model.CqlRows) HColumn(me.prettyprint.hector.api.beans.HColumn)

Aggregations

HColumn (me.prettyprint.hector.api.beans.HColumn)7 Date (java.util.Date)3 CqlRows (me.prettyprint.cassandra.model.CqlRows)3 Row (me.prettyprint.hector.api.beans.Row)3 ChartSeries (com.geminimobile.chart.ChartSeries)2 ChartValueByTime (com.geminimobile.chart.ChartValueByTime)2 ArrayList (java.util.ArrayList)2 StringSerializer (me.prettyprint.cassandra.serializers.StringSerializer)2 Vector (java.util.Vector)1