@Override
public DbService makeDbService(final File subDbServiceHome, final DbService prevService) {
BagIndexBridge b = new BagIndexBridge(subDbServiceHome);
b.setBagIndexFactory(new BagEntryFactory() {
public BagEntry makeBagEntry(String bagName) {
BlueSteelBagIndex bsBagIndex = new FsBlueSteelBagIndex(sync);
BagIndex bagIndex = bsBagIndex;
bagIndex.setHomedir(new File(subDbServiceHome, "bag_"+bagName).getAbsolutePath());
if (prevService != null) {
BagIndex prevIndex = prevService.getBag(bagName);
if (prevIndex != null) {
Bytes[] table = PrefixCompressedBagIndex.determineCompressionTable(prevIndex, lengthToRowRatio);
PrefixCompressedBagIndex pcBagIndex = new PrefixCompressedBagIndex(bsBagIndex, table);
bagIndex = pcBagIndex;
bsBagIndex.setTermTableDepth(pcBagIndex.getNumCompressedBytes());
}
}
return new BagEntry(bagIndex);
}
});