use of org.apache.rya.indexing.pcj.fluo.app.batch.BatchInformation in project incubator-rya by apache.
the class BatchInformationSerializerTest method testJoinBatchInformationSerialization.
@Test
public void testJoinBatchInformationSerialization() {
QueryBindingSet bs = new QueryBindingSet();
bs.addBinding("a", new URIImpl("urn:123"));
bs.addBinding("b", new URIImpl("urn:456"));
VisibilityBindingSet vBis = new VisibilityBindingSet(bs, "FOUO");
JoinBatchInformation batch = JoinBatchInformation.builder().setBatchSize(1000).setTask(Task.Update).setColumn(FluoQueryColumns.PERIODIC_QUERY_BINDING_SET).setSpan(Span.prefix(Bytes.of("prefix346"))).setJoinType(JoinType.LEFT_OUTER_JOIN).setSide(Side.RIGHT).setBs(vBis).build();
byte[] batchBytes = BatchInformationSerializer.toBytes(batch);
Optional<BatchInformation> decodedBatch = BatchInformationSerializer.fromBytes(batchBytes);
assertEquals(batch, decodedBatch.get());
}
use of org.apache.rya.indexing.pcj.fluo.app.batch.BatchInformation in project incubator-rya by apache.
the class BatchInformationSerializerTest method testSpanBatchInformationSerialization.
@Test
public void testSpanBatchInformationSerialization() {
SpanBatchDeleteInformation batch = SpanBatchDeleteInformation.builder().setBatchSize(1000).setColumn(FluoQueryColumns.PERIODIC_QUERY_BINDING_SET).setSpan(Span.prefix(Bytes.of("prefix"))).build();
System.out.println(batch);
byte[] batchBytes = BatchInformationSerializer.toBytes(batch);
Optional<BatchInformation> decodedBatch = BatchInformationSerializer.fromBytes(batchBytes);
System.out.println(decodedBatch);
assertEquals(batch, decodedBatch.get());
}
Aggregations