/** * * @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); }
/** * constructor * * @param level * : IndexCreater.ONE_LEVEL_INDEX or IndexCreater.TWO_LEVEL_INDEX * @throws IOException */ public BSTIndexWriter(final Path fileName, int level, Schema keySchema, TupleComparator comparator) throws IOException { this.fileName = fileName; this.level = level; this.keySchema = keySchema; this.compartor = comparator; this.collector = new KeyOffsetCollector(comparator); this.rowStoreEncoder = RowStoreUtil.createEncoder(keySchema); }
public KeyTuple project(Tuple tuple) { RowStoreUtil.project(tuple, keyTuple, projectIds); return keyTuple; } }
@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); }
}); RowStoreEncoder encoder = RowStoreUtil.createEncoder(schema); RowStoreDecoder decoder = RowStoreUtil.createDecoder(schema); byte [] bytes = encoder.toBytes(tuple); Tuple tuple2 = decoder.toTuple(bytes);
/** * * @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(); }
public NonForwardQueryResultFileScanner(TajoConf tajoConf, String sessionId, QueryId queryId, ScanNode scanNode, int maxRow, CodecType codecType) throws IOException { this.tajoConf = tajoConf; this.sessionId = sessionId; this.queryId = queryId; this.scanNode = scanNode; this.tableDesc = scanNode.getTableDesc(); this.maxRow = maxRow; this.rowEncoder = RowStoreUtil.createEncoder(scanNode.getOutSchema()); this.codecType = codecType; }
public KeyTuple project(Tuple tuple) { RowStoreUtil.project(tuple, keyTuple, projectIds); return keyTuple; } }
/** * * @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(); }
public NonForwardQueryResultFileScanner(AsyncTaskService asyncTaskService, TajoConf tajoConf, String sessionId, QueryId queryId, ScanNode scanNode, int maxRow, Optional<CodecType> codecType) throws IOException { this.asyncTaskService = asyncTaskService; this.tajoConf = tajoConf; this.sessionId = sessionId; this.queryId = queryId; this.scanNode = scanNode; this.tableDesc = scanNode.getTableDesc(); this.maxRow = maxRow; this.rowEncoder = RowStoreUtil.createEncoder(scanNode.getOutSchema()); this.codecType = codecType; }
@Override public Tuple next() throws IOException { Tuple tuple; Tuple keyTuple; long offset; while((tuple = child.next()) != null) { offset = tuple.getOffset(); keyTuple = new VTuple(keySchema.size()); RowStoreUtil.project(tuple, keyTuple, indexKeys); indexWriter.write(keyTuple, offset); } return null; }
SchemaProto proto = builder.build(); this.keySchema = new Schema(proto); this.rowStoreDecoder = RowStoreUtil.createDecoder(keySchema);
/** * constructor * * @param level * : IndexCreater.ONE_LEVEL_INDEX or IndexCreater.TWO_LEVEL_INDEX * @throws java.io.IOException */ public BSTIndexWriter(final Path fileName, int level, Schema keySchema, TupleComparator comparator, boolean sorted) throws IOException { this.fileName = fileName; this.level = level; this.writeRootIndex = level == TWO_LEVEL_INDEX; this.keySchema = keySchema; this.compartor = comparator; this.collector = new KeyOffsetCollector(comparator); this.rootCollector = new KeyOffsetCollector(this.compartor); this.rowStoreEncoder = RowStoreUtil.createEncoder(keySchema); this.sorted = sorted; this.indexBuffer = BufferPool.directBuffer(BUFFER_SIZE, ByteOrder.nativeOrder()); this.rootIndexBuffer = BufferPool.directBuffer(BUFFER_SIZE, ByteOrder.nativeOrder()); this.loadCount = loadNum = conf.getInt(WRITER_INDEX_LOAD, DEFAULT_INDEX_LOAD); }
@Override public Tuple next() throws IOException { Tuple tuple; Tuple keyTuple; long offset; while((tuple = child.next()) != null) { offset = tuple.getOffset(); keyTuple = new VTuple(keySchema.size()); RowStoreUtil.project(tuple, keyTuple, indexKeys); indexWriter.write(keyTuple, offset); } return null; }
SchemaProto proto = builder.build(); this.keySchema = SchemaFactory.newV1(proto); this.rowStoreDecoder = RowStoreUtil.createDecoder(keySchema);
/** * constructor * * @param level * : IndexCreater.ONE_LEVEL_INDEX or IndexCreater.TWO_LEVEL_INDEX * @throws java.io.IOException */ public BSTIndexWriter(final Path fileName, int level, Schema keySchema, TupleComparator comparator, boolean sorted) throws IOException { this.fileName = fileName; this.level = level; this.writeRootIndex = level == TWO_LEVEL_INDEX; this.keySchema = keySchema; this.compartor = comparator; this.collector = new KeyOffsetCollector(comparator); this.rootCollector = new KeyOffsetCollector(this.compartor); this.rowStoreEncoder = RowStoreUtil.createEncoder(keySchema); this.sorted = sorted; this.indexBuffer = BufferPool.directBuffer(BUFFER_SIZE, ByteOrder.nativeOrder()); this.rootIndexBuffer = BufferPool.directBuffer(BUFFER_SIZE, ByteOrder.nativeOrder()); this.loadCount = loadNum = conf.getInt(WRITER_INDEX_LOAD, DEFAULT_INDEX_LOAD); }
Tuple end; Schema keySchema = idxReader.getKeySchema(); RowStoreDecoder decoder = RowStoreUtil.createDecoder(keySchema);
RowStoreUtil.RowStoreEncoder encoder = RowStoreUtil.createEncoder(sortSchema); for (int i = 0; i < ranges.length; i++) { fetchSet = new HashSet<>();
Tuple end; Schema keySchema = idxReader.getKeySchema(); RowStoreDecoder decoder = RowStoreUtil.createDecoder(keySchema);
RowStoreUtil.RowStoreEncoder encoder = RowStoreUtil.createEncoder(sortSchema); for (int i = 0; i < ranges.length; i++) { fetchSet = new HashSet<>();