Package com.hp.hpl.jena.tdb.index

Examples of com.hp.hpl.jena.tdb.index.TupleIndex


            }
           
            if ( false )
            {
                // Dump in tuple order.
                TupleIndex tupleIndex = new TupleIndexRecord(primary.length(), new ColumnMap(primary, indexName), indexName, rIndex.getRecordFactory(), rIndex) ;
                if ( true )
                {
                    System.out.println("---- Tuple contents") ;
                    Iterator<Tuple<NodeId>> iter2 = tupleIndex.all() ;
                    if ( ! iter2.hasNext() )
                        System.out.println("<<Empty>>") ;

                    for ( ; iter2.hasNext() ; )
                    {
View Full Code Here


            primary = null ;
            dftKeyLength = 0 ;
            dftValueLength = 0 ;
        }
       
        TupleIndex srcIdx = SetupTDB.makeTupleIndex(srcLoc, primary, srcIndexName, srcIndexName, dftKeyLength) ;
        TupleIndex dstIdx = SetupTDB.makeTupleIndex(dstLoc, primary, dstIndexName, dstIndexName, dftKeyLength) ;
       
        Iterator<Tuple<NodeId>> iter = srcIdx.all() ;
        for ( ; iter.hasNext() ; )
        {
            Tuple<NodeId> tuple = iter.next() ;
            dstIdx.add(tuple) ;
        }
        srcIdx.close() ;
        dstIdx.close() ;
    }
View Full Code Here

    public static StatsCollector gatherTDB(GraphTDB graph)
    {
        long count = 0 ;
        Map<NodeId, Integer> predicateIds = new HashMap<NodeId, Integer>(1000) ;
       
        TupleIndex index = graph.getNodeTupleTable().getTupleTable().getIndex(0) ;
        if ( ! index.getName().equals("SPO") &&
             ! index.getName().equals("GSPO") )
            Log.warn(StatsCollector.class, "May not be the right index: "+index.getName()+" mapping="+index.getColumnMap().getLabel()) ;
        boolean quads = (index.getTupleLength()==4;
       
        Iterator<Tuple<NodeId>> iter = graph.getNodeTupleTable().findAll() ;
        StatsCollectorNodeId collector = new StatsCollectorNodeId() ;
       
        for ( ; iter.hasNext() ; )
View Full Code Here

        String indexOrder = indexName2 ;
        String label = indexName1+" => "+indexName2 ;
       
        if ( true )
        {
            TupleIndex index1 = IndexFactory.openTupleIndex(location1, indexName1, primary, indexName1, 10, 10, keyLength, valueLength) ;     
            TupleIndex index2 = IndexFactory.openTupleIndex(location2, indexName2, primary, indexOrder, 10, 10, keyLength, valueLength) ;

            tupleIndexCopy(index1, index2, label) ;

            index1.close() ;
            index2.close() ;
        }
        else
        {
            // BPT -> BPT copy with reordering (hardcoded)
            RangeIndex index1 = IndexFactory.openBPT(location1, indexName1, 10, 10, keyLength, valueLength)
            // Unlikely to be metafile for destination.
            keyLength = index1.getRecordFactory().keyLength() ;
            valueLength = index1.getRecordFactory().valueLength() ;
            RangeIndex index2 = IndexFactory.openBPT(location2, indexName2, 10000, 10000, keyLength, valueLength) ;
            bptCopy(index1, index2, label) ;
            index1.close() ;
            index2.close() ;
        }
    }
View Full Code Here

        // This should work but requires properties.
        //return SetupTDB.makeTupleIndex(location, properties, indexName, primary, indexOrder, dftKeyLength)
        // Migrate to TDB proper.
        // Value part is null (zero length)
        RangeIndex rIndex = openBPT(location, indexName, readCacheSize, writeCacheSize, dftKeyLength, dftValueLength) ;
        TupleIndex tupleIndex = new TupleIndexRecord(primary.length(), new ColumnMap(primary, indexOrder), indexOrder, rIndex.getRecordFactory(), rIndex) ;
        return tupleIndex ;
    }
View Full Code Here

     *  make a set of indexes.
     */
    private static TupleIndex[] indexes(final IndexBuilder indexBuilder, RecordFactory recordFactory,
                                       final Location location, String primary, String...descs)
    {
        TupleIndex indexes[] = new TupleIndex[descs.length] ;
        int i = 0 ;
        for ( String desc : descs )
        {
            indexes[i] =
                createTupleIndex(indexBuilder, recordFactory, location, primary, desc) ;
View Full Code Here

    }

    /** Public for testing only : create a triple table.*/
    private static TripleTable createTripleTable(IndexBuilder indexBuilder, NodeTable nodeTable, Location location, String[]descs, DatasetControl policy)
    {
        TupleIndex indexes[] = indexes(indexBuilder, indexRecordTripleFactory, location, primaryIndexTriples, descs) ;
        return new TripleTable(indexes, nodeTable, policy) ;
    }
View Full Code Here

   
    /** Public for testing only : create a quad table.*/
    private static QuadTable createQuadTable(IndexBuilder indexBuilder, NodeTable nodeTable,
                                             Location location, String[]descs, DatasetControl policy)
    {
        TupleIndex indexes[] = indexes(indexBuilder, indexRecordQuadFactory, location, primaryIndexQuads, descs) ;
        return new QuadTable(indexes, nodeTable, policy) ;
    }
View Full Code Here

    private static TupleIndex createTupleIndex(IndexBuilder indexBuilder, RecordFactory recordFactory, Location location, String primary, String desc)
    {
        // Map name of index to name of file.
        FileSet fileset = new FileSet(location, desc) ;
        RangeIndex rIdx1 = indexBuilder.newRangeIndex(fileset, recordFactory) ;
        TupleIndex tupleIndex = new TupleIndexRecord(desc.length(), new ColumnMap(primary, desc), desc, recordFactory, rIdx1) ;
        return tupleIndex ;
    }
View Full Code Here

    static NodeId n5 = new NodeId(0x5555555555555555L) ;
    static NodeId n6 = new NodeId(0x6666666666666666L) ;
   
    static private TupleTable create()
    {
        TupleIndex idxSPO = TestTupleIndexRecord.create("SPO") ;
        TupleIndex idxPOS = TestTupleIndexRecord.create("POS") ;
        TupleIndex idxOSP = TestTupleIndexRecord.create("OSP") ;
        TupleIndex x[] = { idxSPO, idxPOS, idxOSP } ;
        TupleTable table = new TupleTable(3, x) ;
        return table ;
    }
View Full Code Here

TOP

Related Classes of com.hp.hpl.jena.tdb.index.TupleIndex

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.