/** * * @param fileName * @param keySchema * @param comparator * @throws IOException */ public BSTIndexReader(final Path fileName, Schema keySchema, TupleComparator comparator) throws IOException { this.fileName = fileName; this.keySchema = keySchema; this.comparator = comparator; this.rowStoreDecoder = RowStoreUtil.createDecoder(keySchema); }
/** * * @param fileName * @param keySchema * @param comparator * @throws java.io.IOException */ public BSTIndexReader(final Path fileName, Schema keySchema, TupleComparator comparator) throws IOException { this.fileName = fileName; this.keySchema = keySchema; this.comparator = comparator; this.rowStoreDecoder = RowStoreUtil.createDecoder(keySchema); open(); }
/** * * @param fileName * @param keySchema * @param comparator * @throws java.io.IOException */ public BSTIndexReader(final Path fileName, Schema keySchema, TupleComparator comparator) throws IOException { this.fileName = fileName; this.keySchema = keySchema; this.comparator = comparator; this.rowStoreDecoder = RowStoreUtil.createDecoder(keySchema); open(); }
SchemaProto proto = builder.build(); this.keySchema = new Schema(proto); this.rowStoreDecoder = RowStoreUtil.createDecoder(keySchema);
SchemaProto proto = builder.build(); this.keySchema = SchemaFactory.newV1(proto); this.rowStoreDecoder = RowStoreUtil.createDecoder(keySchema);
Tuple end; Schema keySchema = idxReader.getKeySchema(); RowStoreDecoder decoder = RowStoreUtil.createDecoder(keySchema);
Tuple end; Schema keySchema = idxReader.getKeySchema(); RowStoreDecoder decoder = RowStoreUtil.createDecoder(keySchema);
byte [] endBytes = Base64.decodeBase64(endKey); RowStoreDecoder decoder = RowStoreUtil.createDecoder(keySchema); Tuple start; Tuple end;
byte [] endBytes = Base64.decodeBase64(endKey); RowStoreDecoder decoder = RowStoreUtil.createDecoder(keySchema); Tuple start; Tuple end;
RowStoreUtil.RowStoreDecoder decoder = RowStoreUtil.createDecoder(response.getSchema()); while (!isFinished) { try {
List<Tuple> tupleList = new ArrayList<>(); int receviedSize = 0; RowStoreUtil.RowStoreDecoder decoder = RowStoreUtil.createDecoder(response.getSchema()); while (!isFinished) { try {
@Test public final void testFixedSizeChar() { Schema schema = SchemaBuilder.builder().add("col1", CatalogUtil.newDataTypeWithLen(Type.CHAR, 5)).build(); Tuple tuple = new VTuple(1); tuple.put(new Datum[] { DatumFactory.createChar("abc\0\0") }); RowStoreEncoder encoder = RowStoreUtil.createEncoder(schema); RowStoreDecoder decoder = RowStoreUtil.createDecoder(schema); byte [] bytes = encoder.toBytes(tuple); Tuple tuple2 = decoder.toTuple(bytes); assertEquals(tuple, tuple2); }
private void readHeader() throws IOException { // schema int schemaByteSize = indexIn.readInt(); byte [] schemaBytes = new byte[schemaByteSize]; StorageUtil.readFully(indexIn, schemaBytes, 0, schemaByteSize); SchemaProto.Builder builder = SchemaProto.newBuilder(); builder.mergeFrom(schemaBytes); SchemaProto proto = builder.build(); this.keySchema = new Schema(proto); this.rowStoreDecoder = RowStoreUtil.createDecoder(keySchema); // comparator int compByteSize = indexIn.readInt(); byte [] compBytes = new byte[compByteSize]; StorageUtil.readFully(indexIn, compBytes, 0, compByteSize); TupleComparatorProto.Builder compProto = TupleComparatorProto.newBuilder(); compProto.mergeFrom(compBytes); this.comparator = new TupleComparator(compProto.build()); // level this.level = indexIn.readInt(); // entry this.entryNum = indexIn.readInt(); if (entryNum > 0) { // if there is no any entry, do not read firstKey/lastKey values byte [] minBytes = new byte[indexIn.readInt()]; StorageUtil.readFully(indexIn, minBytes, 0, minBytes.length); this.firstKey = rowStoreDecoder.toTuple(minBytes); byte [] maxBytes = new byte[indexIn.readInt()]; StorageUtil.readFully(indexIn, maxBytes, 0, maxBytes.length); this.lastKey = rowStoreDecoder.toTuple(maxBytes); } }
RowStoreDecoder decoder = RowStoreUtil.createDecoder(schema); byte [] bytes = encoder.toBytes(tuple); Tuple tuple2 = decoder.toTuple(bytes);