コード例 #1
0
ファイル: CounterContext.java プロジェクト: daidong/GraphTrek
 /**
  * Returns the clock and the count associated with the local counter id, or (0, 0) if no such
  * shard is present.
  */
 public ClockAndCount getLocalClockAndCount(ByteBuffer context) {
   return getClockAndCountOf(context, CounterId.getLocalId());
 }
コード例 #2
0
ファイル: CounterContext.java プロジェクト: daidong/GraphTrek
 /**
  * Creates a counter context with a single local shard. For use by tests of compatibility with
  * pre-2.1 counters only.
  */
 public ByteBuffer createLocal(long count) {
   ContextState state = ContextState.allocate(0, 1, 0);
   state.writeLocal(CounterId.getLocalId(), 1L, count);
   return state.context;
 }