Search in sources :

Example 41 with Bytes

use of org.apache.fluo.api.data.Bytes in project incubator-rya by apache.

the class PeriodicQueryObserver method parseObservation.

@Override
public Observation parseObservation(final TransactionBase tx, final Bytes row) throws Exception {
    requireNonNull(tx);
    requireNonNull(row);
    // Read the Join metadata.
    final String periodicBinNodeId = BindingSetRow.makeFromShardedRow(Bytes.of(PERIODIC_QUERY_PREFIX), row).getNodeId();
    final PeriodicQueryMetadata periodicBinMetadata = queryDao.readPeriodicQueryMetadata(tx, periodicBinNodeId);
    // Read the Visibility Binding Set from the Value.
    final Bytes valueBytes = tx.get(row, FluoQueryColumns.PERIODIC_QUERY_BINDING_SET);
    final VisibilityBindingSet periodicBinBindingSet = BS_SERDE.deserialize(valueBytes);
    // Figure out which node needs to handle the new metadata.
    final String parentNodeId = periodicBinMetadata.getParentNodeId();
    return new Observation(periodicBinNodeId, periodicBinBindingSet, parentNodeId);
}
Also used : Bytes(org.apache.fluo.api.data.Bytes) VisibilityBindingSet(org.apache.rya.api.model.VisibilityBindingSet) PeriodicQueryMetadata(org.apache.rya.indexing.pcj.fluo.app.query.PeriodicQueryMetadata)

Example 42 with Bytes

use of org.apache.fluo.api.data.Bytes in project incubator-rya by apache.

the class QueryResultObserver method process.

@Override
public void process(final TransactionBase tx, final Bytes brow, final Column col) throws Exception {
    // Read the queryId from the row and get the QueryMetadata.
    final String queryId = BindingSetRow.makeFromShardedRow(Bytes.of(QUERY_PREFIX), brow).getNodeId();
    final QueryMetadata metadata = queryDao.readQueryMetadata(tx, queryId);
    // Read the Child Binding Set that will be exported.
    final Bytes valueBytes = tx.get(brow, col);
    exporterManager.export(metadata.getQueryType(), metadata.getExportStrategies(), queryId, valueBytes);
}
Also used : Bytes(org.apache.fluo.api.data.Bytes) QueryMetadata(org.apache.rya.indexing.pcj.fluo.app.query.QueryMetadata)

Example 43 with Bytes

use of org.apache.fluo.api.data.Bytes in project incubator-rya by apache.

the class BatchInformationDAO method addBatch.

/**
 * Adds BatchInformation to the {@link FluoQueryColumns#BATCH_COLUMN}.
 * @param tx - Fluo Transaction
 * @param nodeId - query node that batch task will be performed on
 * @param batch - BatchInformation to be processed
 */
public static void addBatch(TransactionBase tx, String nodeId, BatchInformation batch) {
    Bytes row = BatchRowKeyUtil.getRow(nodeId);
    tx.set(row, FluoQueryColumns.BATCH_COLUMN, Bytes.of(BatchInformationSerializer.toBytes(batch)));
}
Also used : Bytes(org.apache.fluo.api.data.Bytes)

Aggregations

Bytes (org.apache.fluo.api.data.Bytes)43 VisibilityBindingSet (org.apache.rya.api.model.VisibilityBindingSet)16 VariableOrder (org.apache.rya.indexing.pcj.storage.accumulo.VariableOrder)14 Column (org.apache.fluo.api.data.Column)9 Test (org.junit.Test)9 ColumnScanner (org.apache.fluo.api.client.scanner.ColumnScanner)8 RowScanner (org.apache.fluo.api.client.scanner.RowScanner)8 NodeType (org.apache.rya.indexing.pcj.fluo.app.NodeType)8 QueryBindingSet (org.openrdf.query.algebra.evaluation.QueryBindingSet)6 FluoClient (org.apache.fluo.api.client.FluoClient)5 ColumnValue (org.apache.fluo.api.data.ColumnValue)5 RowColumn (org.apache.fluo.api.data.RowColumn)5 Span (org.apache.fluo.api.data.Span)5 Transaction (org.apache.fluo.api.client.Transaction)4 RyaStatement (org.apache.rya.api.domain.RyaStatement)4 HashSet (java.util.HashSet)3 Snapshot (org.apache.fluo.api.client.Snapshot)3 RyaURI (org.apache.rya.api.domain.RyaURI)3 JoinBatchInformation (org.apache.rya.indexing.pcj.fluo.app.batch.JoinBatchInformation)3 SpanBatchDeleteInformation (org.apache.rya.indexing.pcj.fluo.app.batch.SpanBatchDeleteInformation)3