You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@jena.apache.org by afs <gi...@git.apache.org> on 2017/11/27 18:36:39 UTC

[GitHub] jena pull request #317: JENA-1440: TDB2 - transform bytes to NodeIds directl...

GitHub user afs opened a pull request:

    https://github.com/apache/jena/pull/317

    JENA-1440: TDB2 - transform bytes to NodeIds directly.

    

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

    $ git pull https://github.com/afs/jena tdb-mapper

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

    https://github.com/apache/jena/pull/317.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 #317
    
----

----


---

[GitHub] jena pull request #317: JENA-1440: TDB2 - transform bytes to NodeIds directl...

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

    https://github.com/apache/jena/pull/317


---

[GitHub] jena issue #317: JENA-1440: TDB2 - transform bytes to NodeIds directly.

Posted by afs <gi...@git.apache.org>.
Github user afs commented on the issue:

    https://github.com/apache/jena/pull/317
  
    I had time for some more testing.


---

[GitHub] jena pull request #317: JENA-1440: TDB2 - transform bytes to NodeIds directl...

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

    https://github.com/apache/jena/pull/317#discussion_r153284608
  
    --- Diff: jena-db/jena-dboe-base/src/main/java/org/apache/jena/dboe/base/buffer/RecordBufferIteratorMapper.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.jena.dboe.base.buffer;
    +
    +import static org.apache.jena.atlas.lib.Alg.decodeIndex ;
    +
    +import java.util.Iterator;
    +import java.util.NoSuchElementException;
    +
    +import org.apache.jena.atlas.lib.Bytes;
    +import org.apache.jena.dboe.base.record.Record;
    +import org.apache.jena.dboe.base.record.RecordMapper;
    +
    +// Iterate over one RecordBuffer
    +public class RecordBufferIteratorMapper<X> implements Iterator<X>
    +{
    +    private RecordBuffer rBuff ;
    +    private int nextIdx ;
    +    private X slot = null ;
    +    private final byte[] keySlot ;
    +    private final Record maxRec ;
    +    private final Record minRec ;
    +    private final RecordMapper<X> mapper;
    +    
    +//    RecordBufferIteratorMapper(RecordBuffer rBuff)
    +//    { this(rBuff, null, null); }
    +    
    +    RecordBufferIteratorMapper(RecordBuffer rBuff, Record minRecord, Record maxRecord, int keyLen, RecordMapper<X> mapper)
    +    {
    +        this.rBuff = rBuff ;
    +        this.mapper = mapper ;
    +        this.keySlot = (maxRecord==null) ? null : new byte[keyLen];
    +        nextIdx = 0 ;
    +        minRec = minRecord ;
    +        if ( minRec != null )
    +        {
    +            nextIdx = rBuff.find(minRec) ;
    +            if ( nextIdx < 0 )
    +                nextIdx = decodeIndex(nextIdx) ;
    +        }
    +        
    +        maxRec = maxRecord ; 
    +    }
    +
    +    private void finish()
    +    {
    +        rBuff = null ;
    +        nextIdx = -99 ;
    --- End diff --
    
    Might be nice to call this out as a constant, like `NO_NEXT_INDEX` or the like.


---

[GitHub] jena issue #317: JENA-1440: TDB2 - transform bytes to NodeIds directly.

Posted by afs <gi...@git.apache.org>.
Github user afs commented on the issue:

    https://github.com/apache/jena/pull/317
  
    Not for Jena 3.6.0.


---