Package org.apache.tajo.storage.RowStoreUtil

Examples of org.apache.tajo.storage.RowStoreUtil.RowStoreEncoder.toBytes()


                                 TupleRange range, boolean last) throws IOException {
    Map<String,List<String>> kvs = Maps.newHashMap();
    RowStoreEncoder encoder = RowStoreUtil.createEncoder(keySchema);
    kvs.put("start", Lists.newArrayList(
        new String(Base64.encodeBase64(
            encoder.toBytes(range.getStart()),
            false))));
    kvs.put("end", Lists.newArrayList(
        new String(Base64.encodeBase64(
            encoder.toBytes(range.getEnd()), false))));
View Full Code Here


        new String(Base64.encodeBase64(
            encoder.toBytes(range.getStart()),
            false))));
    kvs.put("end", Lists.newArrayList(
        new String(Base64.encodeBase64(
            encoder.toBytes(range.getEnd()), false))));

    if (last) {
      kvs.put("final", Lists.newArrayList("true"));
    }
    return handler.get(kvs);
View Full Code Here

    Map<String,List<String>> kvs = Maps.newHashMap();
    Tuple startTuple = new VTuple(1);
    startTuple.put(0, DatumFactory.createInt4(50));
    kvs.put("start", Lists.newArrayList(
        new String(Base64.encodeBase64(
            encoder.toBytes(startTuple), false))));
    Tuple endTuple = new VTuple(1);
    endTuple.put(0, DatumFactory.createInt4(80));
    kvs.put("end", Lists.newArrayList(
        new String(Base64.encodeBase64(
            encoder.toBytes(endTuple), false))));
View Full Code Here

            encoder.toBytes(startTuple), false))));
    Tuple endTuple = new VTuple(1);
    endTuple.put(0, DatumFactory.createInt4(80));
    kvs.put("end", Lists.newArrayList(
        new String(Base64.encodeBase64(
            encoder.toBytes(endTuple), false))));
    FileChunk chunk = handler.get(kvs);

    scanner.seek(chunk.startOffset());
    keytuple = scanner.next();
    assertEquals(50, keytuple.get(1).asInt4());
View Full Code Here

        DatumFactory.createInet4("192.168.0.1")
    });

    RowStoreEncoder encoder = RowStoreUtil.createEncoder(schema);
    RowStoreDecoder decoder = RowStoreUtil.createDecoder(schema);
    byte [] bytes = encoder.toBytes(tuple);
    Tuple tuple2 = decoder.toTuple(bytes);
   
    assertEquals(tuple, tuple2);
  }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.