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

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


//                                            int readCacheSize,int writeCacheSize)
   
    public static void dumpNodeIndex(String dir)
    {
        Location location = new Location(dir) ;
        Index nodeToId = SetupTDB.makeIndex(location,  Names.indexNode2Id, SystemTDB.LenNodeHash, SystemTDB.SizeOfNodeId, -1 ,-1) ;
        for ( Record aNodeToId : nodeToId )
        {
            System.out.println( aNodeToId );
        }
    }
View Full Code Here


    }
   
    private NodeTableTrans create(Transaction txn, NodeTable base)
    {
        RecordFactory recordFactory = new RecordFactory(SystemTDB.LenNodeHash, SystemTDB.SizeOfNodeId) ;
        Index idx = new IndexMap(recordFactory) ;
        ObjectFile objectFile = createObjectFile() ;
        NodeTableTrans ntt = new NodeTableTrans(txn, "test", base, idx, objectFile) ;
        return ntt ;
    }
View Full Code Here

      
        int[] keys1 = rand(numKeys, 0, maxValue) ;
        int[] keys2 = permute(keys1, numKeys) ;
        try {
            IndexMaker maker = new BPlusTreeMaker(order, order, false) ;
            Index rIndex = IndexTestLib.buildIndex(maker, keys1);
            IndexTestLib.delete(rIndex, keys2) ;
        } catch (RuntimeException ex)
        {
            System.err.printf("int order=%d ;\n", order) ;
            System.err.printf("int[] keys1 = {%s} ;\n", strings(keys1)) ;
View Full Code Here

       
        // -- make node to id mapping -- Names.indexNode2Id
        // Make index of id to node (data table)
       
        // No caching at the index level - we use the internal caches of the node table.
        Index nodeToId = makeIndex(location, indexNode2Id, LenNodeHash, SizeOfNodeId, -1 ,-1) ;
       
        // -- Make the node table using the components established above.
        NodeTable nodeTable = new NodeTableNative(nodeToId, stringFile) ;
        return nodeTable ;
    }
View Full Code Here

            NodeTable ntBase = nodeTables.get(ref) ;
            if ( ntBase == null )
                throw new TDBException("No NodeTable for "+ref) ;
           
            RecordFactory recordFactory = new RecordFactory(SystemTDB.LenNodeHash, SystemTDB.SizeOfNodeId) ;
            Index idx = new IndexMap(recordFactory) ;
            String objFilename = fsObjectFile.filename(Names.extNodeData+"-"+Names.extJournal) ;
            ObjectFile objectFile ;
           
            if ( fsObjectFile.isMem() )
                objectFile = FileFactory.createObjectFileMem(objFilename) ;
View Full Code Here

    {
        String filename = fsIdToNode.filename(Names.extNodeData) ;
       
        if ( fsNodeToId.isMem() )
        {
            Index nodeToId = indexBuilder.newIndex(FileSet.mem(), SystemTDB.nodeRecordFactory) ;
            ObjectFile objects = FileFactory.createObjectFileMem(filename) ;
            NodeTable nodeTable = new NodeTableNative(nodeToId, objects) ;
           
            nodeTable = NodeTableCache.create(nodeTable, 100, 100, 100) ;
            nodeTable =  NodeTableInline.create(nodeTable) ;
           
            return nodeTable ;
           
            //return NodeTableIndex.createMem(indexBuilder) ;
        }
       
        Index nodeToId = indexBuilder.newIndex(fsNodeToId, SystemTDB.nodeRecordFactory) ;
        // Node table.
        ObjectFile objects = FileFactory.createObjectFileDisk(filename);
        NodeTable nodeTable = new NodeTableNative(nodeToId, objects) ;
        nodeTable = NodeTableCache.create(nodeTable, nodeToIdCacheSize, idToNodeCacheSize, nodeMissCacheSize) ;
        nodeTable = NodeTableInline.create(nodeTable) ;
View Full Code Here

       
        @Override
        public NodeTable buildNodeTable(FileSet fsIndex, FileSet fsObjectFile, int sizeNode2NodeIdCache, int sizeNodeId2NodeCache, int sizeNodeMissCacheSize)
        {
            RecordFactory recordFactory = new RecordFactory(SystemTDB.LenNodeHash, SystemTDB.SizeOfNodeId) ;
            Index idx = indexBuilder.buildIndex(fsIndex, recordFactory) ;
            ObjectFile objectFile = objectFileBuilder.buildObjectFile(fsObjectFile, Names.extNodeData) ;
            NodeTable nodeTable = new NodeTableNative(idx, objectFile) ;
            nodeTable = NodeTableCache.create(nodeTable, sizeNode2NodeIdCache, sizeNodeId2NodeCache, sizeNodeMissCacheSize) ;
            nodeTable = NodeTableInline.create(nodeTable) ;
            return nodeTable ;
View Full Code Here

    }
   
    private NodeTableTrans create(Transaction txn, NodeTable base)
    {
        RecordFactory recordFactory = new RecordFactory(SystemTDB.LenNodeHash, SystemTDB.SizeOfNodeId) ;
        Index idx = new IndexMap(recordFactory) ;
        ObjectFile objectFile = createObjectFile() ;
        NodeTableTrans ntt = new NodeTableTrans(txn, "test", base, idx, objectFile) ;
        return ntt ;
    }
View Full Code Here

            NodeTable ntBase = nodeTables.get(ref) ;
            if ( ntBase == null )
                throw new TDBException("No NodeTable for "+ref) ;
           
            RecordFactory recordFactory = new RecordFactory(SystemTDB.LenNodeHash, SystemTDB.SizeOfNodeId) ;
            Index idx = new IndexMap(recordFactory) ;
            String objFilename = fsObjectFile.filename(Names.extNodeData+"-"+Names.extJournal) ;
            ObjectFile objectFile ;
           
            if ( fsObjectFile.isMem() )
                objectFile = FileFactory.createObjectFileMem(objFilename) ;
View Full Code Here

   
//    RecordFactory tripleRecordFactory = new RecordFactory(SystemTDB.LenIndexTripleRecord, 0) ;
//    RecordFactory quadRecordFactory = new RecordFactory(SystemTDB.LenIndexQuadRecord, 0) ;
    RecordFactory nodeTableRecordFactory = new RecordFactory(SystemTDB.LenNodeHash, SystemTDB.SizeOfNodeId) ;

    Index n2id1 = IndexBuilder.createIndex(new FileSet(location1, Names.indexNode2Id), nodeTableRecordFactory) ;
    Index n2id2 = IndexBuilder.createIndex(new FileSet(location2, Names.indexNode2Id), nodeTableRecordFactory) ;

    System.out.println("Node table 01: node2id index") ;
    Iterator<Record> iter1 = n2id1.iterator() ;
    while ( iter1.hasNext() ) {
      System.out.println(iter1.next()) ;
    }

    System.out.println("Node table 02: node2id index") ;
    Iterator<Record> iter2 = n2id2.iterator() ;
    while ( iter2.hasNext() ) {
      System.out.println(iter2.next()) ;
    }
   
    System.out.println("Node table: how do we merge the node2id indexes?") ;
    List<Iterator<Record>> indexes = new ArrayList<Iterator<Record>>();
    indexes.add(n2id1.iterator()) ;
    indexes.add(n2id2.iterator()) ;
    MergeSortIterator<Record> merger = new MergeSortIterator<Record>(indexes, new RecordComparator()) ;
    while ( merger.hasNext() ) {
      System.out.println(merger.next());
    }
View Full Code Here

TOP

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

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.