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