@Override public <SN, N> MutationResult insertCounter( final K key, final String cf, final HCounterSuperColumn<SN, N> superColumn ) { return target.insertCounter( key, cf, superColumn ); }
@Override public <N> MutationResult insertCounter( final K key, final String cf, final HCounterColumn<N> c ) { return target.insertCounter( key, cf, c ); }
@Test public void testInsertCounter() { Mutator<String> m = createMutator(keyspace, se); MutationResult mr = m.insertCounter("k", "Counter1", createCounterColumn("name", 5)); assertTrue("Execution time on single counter insert should be > 0", mr.getExecutionTimeMicro() > 0); assertTrue("Should have operated on a host", mr.getHostUsed() != null); CounterQuery<String, String> counter = new ThriftCounterColumnQuery<String,String>(keyspace, se, se); counter.setColumnFamily("Counter1").setKey("k").setName("name"); assertEquals(new Long(5), counter.execute().get().getValue()); }
@Override public void set(final K key, final Long value) { createMutator(_keyspace, _serializer_k).insertCounter(key, _cf_name, createCounterColumn(COLUMN_NAME_AS_STRING, value)); }
@Override public void set(final K key, final Long value) { createMutator(_keyspace, _serializer_k).insertCounter(key, _cf_name, createCounterColumn(COLUMN_NAME_AS_STRING, value)); }
@Test public void testInsertGetRemoveCounter() { Mutator<String> m = createMutator(ko, se); MutationResult mr = m.insertCounter("testInsertGetRemoveCounter", COUNTER_CF, createCounterColumn("testInsertGetRemoveCounter_name", 25));