Exemplo n.º 1
0
 public static IncrementOperation build(
     long storeId, Keyspace keyspace, ByteString key, long delta) {
   KeyValueAction.Builder b = KeyValueAction.newBuilder();
   b.setAction(ActionType.INCREMENT);
   b.setStoreId(storeId);
   b.setKeyspaceId(keyspace.getKeyspaceId());
   b.setKey(key);
   b.setValue(ByteString.copyFrom(Value.fromLong(delta).asBytes()));
   return new IncrementOperation(b.build());
 }
Exemplo n.º 2
0
  public IncrementOperation(KeyValueAction entry) {
    super(entry);

    Preconditions.checkArgument(entry.getAction() == ActionType.INCREMENT);
    Preconditions.checkArgument(entry.hasValue());
  }