tupleList.add(decoder.toTuple(dataByteArray)); } catch (EOFException eof) { isFinished = true;
tupleList.add(decoder.toTuple(dataByteArray)); } catch (EOFException eof) { isFinished = true;
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);
public static RowStoreDecoder createDecoder(Schema schema) { return new RowStoreDecoder(schema); }
public static RowStoreDecoder createDecoder(Schema schema) { return new RowStoreDecoder(schema); }
private void fillRootIndex(int entryNum, FSDataInputStream in) throws IOException { this.dataIndex = new Tuple[entryNum]; this.offsetIndex = new long[entryNum]; Tuple keyTuple; byte[] buf; for (int i = 0; i < entryNum; i++) { buf = new byte[in.readInt()]; StorageUtil.readFully(in, buf, 0, buf.length); keyTuple = rowStoreDecoder.toTuple(buf); dataIndex[i] = keyTuple; this.offsetIndex[i] = in.readLong(); } }
public static RowStoreDecoder createDecoder(Schema schema) { return new RowStoreDecoder(schema); }
public static RowStoreDecoder createDecoder(Schema schema) { return new RowStoreDecoder(schema); }
public static RowStoreDecoder createDecoder(Schema schema) { return new RowStoreDecoder(schema); }
private void fillRootIndex(int entryNum, FSDataInputStream in) throws IOException { this.dataIndex = new Tuple[entryNum]; this.offsetIndex = new long[entryNum]; Tuple keyTuple; byte[] buf; for (int i = 0; i < entryNum; i++) { buf = new byte[in.readInt()]; StorageUtil.readFully(in, buf, 0, buf.length); keyTuple = rowStoreDecoder.toTuple(buf); dataIndex[i] = keyTuple; this.offsetIndex[i] = in.readLong(); } }