use of org.apache.rya.indexing.pcj.fluo.app.query.JoinMetadata.JoinType in project incubator-rya by apache.
the class JoinBatchInformationTypeAdapter method deserialize.
@Override
public JoinBatchInformation deserialize(final JsonElement element, final Type typeOfT, final JsonDeserializationContext context) throws JsonParseException {
final JsonObject json = element.getAsJsonObject();
final int batchSize = json.get("batchSize").getAsInt();
final Task task = Task.valueOf(json.get("task").getAsString());
final String[] colArray = json.get("column").getAsString().split("\u0000");
final Column column = new Column(colArray[0], colArray[1]);
final String[] rows = json.get("span").getAsString().split("\u0000");
final boolean startInc = json.get("startInc").getAsBoolean();
final boolean endInc = json.get("endInc").getAsBoolean();
final Span span = new Span(new RowColumn(rows[0]), startInc, new RowColumn(rows[1]), endInc);
final VariableOrder updateVarOrder = new VariableOrder(json.get("updateVarOrder").getAsString());
final VisibilityBindingSet bs = converter.convert(json.get("bindingSet").getAsString(), updateVarOrder);
final Side side = Side.valueOf(json.get("side").getAsString());
final JoinType join = JoinType.valueOf(json.get("joinType").getAsString());
return JoinBatchInformation.builder().setBatchSize(batchSize).setTask(task).setSpan(span).setColumn(column).setBs(bs).setSide(side).setJoinType(join).build();
}
use of org.apache.rya.indexing.pcj.fluo.app.query.JoinMetadata.JoinType in project incubator-rya by apache.
the class FluoQueryMetadataDAO method readJoinMetadataBuilder.
private JoinMetadata.Builder readJoinMetadataBuilder(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.JOIN_VARIABLE_ORDER, FluoQueryColumns.JOIN_TYPE, FluoQueryColumns.JOIN_PARENT_NODE_ID, FluoQueryColumns.JOIN_LEFT_CHILD_NODE_ID, FluoQueryColumns.JOIN_BATCH_SIZE, FluoQueryColumns.JOIN_RIGHT_CHILD_NODE_ID);
// Return an object holding them.
final String varOrderString = values.get(FluoQueryColumns.JOIN_VARIABLE_ORDER);
final VariableOrder varOrder = new VariableOrder(varOrderString);
final String joinTypeString = values.get(FluoQueryColumns.JOIN_TYPE);
final JoinType joinType = JoinType.valueOf(joinTypeString);
final String parentNodeId = values.get(FluoQueryColumns.JOIN_PARENT_NODE_ID);
final String leftChildNodeId = values.get(FluoQueryColumns.JOIN_LEFT_CHILD_NODE_ID);
final int joinBatchSize = Integer.parseInt(values.get(FluoQueryColumns.JOIN_BATCH_SIZE));
final String rightChildNodeId = values.get(FluoQueryColumns.JOIN_RIGHT_CHILD_NODE_ID);
return JoinMetadata.builder(nodeId).setVarOrder(varOrder).setJoinType(joinType).setParentNodeId(parentNodeId).setJoinBatchSize(joinBatchSize).setLeftChildNodeId(leftChildNodeId).setRightChildNodeId(rightChildNodeId);
}
Aggregations