Search in sources :

Example 16 with Mutation

use of org.apache.cassandra.thrift.Mutation in project brisk by riptano.

the class HistoricalPriceInserter method genDaysPrices.

private Map<String, List<Mutation>> genDaysPrices(ByteBuffer date) {
    Map<String, List<Mutation>> prices = new HashMap<String, List<Mutation>>();
    Mutation m = new Mutation();
    m.setColumn_or_supercolumn(new ColumnOrSuperColumn().setColumn(new Column().setName(date).setValue(ByteBufferUtil.bytes(String.valueOf((double) (Pricer.randomizer.nextDouble() * 1000)))).setTimestamp(System.currentTimeMillis())));
    prices.put("StockHist", Arrays.asList(m));
    return prices;
}
Also used : ColumnOrSuperColumn(org.apache.cassandra.thrift.ColumnOrSuperColumn) ColumnOrSuperColumn(org.apache.cassandra.thrift.ColumnOrSuperColumn) Column(org.apache.cassandra.thrift.Column) Mutation(org.apache.cassandra.thrift.Mutation)

Aggregations

Mutation (org.apache.cassandra.thrift.Mutation)16 ColumnOrSuperColumn (org.apache.cassandra.thrift.ColumnOrSuperColumn)10 ByteBuffer (java.nio.ByteBuffer)6 IOException (java.io.IOException)4 Column (org.apache.cassandra.thrift.Column)4 Deletion (org.apache.cassandra.thrift.Deletion)4 Column (org.apache.cassandra.db.Column)2 IColumn (org.apache.cassandra.db.IColumn)2 org.apache.cassandra.thrift (org.apache.cassandra.thrift)2 CounterSuperColumn (org.apache.cassandra.thrift.CounterSuperColumn)2 SlicePredicate (org.apache.cassandra.thrift.SlicePredicate)2 ArrayList (java.util.ArrayList)1 HashMap (java.util.HashMap)1 LinkedList (java.util.LinkedList)1 List (java.util.List)1 Map (java.util.Map)1 ConcurrentHashMap (java.util.concurrent.ConcurrentHashMap)1 CFMetaData (org.apache.cassandra.config.CFMetaData)1 CounterMutation (org.apache.cassandra.db.CounterMutation)1 IMutation (org.apache.cassandra.db.IMutation)1