[jira] [Commented] (RYA-165) Fluo PCJ maintenance should use ColumnVisibility.flatten() to simplify the visibility expression

2016-09-27 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/RYA-165?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15526522#comment-15526522
 ] 

ASF GitHub Bot commented on RYA-165:


Github user asfgit closed the pull request at:

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


> Fluo PCJ maintenance should use ColumnVisibility.flatten() to simplify the 
> visibility expression
> 
>
> Key: RYA-165
> URL: https://issues.apache.org/jira/browse/RYA-165
> Project: Rya
>  Issue Type: Bug
>  Components: dao
>Reporter: Puja Valiyil 
>Assignee: Kevin Chilton
>Priority: Critical
>
> The Fluo application that maintains PCJ indices currently creates complex 
> visibility expressions that grow with every join that is part of the SPARQL 
> query.
> For example, if you create a PCJ for the following SPARQL:
> {code}
> SELECT ?customer ?worker ?city {
> ?customer  ?worker.
> ?worker  ?city.
> ?worker  .
> }
> {code}
> And you insert the following Statements:
> {code}
> Statement: "  " Visibility: "u"
> Statement: "  " Visibility: "u"
> Statement: "  " Visibility: "u"
> {code}
> Then the following result will be exported to the PCJ index:
> {code}
> BindingSet: {{"customer", "urn:Alice"}, {"worker","urn:Bob"}, {"city", 
> "urn:Happyville"} Visibility: "(u&u)&u"
> {code}
> That visibility expression could also be represented as just "u". 
> ColumnVisibility.flatten() calls may be used to iteratively simplify the 
> logical expression, so update the Fluo application to do so before exporting 
> the result.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (RYA-165) Fluo PCJ maintenance should use ColumnVisibility.flatten() to simplify the visibility expression

2016-09-27 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/RYA-165?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15526512#comment-15526512
 ] 

ASF GitHub Bot commented on RYA-165:


Github user pujav65 commented on the issue:

https://github.com/apache/incubator-rya/pull/90
  
looks good.  about to merge.  


> Fluo PCJ maintenance should use ColumnVisibility.flatten() to simplify the 
> visibility expression
> 
>
> Key: RYA-165
> URL: https://issues.apache.org/jira/browse/RYA-165
> Project: Rya
>  Issue Type: Bug
>  Components: dao
>Reporter: Puja Valiyil 
>Assignee: Kevin Chilton
>Priority: Critical
>
> The Fluo application that maintains PCJ indices currently creates complex 
> visibility expressions that grow with every join that is part of the SPARQL 
> query.
> For example, if you create a PCJ for the following SPARQL:
> {code}
> SELECT ?customer ?worker ?city {
> ?customer  ?worker.
> ?worker  ?city.
> ?worker  .
> }
> {code}
> And you insert the following Statements:
> {code}
> Statement: "  " Visibility: "u"
> Statement: "  " Visibility: "u"
> Statement: "  " Visibility: "u"
> {code}
> Then the following result will be exported to the PCJ index:
> {code}
> BindingSet: {{"customer", "urn:Alice"}, {"worker","urn:Bob"}, {"city", 
> "urn:Happyville"} Visibility: "(u&u)&u"
> {code}
> That visibility expression could also be represented as just "u". 
> ColumnVisibility.flatten() calls may be used to iteratively simplify the 
> logical expression, so update the Fluo application to do so before exporting 
> the result.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (RYA-165) Fluo PCJ maintenance should use ColumnVisibility.flatten() to simplify the visibility expression

2016-09-13 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/RYA-165?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15487868#comment-15487868
 ] 

ASF GitHub Bot commented on RYA-165:


Github user kchilton2 commented on a diff in the pull request:

https://github.com/apache/incubator-rya/pull/90#discussion_r78608207
  
--- Diff: 
extras/rya.pcj.fluo/pcj.fluo.app/src/main/java/org/apache/rya/indexing/pcj/fluo/app/observers/QueryResultObserver.java
 ---
@@ -54,6 +58,16 @@
 private static final VisibilityBindingSetStringConverter CONVERTER = 
new VisibilityBindingSetStringConverter();
 
 /**
+ * Simplifies Visibility expressions prior to exporting PCJ results.
+ */
+private static final VisibilitySimplifier SIMPLIFIER = new 
VisibilitySimplifier();
--- End diff --

Static code is harder to test so I just shy away from it.


> Fluo PCJ maintenance should use ColumnVisibility.flatten() to simplify the 
> visibility expression
> 
>
> Key: RYA-165
> URL: https://issues.apache.org/jira/browse/RYA-165
> Project: Rya
>  Issue Type: Bug
>  Components: dao
>Reporter: Puja Valiyil 
>Assignee: Kevin Chilton
>Priority: Critical
>
> The Fluo application that maintains PCJ indices currently creates complex 
> visibility expressions that grow with every join that is part of the SPARQL 
> query.
> For example, if you create a PCJ for the following SPARQL:
> {code}
> SELECT ?customer ?worker ?city {
> ?customer  ?worker.
> ?worker  ?city.
> ?worker  .
> }
> {code}
> And you insert the following Statements:
> {code}
> Statement: "  " Visibility: "u"
> Statement: "  " Visibility: "u"
> Statement: "  " Visibility: "u"
> {code}
> Then the following result will be exported to the PCJ index:
> {code}
> BindingSet: {{"customer", "urn:Alice"}, {"worker","urn:Bob"}, {"city", 
> "urn:Happyville"} Visibility: "(u&u)&u"
> {code}
> That visibility expression could also be represented as just "u". 
> ColumnVisibility.flatten() calls may be used to iteratively simplify the 
> logical expression, so update the Fluo application to do so before exporting 
> the result.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (RYA-165) Fluo PCJ maintenance should use ColumnVisibility.flatten() to simplify the visibility expression

2016-09-13 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/RYA-165?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15487719#comment-15487719
 ] 

ASF GitHub Bot commented on RYA-165:


Github user amihalik commented on a diff in the pull request:

https://github.com/apache/incubator-rya/pull/90#discussion_r78598233
  
--- Diff: 
dao/accumulo.rya/src/main/java/mvm/rya/accumulo/utils/VisibilitySimplifier.java 
---
@@ -0,0 +1,54 @@
+/*
+ * 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 mvm.rya.accumulo.utils;
+
+import static java.util.Objects.requireNonNull;
+
+import javax.annotation.ParametersAreNonnullByDefault;
+
+import org.apache.accumulo.core.security.ColumnVisibility;
+
+import com.google.common.base.Charsets;
+
+/**
+ * Simplifies Accumulo visibility expressions.
+ */
+@ParametersAreNonnullByDefault
+public class VisibilitySimplifier {
+
+/**
+ * Simplifies an Accumulo visibility expression.
+ *
+ * @param visibility - The expression to simplify. (not null)
+ * @return A simplified form of {@code visibility}.
+ */
+public String simplify(final String visibility) {
+requireNonNull(visibility);
+
+String last = visibility;
+String simplified = new String(new 
ColumnVisibility(visibility).flatten(), Charsets.UTF_8);
+
+while(!simplified.equals(last)) {
--- End diff --

wow.  Is this really necessary?  I'm disappointed that you have to run this 
multiple times to completely flatten the expression.


> Fluo PCJ maintenance should use ColumnVisibility.flatten() to simplify the 
> visibility expression
> 
>
> Key: RYA-165
> URL: https://issues.apache.org/jira/browse/RYA-165
> Project: Rya
>  Issue Type: Bug
>  Components: dao
>Reporter: Puja Valiyil 
>Assignee: Kevin Chilton
>Priority: Critical
>
> The Fluo application that maintains PCJ indices currently creates complex 
> visibility expressions that grow with every join that is part of the SPARQL 
> query.
> For example, if you create a PCJ for the following SPARQL:
> {code}
> SELECT ?customer ?worker ?city {
> ?customer  ?worker.
> ?worker  ?city.
> ?worker  .
> }
> {code}
> And you insert the following Statements:
> {code}
> Statement: "  " Visibility: "u"
> Statement: "  " Visibility: "u"
> Statement: "  " Visibility: "u"
> {code}
> Then the following result will be exported to the PCJ index:
> {code}
> BindingSet: {{"customer", "urn:Alice"}, {"worker","urn:Bob"}, {"city", 
> "urn:Happyville"} Visibility: "(u&u)&u"
> {code}
> That visibility expression could also be represented as just "u". 
> ColumnVisibility.flatten() calls may be used to iteratively simplify the 
> logical expression, so update the Fluo application to do so before exporting 
> the result.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (RYA-165) Fluo PCJ maintenance should use ColumnVisibility.flatten() to simplify the visibility expression

2016-09-13 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/RYA-165?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15487702#comment-15487702
 ] 

ASF GitHub Bot commented on RYA-165:


Github user pujav65 commented on a diff in the pull request:

https://github.com/apache/incubator-rya/pull/90#discussion_r78596890
  
--- Diff: 
extras/rya.pcj.fluo/pcj.fluo.app/src/main/java/org/apache/rya/indexing/pcj/fluo/app/observers/QueryResultObserver.java
 ---
@@ -54,6 +58,16 @@
 private static final VisibilityBindingSetStringConverter CONVERTER = 
new VisibilityBindingSetStringConverter();
 
 /**
+ * Simplifies Visibility expressions prior to exporting PCJ results.
+ */
+private static final VisibilitySimplifier SIMPLIFIER = new 
VisibilitySimplifier();
--- End diff --

Is there a reason the simplify method isn't static (why are we creating 
this class)?


> Fluo PCJ maintenance should use ColumnVisibility.flatten() to simplify the 
> visibility expression
> 
>
> Key: RYA-165
> URL: https://issues.apache.org/jira/browse/RYA-165
> Project: Rya
>  Issue Type: Bug
>  Components: dao
>Reporter: Puja Valiyil 
>Assignee: Kevin Chilton
>Priority: Critical
>
> The Fluo application that maintains PCJ indices currently creates complex 
> visibility expressions that grow with every join that is part of the SPARQL 
> query.
> For example, if you create a PCJ for the following SPARQL:
> {code}
> SELECT ?customer ?worker ?city {
> ?customer  ?worker.
> ?worker  ?city.
> ?worker  .
> }
> {code}
> And you insert the following Statements:
> {code}
> Statement: "  " Visibility: "u"
> Statement: "  " Visibility: "u"
> Statement: "  " Visibility: "u"
> {code}
> Then the following result will be exported to the PCJ index:
> {code}
> BindingSet: {{"customer", "urn:Alice"}, {"worker","urn:Bob"}, {"city", 
> "urn:Happyville"} Visibility: "(u&u)&u"
> {code}
> That visibility expression could also be represented as just "u". 
> ColumnVisibility.flatten() calls may be used to iteratively simplify the 
> logical expression, so update the Fluo application to do so before exporting 
> the result.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (RYA-165) Fluo PCJ maintenance should use ColumnVisibility.flatten() to simplify the visibility expression

2016-09-12 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/RYA-165?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15485480#comment-15485480
 ] 

ASF GitHub Bot commented on RYA-165:


Github user isper3at commented on the issue:

https://github.com/apache/incubator-rya/pull/90
  
everything looks good to me.  I like the changes.  We using 
Objects.requireNonNull() inplace of Preconditions moving forward? I still see 
both used in various places


> Fluo PCJ maintenance should use ColumnVisibility.flatten() to simplify the 
> visibility expression
> 
>
> Key: RYA-165
> URL: https://issues.apache.org/jira/browse/RYA-165
> Project: Rya
>  Issue Type: Bug
>  Components: dao
>Reporter: Puja Valiyil 
>Assignee: Kevin Chilton
>Priority: Critical
>
> The Fluo application that maintains PCJ indices currently creates complex 
> visibility expressions that grow with every join that is part of the SPARQL 
> query.
> For example, if you create a PCJ for the following SPARQL:
> {code}
> SELECT ?customer ?worker ?city {
> ?customer  ?worker.
> ?worker  ?city.
> ?worker  .
> }
> {code}
> And you insert the following Statements:
> {code}
> Statement: "  " Visibility: "u"
> Statement: "  " Visibility: "u"
> Statement: "  " Visibility: "u"
> {code}
> Then the following result will be exported to the PCJ index:
> {code}
> BindingSet: {{"customer", "urn:Alice"}, {"worker","urn:Bob"}, {"city", 
> "urn:Happyville"} Visibility: "(u&u)&u"
> {code}
> That visibility expression could also be represented as just "u". 
> ColumnVisibility.flatten() calls may be used to iteratively simplify the 
> logical expression, so update the Fluo application to do so before exporting 
> the result.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (RYA-165) Fluo PCJ maintenance should use ColumnVisibility.flatten() to simplify the visibility expression

2016-09-12 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/RYA-165?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15485467#comment-15485467
 ] 

ASF GitHub Bot commented on RYA-165:


Github user isper3at commented on a diff in the pull request:

https://github.com/apache/incubator-rya/pull/90#discussion_r78465895
  
--- Diff: 
dao/accumulo.rya/src/main/java/mvm/rya/accumulo/utils/VisibilitySimplifier.java 
---
@@ -0,0 +1,54 @@
+/*
+ * 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 mvm.rya.accumulo.utils;
+
+import static java.util.Objects.requireNonNull;
+
+import javax.annotation.ParametersAreNonnullByDefault;
+
+import org.apache.accumulo.core.security.ColumnVisibility;
+
+import com.google.common.base.Charsets;
+
+/**
+ * Simplifies Accumulo visibility expressions.
+ */
+@ParametersAreNonnullByDefault
+public class VisibilitySimplifier {
+
+/**
+ * Simplifies an Accumulo visibility expression.
+ *
+ * @param visibility - The expression to simplify. (not null)
+ * @return A simplified form of {@code visibility}.
+ */
+public String simplify(final String visibility) {
--- End diff --

:+1:  I feel like this is how it should've been implemented in flatten()


> Fluo PCJ maintenance should use ColumnVisibility.flatten() to simplify the 
> visibility expression
> 
>
> Key: RYA-165
> URL: https://issues.apache.org/jira/browse/RYA-165
> Project: Rya
>  Issue Type: Bug
>  Components: dao
>Reporter: Puja Valiyil 
>Assignee: Kevin Chilton
>Priority: Critical
>
> The Fluo application that maintains PCJ indices currently creates complex 
> visibility expressions that grow with every join that is part of the SPARQL 
> query.
> For example, if you create a PCJ for the following SPARQL:
> {code}
> SELECT ?customer ?worker ?city {
> ?customer  ?worker.
> ?worker  ?city.
> ?worker  .
> }
> {code}
> And you insert the following Statements:
> {code}
> Statement: "  " Visibility: "u"
> Statement: "  " Visibility: "u"
> Statement: "  " Visibility: "u"
> {code}
> Then the following result will be exported to the PCJ index:
> {code}
> BindingSet: {{"customer", "urn:Alice"}, {"worker","urn:Bob"}, {"city", 
> "urn:Happyville"} Visibility: "(u&u)&u"
> {code}
> That visibility expression could also be represented as just "u". 
> ColumnVisibility.flatten() calls may be used to iteratively simplify the 
> logical expression, so update the Fluo application to do so before exporting 
> the result.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (RYA-165) Fluo PCJ maintenance should use ColumnVisibility.flatten() to simplify the visibility expression

2016-09-12 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/RYA-165?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15485318#comment-15485318
 ] 

ASF GitHub Bot commented on RYA-165:


GitHub user kchilton2 opened a pull request:

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

RYA-165 Simplify PCJ result visibility expressions before exporting t…



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

$ git pull https://github.com/kchilton2/incubator-rya RYA-165

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

https://github.com/apache/incubator-rya/pull/90.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 #90


commit 91d3c51866691af82e7636a654328984c7a36db1
Author: Kevin Chilton 
Date:   2016-09-12T21:05:51Z

RYA-165 Simplify PCJ result visibility expressions before exporting them to 
the Rya PCJ index table.




> Fluo PCJ maintenance should use ColumnVisibility.flatten() to simplify the 
> visibility expression
> 
>
> Key: RYA-165
> URL: https://issues.apache.org/jira/browse/RYA-165
> Project: Rya
>  Issue Type: Bug
>  Components: dao
>Reporter: Puja Valiyil 
>Assignee: Kevin Chilton
>Priority: Critical
>




--
This message was sent by Atlassian JIRA
(v6.3.4#6332)