Author: andy
Date: Sun Sep  7 17:08:04 2014
New Revision: 1623074

URL: http://svn.apache.org/r1623074
Log:
Step in refactoring of DB building

Added:
    jena/trunk/jena-tdb/src/main/java/com/hp/hpl/jena/tdb/setup/BuildDB.java
      - copied, changed from r1622864, 
jena/trunk/jena-tdb/src/main/java/com/hp/hpl/jena/tdb/setup/BuilderDB.java
    jena/trunk/jena-tdb/src/main/java/com/hp/hpl/jena/tdb/setup/BuildIndex.java
      - copied, changed from r1622992, 
jena/trunk/jena-tdb/src/main/java/com/hp/hpl/jena/tdb/setup/B.java
    jena/trunk/jena-tdb/src/main/java/com/hp/hpl/jena/tdb/setup/BuilderDB.java  
 (with props)
    jena/trunk/jena-tdb/src/main/java/com/hp/hpl/jena/tdb/setup/DBFactory.java  
 (with props)
Removed:
    jena/trunk/jena-tdb/src/main/java/com/hp/hpl/jena/tdb/setup/B.java
    
jena/trunk/jena-tdb/src/main/java/com/hp/hpl/jena/tdb/store/bulkloader2/IndexFactory.java
    
jena/trunk/jena-tdb/src/main/java/com/hp/hpl/jena/tdb/store/bulkloader2/RecordLib.java
Modified:
    jena/trunk/jena-tdb/src/main/java/com/hp/hpl/jena/tdb/StoreConnection.java
    
jena/trunk/jena-tdb/src/main/java/com/hp/hpl/jena/tdb/assembler/IndexAssembler.java
    
jena/trunk/jena-tdb/src/main/java/com/hp/hpl/jena/tdb/setup/BuilderIndex.java
    
jena/trunk/jena-tdb/src/main/java/com/hp/hpl/jena/tdb/setup/DatasetBuilder.java
    
jena/trunk/jena-tdb/src/main/java/com/hp/hpl/jena/tdb/setup/DatasetBuilderBasic.java
    
jena/trunk/jena-tdb/src/main/java/com/hp/hpl/jena/tdb/setup/DatasetBuilderStd.java
    
jena/trunk/jena-tdb/src/main/java/com/hp/hpl/jena/tdb/store/bulkloader2/CmdIndexCopy.java
    
jena/trunk/jena-tdb/src/main/java/com/hp/hpl/jena/tdb/store/bulkloader2/CmdNodeTableBuilder.java
    
jena/trunk/jena-tdb/src/main/java/com/hp/hpl/jena/tdb/store/nodetable/NodeTableFactory.java
    jena/trunk/jena-tdb/src/main/java/com/hp/hpl/jena/tdb/sys/DebugTDB.java
    jena/trunk/jena-tdb/src/main/java/com/hp/hpl/jena/tdb/sys/SetupTDB.java
    jena/trunk/jena-tdb/src/main/java/com/hp/hpl/jena/tdb/sys/TDBMaker.java
    jena/trunk/jena-tdb/src/main/java/tdb/CmdRewriteIndex.java
    jena/trunk/jena-tdb/src/main/java/tdb/tdbconfig.java
    jena/trunk/jena-tdb/src/main/java/tdb/tools/dumpbpt.java
    jena/trunk/jena-tdb/src/main/java/tdb/tools/dumpnodetable.java
    
jena/trunk/jena-tdb/src/test/java/com/hp/hpl/jena/tdb/graph/TestPrefixMappingTDB.java
    
jena/trunk/jena-tdb/src/test/java/com/hp/hpl/jena/tdb/store/TestTripleTable.java
    
jena/trunk/jena-tdb/src/test/java/com/hp/hpl/jena/tdb/store/nodetable/TestNodeTable.java
    
jena/trunk/jena-tdb/src/test/java/com/hp/hpl/jena/tdb/store/nodetable/TestNodeTableStored.java
    
jena/trunk/jena-tdb/src/test/java/com/hp/hpl/jena/tdb/store/tupletable/TestTupleIndexRecord.java
    
jena/trunk/jena-tdb/src/test/java/com/hp/hpl/jena/tdb/store/tupletable/TestTupleIndexRecordDirect.java
    
jena/trunk/jena-tdb/src/test/java/com/hp/hpl/jena/tdb/transaction/AbstractTestNodeTableTrans.java

Modified: 
jena/trunk/jena-tdb/src/main/java/com/hp/hpl/jena/tdb/StoreConnection.java
URL: 
http://svn.apache.org/viewvc/jena/trunk/jena-tdb/src/main/java/com/hp/hpl/jena/tdb/StoreConnection.java?rev=1623074&r1=1623073&r2=1623074&view=diff
==============================================================================
--- jena/trunk/jena-tdb/src/main/java/com/hp/hpl/jena/tdb/StoreConnection.java 
(original)
+++ jena/trunk/jena-tdb/src/main/java/com/hp/hpl/jena/tdb/StoreConnection.java 
Sun Sep  7 17:08:04 2014
@@ -224,7 +224,7 @@ public class StoreConnection
         StoreConnection sConn = cache.get(location) ;
         if (sConn != null) 
             return sConn ;
-        DatasetGraphTDB dsg = DatasetBuilderStd.build(location) ;
+        DatasetGraphTDB dsg = DatasetBuilderStd.create(location) ;
         sConn = _makeAndCache(dsg) ;
         return sConn ;
     }
@@ -292,7 +292,7 @@ public class StoreConnection
      */
     public static StoreConnection createMemUncached()
     {
-        DatasetGraphTDB dsg = DatasetBuilderStd.build(Location.mem()) ;
+        DatasetGraphTDB dsg = DatasetBuilderStd.create(Location.mem()) ;
         return new StoreConnection(dsg) ;
     }
 

Modified: 
jena/trunk/jena-tdb/src/main/java/com/hp/hpl/jena/tdb/assembler/IndexAssembler.java
URL: 
http://svn.apache.org/viewvc/jena/trunk/jena-tdb/src/main/java/com/hp/hpl/jena/tdb/assembler/IndexAssembler.java?rev=1623074&r1=1623073&r2=1623074&view=diff
==============================================================================
--- 
jena/trunk/jena-tdb/src/main/java/com/hp/hpl/jena/tdb/assembler/IndexAssembler.java
 (original)
+++ 
jena/trunk/jena-tdb/src/main/java/com/hp/hpl/jena/tdb/assembler/IndexAssembler.java
 Sun Sep  7 17:08:04 2014
@@ -37,7 +37,7 @@ import com.hp.hpl.jena.tdb.base.file.Loc
 import com.hp.hpl.jena.tdb.base.record.RecordFactory ;
 import com.hp.hpl.jena.tdb.index.IndexParams ;
 import com.hp.hpl.jena.tdb.index.RangeIndex ;
-import com.hp.hpl.jena.tdb.setup.B ;
+import com.hp.hpl.jena.tdb.setup.BuildIndex ;
 import com.hp.hpl.jena.tdb.setup.SystemParams ;
 import com.hp.hpl.jena.tdb.store.tupletable.TupleIndex ;
 import com.hp.hpl.jena.tdb.store.tupletable.TupleIndexRecord ;
@@ -86,7 +86,7 @@ public class IndexAssembler extends Asse
         // Problems with spotting the index technology.
         FileSet fileset = null ; //FileSet.fromFilename(filename) ;
         IndexParams idxParams = SystemParams.getDftSystemParams() ;
-        RangeIndex rIndex = B.buildRangeIndex(fileset, rf, idxParams) ;
+        RangeIndex rIndex = BuildIndex.buildRangeIndex(fileset, rf, idxParams) 
;
         return new TupleIndexRecord(desc.length(), new ColumnMap(primary, 
desc), desc, rf, rIndex) ;
     }
 }

Copied: 
jena/trunk/jena-tdb/src/main/java/com/hp/hpl/jena/tdb/setup/BuildDB.java (from 
r1622864, 
jena/trunk/jena-tdb/src/main/java/com/hp/hpl/jena/tdb/setup/BuilderDB.java)
URL: 
http://svn.apache.org/viewvc/jena/trunk/jena-tdb/src/main/java/com/hp/hpl/jena/tdb/setup/BuildDB.java?p2=jena/trunk/jena-tdb/src/main/java/com/hp/hpl/jena/tdb/setup/BuildDB.java&p1=jena/trunk/jena-tdb/src/main/java/com/hp/hpl/jena/tdb/setup/BuilderDB.java&r1=1622864&r2=1623074&rev=1623074&view=diff
==============================================================================
--- jena/trunk/jena-tdb/src/main/java/com/hp/hpl/jena/tdb/setup/BuilderDB.java 
(original)
+++ jena/trunk/jena-tdb/src/main/java/com/hp/hpl/jena/tdb/setup/BuildDB.java 
Sun Sep  7 17:08:04 2014
@@ -23,67 +23,86 @@ import org.slf4j.Logger ;
 import org.slf4j.LoggerFactory ;
 
 import com.hp.hpl.jena.tdb.base.file.FileSet ;
-import com.hp.hpl.jena.tdb.base.objectfile.ObjectFile ;
+import com.hp.hpl.jena.tdb.base.file.Location ;
 import com.hp.hpl.jena.tdb.base.record.RecordFactory ;
-import com.hp.hpl.jena.tdb.index.Index ;
+import com.hp.hpl.jena.tdb.index.IndexParams ;
 import com.hp.hpl.jena.tdb.index.RangeIndex ;
+import com.hp.hpl.jena.tdb.store.DatasetPrefixesTDB ;
 import com.hp.hpl.jena.tdb.store.nodetable.NodeTable ;
-import com.hp.hpl.jena.tdb.store.nodetable.NodeTableCache ;
-import com.hp.hpl.jena.tdb.store.nodetable.NodeTableInline ;
-import com.hp.hpl.jena.tdb.store.nodetable.NodeTableNative ;
 import com.hp.hpl.jena.tdb.store.tupletable.TupleIndex ;
 import com.hp.hpl.jena.tdb.store.tupletable.TupleIndexRecord ;
-import com.hp.hpl.jena.tdb.sys.Names ;
-import com.hp.hpl.jena.tdb.sys.SystemTDB ;
+import com.hp.hpl.jena.tdb.sys.DatasetControl ;
 
 /** Building datastructures on top of the base file
  *  abstractions of indexes, block managers and object files.  
  */
-public class BuilderDB
+public class BuildDB
 {
     private static boolean VERBOSE = true ;
-    private static Logger log = LoggerFactory.getLogger(BuilderDB.class) ;
+    private static Logger log = LoggerFactory.getLogger(BuildDB.class) ;
+    private static SystemParams params = SystemParams.getDftSystemParams() ;
     
-    public static class TupleIndexBuilderStd implements TupleIndexBuilder
+    public static TupleIndex openTupleIndex(Location location, String 
indexName, String primary, String indexOrder, int readCacheSize, int 
writeCacheSize, int dftKeyLength, int dftValueLength)
     {
-        private final RangeIndexBuilder rangeIndexBuilder ;
+        // XXX replace with:
+        // return DatasetBuilderStd.stdBuilder().makeTupleIndex(location, 
indexName, primary, indexOrder) ;
+        // All this to BuilderDB.
+        SystemParamsBuilder spb = new SystemParamsBuilder() ;
+        spb.blockReadCacheSize(readCacheSize) ;
+        spb.blockWriteCacheSize(writeCacheSize) ;
+        RecordFactory recordFactory = new RecordFactory(dftKeyLength, 
dftValueLength) ;
+        IndexParams idxParams = spb.buildParams() ;
+        FileSet fs = new FileSet(location, indexName) ;
+        RangeIndex rIndex = BuildIndex.buildRangeIndex(fs, recordFactory, 
idxParams) ;
+        TupleIndex tupleIndex = new TupleIndexRecord(primary.length(), new 
ColumnMap(primary, indexOrder), indexOrder, rIndex.getRecordFactory(), rIndex) ;
+        return tupleIndex ;
+    }
     
-        public TupleIndexBuilderStd(RangeIndexBuilder rangeIndexBuilder) {
-            this.rangeIndexBuilder = rangeIndexBuilder ;
-        }
-        
-        @Override
-        public TupleIndex buildTupleIndex(FileSet fileSet, ColumnMap colMap, 
String name, SystemParams params) {
-            RecordFactory recordFactory = new 
RecordFactory(SystemTDB.SizeOfNodeId * colMap.length(), 0) ;
-
-            RangeIndex rIdx = rangeIndexBuilder.buildRangeIndex(fileSet, 
recordFactory, params) ;
-            TupleIndex tIdx = new TupleIndexRecord(colMap.length(), colMap, 
name, recordFactory, rIdx) ;
-            return tIdx ;
-        }
+    public static DatasetPrefixesTDB makePrefixes(Location location, 
DatasetControl policy) {
+        return DatasetBuilderStd.stdBuilder().makePrefixTable(location, 
policy) ;
     }
+//        
+//        // The index using for Graph+Prefix => URI
+//        String indexPrefixes = params.getIndexPrefix() ;
+//        String primary = params.getPrimaryIndexPrefix() ;
+//        String indexes[] = params.getPrefixIndexes() ;
+//
+//        TupleIndex prefixIndexes[] = makeTupleIndexes(location, primary, 
indexes, new String[]{indexPrefixes}) ;
+//        if ( prefixIndexes.length != indexes.length )
+//            error(log, "Wrong number of triple table tuples indexes: 
"+prefixIndexes.length) ;
+//
+//        // The nodetable.
+//        String pnNode2Id = params.getPrefixNode2Id() ;
+//        String pnId2Node = params.getPrefixId2Node() ;
+//
+//        // No cache - the prefix mapping is a cache
+//        NodeTable prefixNodes = makeNodeTable(location, pnNode2Id, -1, 
pnId2Node, -1, -1)  ;
+//        NodeTupleTable prefixTable = new 
NodeTupleTableConcrete(primary.length(),
+//                                                                
prefixIndexes,
+//                                                                prefixNodes, 
policy) ;
+//        DatasetPrefixesTDB prefixes = new DatasetPrefixesTDB(prefixTable) ; 
+//        log.debug("Prefixes: "+StrUtils.strjoin(", ", indexes)) ;
+//        return prefixes ;
+//      }
 
-    public static class NodeTableBuilderStd implements NodeTableBuilder
-    {
-        private final IndexBuilder indexBuilder ;
-        private final ObjectFileBuilder objectFileBuilder ;
-        
-        public NodeTableBuilderStd(IndexBuilder indexBuilder, 
ObjectFileBuilder objectFileBuilder) {
-            this.indexBuilder = indexBuilder ;
-            this.objectFileBuilder = objectFileBuilder ;
-        }
+    public static NodeTable makeNodeTable(Location location) {
+        return makeNodeTable(location, params) ;
+    }
 
-        @Override
-        public NodeTable buildNodeTable(FileSet fsIndex, FileSet fsObjectFile, 
SystemParams params) {
-            RecordFactory recordFactory = new 
RecordFactory(SystemTDB.LenNodeHash, SystemTDB.SizeOfNodeId) ;
-            Index idx = indexBuilder.buildIndex(fsIndex, recordFactory, 
params) ;
-            ObjectFile objectFile = 
objectFileBuilder.buildObjectFile(fsObjectFile, Names.extNodeData) ;
-            NodeTable nodeTable = new NodeTableNative(idx, objectFile) ;
-            nodeTable = NodeTableCache.create(nodeTable, 
-                                              params.getNode2NodeIdCacheSize(),
-                                              params.getNodeId2NodeCacheSize(),
-                                              params.getNodeMissCacheSize()) ;
-            nodeTable = NodeTableInline.create(nodeTable) ;
-            return nodeTable ;
-        }
+    public static NodeTable makeNodeTable(Location location, SystemParams 
params) {
+        DatasetBuilderStd dbBuild = DatasetBuilderStd.stdBuilder(params) ;
+        return dbBuild.makeNodeTable(location, params) ; 
+    }
+    
+    //XXX Reorg all calls to NodeTableBuilder to this argument order.
+    public static NodeTable makeNodeTable(Location location, 
+                                          String indexNode2Id, int 
node2NodeIdCacheSize,
+                                          String indexId2Node, int 
nodeId2NodeCacheSize,
+                                          int sizeNodeMissCacheSize) {
+        SystemParamsBuilder spb = new SystemParamsBuilder() ;
+        
spb.indexNode2Id(indexNode2Id).node2NodeIdCacheSize(node2NodeIdCacheSize) ;
+        
spb.indexId2Node(indexId2Node).nodeId2NodeCacheSize(nodeId2NodeCacheSize) ;
+        DatasetBuilderStd dbBuild = DatasetBuilderStd.stdBuilder() ;
+        return makeNodeTable(location, spb.buildParams()) ; 
     }
 }

Copied: 
jena/trunk/jena-tdb/src/main/java/com/hp/hpl/jena/tdb/setup/BuildIndex.java 
(from r1622992, 
jena/trunk/jena-tdb/src/main/java/com/hp/hpl/jena/tdb/setup/B.java)
URL: 
http://svn.apache.org/viewvc/jena/trunk/jena-tdb/src/main/java/com/hp/hpl/jena/tdb/setup/BuildIndex.java?p2=jena/trunk/jena-tdb/src/main/java/com/hp/hpl/jena/tdb/setup/BuildIndex.java&p1=jena/trunk/jena-tdb/src/main/java/com/hp/hpl/jena/tdb/setup/B.java&r1=1622992&r2=1623074&rev=1623074&view=diff
==============================================================================
--- jena/trunk/jena-tdb/src/main/java/com/hp/hpl/jena/tdb/setup/B.java 
(original)
+++ jena/trunk/jena-tdb/src/main/java/com/hp/hpl/jena/tdb/setup/BuildIndex.java 
Sun Sep  7 17:08:04 2014
@@ -19,15 +19,23 @@
 package com.hp.hpl.jena.tdb.setup;
 
 import com.hp.hpl.jena.tdb.base.file.FileSet ;
+import com.hp.hpl.jena.tdb.base.file.Location ;
 import com.hp.hpl.jena.tdb.base.record.RecordFactory ;
 import com.hp.hpl.jena.tdb.index.Index ;
 import com.hp.hpl.jena.tdb.index.IndexParams ;
 import com.hp.hpl.jena.tdb.index.RangeIndex ;
-import com.hp.hpl.jena.tdb.setup.BuilderIndex.BlockMgrBuilderStd ;
 
-public class B {
+public class BuildIndex {
+    // XXX Merge with com.hp.hpl.jena.tdb.index.IndexFactory
     // c.f. setupTDB
     
+    
+    private static BlockMgrBuilder   blockMgrBuilder   = new 
BuilderIndex.BlockMgrBuilderStd() ;
+    private static RangeIndexBuilder rangeIndexBuilder = new 
BuilderIndex.RangeIndexBuilderStd(blockMgrBuilder,
+                                                                               
                blockMgrBuilder) ;
+    private static IndexBuilder      indexBuilder      = new 
BuilderIndex.IndexBuilderStd(blockMgrBuilder,
+                                                                               
           blockMgrBuilder) ;
+    
     public static IndexBuilder createIndexBuilderMem() { 
         return createIndexBuilder(createRangeIndexBuilderMem()) ;
     }
@@ -43,28 +51,32 @@ public class B {
     }
 
     public static RangeIndexBuilder createRangeIndexBuilderMem() {
-        BlockMgrBuilder blockMgrBuilderNodes = new BlockMgrBuilderStd() ;
-        BlockMgrBuilder blockMgrBuilderRecords = new BlockMgrBuilderStd() ;
-        return new BuilderIndex.RangeIndexBuilderStd(blockMgrBuilderNodes, 
blockMgrBuilderRecords) ;
+        return new BuilderIndex.RangeIndexBuilderStd(blockMgrBuilder, 
blockMgrBuilder) ;
     }
     
-    // XXX Merge with com.hp.hpl.jena.tdb.index.IndexFactory
     
     public static RangeIndex buildRangeIndexMem(RecordFactory recordFactory) {
         FileSet fileSet = FileSet.mem() ;
         return buildRangeIndex(fileSet, recordFactory) ;
     }
     
+    public static RangeIndex buildRangeIndex(Location location, String 
indexName, RecordFactory recordFactory) {
+        FileSet fileset = new FileSet(location, indexName) ;
+        return buildRangeIndex(fileset, recordFactory) ;
+    }
+    
+    public static RangeIndex buildRangeIndex(Location location, String 
indexName, RecordFactory recordFactory, IndexParams indexParams) {
+        FileSet fileset = new FileSet(location, indexName) ;
+        return buildRangeIndex(fileset, recordFactory, indexParams) ;
+    }
+
     public static RangeIndex buildRangeIndex(FileSet fileset, RecordFactory 
recordFactory) {
         IndexParams indexParams = SystemParams.getDftSystemParams() ;
         return buildRangeIndex(fileset, recordFactory, indexParams) ;
     }
         
     public static RangeIndex buildRangeIndex(FileSet fileset, RecordFactory 
recordFactory, IndexParams indexParams) {
-        BlockMgrBuilder nodeBld = new BuilderIndex.BlockMgrBuilderStd() ;
-        BlockMgrBuilder leavesBld = new BuilderIndex.BlockMgrBuilderStd() ;
-        RangeIndexBuilder builder = new 
BuilderIndex.RangeIndexBuilderStd(nodeBld, leavesBld) ;
-        return builder.buildRangeIndex(fileset, recordFactory, indexParams) ; 
+        return rangeIndexBuilder.buildRangeIndex(fileset, recordFactory, 
indexParams) ; 
     }
     
     public static Index buildIndexMem(RecordFactory recordFactory) {
@@ -78,28 +90,7 @@ public class B {
     }
     
     public static Index buildIndex(FileSet fileset, RecordFactory 
recordFactory, IndexParams indexParams) {
-        BlockMgrBuilder nodeBld = new BuilderIndex.BlockMgrBuilderStd() ;
-        BlockMgrBuilder leavesBld = new BuilderIndex.BlockMgrBuilderStd() ;
-        IndexBuilder builder = new BuilderIndex.IndexBuilderStd(nodeBld, 
leavesBld) ;
-        return builder.buildIndex(fileset, recordFactory, indexParams) ; 
-    }
-    
-//    public static NodeTable buildNodeTable(FileSet fileset, SystemParams 
params) {
-//        BlockMgrBuilder nodeBld = new Builder.BlockMgrBuilderStd() ;
-//        BlockMgrBuilder leavesBld = new Builder.BlockMgrBuilderStd() ;
-//        
-//        NodeTableBuilder ntb = new Builder.NodeTableBuilderStd(null, null) ;
-//        
-//        
-//        IndexBuilder builder = new Builder.IndexBuilderStd(nodeBld, 
leavesBld) ;
-//        FileSet filesetIdx = new FileSet(params) ;
-//        FileSet filesetObjFile = new FileSet(params.
-//                                                                          
-//        return ntb.buildNodeTable(fileset, 
-//                                  fileset, 
-//                                  params.getNode2NodeIdCacheSize(),
-//                                  params.getNodeId2NodeCacheSize(),
-//                                  params.getNodeMissCacheSize()) ;
-//    }
+        return indexBuilder.buildIndex(fileset, recordFactory, indexParams) ; 
+    }
 }
 

Added: 
jena/trunk/jena-tdb/src/main/java/com/hp/hpl/jena/tdb/setup/BuilderDB.java
URL: 
http://svn.apache.org/viewvc/jena/trunk/jena-tdb/src/main/java/com/hp/hpl/jena/tdb/setup/BuilderDB.java?rev=1623074&view=auto
==============================================================================
--- jena/trunk/jena-tdb/src/main/java/com/hp/hpl/jena/tdb/setup/BuilderDB.java 
(added)
+++ jena/trunk/jena-tdb/src/main/java/com/hp/hpl/jena/tdb/setup/BuilderDB.java 
Sun Sep  7 17:08:04 2014
@@ -0,0 +1,83 @@
+/**
+ * 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 com.hp.hpl.jena.tdb.setup;
+
+import org.apache.jena.atlas.lib.ColumnMap ;
+
+import com.hp.hpl.jena.tdb.base.file.FileSet ;
+import com.hp.hpl.jena.tdb.base.objectfile.ObjectFile ;
+import com.hp.hpl.jena.tdb.base.record.RecordFactory ;
+import com.hp.hpl.jena.tdb.index.Index ;
+import com.hp.hpl.jena.tdb.index.RangeIndex ;
+import com.hp.hpl.jena.tdb.store.nodetable.NodeTable ;
+import com.hp.hpl.jena.tdb.store.nodetable.NodeTableCache ;
+import com.hp.hpl.jena.tdb.store.nodetable.NodeTableInline ;
+import com.hp.hpl.jena.tdb.store.nodetable.NodeTableNative ;
+import com.hp.hpl.jena.tdb.store.tupletable.TupleIndex ;
+import com.hp.hpl.jena.tdb.store.tupletable.TupleIndexRecord ;
+import com.hp.hpl.jena.tdb.sys.Names ;
+import com.hp.hpl.jena.tdb.sys.SystemTDB ;
+
+public class BuilderDB {
+
+    public static class TupleIndexBuilderStd implements TupleIndexBuilder
+    {
+        private final RangeIndexBuilder rangeIndexBuilder ;
+    
+        public TupleIndexBuilderStd(RangeIndexBuilder rangeIndexBuilder) {
+            this.rangeIndexBuilder = rangeIndexBuilder ;
+        }
+        
+        @Override
+        public TupleIndex buildTupleIndex(FileSet fileSet, ColumnMap colMap, 
String name, SystemParams params) {
+            RecordFactory recordFactory = new 
RecordFactory(SystemTDB.SizeOfNodeId * colMap.length(), 0) ;
+    
+            RangeIndex rIdx = rangeIndexBuilder.buildRangeIndex(fileSet, 
recordFactory, params) ;
+            TupleIndex tIdx = new TupleIndexRecord(colMap.length(), colMap, 
name, recordFactory, rIdx) ;
+            return tIdx ;
+        }
+    }
+
+    public static class NodeTableBuilderStd implements NodeTableBuilder
+    {
+        private final IndexBuilder indexBuilder ;
+        private final ObjectFileBuilder objectFileBuilder ;
+        
+        public NodeTableBuilderStd(IndexBuilder indexBuilder, 
ObjectFileBuilder objectFileBuilder) {
+            this.indexBuilder = indexBuilder ;
+            this.objectFileBuilder = objectFileBuilder ;
+        }
+    
+        @Override
+        public NodeTable buildNodeTable(FileSet fsIndex, FileSet fsObjectFile, 
SystemParams params) {
+            RecordFactory recordFactory = new 
RecordFactory(SystemTDB.LenNodeHash, SystemTDB.SizeOfNodeId) ;
+            Index idx = indexBuilder.buildIndex(fsIndex, recordFactory, 
params) ;
+            ObjectFile objectFile = 
objectFileBuilder.buildObjectFile(fsObjectFile, Names.extNodeData) ;
+            NodeTable nodeTable = new NodeTableNative(idx, objectFile) ;
+            nodeTable = NodeTableCache.create(nodeTable, 
+                                              params.getNode2NodeIdCacheSize(),
+                                              params.getNodeId2NodeCacheSize(),
+                                              params.getNodeMissCacheSize()) ;
+            nodeTable = NodeTableInline.create(nodeTable) ;
+            return nodeTable ;
+        }
+    }
+
+}
+

Propchange: 
jena/trunk/jena-tdb/src/main/java/com/hp/hpl/jena/tdb/setup/BuilderDB.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Modified: 
jena/trunk/jena-tdb/src/main/java/com/hp/hpl/jena/tdb/setup/BuilderIndex.java
URL: 
http://svn.apache.org/viewvc/jena/trunk/jena-tdb/src/main/java/com/hp/hpl/jena/tdb/setup/BuilderIndex.java?rev=1623074&r1=1623073&r2=1623074&view=diff
==============================================================================
--- 
jena/trunk/jena-tdb/src/main/java/com/hp/hpl/jena/tdb/setup/BuilderIndex.java 
(original)
+++ 
jena/trunk/jena-tdb/src/main/java/com/hp/hpl/jena/tdb/setup/BuilderIndex.java 
Sun Sep  7 17:08:04 2014
@@ -35,8 +35,6 @@ import com.hp.hpl.jena.tdb.sys.Names ;
 /** Building indexes, blockMgr and files */ 
 
 public class BuilderIndex {
-    // XXX NO SYSTEM PARAMS here
-    
     public static class IndexBuilderStd implements IndexBuilder
     {
         protected BlockMgrBuilder bMgrNodes ;

Added: 
jena/trunk/jena-tdb/src/main/java/com/hp/hpl/jena/tdb/setup/DBFactory.java
URL: 
http://svn.apache.org/viewvc/jena/trunk/jena-tdb/src/main/java/com/hp/hpl/jena/tdb/setup/DBFactory.java?rev=1623074&view=auto
==============================================================================
--- jena/trunk/jena-tdb/src/main/java/com/hp/hpl/jena/tdb/setup/DBFactory.java 
(added)
+++ jena/trunk/jena-tdb/src/main/java/com/hp/hpl/jena/tdb/setup/DBFactory.java 
Sun Sep  7 17:08:04 2014
@@ -0,0 +1,35 @@
+/**
+ * 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 com.hp.hpl.jena.tdb.setup;
+
+import com.hp.hpl.jena.tdb.base.file.Location ;
+import com.hp.hpl.jena.tdb.store.nodetable.NodeTable ;
+
+/** Convenience operation to make things
+ * @see BuildIndex
+ */
+public class DBFactory {
+    // c.f. setupTDB
+    // c.f. NodeTableFactory.
+    
+    public static NodeTable buildNodeTable(Location location, SystemParams 
params) {
+        return DatasetBuilderStd.stdBuilder().makeNodeTable(location, params) ;
+    }
+}
+

Propchange: 
jena/trunk/jena-tdb/src/main/java/com/hp/hpl/jena/tdb/setup/DBFactory.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Modified: 
jena/trunk/jena-tdb/src/main/java/com/hp/hpl/jena/tdb/setup/DatasetBuilder.java
URL: 
http://svn.apache.org/viewvc/jena/trunk/jena-tdb/src/main/java/com/hp/hpl/jena/tdb/setup/DatasetBuilder.java?rev=1623074&r1=1623073&r2=1623074&view=diff
==============================================================================
--- 
jena/trunk/jena-tdb/src/main/java/com/hp/hpl/jena/tdb/setup/DatasetBuilder.java 
(original)
+++ 
jena/trunk/jena-tdb/src/main/java/com/hp/hpl/jena/tdb/setup/DatasetBuilder.java 
Sun Sep  7 17:08:04 2014
@@ -29,5 +29,5 @@ public interface DatasetBuilder
      * Build a new Java object for a dataset.
      * Location may already contains files for the state, or may need 
initializing.  
      */
-    public DatasetGraphTDB build(Location location, SystemParams config) ;
+    public DatasetGraphTDB build(Location location) ;
 }

Modified: 
jena/trunk/jena-tdb/src/main/java/com/hp/hpl/jena/tdb/setup/DatasetBuilderBasic.java
URL: 
http://svn.apache.org/viewvc/jena/trunk/jena-tdb/src/main/java/com/hp/hpl/jena/tdb/setup/DatasetBuilderBasic.java?rev=1623074&r1=1623073&r2=1623074&view=diff
==============================================================================
--- 
jena/trunk/jena-tdb/src/main/java/com/hp/hpl/jena/tdb/setup/DatasetBuilderBasic.java
 (original)
+++ 
jena/trunk/jena-tdb/src/main/java/com/hp/hpl/jena/tdb/setup/DatasetBuilderBasic.java
 Sun Sep  7 17:08:04 2014
@@ -93,7 +93,7 @@ public class DatasetBuilderBasic //imple
     {    
         return DatasetBuilderStd.chooseOptimizer(location) ;
     }
-    
+
     protected NodeTable makeNodeTable(Location location, String indexNode2Id, 
String indexId2Node, 
                                       int sizeNode2NodeIdCache, int 
sizeNodeId2NodeCache, int sizeNodeMissCache)
     {

Modified: 
jena/trunk/jena-tdb/src/main/java/com/hp/hpl/jena/tdb/setup/DatasetBuilderStd.java
URL: 
http://svn.apache.org/viewvc/jena/trunk/jena-tdb/src/main/java/com/hp/hpl/jena/tdb/setup/DatasetBuilderStd.java?rev=1623074&r1=1623073&r2=1623074&view=diff
==============================================================================
--- 
jena/trunk/jena-tdb/src/main/java/com/hp/hpl/jena/tdb/setup/DatasetBuilderStd.java
 (original)
+++ 
jena/trunk/jena-tdb/src/main/java/com/hp/hpl/jena/tdb/setup/DatasetBuilderStd.java
 Sun Sep  7 17:08:04 2014
@@ -62,23 +62,35 @@ public class DatasetBuilderStd implement
     private Map<FileRef, BufferChannel> bufferChannels = new HashMap<>() ;
     private Map<FileRef, NodeTable>     nodeTables     = new HashMap<>() ;
 
-    public static DatasetGraphTDB build(Location location) {
-        DatasetBuilderStd x = new DatasetBuilderStd() ;
+    public static DatasetGraphTDB create(Location location) {
+        DatasetBuilderStd x = new 
DatasetBuilderStd(SystemParams.getDftSystemParams()) ;
         x.standardSetup() ;
-        return x.build(location, null) ;
+        return x.build(location) ;
     }
 
-    public static DatasetGraphTDB build() {
-        return build(Location.mem()) ;
+    public static DatasetGraphTDB create() {
+        return create(Location.mem()) ;
     }
 
     public static DatasetBuilderStd stdBuilder() {
-        DatasetBuilderStd x = new DatasetBuilderStd() ;
+        DatasetBuilderStd x = new 
DatasetBuilderStd(SystemParams.getDftSystemParams()) ;
         x.standardSetup() ;
         return x ;
     }
 
-    protected DatasetBuilderStd() {}
+    public static DatasetBuilderStd stdBuilder(SystemParams params) {
+        DatasetBuilderStd x = new DatasetBuilderStd(params) ;
+        x.standardSetup() ;
+        return x ;
+    }
+
+    protected DatasetBuilderStd() {
+        this(SystemParams.getDftSystemParams()) ;
+    }
+
+    protected DatasetBuilderStd(SystemParams params) {
+        this.params = params ;
+    }
 
     // Used by DatasetBuilderTxn
     public DatasetBuilderStd(BlockMgrBuilder blockMgrBuilder, NodeTableBuilder 
nodeTableBuilder) {
@@ -114,10 +126,7 @@ public class DatasetBuilderStd implement
     }
 
     @Override
-    public DatasetGraphTDB build(Location location, SystemParams params) {
-        if ( params == null )
-            params = SystemParams.getDftSystemParams() ;
-
+    public DatasetGraphTDB build(Location location) {
         // Ensure that there is global synchronization
         synchronized (DatasetBuilderStd.class) {
             return _build(location, params, true, null) ;
@@ -126,16 +135,16 @@ public class DatasetBuilderStd implement
 
     // Main engine for building.
     // Called by DatasetBuilderTxn
+    // XXX Rework - provide a cloning constructor (copies maps).
+    // Or "reset"
     public DatasetGraphTDB _build(Location location, SystemParams _params, 
boolean readonly,
                                   ReorderTransformation _transform) {
-        params = _params ;
+        if ( _params != null )
+            params = _params ;
         init(location) ;
         DatasetControl policy = createConcurrencyPolicy() ;
 
-        NodeTable nodeTable = makeNodeTable(location, 
params.getIndexNode2Id(), params.getIndexId2Node(),
-                                            params.getNode2NodeIdCacheSize(), 
params.getNodeId2NodeCacheSize(),
-                                            params.getNodeMissCacheSize()) ;
-
+        NodeTable nodeTable = makeNodeTable(location, params) ;
         TripleTable tripleTable = makeTripleTable(location, nodeTable, policy) 
;
         QuadTable quadTable = makeQuadTable(location, nodeTable, policy) ;
         DatasetPrefixesTDB prefixes = makePrefixTable(location, policy) ;
@@ -212,7 +221,7 @@ public class DatasetBuilderStd implement
         String pnId2Node = params.getPrefixId2Node() ;
 
         // No cache - the prefix mapping is a cache
-        NodeTable prefixNodes = makeNodeTable(location, pnNode2Id, pnId2Node, 
-1, -1, -1) ;
+        NodeTable prefixNodes = makeNodeTableNoCache(location, pnNode2Id, 
pnId2Node) ;
         NodeTupleTable prefixTable = new 
NodeTupleTableConcrete(primary.length(),
                                                                 prefixIndexes,
                                                                 prefixNodes, 
policy) ;
@@ -274,13 +283,30 @@ public class DatasetBuilderStd implement
     }
 
     // ----
-    // XXX Add params
-    protected NodeTable makeNodeTable(Location location, String indexNode2Id, 
String indexId2Node,
-                                      int sizeNode2NodeIdCache, int 
sizeNodeId2NodeCache, int sizeNodeMissCache) {
+    public NodeTable makeNodeTable(Location location, SystemParams params2) {
+        // Note - uses different params.
+        FileSet fsNodeToId = new FileSet(location, params2.getIndexNode2Id()) ;
+        FileSet fsId2Node = new FileSet(location, params2.getIndexId2Node()) ;
+        NodeTable nt = nodeTableBuilder.buildNodeTable(fsNodeToId, fsId2Node, 
params2) ;
+        return nt ;
+    }
+    
+    protected NodeTable makeNodeTableNoCache(Location location, String 
indexNode2Id, String indexId2Node) {
+        return makeNodeTable$(location, indexNode2Id, -1, indexId2Node, -1, 
-1) ;
+    }
+    
+    private NodeTable makeNodeTable$(Location location, 
+                                    String indexNode2Id, int 
sizeNode2NodeIdCache,
+                                    String indexId2Node, int 
sizeNodeId2NodeCache,
+                                    int sizeNodeMissCache) {
         FileSet fsNodeToId = new FileSet(location, indexNode2Id) ;
         FileSet fsId2Node = new FileSet(location, indexId2Node) ;
-        NodeTable nt = nodeTableBuilder.buildNodeTable(fsNodeToId, fsId2Node, 
params) ;
-        return nt ;
+        SystemParamsBuilder spb = new SystemParamsBuilder() ;
+        spb.indexNode2Id(indexNode2Id) ;
+        spb.indexId2Node(indexId2Node) ;
+        spb.node2NodeIdCacheSize(sizeNode2NodeIdCache) ;
+        spb.nodeId2NodeCacheSize(sizeNodeId2NodeCache) ;
+        return makeNodeTable(location, spb.buildParams()) ;
     }
 
     private static void error(Logger log, String msg) {

Modified: 
jena/trunk/jena-tdb/src/main/java/com/hp/hpl/jena/tdb/store/bulkloader2/CmdIndexCopy.java
URL: 
http://svn.apache.org/viewvc/jena/trunk/jena-tdb/src/main/java/com/hp/hpl/jena/tdb/store/bulkloader2/CmdIndexCopy.java?rev=1623074&r1=1623073&r2=1623074&view=diff
==============================================================================
--- 
jena/trunk/jena-tdb/src/main/java/com/hp/hpl/jena/tdb/store/bulkloader2/CmdIndexCopy.java
 (original)
+++ 
jena/trunk/jena-tdb/src/main/java/com/hp/hpl/jena/tdb/store/bulkloader2/CmdIndexCopy.java
 Sun Sep  7 17:08:04 2014
@@ -22,7 +22,6 @@ import static com.hp.hpl.jena.sparql.uti
 
 import java.util.Iterator ;
 
-import org.apache.jena.atlas.lib.Bytes ;
 import org.apache.jena.atlas.lib.Tuple ;
 import org.apache.jena.atlas.logging.LogCtl ;
 import org.apache.jena.atlas.logging.ProgressLogger ;
@@ -31,9 +30,7 @@ import org.slf4j.LoggerFactory ;
 import tdb.cmdline.CmdTDB ;
 
 import com.hp.hpl.jena.tdb.base.file.Location ;
-import com.hp.hpl.jena.tdb.base.record.Record ;
-import com.hp.hpl.jena.tdb.base.record.RecordFactory ;
-import com.hp.hpl.jena.tdb.index.RangeIndex ;
+import com.hp.hpl.jena.tdb.setup.BuildDB ;
 import com.hp.hpl.jena.tdb.store.NodeId ;
 import com.hp.hpl.jena.tdb.store.tupletable.TupleIndex ;
 import com.hp.hpl.jena.tdb.sys.SystemTDB ;
@@ -85,28 +82,11 @@ public class CmdIndexCopy
         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() ;
-        }
+        TupleIndex index1 = BuildDB.openTupleIndex(location1, indexName1, 
primary, indexName1, 10, 10, keyLength, valueLength) ;      
+        TupleIndex index2 = BuildDB.openTupleIndex(location2, indexName2, 
primary, indexOrder, 10, 10, keyLength, valueLength) ;
+        tupleIndexCopy(index1, index2, label) ;
+        index1.close() ;
+        index2.close() ;
     }
 
     private static void tupleIndexCopy(TupleIndex index1, TupleIndex index2, 
String label)
@@ -134,51 +114,6 @@ public class CmdIndexCopy
         print("Total: %,d records : %,.2f seconds : %,.2f records/sec [%s]", 
counter, elapsedSecs, rate, nowAsString()) ;
     }
     
-
-    // ??Fast copy by record.
-    
-    private static void bptCopy(RangeIndex bpt1, RangeIndex bpt2, String label)
-    {
-        ProgressLogger monitor = new ProgressLogger(log, label, tickQuantum, 
superTick) ;
-        monitor.start() ;
-        RecordFactory rf = bpt1.getRecordFactory() ;
-        
-        Iterator<Record> iter1 = bpt1.iterator() ;
-        long counter = 0 ;
-        // Use the same slot each time.
-        Record r2 = rf.create() ;
-        
-        for ( ; iter1.hasNext(); )
-        {
-            counter++ ;
-            Record r = iter1.next() ;
-            byte[] key1 = r.getKey() ;
-            
-            long i1 = Bytes.getLong(key1, 0 ) ;
-            long i2 = Bytes.getLong(key1, 8 ) ;
-            long i3 = Bytes.getLong(key1, 16 ) ;
-            
-            //r2 = rf.create() ;
-            //bpt2.add(r) ;
-            // TESTING: SPO => OSP
-            byte[] key2 = r2.getKey() ;
-            Bytes.setLong(i3, key2, 0) ;
-            Bytes.setLong(i1, key2, 8) ;
-            Bytes.setLong(i2, key2, 16) ;
-            bpt2.add(r2) ;
-            monitor.tick() ;
-        }
-        
-        bpt2.sync() ;
-        long time = monitor.finish() ;
-        float elapsedSecs = time/1000F ;
-        
-        float rate = (elapsedSecs!=0) ? counter/elapsedSecs : 0 ;
-        
-        String str =  String.format("Total: %,d records : %,.2f seconds : 
%,.2f records/sec [%s]", counter, elapsedSecs, rate, nowAsString()) ;
-        log.info(str) ;
-    }
-    
     static private void print(String fmt, Object...args)
     {
         if ( log != null && log.isInfoEnabled() )

Modified: 
jena/trunk/jena-tdb/src/main/java/com/hp/hpl/jena/tdb/store/bulkloader2/CmdNodeTableBuilder.java
URL: 
http://svn.apache.org/viewvc/jena/trunk/jena-tdb/src/main/java/com/hp/hpl/jena/tdb/store/bulkloader2/CmdNodeTableBuilder.java?rev=1623074&r1=1623073&r2=1623074&view=diff
==============================================================================
--- 
jena/trunk/jena-tdb/src/main/java/com/hp/hpl/jena/tdb/store/bulkloader2/CmdNodeTableBuilder.java
 (original)
+++ 
jena/trunk/jena-tdb/src/main/java/com/hp/hpl/jena/tdb/store/bulkloader2/CmdNodeTableBuilder.java
 Sun Sep  7 17:08:04 2014
@@ -134,7 +134,7 @@ public class CmdNodeTableBuilder extends
     {
         // This formats the location correctly.
         // But we're not really interested in it all.
-        DatasetGraphTDB dsg = DatasetBuilderStd.build(location) ;
+        DatasetGraphTDB dsg = DatasetBuilderStd.create(location) ;
         
         // so close indexes and the prefix table.
         dsg.getTripleTable().getNodeTupleTable().getTupleTable().close();

Modified: 
jena/trunk/jena-tdb/src/main/java/com/hp/hpl/jena/tdb/store/nodetable/NodeTableFactory.java
URL: 
http://svn.apache.org/viewvc/jena/trunk/jena-tdb/src/main/java/com/hp/hpl/jena/tdb/store/nodetable/NodeTableFactory.java?rev=1623074&r1=1623073&r2=1623074&view=diff
==============================================================================
--- 
jena/trunk/jena-tdb/src/main/java/com/hp/hpl/jena/tdb/store/nodetable/NodeTableFactory.java
 (original)
+++ 
jena/trunk/jena-tdb/src/main/java/com/hp/hpl/jena/tdb/store/nodetable/NodeTableFactory.java
 Sun Sep  7 17:08:04 2014
@@ -23,7 +23,7 @@ import com.hp.hpl.jena.tdb.base.file.Fil
 import com.hp.hpl.jena.tdb.base.file.Location ;
 import com.hp.hpl.jena.tdb.base.objectfile.ObjectFile ;
 import com.hp.hpl.jena.tdb.index.Index ;
-import com.hp.hpl.jena.tdb.setup.B ;
+import com.hp.hpl.jena.tdb.setup.BuildIndex ;
 import com.hp.hpl.jena.tdb.setup.IndexBuilder ;
 import com.hp.hpl.jena.tdb.setup.SystemParams ;
 import com.hp.hpl.jena.tdb.sys.Names ;
@@ -81,6 +81,6 @@ public class NodeTableFactory
     }
 
     public static NodeTable createMem() {
-        return create(B.createIndexBuilderMem(), FileSet.mem(), FileSet.mem(), 
SystemParams.getDftSystemParams()) ;
+        return create(BuildIndex.createIndexBuilderMem(), FileSet.mem(), 
FileSet.mem(), SystemParams.getDftSystemParams()) ;
     }
 }

Modified: 
jena/trunk/jena-tdb/src/main/java/com/hp/hpl/jena/tdb/sys/DebugTDB.java
URL: 
http://svn.apache.org/viewvc/jena/trunk/jena-tdb/src/main/java/com/hp/hpl/jena/tdb/sys/DebugTDB.java?rev=1623074&r1=1623073&r2=1623074&view=diff
==============================================================================
--- jena/trunk/jena-tdb/src/main/java/com/hp/hpl/jena/tdb/sys/DebugTDB.java 
(original)
+++ jena/trunk/jena-tdb/src/main/java/com/hp/hpl/jena/tdb/sys/DebugTDB.java Sun 
Sep  7 17:08:04 2014
@@ -78,7 +78,7 @@ public class DebugTDB
     public static void dumpNodeIndex(String dir)
     {
         Location location = new Location(dir) ;
-        Index nodeToId = SetupTDB.makeIndex(location,  Names.indexNode2Id, 
SystemTDB.LenNodeHash, SystemTDB.SizeOfNodeId, -1 ,-1) ;
+        Index nodeToId = SetupTDB.makeIndex(location, Names.indexNode2Id, 
SystemTDB.BlockSize, SystemTDB.LenNodeHash, SystemTDB.SizeOfNodeId, -1 ,-1) ;
         for ( Record aNodeToId : nodeToId )
         {
             System.out.println( aNodeToId );

Modified: 
jena/trunk/jena-tdb/src/main/java/com/hp/hpl/jena/tdb/sys/SetupTDB.java
URL: 
http://svn.apache.org/viewvc/jena/trunk/jena-tdb/src/main/java/com/hp/hpl/jena/tdb/sys/SetupTDB.java?rev=1623074&r1=1623073&r2=1623074&view=diff
==============================================================================
--- jena/trunk/jena-tdb/src/main/java/com/hp/hpl/jena/tdb/sys/SetupTDB.java 
(original)
+++ jena/trunk/jena-tdb/src/main/java/com/hp/hpl/jena/tdb/sys/SetupTDB.java Sun 
Sep  7 17:08:04 2014
@@ -18,10 +18,7 @@
 
 package com.hp.hpl.jena.tdb.sys ;
 
-import static com.hp.hpl.jena.tdb.sys.SystemTDB.LenNodeHash ;
-import static com.hp.hpl.jena.tdb.sys.SystemTDB.SizeOfNodeId ;
 import org.apache.jena.atlas.lib.ColumnMap ;
-import org.apache.jena.atlas.lib.StrUtils ;
 import org.slf4j.Logger ;
 
 import com.hp.hpl.jena.tdb.TDB ;
@@ -37,12 +34,8 @@ import com.hp.hpl.jena.tdb.index.Index ;
 import com.hp.hpl.jena.tdb.index.RangeIndex ;
 import com.hp.hpl.jena.tdb.index.bplustree.BPlusTree ;
 import com.hp.hpl.jena.tdb.index.bplustree.BPlusTreeParams ;
-import com.hp.hpl.jena.tdb.setup.DatasetBuilderStd ;
 import com.hp.hpl.jena.tdb.setup.SystemParams ;
-import com.hp.hpl.jena.tdb.store.* ;
-import com.hp.hpl.jena.tdb.store.nodetable.* ;
-import com.hp.hpl.jena.tdb.store.nodetupletable.NodeTupleTable ;
-import com.hp.hpl.jena.tdb.store.nodetupletable.NodeTupleTableConcrete ;
+import com.hp.hpl.jena.tdb.store.NodeId ;
 import com.hp.hpl.jena.tdb.store.tupletable.TupleIndex ;
 import com.hp.hpl.jena.tdb.store.tupletable.TupleIndexRecord ;
 
@@ -63,71 +56,71 @@ public class SetupTDB
 
     private static SystemParams params = SystemParams.getDftSystemParams() ;
 
-    // And here we make datasets ... 
-    public static DatasetGraphTDB buildDataset(Location location)
-    {
-        return DatasetBuilderStd.build(location) ;
-    }
-
-    //protected static DatasetControl createConcurrencyPolicy() { return new 
DatasetControlMRSW() ; }
-    
-    public static TripleTable makeTripleTable(Location location, NodeTable 
nodeTable, String dftPrimary, String[] dftIndexes, DatasetControl policy)
-    {
-        String primary = Names.primaryIndexTriples ;
-        String indexes[] = Names.tripleIndexes ;
-        
-        if ( indexes.length != 3 )
-            error(log, "Wrong number of triple table indexes: 
"+StrUtils.strjoin(",", indexes)) ;
-        log.debug("Triple table: "+primary+" :: "+StrUtils.strjoin(",", 
indexes)) ;
-        
-        TupleIndex tripleIndexes[] = makeTupleIndexes(location, primary, 
indexes, indexes) ;
-        if ( tripleIndexes.length != indexes.length )
-            error(log, "Wrong number of triple table tuples indexes: 
"+tripleIndexes.length) ;
-        TripleTable tripleTable = new TripleTable(tripleIndexes, nodeTable, 
policy) ;
-        return tripleTable ;
-    }
-    
-    public static QuadTable makeQuadTable(Location location, NodeTable 
nodeTable, String dftPrimary, String[] dftIndexes, DatasetControl policy)
-    {
-        String primary = Names.primaryIndexQuads ;
-        String indexes[] = Names.quadIndexes ;
-
-        if ( indexes.length != 6 )
-            error(log, "Wrong number of quad table indexes: 
"+StrUtils.strjoin(",", indexes)) ;
-        log.debug("Quad table: "+primary+" :: "+StrUtils.strjoin(",", 
indexes)) ;
-        
-        TupleIndex quadIndexes[] = makeTupleIndexes(location, primary, 
indexes, indexes) ;
-        if ( quadIndexes.length != indexes.length )
-            error(log, "Wrong number of quad table tuples indexes: 
"+quadIndexes.length) ;
-        QuadTable quadTable = new QuadTable(quadIndexes, nodeTable, policy) ;
-        return quadTable ;
-    }
-
-
-    public static DatasetPrefixesTDB makePrefixes(Location location, 
DatasetControl policy)
-    {
-        // The index using for Graph+Prefix => URI
-        String indexPrefixes = params.getIndexPrefix() ;
-        String primary = params.getPrimaryIndexPrefix() ;
-        String indexes[] = params.getPrefixIndexes() ;
-        
-        TupleIndex prefixIndexes[] = makeTupleIndexes(location, primary, 
indexes, new String[]{indexPrefixes}) ;
-        if ( prefixIndexes.length != indexes.length )
-            error(log, "Wrong number of triple table tuples indexes: 
"+prefixIndexes.length) ;
-        
-        // The nodetable.
-        String pnNode2Id = params.getPrefixNode2Id() ;
-        String pnId2Node = params.getPrefixId2Node() ;
-        
-        // No cache - the prefix mapping is a cache
-        NodeTable prefixNodes = makeNodeTable(location, pnNode2Id, -1, 
pnId2Node, -1, -1)  ;
-        NodeTupleTable prefixTable = new 
NodeTupleTableConcrete(primary.length(),
-                                                                prefixIndexes,
-                                                                prefixNodes, 
policy) ;
-        DatasetPrefixesTDB prefixes = new DatasetPrefixesTDB(prefixTable) ; 
-        log.debug("Prefixes: "+StrUtils.strjoin(", ", indexes)) ;
-        return prefixes ;
-    }
+//    // And here we make datasets ... 
+//    public static DatasetGraphTDB buildDataset(Location location)
+//    {
+//        return DatasetBuilderStd.build(location) ;
+//    }
+//
+//    //protected static DatasetControl createConcurrencyPolicy() { return new 
DatasetControlMRSW() ; }
+//    
+//    public static TripleTable makeTripleTable(Location location, NodeTable 
nodeTable, String dftPrimary, String[] dftIndexes, DatasetControl policy)
+//    {
+//        String primary = Names.primaryIndexTriples ;
+//        String indexes[] = Names.tripleIndexes ;
+//        
+//        if ( indexes.length != 3 )
+//            error(log, "Wrong number of triple table indexes: 
"+StrUtils.strjoin(",", indexes)) ;
+//        log.debug("Triple table: "+primary+" :: "+StrUtils.strjoin(",", 
indexes)) ;
+//        
+//        TupleIndex tripleIndexes[] = makeTupleIndexes(location, primary, 
indexes, indexes) ;
+//        if ( tripleIndexes.length != indexes.length )
+//            error(log, "Wrong number of triple table tuples indexes: 
"+tripleIndexes.length) ;
+//        TripleTable tripleTable = new TripleTable(tripleIndexes, nodeTable, 
policy) ;
+//        return tripleTable ;
+//    }
+//    
+//    public static QuadTable makeQuadTable(Location location, NodeTable 
nodeTable, String dftPrimary, String[] dftIndexes, DatasetControl policy)
+//    {
+//        String primary = Names.primaryIndexQuads ;
+//        String indexes[] = Names.quadIndexes ;
+//
+//        if ( indexes.length != 6 )
+//            error(log, "Wrong number of quad table indexes: 
"+StrUtils.strjoin(",", indexes)) ;
+//        log.debug("Quad table: "+primary+" :: "+StrUtils.strjoin(",", 
indexes)) ;
+//        
+//        TupleIndex quadIndexes[] = makeTupleIndexes(location, primary, 
indexes, indexes) ;
+//        if ( quadIndexes.length != indexes.length )
+//            error(log, "Wrong number of quad table tuples indexes: 
"+quadIndexes.length) ;
+//        QuadTable quadTable = new QuadTable(quadIndexes, nodeTable, policy) ;
+//        return quadTable ;
+//    }
+//
+//
+//    public static DatasetPrefixesTDB makePrefixes(Location location, 
DatasetControl policy)
+//    {
+//        // The index using for Graph+Prefix => URI
+//        String indexPrefixes = params.getIndexPrefix() ;
+//        String primary = params.getPrimaryIndexPrefix() ;
+//        String indexes[] = params.getPrefixIndexes() ;
+//        
+//        TupleIndex prefixIndexes[] = makeTupleIndexes(location, primary, 
indexes, new String[]{indexPrefixes}) ;
+//        if ( prefixIndexes.length != indexes.length )
+//            error(log, "Wrong number of triple table tuples indexes: 
"+prefixIndexes.length) ;
+//        
+//        // The nodetable.
+//        String pnNode2Id = params.getPrefixNode2Id() ;
+//        String pnId2Node = params.getPrefixId2Node() ;
+//        
+//        // No cache - the prefix mapping is a cache
+//        NodeTable prefixNodes = makeNodeTable(location, pnNode2Id, -1, 
pnId2Node, -1, -1)  ;
+//        NodeTupleTable prefixTable = new 
NodeTupleTableConcrete(primary.length(),
+//                                                                
prefixIndexes,
+//                                                                prefixNodes, 
policy) ;
+//        DatasetPrefixesTDB prefixes = new DatasetPrefixesTDB(prefixTable) ; 
+//        log.debug("Prefixes: "+StrUtils.strjoin(", ", indexes)) ;
+//        return prefixes ;
+//    }
 
     public static TupleIndex[] makeTupleIndexes(Location location, String 
primary, String[] descs, String[] filenames)
     {
@@ -150,37 +143,35 @@ public class SetupTDB
         int writeCacheSize = params.getBlockWriteCacheSize() ;
         
         // Value part is null (zero length)
-        RangeIndex rIndex = makeRangeIndex(location, indexName, keyLength, 0, 
readCacheSize, writeCacheSize) ;
+        RangeIndex rIndex = makeRangeIndex(location, indexName, 
params.getBlockSize(), keyLength, 0, readCacheSize, writeCacheSize) ;
         TupleIndex tupleIndex = new TupleIndexRecord(primary.length(), new 
ColumnMap(primary, indexOrder), indexOrder, rIndex.getRecordFactory(), rIndex) ;
         return tupleIndex ;
     }
     
-    public static Index makeIndex(Location location, String indexName, 
+    
+    public static Index makeIndex(Location location, String indexName,
+                                  int blkSize,
                                   int dftKeyLength, int dftValueLength, 
                                   int readCacheSize,int writeCacheSize)
     {
-        return makeRangeIndex(location, indexName, dftKeyLength, 
dftValueLength, readCacheSize, writeCacheSize) ;
+        return makeRangeIndex(location, indexName, blkSize, dftKeyLength, 
dftValueLength, readCacheSize, writeCacheSize) ;
     }
     
     public static RangeIndex makeRangeIndex(Location location, String 
indexName, 
+                                            int blkSize,
                                              int dftKeyLength, int 
dftValueLength,
                                              int readCacheSize,int 
writeCacheSize)
     {
          FileSet fs = new FileSet(location, indexName) ;
-         RangeIndex rIndex =  makeBPlusTree(fs, readCacheSize, writeCacheSize, 
dftKeyLength, dftValueLength) ;
+         RangeIndex rIndex =  makeBPlusTree(fs, blkSize, readCacheSize, 
writeCacheSize, dftKeyLength, dftValueLength) ;
          return rIndex ;
     }
     
-    public static RangeIndex makeBPlusTree(FileSet fs, 
+    public static RangeIndex makeBPlusTree(FileSet fs, int blkSize,
                                            int readCacheSize, int 
writeCacheSize,
                                            int dftKeyLength, int 
dftValueLength)
     {
         RecordFactory recordFactory = makeRecordFactory(dftKeyLength, 
dftValueLength) ;
-        int blkSize = params.getBlockSize() ;
-        
-        // IndexBuilder.getBPlusTree().newRangeIndex(fs, recordFactory) ;
-        // Does not set order.
-        
         int order = BPlusTreeParams.calcOrder(blkSize, 
recordFactory.recordLength()) ;
         RangeIndex rIndex = createBPTree(fs, order, blkSize, readCacheSize, 
writeCacheSize, recordFactory) ;
         return rIndex ;
@@ -190,50 +181,52 @@ public class SetupTDB
     {
         return new RecordFactory(keyLen, valueLen) ;
     }
+//    
+//    /** Make a NodeTable without cache and inline wrappers */ 
+//    public static NodeTable makeNodeTableBase(Location location, String 
indexNode2Id, String indexId2Node)
+//    {
+//        if (location.isMem()) 
+//            return NodeTableFactory.createMem() ;
+//
+//        // -- make id to node mapping -- Names.indexId2Node
+//        FileSet fsIdToNode = new FileSet(location, indexId2Node) ;
+//        
+//        ObjectFile stringFile = makeObjectFile(fsIdToNode) ;
+//        
+//        // -- 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 ;
+//    }
+//
+//    /** Make a NodeTable with cache and inline wrappers */ 
+//    public static NodeTable makeNodeTable(Location location)
+//    {
+//        return makeNodeTable(location,
+//                             Names.indexNode2Id, 
SystemTDB.Node2NodeIdCacheSize,
+//                             Names.indexId2Node, 
SystemTDB.NodeId2NodeCacheSize,
+//                             SystemTDB.NodeMissCacheSize) ;
+//    }
+//
+//    /** Make a NodeTable with cache and inline wrappers */ 
+//    public static NodeTable makeNodeTable(Location location,
+//                                          String indexNode2Id, int 
nodeToIdCacheSize,
+//                                          String indexId2Node, int 
idToNodeCacheSize,
+//                                          int nodeMissCacheSize)
+//    {
+//        NodeTable nodeTable = makeNodeTableBase(location, indexNode2Id, 
indexId2Node) ;
+//        nodeTable = NodeTableCache.create(nodeTable, nodeToIdCacheSize, 
idToNodeCacheSize, nodeMissCacheSize) ; 
+//        nodeTable = NodeTableInline.create(nodeTable) ;
+//        return nodeTable ;
+//    }
+//
     
-    /** Make a NodeTable without cache and inline wrappers */ 
-    public static NodeTable makeNodeTableBase(Location location, String 
indexNode2Id, String indexId2Node)
-    {
-        if (location.isMem()) 
-            return NodeTableFactory.createMem() ;
-
-        // -- make id to node mapping -- Names.indexId2Node
-        FileSet fsIdToNode = new FileSet(location, indexId2Node) ;
-        
-        ObjectFile stringFile = makeObjectFile(fsIdToNode) ;
-        
-        // -- 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 ;
-    }
-
-    /** Make a NodeTable with cache and inline wrappers */ 
-    public static NodeTable makeNodeTable(Location location)
-    {
-        return makeNodeTable(location,
-                             Names.indexNode2Id, 
SystemTDB.Node2NodeIdCacheSize,
-                             Names.indexId2Node, 
SystemTDB.NodeId2NodeCacheSize,
-                             SystemTDB.NodeMissCacheSize) ;
-    }
-
-    /** Make a NodeTable with cache and inline wrappers */ 
-    public static NodeTable makeNodeTable(Location location,
-                                          String indexNode2Id, int 
nodeToIdCacheSize,
-                                          String indexId2Node, int 
idToNodeCacheSize,
-                                          int nodeMissCacheSize)
-    {
-        NodeTable nodeTable = makeNodeTableBase(location, indexNode2Id, 
indexId2Node) ;
-        nodeTable = NodeTableCache.create(nodeTable, nodeToIdCacheSize, 
idToNodeCacheSize, nodeMissCacheSize) ; 
-        nodeTable = NodeTableInline.create(nodeTable) ;
-        return nodeTable ;
-    }
-
+    // XXX Move to FileFactory
     public static ObjectFile makeObjectFile(FileSet fsIdToNode)
     {
         String filename = fsIdToNode.filename(Names.extNodeData) ;

Modified: 
jena/trunk/jena-tdb/src/main/java/com/hp/hpl/jena/tdb/sys/TDBMaker.java
URL: 
http://svn.apache.org/viewvc/jena/trunk/jena-tdb/src/main/java/com/hp/hpl/jena/tdb/sys/TDBMaker.java?rev=1623074&r1=1623073&r2=1623074&view=diff
==============================================================================
--- jena/trunk/jena-tdb/src/main/java/com/hp/hpl/jena/tdb/sys/TDBMaker.java 
(original)
+++ jena/trunk/jena-tdb/src/main/java/com/hp/hpl/jena/tdb/sys/TDBMaker.java Sun 
Sep  7 17:08:04 2014
@@ -90,7 +90,7 @@ public class TDBMaker
         @Override
         public DatasetGraphTDB createDatasetGraph(Location location)
         {
-            return DatasetBuilderStd.build(location) ;
+            return DatasetBuilderStd.create(location) ;
         }
     }
     

Modified: jena/trunk/jena-tdb/src/main/java/tdb/CmdRewriteIndex.java
URL: 
http://svn.apache.org/viewvc/jena/trunk/jena-tdb/src/main/java/tdb/CmdRewriteIndex.java?rev=1623074&r1=1623073&r2=1623074&view=diff
==============================================================================
--- jena/trunk/jena-tdb/src/main/java/tdb/CmdRewriteIndex.java (original)
+++ jena/trunk/jena-tdb/src/main/java/tdb/CmdRewriteIndex.java Sun Sep  7 
17:08:04 2014
@@ -106,9 +106,8 @@ public class CmdRewriteIndex
         BlockMgr blkMgrNodes ;
         BlockMgr blkMgrRecords ;
         int blockSize = SystemTDB.BlockSize ;
-        Iterator<Record> iterator ;
         
-        RangeIndex rangeIndex = SetupTDB.makeRangeIndex(srcLoc, indexName, 
dftKeyLength, dftValueLength, readCacheSize, writeCacheSize) ;
+        RangeIndex rangeIndex = SetupTDB.makeRangeIndex(srcLoc, indexName, 
blockSize, dftKeyLength, dftValueLength, readCacheSize, writeCacheSize) ;
         BPlusTree bpt = (BPlusTree)rangeIndex ;
         bptParams = bpt.getParams() ;
         recordFactory = bpt.getRecordFactory() ;
@@ -119,7 +118,7 @@ public class CmdRewriteIndex
         blkMgrNodes = BlockMgrFactory.create(destination, Names.bptExtTree, 
blockSizeNodes, readCacheSize, writeCacheSize) ;
         blkMgrRecords = BlockMgrFactory.create(destination, 
Names.bptExtRecords, blockSizeRecords, readCacheSize, writeCacheSize) ;
 
-        iterator = bpt.iterator() ;
+        Iterator<Record>  iterator = bpt.iterator() ;
             
 //            // Fakery.
 //            blkMgrNodes = BlockMgrFactory.create(destination, Names.bptExt1, 
blockSize, readCacheSize, writeCacheSize) ;

Modified: jena/trunk/jena-tdb/src/main/java/tdb/tdbconfig.java
URL: 
http://svn.apache.org/viewvc/jena/trunk/jena-tdb/src/main/java/tdb/tdbconfig.java?rev=1623074&r1=1623073&r2=1623074&view=diff
==============================================================================
--- jena/trunk/jena-tdb/src/main/java/tdb/tdbconfig.java (original)
+++ jena/trunk/jena-tdb/src/main/java/tdb/tdbconfig.java Sun Sep  7 17:08:04 
2014
@@ -37,11 +37,11 @@ import com.hp.hpl.jena.tdb.TDB ;
 import com.hp.hpl.jena.tdb.base.file.FileFactory ;
 import com.hp.hpl.jena.tdb.base.file.Location ;
 import com.hp.hpl.jena.tdb.base.objectfile.StringFile ;
+import com.hp.hpl.jena.tdb.setup.BuildDB ;
 import com.hp.hpl.jena.tdb.solver.stats.Stats ;
 import com.hp.hpl.jena.tdb.solver.stats.StatsResults ;
 import com.hp.hpl.jena.tdb.store.DatasetGraphTDB ;
 import com.hp.hpl.jena.tdb.sys.DatasetControlNone ;
-import com.hp.hpl.jena.tdb.sys.SetupTDB ;
 
 /** Tools to manage a TDB store.  Subcommand based. */
 public class tdbconfig extends CmdSub
@@ -106,7 +106,7 @@ public class tdbconfig extends CmdSub
         protected void exec()
         {
             Location location = getLocation() ;
-            DatasetPrefixStorage prefixes = SetupTDB.makePrefixes(location, 
new DatasetControlNone()) ;
+            DatasetPrefixStorage prefixes = BuildDB.makePrefixes(location, new 
DatasetControlNone()) ;
             for ( String gn : prefixes.graphNames() )
             {
                 System.out.println("Graph: "+gn) ;

Modified: jena/trunk/jena-tdb/src/main/java/tdb/tools/dumpbpt.java
URL: 
http://svn.apache.org/viewvc/jena/trunk/jena-tdb/src/main/java/tdb/tools/dumpbpt.java?rev=1623074&r1=1623073&r2=1623074&view=diff
==============================================================================
--- jena/trunk/jena-tdb/src/main/java/tdb/tools/dumpbpt.java (original)
+++ jena/trunk/jena-tdb/src/main/java/tdb/tools/dumpbpt.java Sun Sep  7 
17:08:04 2014
@@ -32,10 +32,11 @@ import arq.cmdline.CmdGeneral ;
 import com.hp.hpl.jena.sparql.util.Utils ;
 import com.hp.hpl.jena.tdb.base.file.Location ;
 import com.hp.hpl.jena.tdb.base.record.Record ;
+import com.hp.hpl.jena.tdb.base.record.RecordFactory ;
 import com.hp.hpl.jena.tdb.index.RangeIndex ;
 import com.hp.hpl.jena.tdb.index.bplustree.BPlusTree ;
+import com.hp.hpl.jena.tdb.setup.BuildIndex ;
 import com.hp.hpl.jena.tdb.store.NodeId ;
-import com.hp.hpl.jena.tdb.store.bulkloader2.IndexFactory ;
 import com.hp.hpl.jena.tdb.store.tupletable.TupleIndex ;
 import com.hp.hpl.jena.tdb.store.tupletable.TupleIndexRecord ;
 import com.hp.hpl.jena.tdb.sys.Names ;
@@ -112,10 +113,8 @@ public class dumpbpt extends CmdGeneral
             int valueLength = 0 ;
             
             
-            RangeIndex rIndex = IndexFactory.openBPT(loc, indexName, 
-                                                     
SystemTDB.BlockReadCacheSize,
-                                                     
SystemTDB.BlockWriteCacheSize,
-                                                     keyLength, valueLength) ;
+            RecordFactory rf = new RecordFactory(keyLength, valueLength) ;
+            RangeIndex rIndex = BuildIndex.buildRangeIndex(loc, indexName, rf) 
;
             BPlusTree bpt = (BPlusTree)rIndex ;
             
             if ( false )

Modified: jena/trunk/jena-tdb/src/main/java/tdb/tools/dumpnodetable.java
URL: 
http://svn.apache.org/viewvc/jena/trunk/jena-tdb/src/main/java/tdb/tools/dumpnodetable.java?rev=1623074&r1=1623073&r2=1623074&view=diff
==============================================================================
--- jena/trunk/jena-tdb/src/main/java/tdb/tools/dumpnodetable.java (original)
+++ jena/trunk/jena-tdb/src/main/java/tdb/tools/dumpnodetable.java Sun Sep  7 
17:08:04 2014
@@ -36,11 +36,11 @@ import com.hp.hpl.jena.sparql.util.FmtUt
 import com.hp.hpl.jena.sparql.util.Utils ;
 import com.hp.hpl.jena.tdb.StoreConnection ;
 import com.hp.hpl.jena.tdb.base.file.Location ;
+import com.hp.hpl.jena.tdb.setup.BuildDB ;
 import com.hp.hpl.jena.tdb.store.DatasetGraphTDB ;
 import com.hp.hpl.jena.tdb.store.NodeId ;
 import com.hp.hpl.jena.tdb.store.nodetable.NodeTable ;
 import com.hp.hpl.jena.tdb.sys.Names ;
-import com.hp.hpl.jena.tdb.sys.SetupTDB ;
 import com.hp.hpl.jena.tdb.sys.SystemTDB ;
 
 public class dumpnodetable extends CmdGeneral
@@ -89,10 +89,10 @@ public class dumpnodetable extends CmdGe
 
                             int sizeNodeMissCacheSize)
     {
-        NodeTable nodeTable = SetupTDB.makeNodeTable(new Location(location), 
-                                                     indexNode2Id, 
node2NodeIdCacheSize,
-                                                     indexId2Node, 
nodeId2NodeCacheSize,
-                                                     sizeNodeMissCacheSize) ;
+        NodeTable nodeTable = BuildDB.makeNodeTable(new Location(location), 
+                                                    indexNode2Id, 
node2NodeIdCacheSize,
+                                                    indexId2Node, 
nodeId2NodeCacheSize,
+                                                    sizeNodeMissCacheSize) ;
     }
     
     

Modified: 
jena/trunk/jena-tdb/src/test/java/com/hp/hpl/jena/tdb/graph/TestPrefixMappingTDB.java
URL: 
http://svn.apache.org/viewvc/jena/trunk/jena-tdb/src/test/java/com/hp/hpl/jena/tdb/graph/TestPrefixMappingTDB.java?rev=1623074&r1=1623073&r2=1623074&view=diff
==============================================================================
--- 
jena/trunk/jena-tdb/src/test/java/com/hp/hpl/jena/tdb/graph/TestPrefixMappingTDB.java
 (original)
+++ 
jena/trunk/jena-tdb/src/test/java/com/hp/hpl/jena/tdb/graph/TestPrefixMappingTDB.java
 Sun Sep  7 17:08:04 2014
@@ -31,10 +31,10 @@ import com.hp.hpl.jena.tdb.StoreConnecti
 import com.hp.hpl.jena.tdb.TDB ;
 import com.hp.hpl.jena.tdb.TDBFactory ;
 import com.hp.hpl.jena.tdb.base.file.Location ;
+import com.hp.hpl.jena.tdb.setup.BuildDB ;
 import com.hp.hpl.jena.tdb.store.DatasetPrefixesTDB ;
 import com.hp.hpl.jena.tdb.sys.DatasetControl ;
 import com.hp.hpl.jena.tdb.sys.DatasetControlMRSW ;
-import com.hp.hpl.jena.tdb.sys.SetupTDB ;
 import com.hp.hpl.jena.tdb.sys.SystemTDB ;
 
 public class TestPrefixMappingTDB extends AbstractTestPrefixMapping2
@@ -59,7 +59,7 @@ public class TestPrefixMappingTDB extend
     }
     
     static DatasetPrefixesTDB createTesting(Location location, DatasetControl 
policy) {
-        return SetupTDB.makePrefixes(location, policy) ;
+        return BuildDB.makePrefixes(location, policy) ;
     }
 
     @Override

Modified: 
jena/trunk/jena-tdb/src/test/java/com/hp/hpl/jena/tdb/store/TestTripleTable.java
URL: 
http://svn.apache.org/viewvc/jena/trunk/jena-tdb/src/test/java/com/hp/hpl/jena/tdb/store/TestTripleTable.java?rev=1623074&r1=1623073&r2=1623074&view=diff
==============================================================================
--- 
jena/trunk/jena-tdb/src/test/java/com/hp/hpl/jena/tdb/store/TestTripleTable.java
 (original)
+++ 
jena/trunk/jena-tdb/src/test/java/com/hp/hpl/jena/tdb/store/TestTripleTable.java
 Sun Sep  7 17:08:04 2014
@@ -127,7 +127,7 @@ public class TestTripleTable extends Bas
     
     private TripleTable createTripleTableMem()
     {
-        DatasetGraphTDB ds = DatasetBuilderStd.build(Location.mem()) ; 
+        DatasetGraphTDB ds = DatasetBuilderStd.create(Location.mem()) ; 
         return ds.getTripleTable() ;
     }
 }

Modified: 
jena/trunk/jena-tdb/src/test/java/com/hp/hpl/jena/tdb/store/nodetable/TestNodeTable.java
URL: 
http://svn.apache.org/viewvc/jena/trunk/jena-tdb/src/test/java/com/hp/hpl/jena/tdb/store/nodetable/TestNodeTable.java?rev=1623074&r1=1623073&r2=1623074&view=diff
==============================================================================
--- 
jena/trunk/jena-tdb/src/test/java/com/hp/hpl/jena/tdb/store/nodetable/TestNodeTable.java
 (original)
+++ 
jena/trunk/jena-tdb/src/test/java/com/hp/hpl/jena/tdb/store/nodetable/TestNodeTable.java
 Sun Sep  7 17:08:04 2014
@@ -19,15 +19,14 @@
 package com.hp.hpl.jena.tdb.store.nodetable;
 
 import com.hp.hpl.jena.tdb.base.file.Location ;
-import com.hp.hpl.jena.tdb.store.nodetable.NodeTable ;
+import com.hp.hpl.jena.tdb.setup.BuildDB ;
 import com.hp.hpl.jena.tdb.sys.Names ;
-import com.hp.hpl.jena.tdb.sys.SetupTDB ;
 
 public class TestNodeTable extends AbstractTestNodeTable
 {
     @Override
     protected NodeTable createEmptyNodeTable()
     {
-        return SetupTDB.makeNodeTable(Location.mem(), Names.indexNode2Id, 10, 
Names.indexId2Node, 10, 10) ;
+        return BuildDB.makeNodeTable(Location.mem(), Names.indexNode2Id, 10, 
Names.indexId2Node, 10, 10) ;
     }
 }

Modified: 
jena/trunk/jena-tdb/src/test/java/com/hp/hpl/jena/tdb/store/nodetable/TestNodeTableStored.java
URL: 
http://svn.apache.org/viewvc/jena/trunk/jena-tdb/src/test/java/com/hp/hpl/jena/tdb/store/nodetable/TestNodeTableStored.java?rev=1623074&r1=1623073&r2=1623074&view=diff
==============================================================================
--- 
jena/trunk/jena-tdb/src/test/java/com/hp/hpl/jena/tdb/store/nodetable/TestNodeTableStored.java
 (original)
+++ 
jena/trunk/jena-tdb/src/test/java/com/hp/hpl/jena/tdb/store/nodetable/TestNodeTableStored.java
 Sun Sep  7 17:08:04 2014
@@ -19,15 +19,14 @@
 package com.hp.hpl.jena.tdb.store.nodetable;
 
 import com.hp.hpl.jena.tdb.base.file.Location ;
-import com.hp.hpl.jena.tdb.store.nodetable.NodeTable ;
-import com.hp.hpl.jena.tdb.sys.Names ;
-import com.hp.hpl.jena.tdb.sys.SetupTDB ;
+import com.hp.hpl.jena.tdb.setup.BuildDB ;
+
 
 public class TestNodeTableStored extends AbstractTestNodeTable
 {
     @Override
     protected NodeTable createEmptyNodeTable()
     {
-        return SetupTDB.makeNodeTableBase(Location.mem(), Names.indexNode2Id, 
Names.indexId2Node) ;
+        return BuildDB.makeNodeTable(Location.mem()) ;
     }
 }

Modified: 
jena/trunk/jena-tdb/src/test/java/com/hp/hpl/jena/tdb/store/tupletable/TestTupleIndexRecord.java
URL: 
http://svn.apache.org/viewvc/jena/trunk/jena-tdb/src/test/java/com/hp/hpl/jena/tdb/store/tupletable/TestTupleIndexRecord.java?rev=1623074&r1=1623073&r2=1623074&view=diff
==============================================================================
--- 
jena/trunk/jena-tdb/src/test/java/com/hp/hpl/jena/tdb/store/tupletable/TestTupleIndexRecord.java
 (original)
+++ 
jena/trunk/jena-tdb/src/test/java/com/hp/hpl/jena/tdb/store/tupletable/TestTupleIndexRecord.java
 Sun Sep  7 17:08:04 2014
@@ -26,7 +26,7 @@ import com.hp.hpl.jena.tdb.base.record.R
 import com.hp.hpl.jena.tdb.index.AbstractTestTupleIndex ;
 import com.hp.hpl.jena.tdb.index.IndexParams ;
 import com.hp.hpl.jena.tdb.index.RangeIndex ;
-import com.hp.hpl.jena.tdb.setup.B ;
+import com.hp.hpl.jena.tdb.setup.BuildIndex ;
 import com.hp.hpl.jena.tdb.setup.SystemParams ;
 import com.hp.hpl.jena.tdb.sys.SystemTDB ;
 
@@ -38,7 +38,7 @@ public class TestTupleIndexRecord extend
     protected TupleIndexRecord create(String description)
     {
         IndexParams indexParams = SystemParams.getDftSystemParams() ; 
-        RangeIndex rIdx = B.buildRangeIndex(FileSet.mem(), factory, 
indexParams) ;
+        RangeIndex rIdx = BuildIndex.buildRangeIndex(FileSet.mem(), factory, 
indexParams) ;
         ColumnMap cmap = new ColumnMap("SPO", description) ;
         TupleIndexRecord index = new TupleIndexRecord(3, cmap, description, 
factory, rIdx) ;
         return index ;

Modified: 
jena/trunk/jena-tdb/src/test/java/com/hp/hpl/jena/tdb/store/tupletable/TestTupleIndexRecordDirect.java
URL: 
http://svn.apache.org/viewvc/jena/trunk/jena-tdb/src/test/java/com/hp/hpl/jena/tdb/store/tupletable/TestTupleIndexRecordDirect.java?rev=1623074&r1=1623073&r2=1623074&view=diff
==============================================================================
--- 
jena/trunk/jena-tdb/src/test/java/com/hp/hpl/jena/tdb/store/tupletable/TestTupleIndexRecordDirect.java
 (original)
+++ 
jena/trunk/jena-tdb/src/test/java/com/hp/hpl/jena/tdb/store/tupletable/TestTupleIndexRecordDirect.java
 Sun Sep  7 17:08:04 2014
@@ -33,7 +33,7 @@ import com.hp.hpl.jena.tdb.base.file.Fil
 import com.hp.hpl.jena.tdb.base.record.RecordFactory ;
 import com.hp.hpl.jena.tdb.index.IndexParams ;
 import com.hp.hpl.jena.tdb.index.RangeIndex ;
-import com.hp.hpl.jena.tdb.setup.B ;
+import com.hp.hpl.jena.tdb.setup.BuildIndex ;
 import com.hp.hpl.jena.tdb.setup.SystemParams ;
 import com.hp.hpl.jena.tdb.store.NodeId ;
 import com.hp.hpl.jena.tdb.sys.SystemTDB ;
@@ -51,7 +51,7 @@ public class TestTupleIndexRecordDirect 
     static TupleIndexRecord create(String description)
     {
         IndexParams indexParams = SystemParams.getDftSystemParams() ; 
-        RangeIndex rIdx = B.buildRangeIndex(FileSet.mem(), factory, 
indexParams) ;
+        RangeIndex rIdx = BuildIndex.buildRangeIndex(FileSet.mem(), factory, 
indexParams) ;
         ColumnMap cmap = new ColumnMap("SPO", description) ;
         TupleIndexRecord index = new TupleIndexRecord(3, cmap, description, 
factory, rIdx) ;
         return index ;

Modified: 
jena/trunk/jena-tdb/src/test/java/com/hp/hpl/jena/tdb/transaction/AbstractTestNodeTableTrans.java
URL: 
http://svn.apache.org/viewvc/jena/trunk/jena-tdb/src/test/java/com/hp/hpl/jena/tdb/transaction/AbstractTestNodeTableTrans.java?rev=1623074&r1=1623073&r2=1623074&view=diff
==============================================================================
--- 
jena/trunk/jena-tdb/src/test/java/com/hp/hpl/jena/tdb/transaction/AbstractTestNodeTableTrans.java
 (original)
+++ 
jena/trunk/jena-tdb/src/test/java/com/hp/hpl/jena/tdb/transaction/AbstractTestNodeTableTrans.java
 Sun Sep  7 17:08:04 2014
@@ -29,9 +29,9 @@ import com.hp.hpl.jena.tdb.base.objectfi
 import com.hp.hpl.jena.tdb.base.record.RecordFactory ;
 import com.hp.hpl.jena.tdb.index.Index ;
 import com.hp.hpl.jena.tdb.index.IndexMap ;
+import com.hp.hpl.jena.tdb.setup.BuildDB ;
 import com.hp.hpl.jena.tdb.store.NodeId ;
 import com.hp.hpl.jena.tdb.store.nodetable.NodeTable ;
-import com.hp.hpl.jena.tdb.sys.SetupTDB ;
 import com.hp.hpl.jena.tdb.sys.SystemTDB ;
 
 public abstract class AbstractTestNodeTableTrans extends BaseTest
@@ -41,7 +41,7 @@ public abstract class AbstractTestNodeTa
     
     private NodeTableTrans create(Transaction txn, Node...nodes)
     {
-        NodeTable base = SetupTDB.makeNodeTable(getLocation()) ;
+        NodeTable base = BuildDB.makeNodeTable(getLocation()) ;
         for ( Node n : nodes )
             base.getAllocateNodeId(n) ;
         return create(txn, base) ;


Reply via email to