Search in sources :

Example 21 with Column

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

the class FluoQueryMetadataDAO method readProjectionMetadataBuilder.

private ProjectionMetadata.Builder readProjectionMetadataBuilder(final SnapshotBase sx, final String nodeId) {
    requireNonNull(sx);
    requireNonNull(nodeId);
    // Fetch the values from the Fluo table.
    final String rowId = nodeId;
    final Map<Column, String> values = sx.gets(rowId, FluoQueryColumns.PROJECTION_VARIABLE_ORDER, FluoQueryColumns.PROJECTION_PROJECTED_VARS, FluoQueryColumns.PROJECTION_PARENT_NODE_ID, FluoQueryColumns.PROJECTION_CHILD_NODE_ID);
    // Return an object holding them.
    final String varOrderString = values.get(FluoQueryColumns.PROJECTION_VARIABLE_ORDER);
    final String projectedVarString = values.get(FluoQueryColumns.PROJECTION_PROJECTED_VARS);
    final VariableOrder varOrder = new VariableOrder(varOrderString);
    final VariableOrder projectedVars = new VariableOrder(projectedVarString);
    final String childNodeId = values.get(FluoQueryColumns.PROJECTION_CHILD_NODE_ID);
    final String parentNodeId = values.get(FluoQueryColumns.PROJECTION_PARENT_NODE_ID);
    return ProjectionMetadata.builder(nodeId).setVarOrder(varOrder).setProjectedVars(projectedVars).setParentNodeId(parentNodeId).setChildNodeId(childNodeId);
}
Also used : Column(org.apache.fluo.api.data.Column) VariableOrder(org.apache.rya.indexing.pcj.storage.accumulo.VariableOrder)

Example 22 with Column

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

the class JoinBatchInformationTypeAdapter method serialize.

@Override
public JsonElement serialize(final JoinBatchInformation batch, final Type typeOfSrc, final JsonSerializationContext context) {
    final JsonObject result = new JsonObject();
    result.add("class", new JsonPrimitive(batch.getClass().getName()));
    result.add("batchSize", new JsonPrimitive(batch.getBatchSize()));
    result.add("task", new JsonPrimitive(batch.getTask().name()));
    final Column column = batch.getColumn();
    result.add("column", new JsonPrimitive(column.getsFamily() + "\u0000" + column.getsQualifier()));
    final Span span = batch.getSpan();
    result.add("span", new JsonPrimitive(span.getStart().getsRow() + "\u0000" + span.getEnd().getsRow()));
    result.add("startInc", new JsonPrimitive(span.isStartInclusive()));
    result.add("endInc", new JsonPrimitive(span.isEndInclusive()));
    result.add("side", new JsonPrimitive(batch.getSide().name()));
    result.add("joinType", new JsonPrimitive(batch.getJoinType().name()));
    final String updateVarOrderString = Joiner.on(";").join(batch.getBs().getBindingNames());
    final VariableOrder updateVarOrder = new VariableOrder(updateVarOrderString);
    result.add("bindingSet", new JsonPrimitive(converter.convert(batch.getBs(), updateVarOrder)));
    result.add("updateVarOrder", new JsonPrimitive(updateVarOrderString));
    return result;
}
Also used : JsonPrimitive(com.google.gson.JsonPrimitive) RowColumn(org.apache.fluo.api.data.RowColumn) Column(org.apache.fluo.api.data.Column) VariableOrder(org.apache.rya.indexing.pcj.storage.accumulo.VariableOrder) JsonObject(com.google.gson.JsonObject) Span(org.apache.fluo.api.data.Span)

Aggregations

Column (org.apache.fluo.api.data.Column)22 VariableOrder (org.apache.rya.indexing.pcj.storage.accumulo.VariableOrder)13 Bytes (org.apache.fluo.api.data.Bytes)9 RowColumn (org.apache.fluo.api.data.RowColumn)9 Span (org.apache.fluo.api.data.Span)8 JsonObject (com.google.gson.JsonObject)4 VisibilityBindingSet (org.apache.rya.api.model.VisibilityBindingSet)4 HashSet (java.util.HashSet)3 Task (org.apache.rya.indexing.pcj.fluo.app.batch.BatchInformation.Task)3 JsonPrimitive (com.google.gson.JsonPrimitive)2 Transaction (org.apache.fluo.api.client.Transaction)2 IterativeJoin (org.apache.rya.api.function.join.IterativeJoin)2 Side (org.apache.rya.api.function.join.LazyJoiningIterator.Side)2 LeftOuterJoin (org.apache.rya.api.function.join.LeftOuterJoin)2 NaturalJoin (org.apache.rya.api.function.join.NaturalJoin)2 NodeType (org.apache.rya.indexing.pcj.fluo.app.NodeType)2 SpanBatchDeleteInformation (org.apache.rya.indexing.pcj.fluo.app.batch.SpanBatchDeleteInformation)2 JoinType (org.apache.rya.indexing.pcj.fluo.app.query.JoinMetadata.JoinType)2 IOException (java.io.IOException)1 InvalidClassException (java.io.InvalidClassException)1