[GitHub] incubator-rya pull request #198: Rya 283

2017-08-18 Thread asfgit
Github user asfgit closed the pull request at:

https://github.com/apache/incubator-rya/pull/198


---
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.
---


[GitHub] incubator-rya pull request #198: Rya 283

2017-08-17 Thread meiercaleb
Github user meiercaleb commented on a diff in the pull request:

https://github.com/apache/incubator-rya/pull/198#discussion_r133722022
  
--- Diff: 
extras/rya.pcj.fluo/pcj.fluo.integration/src/test/java/org/apache/rya/indexing/pcj/fluo/integration/KafkaExportIT.java
 ---
@@ -425,6 +432,160 @@ public void groupByManyBindings_avaerages() throws 
Exception {
 assertEquals(expectedResults, results);
 }
 
+
+@Test
+public void nestedGroupByManyBindings_averages() throws Exception {
+// A query that groups what is aggregated by two of the keys.
+final String sparql =
+"SELECT ?type ?location ?averagePrice {" +
+"FILTER(?averagePrice > 4) " +
+"{SELECT ?type ?location (avg(?price) as ?averagePrice) {" 
+
+"?id  ?type . " +
+"?id  ?location ." +
+"?id  ?price ." +
+"} " +
+"GROUP BY ?type ?location }}";
+
+// Create the Statements that will be loaded into Rya.
+final ValueFactory vf = new ValueFactoryImpl();
+final Collection statements = Sets.newHashSet(
+// American items that will be averaged.
+vf.createStatement(vf.createURI("urn:1"), 
vf.createURI("urn:type"), vf.createLiteral("apple")),
+vf.createStatement(vf.createURI("urn:1"), 
vf.createURI("urn:location"), vf.createLiteral("USA")),
+vf.createStatement(vf.createURI("urn:1"), 
vf.createURI("urn:price"), vf.createLiteral(2.50)),
+
+vf.createStatement(vf.createURI("urn:2"), 
vf.createURI("urn:type"), vf.createLiteral("cheese")),
+vf.createStatement(vf.createURI("urn:2"), 
vf.createURI("urn:location"), vf.createLiteral("USA")),
+vf.createStatement(vf.createURI("urn:2"), 
vf.createURI("urn:price"), vf.createLiteral(4.25)),
+
+vf.createStatement(vf.createURI("urn:3"), 
vf.createURI("urn:type"), vf.createLiteral("cheese")),
+vf.createStatement(vf.createURI("urn:3"), 
vf.createURI("urn:location"), vf.createLiteral("USA")),
+vf.createStatement(vf.createURI("urn:3"), 
vf.createURI("urn:price"), vf.createLiteral(5.25)),
+
+// French items that will be averaged.
+vf.createStatement(vf.createURI("urn:4"), 
vf.createURI("urn:type"), vf.createLiteral("cheese")),
+vf.createStatement(vf.createURI("urn:4"), 
vf.createURI("urn:location"), vf.createLiteral("France")),
+vf.createStatement(vf.createURI("urn:4"), 
vf.createURI("urn:price"), vf.createLiteral(8.5)),
+
+vf.createStatement(vf.createURI("urn:5"), 
vf.createURI("urn:type"), vf.createLiteral("cigarettes")),
+vf.createStatement(vf.createURI("urn:5"), 
vf.createURI("urn:location"), vf.createLiteral("France")),
+vf.createStatement(vf.createURI("urn:5"), 
vf.createURI("urn:price"), vf.createLiteral(3.99)),
+
+vf.createStatement(vf.createURI("urn:6"), 
vf.createURI("urn:type"), vf.createLiteral("cigarettes")),
+vf.createStatement(vf.createURI("urn:6"), 
vf.createURI("urn:location"), vf.createLiteral("France")),
+vf.createStatement(vf.createURI("urn:6"), 
vf.createURI("urn:price"), vf.createLiteral(4.99)));
+
+// Create the PCJ in Fluo and load the statements into Rya.
+final String pcjId = loadData(sparql, statements);
+
+// Create the expected results of the SPARQL query once the PCJ 
has been computed.
+final Set expectedResults = new HashSet<>();
+
+MapBindingSet bs = new MapBindingSet();
+bs.addBinding("type", vf.createLiteral("cheese", 
XMLSchema.STRING));
+bs.addBinding("location", vf.createLiteral("France", 
XMLSchema.STRING));
+bs.addBinding("averagePrice", vf.createLiteral("8.5", 
XMLSchema.DECIMAL));
+expectedResults.add( new VisibilityBindingSet(bs));
+
+bs = new MapBindingSet();
+bs.addBinding("type", vf.createLiteral("cigarettes", 
XMLSchema.STRING));
+bs.addBinding("location", vf.createLiteral("France", 
XMLSchema.STRING));
+bs.addBinding("averagePrice", vf.createLiteral("4.49", 
XMLSchema.DECIMAL));
+expectedResults.add( new VisibilityBindingSet(bs) );
+
+bs = new MapBindingSet();
+bs.addBinding("type", vf.createLiteral("cheese", 
XMLSchema.STRING));
+bs.addBinding("location", vf.createLiteral("USA", 
XMLSchema.STRING));
+bs.addBinding("averagePrice", vf.createLiteral("4.75", 
XMLSchema.DECIMAL));
+expectedResults.add( new VisibilityBindingSet(bs) );
   

[GitHub] incubator-rya pull request #198: Rya 283

2017-08-17 Thread meiercaleb
Github user meiercaleb commented on a diff in the pull request:

https://github.com/apache/incubator-rya/pull/198#discussion_r133721289
  
--- Diff: 
extras/rya.pcj.fluo/pcj.fluo.app/src/main/java/org/apache/rya/indexing/pcj/fluo/app/query/QueryMetadataVisitorBase.java
 ---
@@ -0,0 +1,113 @@
+/*
+ * 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.
+ */
+package org.apache.rya.indexing.pcj.fluo.app.query;
+
+import org.apache.rya.indexing.pcj.fluo.app.NodeType;
+
+import com.google.common.base.Optional;
+import com.google.common.base.Preconditions;
+
+public abstract class QueryMetadataVisitorBase {
--- End diff --

Because there is a need to navigate the FluoQuery.Builder (which is 
essentially a tree of Builders) as well as the QueryMetadatada (which is a tree 
of metadata).


---
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.
---


[GitHub] incubator-rya pull request #198: Rya 283

2017-08-17 Thread meiercaleb
Github user meiercaleb commented on a diff in the pull request:

https://github.com/apache/incubator-rya/pull/198#discussion_r133720806
  
--- Diff: 
extras/rya.pcj.fluo/pcj.fluo.app/src/main/java/org/apache/rya/indexing/pcj/fluo/app/batch/JoinBatchInformation.java
 ---
@@ -149,12 +137,12 @@ public boolean equals(Object other) {
 
 JoinBatchInformation batch = (JoinBatchInformation) other;
 return super.equals(other) &&  Objects.equals(this.bs, batch.bs) 
&& Objects.equals(this.join, batch.join)
--- End diff --

java.utils.Object.equals() returns a boolean, so you cannot chain these 
calls.


---
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.
---


[GitHub] incubator-rya pull request #198: Rya 283

2017-08-17 Thread meiercaleb
Github user meiercaleb commented on a diff in the pull request:

https://github.com/apache/incubator-rya/pull/198#discussion_r133719717
  
--- Diff: 
extras/rya.pcj.fluo/pcj.fluo.app/src/main/java/org/apache/rya/indexing/pcj/fluo/app/JoinResultUpdater.java
 ---
@@ -160,8 +183,55 @@ public void updateJoinResults(
 public static enum Side {
 LEFT, RIGHT;
 }
+
+
+/**
+ * Fetches batch to be processed by scanning over the Span specified 
by the
+ * {@link JoinBatchInformation}. The number of results is less than or 
equal
+ * to the batch size specified by the JoinBatchInformation.
+ * 
+ * @param tx - Fluo transaction in which batch operation is performed
+ * @param siblingSpan - span of sibling to retrieve elements to join 
with
+ * @param bsSet- set that batch results are added to
+ * @return Set - containing results of sibling scan.
+ * @throws Exception 
+ */
+private Optional fillSiblingBatch(TransactionBase tx, Span 
siblingSpan, Column siblingColumn, Set bsSet, int 
batchSize) throws Exception {
+
+RowScanner rs = 
tx.scanner().over(siblingSpan).fetch(siblingColumn).byRow().build();
+Iterator colScannerIter = rs.iterator();
+
+boolean batchLimitMet = false;
+Bytes row = siblingSpan.getStart().getRow();
+while (colScannerIter.hasNext() && !batchLimitMet) {
+ColumnScanner colScanner = colScannerIter.next();
+row = colScanner.getRow();
+Iterator iter = colScanner.iterator();
+while (iter.hasNext()) {
--- End diff --

Yeah, okay.  That'd probably be a bit cleaner.  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.
---


[GitHub] incubator-rya pull request #198: Rya 283

2017-08-16 Thread meiercaleb
Github user meiercaleb commented on a diff in the pull request:

https://github.com/apache/incubator-rya/pull/198#discussion_r133497519
  
--- Diff: 
extras/rya.pcj.fluo/pcj.fluo.app/src/main/java/org/apache/rya/indexing/pcj/fluo/app/query/CommonNodeMetadata.java
 ---
@@ -99,4 +99,18 @@ public String toString() {
 .append("}")
 .toString();
 }
+
+/**
+ * Base interface for all metadata Builders.  Using this type def
+ * allows for the implementation of a Builder visitor for navigating
+ * the Builder tree.
+ *
+ */
+public static interface Builder {
--- End diff --

That's because it a type def that is meant to be extended.  If a build 
method was added, it would have to pass back a type, which would make it 
necessary to cast for extensions of this class that pass back extensions of 
CommonNodeMetadata.  


---
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.
---


[GitHub] incubator-rya pull request #198: Rya 283

2017-08-09 Thread isper3at
Github user isper3at commented on a diff in the pull request:

https://github.com/apache/incubator-rya/pull/198#discussion_r132251517
  
--- Diff: 
extras/rya.pcj.fluo/pcj.fluo.app/src/main/java/org/apache/rya/indexing/pcj/fluo/app/query/QueryBuilderVisitorBase.java
 ---
@@ -0,0 +1,119 @@
+/*
+ * 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.
+ */
+package org.apache.rya.indexing.pcj.fluo.app.query;
+
+import org.apache.rya.indexing.pcj.fluo.app.NodeType;
+
+import com.google.common.base.Optional;
+import com.google.common.base.Preconditions;
+
+/**
+ * Base visitor class for navigating a {@link FluoQuery.Builder}.
+ * The visit methods in this class provide the basic functionality
+ * for navigating between the Builders that make u the FluoQuery.Builder.
+ *
+ */
+public abstract class QueryBuilderVisitorBase {
--- End diff --

you can ignore this, I'm talking to you in person for clarification


---
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.
---


[GitHub] incubator-rya pull request #198: Rya 283

2017-08-09 Thread isper3at
Github user isper3at commented on a diff in the pull request:

https://github.com/apache/incubator-rya/pull/198#discussion_r132250708
  
--- Diff: 
extras/rya.pcj.fluo/pcj.fluo.integration/src/test/java/org/apache/rya/indexing/pcj/fluo/integration/KafkaExportIT.java
 ---
@@ -425,6 +432,160 @@ public void groupByManyBindings_avaerages() throws 
Exception {
 assertEquals(expectedResults, results);
 }
 
+
+@Test
+public void nestedGroupByManyBindings_averages() throws Exception {
+// A query that groups what is aggregated by two of the keys.
+final String sparql =
+"SELECT ?type ?location ?averagePrice {" +
+"FILTER(?averagePrice > 4) " +
+"{SELECT ?type ?location (avg(?price) as ?averagePrice) {" 
+
+"?id  ?type . " +
+"?id  ?location ." +
+"?id  ?price ." +
+"} " +
+"GROUP BY ?type ?location }}";
+
+// Create the Statements that will be loaded into Rya.
+final ValueFactory vf = new ValueFactoryImpl();
+final Collection statements = Sets.newHashSet(
+// American items that will be averaged.
+vf.createStatement(vf.createURI("urn:1"), 
vf.createURI("urn:type"), vf.createLiteral("apple")),
+vf.createStatement(vf.createURI("urn:1"), 
vf.createURI("urn:location"), vf.createLiteral("USA")),
+vf.createStatement(vf.createURI("urn:1"), 
vf.createURI("urn:price"), vf.createLiteral(2.50)),
+
+vf.createStatement(vf.createURI("urn:2"), 
vf.createURI("urn:type"), vf.createLiteral("cheese")),
+vf.createStatement(vf.createURI("urn:2"), 
vf.createURI("urn:location"), vf.createLiteral("USA")),
+vf.createStatement(vf.createURI("urn:2"), 
vf.createURI("urn:price"), vf.createLiteral(4.25)),
+
+vf.createStatement(vf.createURI("urn:3"), 
vf.createURI("urn:type"), vf.createLiteral("cheese")),
+vf.createStatement(vf.createURI("urn:3"), 
vf.createURI("urn:location"), vf.createLiteral("USA")),
+vf.createStatement(vf.createURI("urn:3"), 
vf.createURI("urn:price"), vf.createLiteral(5.25)),
+
+// French items that will be averaged.
+vf.createStatement(vf.createURI("urn:4"), 
vf.createURI("urn:type"), vf.createLiteral("cheese")),
+vf.createStatement(vf.createURI("urn:4"), 
vf.createURI("urn:location"), vf.createLiteral("France")),
+vf.createStatement(vf.createURI("urn:4"), 
vf.createURI("urn:price"), vf.createLiteral(8.5)),
+
+vf.createStatement(vf.createURI("urn:5"), 
vf.createURI("urn:type"), vf.createLiteral("cigarettes")),
+vf.createStatement(vf.createURI("urn:5"), 
vf.createURI("urn:location"), vf.createLiteral("France")),
+vf.createStatement(vf.createURI("urn:5"), 
vf.createURI("urn:price"), vf.createLiteral(3.99)),
+
+vf.createStatement(vf.createURI("urn:6"), 
vf.createURI("urn:type"), vf.createLiteral("cigarettes")),
+vf.createStatement(vf.createURI("urn:6"), 
vf.createURI("urn:location"), vf.createLiteral("France")),
+vf.createStatement(vf.createURI("urn:6"), 
vf.createURI("urn:price"), vf.createLiteral(4.99)));
+
+// Create the PCJ in Fluo and load the statements into Rya.
+final String pcjId = loadData(sparql, statements);
+
+// Create the expected results of the SPARQL query once the PCJ 
has been computed.
+final Set expectedResults = new HashSet<>();
+
+MapBindingSet bs = new MapBindingSet();
+bs.addBinding("type", vf.createLiteral("cheese", 
XMLSchema.STRING));
+bs.addBinding("location", vf.createLiteral("France", 
XMLSchema.STRING));
+bs.addBinding("averagePrice", vf.createLiteral("8.5", 
XMLSchema.DECIMAL));
+expectedResults.add( new VisibilityBindingSet(bs));
+
+bs = new MapBindingSet();
+bs.addBinding("type", vf.createLiteral("cigarettes", 
XMLSchema.STRING));
+bs.addBinding("location", vf.createLiteral("France", 
XMLSchema.STRING));
+bs.addBinding("averagePrice", vf.createLiteral("4.49", 
XMLSchema.DECIMAL));
+expectedResults.add( new VisibilityBindingSet(bs) );
+
+bs = new MapBindingSet();
+bs.addBinding("type", vf.createLiteral("cheese", 
XMLSchema.STRING));
+bs.addBinding("location", vf.createLiteral("USA", 
XMLSchema.STRING));
+bs.addBinding("averagePrice", vf.createLiteral("4.75", 
XMLSchema.DECIMAL));
+expectedResults.add( new VisibilityBindingSet(bs) );

[GitHub] incubator-rya pull request #198: Rya 283

2017-08-09 Thread isper3at
Github user isper3at commented on a diff in the pull request:

https://github.com/apache/incubator-rya/pull/198#discussion_r132244653
  
--- Diff: 
extras/rya.pcj.fluo/pcj.fluo.app/src/main/java/org/apache/rya/indexing/pcj/fluo/app/query/QueryBuilderVisitorBase.java
 ---
@@ -0,0 +1,119 @@
+/*
+ * 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.
+ */
+package org.apache.rya.indexing.pcj.fluo.app.query;
+
+import org.apache.rya.indexing.pcj.fluo.app.NodeType;
+
+import com.google.common.base.Optional;
+import com.google.common.base.Preconditions;
+
+/**
+ * Base visitor class for navigating a {@link FluoQuery.Builder}.
+ * The visit methods in this class provide the basic functionality
+ * for navigating between the Builders that make u the FluoQuery.Builder.
+ *
+ */
+public abstract class QueryBuilderVisitorBase {
--- End diff --

should this extend some openRDF visitor? or are you just mimicking the 
visitor pattern?  Why are you visiting on the builders rather than what they 
build?


---
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.
---


[GitHub] incubator-rya pull request #198: Rya 283

2017-08-09 Thread isper3at
Github user isper3at commented on a diff in the pull request:

https://github.com/apache/incubator-rya/pull/198#discussion_r132234446
  
--- Diff: 
extras/rya.pcj.fluo/pcj.fluo.app/src/main/java/org/apache/rya/indexing/pcj/fluo/app/query/CommonNodeMetadata.java
 ---
@@ -99,4 +99,18 @@ public String toString() {
 .append("}")
 .toString();
 }
+
+/**
+ * Base interface for all metadata Builders.  Using this type def
+ * allows for the implementation of a Builder visitor for navigating
+ * the Builder tree.
+ *
+ */
+public static interface Builder {
--- End diff --

there's no build function?


---
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.
---


[GitHub] incubator-rya pull request #198: Rya 283

2017-08-09 Thread isper3at
Github user isper3at commented on a diff in the pull request:

https://github.com/apache/incubator-rya/pull/198#discussion_r132250247
  
--- Diff: 
extras/rya.pcj.fluo/pcj.fluo.app/src/test/java/org/apache/rya/indexing/pcj/fluo/app/query/QueryBuilderVisitorTest.java
 ---
@@ -0,0 +1,105 @@
+/*
+ * 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.
+ */
+package org.apache.rya.indexing.pcj.fluo.app.query;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+
+import org.apache.rya.indexing.pcj.fluo.app.NodeType;
+import org.junit.Assert;
+import org.junit.Test;
+
+public class QueryBuilderVisitorTest {
+
+@Test
+public void builderTest() {
+
+FluoQuery.Builder fluoBuilder = FluoQuery.builder();
+
+String queryId = NodeType.generateNewFluoIdForType(NodeType.QUERY);
+String projectionId = 
NodeType.generateNewFluoIdForType(NodeType.PROJECTION);
+String joinId = NodeType.generateNewFluoIdForType(NodeType.JOIN);
+String leftSp = 
NodeType.generateNewFluoIdForType(NodeType.STATEMENT_PATTERN);
+String rightSp = 
NodeType.generateNewFluoIdForType(NodeType.STATEMENT_PATTERN);
+
+List expected = Arrays.asList(queryId, projectionId, 
joinId, leftSp, rightSp);
+
+QueryMetadata.Builder queryBuilder = 
QueryMetadata.builder(queryId);
+queryBuilder.setChildNodeId(projectionId);
+
+ProjectionMetadata.Builder projectionBuilder = 
ProjectionMetadata.builder(projectionId);
+projectionBuilder.setChildNodeId(joinId);
+
+JoinMetadata.Builder joinBuilder = JoinMetadata.builder(joinId);
+joinBuilder.setLeftChildNodeId(leftSp);
+joinBuilder.setRightChildNodeId(rightSp);
+
+StatementPatternMetadata.Builder left = 
StatementPatternMetadata.builder(leftSp);
+StatementPatternMetadata.Builder right = 
StatementPatternMetadata.builder(rightSp);
+
+fluoBuilder.setQueryMetadata(queryBuilder);
+fluoBuilder.addProjectionBuilder(projectionBuilder);
+fluoBuilder.addJoinMetadata(joinBuilder);
+fluoBuilder.addStatementPatternBuilder(left);
+fluoBuilder.addStatementPatternBuilder(right);
+
+QueryBuilderPrinter printer = new QueryBuilderPrinter(fluoBuilder);
+printer.visit();
+Assert.assertEquals(expected, printer.getIds());
+}
+
+
+public static class QueryBuilderPrinter extends 
QueryBuilderVisitorBase {
+
+private List ids = new ArrayList<>();
+
+public List getIds() {
+return ids;
+}
+
+public QueryBuilderPrinter(FluoQuery.Builder builder) {
+super(builder);
+}
+
+public void visit(QueryMetadata.Builder queryBuilder) {
+System.out.println(queryBuilder.getNodeId());
--- End diff --

why do you need to print during a test?


---
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.
---


[GitHub] incubator-rya pull request #198: Rya 283

2017-08-09 Thread isper3at
Github user isper3at commented on a diff in the pull request:

https://github.com/apache/incubator-rya/pull/198#discussion_r132245408
  
--- Diff: 
extras/rya.pcj.fluo/pcj.fluo.app/src/main/java/org/apache/rya/indexing/pcj/fluo/app/query/QueryMetadataVisitorBase.java
 ---
@@ -0,0 +1,113 @@
+/*
+ * 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.
+ */
+package org.apache.rya.indexing.pcj.fluo.app.query;
+
+import org.apache.rya.indexing.pcj.fluo.app.NodeType;
+
+import com.google.common.base.Optional;
+import com.google.common.base.Preconditions;
+
+public abstract class QueryMetadataVisitorBase {
--- End diff --

confusedwhy are you visiting on the builders as well as the metadata 
built?  


---
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.
---


[GitHub] incubator-rya pull request #198: Rya 283

2017-08-09 Thread isper3at
Github user isper3at commented on a diff in the pull request:

https://github.com/apache/incubator-rya/pull/198#discussion_r132234031
  
--- Diff: 
extras/rya.pcj.fluo/pcj.fluo.app/src/main/java/org/apache/rya/indexing/pcj/fluo/app/observers/QueryResultObserver.java
 ---
@@ -107,7 +107,7 @@ public void process(final TransactionBase tx, final 
Bytes brow, final Column col
 // Read the Child Binding Set that will be exported.
 final Bytes valueBytes = tx.get(brow, col);
 final VisibilityBindingSet result = 
BS_SERDE.deserialize(valueBytes);
-
+
--- End diff --

this class only has this whitespace change, can it be removed from the 
commits?


---
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.
---


[GitHub] incubator-rya pull request #198: Rya 283

2017-08-09 Thread isper3at
Github user isper3at commented on a diff in the pull request:

https://github.com/apache/incubator-rya/pull/198#discussion_r132233795
  
--- Diff: 
extras/rya.pcj.fluo/pcj.fluo.app/src/main/java/org/apache/rya/indexing/pcj/fluo/app/batch/JoinBatchInformation.java
 ---
@@ -149,12 +137,12 @@ public boolean equals(Object other) {
 
 JoinBatchInformation batch = (JoinBatchInformation) other;
 return super.equals(other) &&  Objects.equals(this.bs, batch.bs) 
&& Objects.equals(this.join, batch.join)
--- End diff --

you should be able to just Objects.equals().equals().equals();


---
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.
---


[GitHub] incubator-rya pull request #198: Rya 283

2017-08-06 Thread meiercaleb
GitHub user meiercaleb opened a pull request:

https://github.com/apache/incubator-rya/pull/198

Rya 283


## Description
Integrated BatchObserver with Rya Fluo Application.  The user can specify a 
batch size for processing joins.  If the batch size is exceed when the join is 
being processed, a batch task is registered with the BatchObserver to process 
the remaining BindingSets to complete the join.

### Tests
Integration tests were added to BatchIT in the Fluo Integration Test 
project.
The tests check that joins are processed successfully for a batch size of 5.

### Links
[Jira](https://issues.apache.org/jira/browse/RYA-283)

### Checklist
- [ ] Code Review
- [x ] Squash Commits

 People To Reivew
@amihalik @pujav65 @isper3at 


You can merge this pull request into a Git repository by running:

$ git pull https://github.com/meiercaleb/incubator-rya RYA-283

Alternatively you can review and apply these changes as the patch at:

https://github.com/apache/incubator-rya/pull/198.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

This closes #198


commit 1c022e789b9332708b6a2f8ddd46ff6f37925c51
Author: Caleb Meier 
Date:   2017-07-20T13:57:38Z

RYA-282-Nested-Query

commit 7ddd70182bc55392186b725e7de4b440269e019b
Author: Caleb Meier 
Date:   2017-08-05T23:53:49Z

RYA-283-Batch-Observer-Integration




---
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.
---