You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@rya.apache.org by meiercaleb <gi...@git.apache.org> on 2016/04/04 22:33:01 UTC

[GitHub] incubator-rya pull request: RYA-50 Updated Rya PCJs to support SPA...

GitHub user meiercaleb opened a pull request:

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

    RYA-50 Updated Rya PCJs to support SPARQL queries with OPTIONALs.

    

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

    $ git pull https://github.com/meiercaleb/incubator-rya RYA-50-Add-Support-for-Sparql-Optional-Statements-in-Precomputed-Joins

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

    https://github.com/apache/incubator-rya/pull/35.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 #35
    
----
commit 82cc45d718d1660f3577c5f034e8c5869d0a7e5f
Author: Kevin Chilton <ke...@localhost.localdomain>
Date:   2016-03-22T18:49:54Z

    RYA-50 Updated Rya PCJs to support SPARQL queries with OPTIONALs.

----


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-rya pull request: RYA-50 Updated Rya PCJs to support SPA...

Posted by asfgit <gi...@git.apache.org>.
Github user asfgit closed the pull request at:

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


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-rya pull request: RYA-50 Updated Rya PCJs to support SPA...

Posted by amihalik <gi...@git.apache.org>.
Github user amihalik commented on a diff in the pull request:

    https://github.com/apache/incubator-rya/pull/35#discussion_r58443882
  
    --- Diff: extras/indexing/src/main/java/mvm/rya/indexing/external/tupleSet/AccumuloPcjSerializer.java ---
    @@ -19,104 +19,198 @@
      * under the License.
      */
     
    +import static com.google.common.base.Preconditions.checkNotNull;
    +import static com.google.common.base.Preconditions.checkArgument;
     import static mvm.rya.api.RdfCloudTripleStoreConstants.DELIM_BYTE;
     import static mvm.rya.api.RdfCloudTripleStoreConstants.DELIM_BYTES;
     import static mvm.rya.api.RdfCloudTripleStoreConstants.TYPE_DELIM_BYTE;
     
    -import java.util.ArrayList;
    +import java.nio.ByteBuffer;
     import java.util.Arrays;
    +import java.util.LinkedList;
     import java.util.List;
    +import java.util.Set;
    +
    +import javax.annotation.ParametersAreNonnullByDefault;
     
     import mvm.rya.api.domain.RyaType;
     import mvm.rya.api.resolver.RdfToRyaConversions;
     import mvm.rya.api.resolver.RyaContext;
     import mvm.rya.api.resolver.RyaToRdfConversions;
     import mvm.rya.api.resolver.RyaTypeResolverException;
    +import mvm.rya.indexing.external.tupleSet.PcjTables.VariableOrder;
     
     import org.openrdf.model.Value;
    +import org.openrdf.query.Binding;
     import org.openrdf.query.BindingSet;
     import org.openrdf.query.algebra.evaluation.QueryBindingSet;
     
    -import com.google.common.base.Preconditions;
     import com.google.common.primitives.Bytes;
     
     /**
    - * AccumuloPcjSerializer provides two methods, serialize and deserialize, which
    - * are used for writing BindingSets to PCJ tables and reading serialized byte
    - * representations of BindingSets from PCJ tables.
    - *
    + * Converts {@link BindingSet}s to byte[]s and back again. The bytes do not
    + * include the binding names and are ordered with a {@link VariableOrder}.
      */
    -public class AccumuloPcjSerializer {
    +@ParametersAreNonnullByDefault
    +public class AccumuloPcjSerializer implements BindingSetConverter<byte[]> {
    +    
    +    @Override
    +    public byte[] convert(BindingSet bindingSet, VariableOrder varOrder) throws BindingSetConversionException {
    +        checkNotNull(bindingSet);
    +        checkNotNull(varOrder);
    +        
    +        try {
    +            return serialize(bindingSet, varOrder.toArray());
    +        } catch (RyaTypeResolverException e) {
    +            throw new BindingSetConversionException("Could not convert the BindingSet into a byte[].", e);
    +        }
    +    }
     
    +    @Override
    +    public BindingSet convert(byte[] bindingSetBytes, VariableOrder varOrder) throws BindingSetConversionException {
    +        checkNotNull(bindingSetBytes);
    +        checkNotNull(varOrder);
    +        
    +        try {
    +            return deSerialize(bindingSetBytes, varOrder.toArray());
    +        } catch (RyaTypeResolverException e) {
    +            throw new BindingSetConversionException("Could not convert the byte[] into a BindingSet.", e); 
    +        }
    +    }
    +    
     	/**
    -	 *
    +	 * 
     	 * @param bs {@link BindingSet} to be serialized
     	 * @param varOrder order in which binding values should be written to byte array
     	 * @return byte array containing serialized values written in order indicated by varOrder
     	 * @throws RyaTypeResolverException
    +	 * @deprecated Use {@link #convert(BindingSet, VariableOrder)} instead.
     	 */
    +    @Deprecated
    --- End diff --
    
    Why not remove the method?


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---