public String getString(ByteBuffer bytes) { return BytesType.instance.getString(bytes); }
return BytesType.instance.decompose(ByteBuffer.wrap(PropertyAccessorFactory.getPropertyAccessor(clazz) .toBytes(value)));
@Override public Term fromJSONObject(Object parsed) throws MarshalException { try { String parsedString = (String) parsed; if (!parsedString.startsWith("0x")) throw new MarshalException(String.format("String representation of blob is missing 0x prefix: %s", parsedString)); return new Constants.Value(BytesType.instance.fromString(parsedString.substring(2))); } catch (ClassCastException | MarshalException exc) { throw new MarshalException(String.format("Value '%s' is not a valid blob representation: %s", parsed, exc.getMessage())); } }
protected Pair<Long, Row> computeNext() { if (rows == null || !rows.hasNext()) return endOfData(); Row row = rows.next(); Map<String, ByteBuffer> keyColumns = new HashMap<String, ByteBuffer>(); for (String column : partitionBoundColumns.keySet()) keyColumns.put(column, row.getBytesUnsafe(column)); // increase total CF row read if (previousRowKey.isEmpty() && !keyColumns.isEmpty()) { previousRowKey = keyColumns; totalRead++; } else { for (String column : partitionBoundColumns.keySet()) { if (BytesType.bytesCompare(keyColumns.get(column), previousRowKey.get(column)) != 0) { previousRowKey = keyColumns; totalRead++; break; } } } keyId++; return Pair.create(keyId, row); } }
@Override public Term fromJSONObject(Object parsed) throws MarshalException { try { String parsedString = (String) parsed; if (!parsedString.startsWith("0x")) throw new MarshalException(String.format("String representation of blob is missing 0x prefix: %s", parsedString)); return new Constants.Value(BytesType.instance.fromString(parsedString.substring(2))); } catch (ClassCastException | MarshalException exc) { throw new MarshalException(String.format("Value '%s' is not a valid blob representation: %s", parsed, exc.getMessage())); } }
} else { for (String column : partitionBoundColumns.keySet()) { if (BytesType.bytesCompare(keyColumns.get(column), previousRowKey.get(column)) != 0) { previousRowKey = keyColumns; totalRead++;
public String getString(ByteBuffer bytes) { return BytesType.instance.getString(bytes); }
@Override public Term fromJSONObject(Object parsed) throws MarshalException { try { String parsedString = (String) parsed; if (!parsedString.startsWith("0x")) throw new MarshalException(String.format("String representation of blob is missing 0x prefix: %s", parsedString)); return new Constants.Value(BytesType.instance.fromString(parsedString.substring(2))); } catch (ClassCastException | MarshalException exc) { throw new MarshalException(String.format("Value '%s' is not a valid blob representation: %s", parsed, exc.getMessage())); } }
public String getString(ByteBuffer bytes) { return BytesType.instance.getString(bytes); }
@Override public Term fromJSONObject(Object parsed) throws MarshalException { try { String parsedString = (String) parsed; if (!parsedString.startsWith("0x")) throw new MarshalException(String.format("String representation of blob is missing 0x prefix: %s", parsedString)); return new Constants.Value(BytesType.instance.fromString(parsedString.substring(2))); } catch (ClassCastException | MarshalException exc) { throw new MarshalException(String.format("Value '%s' is not a valid blob representation: %s", parsed, exc.getMessage())); } }
public String getString(ByteBuffer bytes) { return BytesType.instance.getString(bytes); }
private ByteBuffer parsedValue(AbstractType<?> validator) throws InvalidRequestException { if (validator instanceof ReversedType<?>) validator = ((ReversedType<?>) validator).baseType; try { if (type == Type.HEX) // Note that validator could be BytesType, but it could also be a custom type, so // we hardcode BytesType (rather than using 'validator') in the call below. // Further note that BytesType doesn't want it's input prefixed by '0x', hence the substring. return BytesType.instance.fromString(text.substring(2)); if (validator instanceof CounterColumnType) return LongType.instance.fromString(text); return validator.fromString(text); } catch (MarshalException e) { throw new InvalidRequestException(e.getMessage()); } }
public String getString(ByteBuffer bytes) { return BytesType.instance.getString(bytes); }
private ByteBuffer parsedValue(AbstractType<?> validator) throws InvalidRequestException { if (validator instanceof ReversedType<?>) validator = ((ReversedType<?>) validator).baseType; try { if (type == Type.HEX) // Note that validator could be BytesType, but it could also be a custom type, so // we hardcode BytesType (rather than using 'validator') in the call below. // Further note that BytesType doesn't want it's input prefixed by '0x', hence the substring. return BytesType.instance.fromString(text.substring(2)); if (validator instanceof CounterColumnType) return LongType.instance.fromString(text); return validator.fromString(text); } catch (MarshalException e) { throw new InvalidRequestException(e.getMessage()); } }
public String getString(ByteBuffer bytes) { return BytesType.instance.getString(bytes); }
private ByteBuffer parsedValue(AbstractType<?> validator) throws InvalidRequestException { if (validator instanceof ReversedType<?>) validator = ((ReversedType<?>) validator).baseType; try { if (type == Type.HEX) // Note that validator could be BytesType, but it could also be a custom type, so // we hardcode BytesType (rather than using 'validator') in the call below. // Further note that BytesType doesn't want it's input prefixed by '0x', hence the substring. return BytesType.instance.fromString(text.substring(2)); if (validator instanceof CounterColumnType) return LongType.instance.fromString(text); return validator.fromString(text); } catch (MarshalException e) { throw new InvalidRequestException(e.getMessage()); } }
public String getString(ByteBuffer bytes) { return BytesType.instance.getString(bytes); }
private ByteBuffer parsedValue(AbstractType<?> validator) throws InvalidRequestException { if (validator instanceof ReversedType<?>) validator = ((ReversedType<?>) validator).baseType; try { if (type == Type.HEX) // Note that validator could be BytesType, but it could also be a custom type, so // we hardcode BytesType (rather than using 'validator') in the call below. // Further note that BytesType doesn't want it's input prefixed by '0x', hence the substring. return BytesType.instance.fromString(text.substring(2)); if (validator instanceof CounterColumnType) return LongType.instance.fromString(text); return validator.fromString(text); } catch (MarshalException e) { throw new InvalidRequestException(e.getMessage()); } }
public String getString(ByteBuffer bytes) { return BytesType.instance.getString(bytes); }
public String getString(ByteBuffer bytes) { return BytesType.instance.getString(bytes); }