/** * Gets the range end of the given prefix. * * <p>The range end is the key plus one (e.g., "aa"+1 == "ab", "a\xff"+1 == "b"). * * @param prefix the given prefix * @return the range end of the given prefix */ public static ByteSequence PrefixEndOf(ByteSequence prefix) { byte[] endKey = (byte[])prefix.GetBytes().Clone(); for (int i = endKey.Length - 1; i >= 0; i--) { if (endKey[i] < 0xff) { endKey[i] = (byte)(endKey[i] + 1); byte[] dest = new byte[endKey.Length - i - 1]; Array.Copy(endKey, i + 1, dest, 0, dest.Length); return(ByteSequence.From(dest)); } } return(ByteSequence.From(NO_PREFIX_END)); }
public static DeleteOp delete(ByteSequence key, DeleteOption option) { return(new DeleteOp(ByteString.CopyFrom(key.GetBytes()), option)); }
public static GetOp get(ByteSequence key, GetOption option) { return(new GetOp(ByteString.CopyFrom(key.GetBytes()), option)); }
public static PutOp Put(ByteSequence key, ByteSequence value, PutOption option) { return(new PutOp(ByteString.CopyFrom(key.GetBytes()), ByteString.CopyFrom(value.GetBytes()), option)); }
public Cmp(ByteSequence key, Op compareOp, CmpTarget <T> target) { this.key = ByteString.CopyFrom(key.GetBytes()); this.op = compareOp; this.target = target; }
/** * Cmp on the <i>value</i>. * * @param value the value to compare * @return the value compare target */ public static ValueCmpTarget Value(ByteSequence value) { return(new ValueCmpTarget(ByteString.CopyFrom(value.GetBytes()))); }