/** * 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.bytesToHex(buf); } }
@Test public void testInsertSyntaxHex() { CqlQuery<String,String,Long> cqlQuery = new CqlQuery<String,String,Long>(keyspace, se, se, le); String query = String.format("update Standard1 set '%s' = '%s' WHERE KEY = '%s'", ByteBufferUtil.bytesToHex(se.toByteBuffer("birthyear")), ByteBufferUtil.bytesToHex(se.toByteBuffer("1976")), ByteBufferUtil.bytesToHex(se.toByteBuffer("mykey1"))); cqlQuery.setQuery(query); cqlQuery.execute(); } }
@Override public String toString() { return mark == null ? "null" : ByteBufferUtil.bytesToHex(mark); } }
@Override public String toString() { return mark == null ? "null" : ByteBufferUtil.bytesToHex(mark); } }
@Override public String toJSONString(ByteBuffer buffer, ProtocolVersion protocolVersion) { return "\"0x" + ByteBufferUtil.bytesToHex(buffer) + '"'; }
@Override public String toString() { return String.format("LegacyCell(%s, name=%s, v=%s, ts=%s, ldt=%s, ttl=%s)", kind, name, ByteBufferUtil.bytesToHex(value), timestamp, localDeletionTime, ttl); } }
@Override public String toString() { return String.format("LegacyCell(%s, name=%s, v=%s, ts=%s, ldt=%s, ttl=%s)", kind, name, ByteBufferUtil.bytesToHex(value), timestamp, localDeletionTime, ttl); } }
@Override public String toString() { return String.format("CounterCacheKey(%s, %s, %s)", ksAndCFName, ByteBufferUtil.bytesToHex(ByteBuffer.wrap(partitionKey)), ByteBufferUtil.bytesToHex(ByteBuffer.wrap(cellName))); }
public DigestMismatchException(DecoratedKey key, ByteBuffer digest1, ByteBuffer digest2) { super(String.format("Mismatch for key %s (%s vs %s)", key.toString(), ByteBufferUtil.bytesToHex(digest1), ByteBufferUtil.bytesToHex(digest2))); } }
public DigestMismatchException(DecoratedKey key, ByteBuffer digest1, ByteBuffer digest2) { super(String.format("Mismatch for key %s (%s vs %s)", key.toString(), ByteBufferUtil.bytesToHex(digest1), ByteBufferUtil.bytesToHex(digest2))); } }
private static String stringify(ByteBuffer name) { try { return UTF8Type.instance.getString(name); } catch (Exception e) { return ByteBufferUtil.bytesToHex(name); } } }
@Override public String toString() { StringBuilder sb = new StringBuilder(); for (int i = 0; i < clustering.size(); i++) sb.append(i > 0 ? ":" : "").append(clustering.get(i) == null ? "null" : ByteBufferUtil.bytesToHex(clustering.get(i))); return String.format("Cellname(clustering=%s, column=%s, collElt=%s)", sb.toString(), column == null ? "null" : column.name, collectionElement == null ? "null" : ByteBufferUtil.bytesToHex(collectionElement)); } }
@Override public String toString() { StringBuilder sb = new StringBuilder(); for (int i = 0; i < clustering.size(); i++) sb.append(i > 0 ? ":" : "").append(clustering.get(i) == null ? "null" : ByteBufferUtil.bytesToHex(clustering.get(i))); return String.format("Cellname(clustering=%s, column=%s, collElt=%s)", sb.toString(), column == null ? "null" : column.name, collectionElement == null ? "null" : ByteBufferUtil.bytesToHex(collectionElement)); } }
@Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append(bound.kind()).append('('); for (int i = 0; i < bound.size(); i++) sb.append(i > 0 ? ":" : "").append(bound.get(i) == null ? "null" : ByteBufferUtil.bytesToHex(bound.get(i))); sb.append(')'); return String.format("Bound(%s, collection=%s)", sb.toString(), collectionName == null ? "null" : collectionName.name); } }
public String deserialize(ByteBuffer bytes) { try { return ByteBufferUtil.string(bytes, charset); } catch (CharacterCodingException e) { throw new MarshalException("Invalid " + charset + " bytes " + ByteBufferUtil.bytesToHex(bytes)); } }
public String deserialize(ByteBuffer bytes) { try { return ByteBufferUtil.string(bytes, charset); } catch (CharacterCodingException e) { throw new MarshalException("Invalid " + charset + " bytes " + ByteBufferUtil.bytesToHex(bytes)); } }
public void validateCollectionMember(ByteBuffer bytes, ByteBuffer collectionName) throws MarshalException { CollectionType t = defined.get(collectionName); if (t == null) throw new MarshalException(ByteBufferUtil.bytesToHex(collectionName) + " is not defined as a collection"); t.nameComparator().validate(bytes); }
public void validateCollectionMember(ByteBuffer bytes, ByteBuffer collectionName) throws MarshalException { CollectionType t = defined.get(collectionName); if (t == null) throw new MarshalException(ByteBufferUtil.bytesToHex(collectionName) + " is not defined as a collection"); t.nameComparator().validate(bytes); }
@Override public String toString() { String keystring = getKey() == null ? "null" : ByteBufferUtil.bytesToHex(getKey()); return "DecoratedKey(" + getToken() + ", " + keystring + ")"; }
@Override public String toString() { String keystring = getKey() == null ? "null" : ByteBufferUtil.bytesToHex(getKey()); return "DecoratedKey(" + getToken() + ", " + keystring + ")"; }