/** * Decompose. * * @param value * the value * @param clazz * the clazz * @return the object */ private static Object decompose(Object value, Class clazz) { ByteBuffer buf = ByteBuffer.wrap((byte[]) value, 0, ((byte[]) value).length); return ByteBufferUtil.toLong(buf); } }
latestCount = ByteBufferUtil.toLong(ByteBuffer.wrap(row.getColumns().get(0).getValue()));
public Long deserialize(ByteBuffer bytes) { return bytes.remaining() == 0 ? null : ByteBufferUtil.toLong(bytes); }
private static Object decompose(Object value, Class clazz) { ByteBuffer buf = ByteBuffer.wrap((byte[]) value, 0, ((byte[]) value).length); return ByteBufferUtil.toLong(buf); } }
public Long deserialize(ByteBuffer bytes) { return bytes.remaining() == 0 ? null : ByteBufferUtil.toLong(bytes); }
public Long deserialize(ByteBuffer bytes) { return bytes.remaining() == 0 ? null : ByteBufferUtil.toLong(bytes); }
@Override public Long deserialize(ByteBuffer paramByteBuffer, ProtocolVersion paramProtocolVersion) throws InvalidTypeException { if (paramByteBuffer == null) { return null; } // always duplicate the ByteBuffer instance before consuming it! return ByteBufferUtil.toLong(paramByteBuffer.duplicate()); }
public Date deserialize(ByteBuffer bytes) { return bytes.remaining() == 0 ? null : new Date(ByteBufferUtil.toLong(bytes)); }
public Date deserialize(ByteBuffer bytes) { return bytes.remaining() == 0 ? null : new Date(ByteBufferUtil.toLong(bytes)); }
public Date deserialize(ByteBuffer bytes) { return bytes.remaining() == 0 ? null : new Date(ByteBufferUtil.toLong(bytes)); }
public Token fromByteArray(ByteBuffer bytes) { return new LongToken(ByteBufferUtil.toLong(bytes)); }
public Token fromByteArray(ByteBuffer bytes) { return new LongToken(ByteBufferUtil.toLong(bytes)); }
@Override public String getString(CellNameType comparator) { return String.format("%s:%s@%d", comparator.getString(name()), ByteBufferUtil.toLong(value), timestamp()); } }
public void execute(DecoratedKey partitionKey, UpdateParameters params) throws InvalidRequestException { ByteBuffer bytes = t.bindAndGet(params.options); if (bytes == null) throw new InvalidRequestException("Invalid null value for counter increment"); if (bytes == ByteBufferUtil.UNSET_BYTE_BUFFER) return; long increment = ByteBufferUtil.toLong(bytes); params.addCounter(column, increment); } }
public void execute(DecoratedKey partitionKey, UpdateParameters params) throws InvalidRequestException { ByteBuffer bytes = t.bindAndGet(params.options); if (bytes == null) throw new InvalidRequestException("Invalid null value for counter increment"); if (bytes == ByteBufferUtil.UNSET_BYTE_BUFFER) return; long increment = ByteBufferUtil.toLong(bytes); params.addCounter(column, increment); } }
public void execute(DecoratedKey partitionKey, UpdateParameters params) throws InvalidRequestException { ByteBuffer bytes = t.bindAndGet(params.options); if (bytes == null) throw new InvalidRequestException("Invalid null value for counter increment"); if (bytes == ByteBufferUtil.UNSET_BYTE_BUFFER) return; long increment = ByteBufferUtil.toLong(bytes); params.addCounter(column, increment); } }
public void execute(DecoratedKey partitionKey, UpdateParameters params) throws InvalidRequestException { ByteBuffer bytes = t.bindAndGet(params.options); if (bytes == null) throw new InvalidRequestException("Invalid null value for counter increment"); if (bytes == ByteBufferUtil.UNSET_BYTE_BUFFER) return; long increment = ByteBufferUtil.toLong(bytes); params.addCounter(column, increment); } }
public void execute(DecoratedKey partitionKey, UpdateParameters params) throws InvalidRequestException { ByteBuffer bytes = t.bindAndGet(params.options); if (bytes == null) throw new InvalidRequestException("Invalid null value for counter increment"); if (bytes == ByteBufferUtil.UNSET_BYTE_BUFFER) return; long increment = ByteBufferUtil.toLong(bytes); if (increment == Long.MIN_VALUE) throw new InvalidRequestException("The negation of " + increment + " overflows supported counter precision (signed 8 bytes integer)"); params.addCounter(column, -increment); } }
public void execute(ByteBuffer rowKey, ColumnFamily cf, Composite prefix, UpdateParameters params) throws InvalidRequestException { ByteBuffer bytes = t.bindAndGet(params.options); if (bytes == null) throw new InvalidRequestException("Invalid null value for counter increment"); long increment = ByteBufferUtil.toLong(bytes); CellName cname = cf.getComparator().create(prefix, column); cf.addColumn(params.makeCounter(cname, increment)); } }
public void execute(ByteBuffer rowKey, ColumnFamily cf, Composite prefix, UpdateParameters params) throws InvalidRequestException { ByteBuffer bytes = t.bindAndGet(params.options); if (bytes == null) throw new InvalidRequestException("Invalid null value for counter increment"); long increment = ByteBufferUtil.toLong(bytes); if (increment == Long.MIN_VALUE) throw new InvalidRequestException("The negation of " + increment + " overflows supported counter precision (signed 8 bytes integer)"); CellName cname = cf.getComparator().create(prefix, column); cf.addColumn(params.makeCounter(cname, -increment)); } }