Search in sources :

Example 1 with BatchInformation

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());
}
Also used : VisibilityBindingSet(org.apache.rya.api.model.VisibilityBindingSet) JoinBatchInformation(org.apache.rya.indexing.pcj.fluo.app.batch.JoinBatchInformation) BatchInformation(org.apache.rya.indexing.pcj.fluo.app.batch.BatchInformation) URIImpl(org.openrdf.model.impl.URIImpl) JoinBatchInformation(org.apache.rya.indexing.pcj.fluo.app.batch.JoinBatchInformation) QueryBindingSet(org.openrdf.query.algebra.evaluation.QueryBindingSet) Test(org.junit.Test)

Example 2 with BatchInformation

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());
}
Also used : JoinBatchInformation(org.apache.rya.indexing.pcj.fluo.app.batch.JoinBatchInformation) BatchInformation(org.apache.rya.indexing.pcj.fluo.app.batch.BatchInformation) SpanBatchDeleteInformation(org.apache.rya.indexing.pcj.fluo.app.batch.SpanBatchDeleteInformation) Test(org.junit.Test)

Aggregations

BatchInformation (org.apache.rya.indexing.pcj.fluo.app.batch.BatchInformation)2 JoinBatchInformation (org.apache.rya.indexing.pcj.fluo.app.batch.JoinBatchInformation)2 Test (org.junit.Test)2 VisibilityBindingSet (org.apache.rya.api.model.VisibilityBindingSet)1 SpanBatchDeleteInformation (org.apache.rya.indexing.pcj.fluo.app.batch.SpanBatchDeleteInformation)1 URIImpl (org.openrdf.model.impl.URIImpl)1 QueryBindingSet (org.openrdf.query.algebra.evaluation.QueryBindingSet)1