public Token deserialize(DataInput in, IPartitioner p, int version) throws IOException { int size = in.readInt(); byte[] bytes = new byte[size]; in.readFully(bytes); return p.getTokenFactory().fromByteArray(ByteBuffer.wrap(bytes)); }
public Token deserialize(DataInput in, IPartitioner p, int version) throws IOException { int size = in.readInt(); byte[] bytes = new byte[size]; in.readFully(bytes); return p.getTokenFactory().fromByteArray(ByteBuffer.wrap(bytes)); }
public Token deserialize(DataInput in, IPartitioner p, int version) throws IOException { int size = in.readInt(); byte[] bytes = new byte[size]; in.readFully(bytes); return p.getTokenFactory().fromByteArray(ByteBuffer.wrap(bytes)); }
public static Collection<Token> deserialize(IPartitioner partitioner, DataInput in) throws IOException { Collection<Token> tokens = new ArrayList<Token>(); while (true) { int size = in.readInt(); if (size < 1) break; logger.trace("Reading token of {}", FBUtilities.prettyPrintMemory(size)); byte[] bintoken = new byte[size]; in.readFully(bintoken); tokens.add(partitioner.getTokenFactory().fromByteArray(ByteBuffer.wrap(bintoken))); } return tokens; } }
public static Collection<Token> deserialize(IPartitioner partitioner, DataInput in) throws IOException { Collection<Token> tokens = new ArrayList<Token>(); while (true) { int size = in.readInt(); if (size < 1) break; logger.trace("Reading token of {}", FBUtilities.prettyPrintMemory(size)); byte[] bintoken = new byte[size]; in.readFully(bintoken); tokens.add(partitioner.getTokenFactory().fromByteArray(ByteBuffer.wrap(bintoken))); } return tokens; } }
public static Collection<Token> deserialize(IPartitioner partitioner, DataInput in) throws IOException { Collection<Token> tokens = new ArrayList<Token>(); while (true) { int size = in.readInt(); if (size < 1) break; logger.trace("Reading token of {}", FBUtilities.prettyPrintMemory(size)); byte[] bintoken = new byte[size]; in.readFully(bintoken); tokens.add(partitioner.getTokenFactory().fromByteArray(ByteBuffer.wrap(bintoken))); } return tokens; } }
private String toTokenString(ByteBuffer bytes) { return _tokenFactory.toString(_tokenFactory.fromByteArray(bytes)); }
private String toTokenString(ByteBuffer bytes) { return _tokenFactory.toString(_tokenFactory.fromByteArray(bytes)); }
private String toTokenString(ByteBuffer bytes) { return _tokenFactory.toString(_tokenFactory.fromByteArray(bytes)); }
private String toTokenString(ByteBuffer bytes) { return _tokenFactory.toString(_tokenFactory.fromByteArray(bytes)); }
private String toTokenString(ByteBuffer bytes) { return _tokenFactory.toString(_tokenFactory.fromByteArray(bytes)); }
private Token getTokenBound(Bound b, QueryOptions options, IPartitioner p) { if (!partitionKeyRestrictions.hasBound(b)) return p.getMinimumToken(); ByteBuffer value = partitionKeyRestrictions.bounds(b, options).get(0); checkNotNull(value, "Invalid null token value"); return p.getTokenFactory().fromByteArray(value); }
/** * Deserializes the token corresponding to the specified buffer. * * @param buffer the buffer * @return the token corresponding to the specified buffer */ private Token deserializeToken(ByteBuffer buffer) { return partitioner.getTokenFactory().fromByteArray(buffer); }
public Token deserialize(DataInput in, IPartitioner p, int version) throws IOException { int size = in.readInt(); byte[] bytes = new byte[size]; in.readFully(bytes); return p.getTokenFactory().fromByteArray(ByteBuffer.wrap(bytes)); }
/** * Returns the specified token as a {@link java.lang.String}. * * @param tokenAsComparable a token represented as a {@link java.lang.Comparable}. * @return the specified token as a {@link java.lang.String}. */ @SuppressWarnings("unchecked") public String tokenAsString(Comparable tokenAsComparable) { ByteBuffer bb = tokenType.decompose(tokenAsComparable); Token token = tokenFactory.fromByteArray(bb); return tokenFactory.toString(token); }
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)); }
private Token getTokenBound(Bound b, QueryOptions options, IPartitioner p) { if (!partitionKeyRestrictions.hasBound(b)) return p.getMinimumToken(); ByteBuffer value = partitionKeyRestrictions.bounds(b, options).get(0); checkNotNull(value, "Invalid null token value"); return p.getTokenFactory().fromByteArray(value); }
/** * Deserializes the token corresponding to the specified buffer. * * @param buffer the buffer * @return the token corresponding to the specified buffer */ private Token deserializeToken(ByteBuffer buffer) { return partitioner.getTokenFactory().fromByteArray(buffer); }
/** * Deserializes the token corresponding to the specified buffer. * * @param buffer the buffer * @return the token corresponding to the specified buffer */ private Token deserializeToken(ByteBuffer buffer) { return partitioner.getTokenFactory().fromByteArray(buffer); }
private Token getTokenBound(Bound b, QueryOptions options, IPartitioner p) { if (!partitionKeyRestrictions.hasBound(b)) return p.getMinimumToken(); ByteBuffer value = partitionKeyRestrictions.bounds(b, options).get(0); checkNotNull(value, "Invalid null token value"); return p.getTokenFactory().fromByteArray(value); }