public static PartialRow decodePrimaryKey(Schema schema, byte[] key) { return KeyEncoder.decodePrimaryKey(schema, key); }
public static PartialRow decodeRangePartitionKey(Schema schema, PartitionSchema partitionSchema, byte[] key) { return KeyEncoder.decodeRangePartitionKey(schema, partitionSchema, key); } }
public static byte[] encodePrimaryKey(PartialRow row) { return KeyEncoder.encodePrimaryKey(row); }
public static byte[] encodeRangePartitionKey(PartialRow row, PartitionSchema.RangeSchema rangeSchema) { return KeyEncoder.encodeRangePartitionKey(row, rangeSchema); }
KeyEncoder.decodePrimaryKey(table.getSchema(), token.getLowerBoundPrimaryKey().toByteArray()) .stringifyRowKey()); KeyEncoder.decodePrimaryKey(table.getSchema(), token.getUpperBoundPrimaryKey().toByteArray()) .stringifyRowKey()); helper.addValue(KeyEncoder.formatPartitionKeyRange(table.getSchema(), table.getPartitionSchema(), token.getLowerBoundPartitionKey()
/** * Returns the encoded partition key of the row. * @return a byte array containing the encoded partition key of the row */ public byte[] encodePartitionKey(PartialRow row) { return KeyEncoder.encodePartitionKey(row, this); }
break; case BINARY: { byte[] binary = decodeBinaryColumn(buf, isLast); row.addBinary(idx, binary); break; byte[] binary = decodeBinaryColumn(buf, isLast); row.addStringUtf8(idx, binary); break;
public static byte[] encodeRangePartitionKey(PartialRow row, PartitionSchema.RangeSchema rangeSchema) { return KeyEncoder.encodeRangePartitionKey(row, rangeSchema); }
rowA.addString("b", ""); rowA.addString("c", ""); assertBytesEquals(KeyEncoder.encodePartitionKey(rowA, partitionSchema), new byte[]{ 0, 0, 0, 0, // hash(0, "") rowB.addString("b", ""); rowB.addString("c", ""); assertBytesEquals(KeyEncoder.encodePartitionKey(rowB, partitionSchema), new byte[]{ 0, 0, 0, 0x5, // hash(1, "") rowC.addString("b", "b"); rowC.addString("c", "c"); assertBytesEquals(KeyEncoder.encodePartitionKey(rowC, partitionSchema), new byte[]{ 0, 0, 0, 0x1A, // hash(0, "b") rowD.addString("b", "b"); rowD.addString("c", "c"); assertBytesEquals(KeyEncoder.encodePartitionKey(rowD, partitionSchema), new byte[]{ 0, 0, 0, 0, // hash(1, "b")
public static PartialRow decodeRangePartitionKey(Schema schema, PartitionSchema partitionSchema, byte[] key) { return KeyEncoder.decodeRangePartitionKey(schema, partitionSchema, key); } }
public static PartialRow decodePrimaryKey(Schema schema, byte[] key) { return KeyEncoder.decodePrimaryKey(schema, key); }
public static byte[] encodeRangePartitionKey(PartialRow row, PartitionSchema.RangeSchema rangeSchema) { return KeyEncoder.encodeRangePartitionKey(row, rangeSchema); }
/** * Returns the encoded primary key of the row. * @return a byte array containing an encoded primary key */ public byte[] encodePrimaryKey() { return KeyEncoder.encodePrimaryKey(this); }
public static PartialRow decodeRangePartitionKey(Schema schema, PartitionSchema partitionSchema, byte[] key) { return KeyEncoder.decodeRangePartitionKey(schema, partitionSchema, key); } }
public static PartialRow decodePrimaryKey(Schema schema, byte[] key) { return KeyEncoder.decodePrimaryKey(schema, key); }
return KeyEncoder.encodeRangePartitionKey(row, rangeSchema);
public static byte[] encodePrimaryKey(PartialRow row) { return KeyEncoder.encodePrimaryKey(row); }
/** * Decodes a range partition key into a partial row. * * @param schema the schema of the table * @param partitionSchema the partition schema of the table * @param key the encoded range partition key * @return the decoded range key */ public static PartialRow decodeRangePartitionKey(Schema schema, PartitionSchema partitionSchema, byte[] key) { ByteBuffer buf = ByteBuffer.wrap(key); buf.order(ByteOrder.BIG_ENDIAN); return decodeRangePartitionKey(schema, partitionSchema, buf); }
}); assertEquals(rowA.stringifyRowKey(), KeyEncoder.decodePrimaryKey(schema, rowAEncoded).stringifyRowKey()); }); assertEquals(rowB.stringifyRowKey(), KeyEncoder.decodePrimaryKey(schema, rowBEncoded).stringifyRowKey()); }); assertEquals(rowC.stringifyRowKey(), KeyEncoder.decodePrimaryKey(schema, rowCEncoded).stringifyRowKey()); }); assertEquals(rowD.stringifyRowKey(), KeyEncoder.decodePrimaryKey(schema, rowDEncoded).stringifyRowKey());
return KeyEncoder.encodeRangePartitionKey(row, rangeSchema);