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);
}
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);
}
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)));
}
Aggregations