public static class TokenSerializer implements ISerializer<Token> { public void serialize(Token token, DataOutputPlus out) throws IOException { IPartitioner p = StorageService.getPartitioner(); ByteBuffer b = p.getTokenFactory().toByteArray(token); ByteBufferUtil.writeWithLength(b, out); } public Token deserialize(DataInput in) throws IOException { IPartitioner p = StorageService.getPartitioner(); int size = in.readInt(); byte[] bytes = new byte[size]; in.readFully(bytes); return p.getTokenFactory().fromByteArray(ByteBuffer.wrap(bytes)); } public long serializedSize(Token object, TypeSizes typeSizes) { IPartitioner p = StorageService.getPartitioner(); ByteBuffer b = p.getTokenFactory().toByteArray(object); return TypeSizes.NATIVE.sizeof(b.remaining()) + b.remaining(); } }
public KeyBound maxKeyBound() { /* * For each token, we needs both minKeyBound and maxKeyBound * because a token corresponds to a range of keys. But the minimun * token corresponds to no key, so it is valid and actually much * simpler to associate the same value for minKeyBound and * maxKeyBound for the minimun token. */ if (isMinimum()) return minKeyBound(); return new KeyBound(this, false); }
public KeyBound minKeyBound() { return new KeyBound(this, true); }
public KeyBound maxKeyBound() { /* * For each token, we needs both minKeyBound and maxKeyBound * because a token corresponds to a range of keys. But the minimun * token corresponds to no key, so it is valid and actually much * simpler to associate the same value for minKeyBound and * maxKeyBound for the minimun token. */ if (isMinimum()) return minKeyBound(); return new KeyBound(this, false); }
public KeyBound maxKeyBound() { /* * For each token, we needs both minKeyBound and maxKeyBound * because a token corresponds to a range of keys. But the minimun * token corresponds to no key, so it is valid and actually much * simpler to associate the same value for minKeyBound and * maxKeyBound for the minimun token. */ if (isMinimum()) return minKeyBound(); return new KeyBound(this, false); }
public KeyBound maxKeyBound() { /* * For each token, we needs both minKeyBound and maxKeyBound * because a token corresponds to a range of keys. But the minimun * token corresponds to no key, so it is valid and actually much * simpler to associate the same value for minKeyBound and * maxKeyBound for the minimun token. */ if (isMinimum()) return minKeyBound(); return new KeyBound(this, false); }
public KeyBound minKeyBound(IPartitioner partitioner) { return new KeyBound(this, true); }
public KeyBound minKeyBound() { return new KeyBound(this, true); }
public KeyBound minKeyBound() { return new KeyBound(this, true); }
public KeyBound minKeyBound() { return new KeyBound(this, true); }