Github user meiercaleb commented on a diff in the pull request: https://github.com/apache/incubator-rya/pull/177#discussion_r127995235 --- Diff: extras/rya.pcj.fluo/pcj.fluo.app/src/main/java/org/apache/rya/indexing/pcj/fluo/app/batch/JoinBatchInformation.java --- @@ -0,0 +1,262 @@ +package org.apache.rya.indexing.pcj.fluo.app.batch; +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +import java.util.Objects; + +import org.apache.fluo.api.data.Column; +import org.apache.fluo.api.data.Span; +import org.apache.rya.indexing.pcj.fluo.app.JoinResultUpdater.Side; +import org.apache.rya.indexing.pcj.fluo.app.query.JoinMetadata.JoinType; +import org.apache.rya.indexing.pcj.storage.accumulo.VariableOrder; +import org.apache.rya.indexing.pcj.storage.accumulo.VisibilityBindingSet; +import org.openrdf.query.Binding; + +import jline.internal.Preconditions; + +/** + * This class updates join results based on parameters specified for the join's + * children. The join has two children, and for one child a VisibilityBindingSet + * is specified along with the Side of that child. This BindingSet represents an + * update to that join child. For the other child, a Span, Column and + * VariableOrder are specified. This is so that the sibling node (the node that + * wasn't updated) can be scanned to obtain results that can be joined with the + * VisibilityBindingSet. The assumption here is that the Span is derived from + * the {@link Binding}s of common variables between the join children, with + * Values ordered according to the indicated {@link VariableOrder}. This class + * represents a batch order to perform a given task on join BindingSet results. + * The {@link Task} is to Add, Delete, or Update. This batch order is processed + * by the {@link BatchObserver} and used with the nodeId provided to the + * Observer to process the Task specified by the batch order. If the Task is to + * add, the BatchBindingSetUpdater returned by + * {@link JoinBatchInformation#getBatchUpdater()} will scan the join's child for + * results using the indicated Span and Column. These results are joined with + * the indicated VisibilityBindingSet, and the results are added to the parent + * join. The other Tasks are performed analogously. + * + */ +public class JoinBatchInformation extends AbstractSpanBatchInformation { + + private static final BatchBindingSetUpdater updater = new JoinBatchBindingSetUpdater(); + private VisibilityBindingSet bs; //update for join child indicated by side + private VariableOrder varOrder; //variable order for child indicated by Span + private Side side; //join child that was updated by bs + private JoinType join; + /** + * @param batchSize - batch size that Tasks are performed in + * @param task - Add, Delete, or Update + * @param column - Column of join child to be scanned + * @param span - span of join child to be scanned (derived from common variables of left and right join children) + * @param bs - BindingSet to be joined with results of child scan + * @param varOrder - VariableOrder used to form join (order for join child corresponding to Span) + * @param side - The side of the child that the VisibilityBindingSet update occurred at + * @param join - JoinType (left, right, natural inner) + */ + public JoinBatchInformation(int batchSize, Task task, Column column, Span span, VisibilityBindingSet bs, VariableOrder varOrder, Side side, JoinType join) { + super(batchSize, task, column, span); + Preconditions.checkNotNull(bs); + Preconditions.checkNotNull(varOrder); + Preconditions.checkNotNull(side); + Preconditions.checkNotNull(join); + this.bs = bs; --- End diff -- done
--- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. ---