Skip to content

Instantly share code, notes, and snippets.

@jsanda
Created May 25, 2012 20:34
Show Gist options
  • Save jsanda/2790424 to your computer and use it in GitHub Desktop.
Save jsanda/2790424 to your computer and use it in GitHub Desktop.
SliceQuery<String,Composite, Integer> sliceQuery = HFactory.createSliceQuery(keyspace, StringSerializer.get(),
new CompositeSerializer().get(), IntegerSerializer.get());
sliceQuery.setColumnFamily("metrics_work_queue");
sliceQuery.setKey("raw_metrics");
ColumnSliceIterator<String, Composite, Integer> iterator = new ColumnSliceIterator<String, Composite, Integer>(
sliceQuery, (Composite) null, (Composite) null, false);
assertTrue(iterator.hasNext());
HColumn<Composite, Integer> actualQueueValue = iterator.next();
HColumn<Composite, Integer> expectedQueueValue = HFactory.createColumn(new Composite(theHour.getMillis(),
scheduleId), 0, CompositeSerializer.get(), IntegerSerializer.get());
assertPropertiesMatch("The column in the queue does not match the expected value", expectedQueueValue,
actualQueueValue, "clock");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment