LOG.info("Kaha Store using data directory " + directory);
lockFile = new RandomAccessFile(new File(directory, "lock"), "rw");
lock();
DataManager defaultDM = getDataManager(defaultContainerName);
IndexManager rootIndexManager = getIndexManager(defaultDM, defaultContainerName);
IndexItem mapRoot = new IndexItem();
IndexItem listRoot = new IndexItem();
if (rootIndexManager.isEmpty()) {
mapRoot.setOffset(0);
rootIndexManager.storeIndex(mapRoot);
listRoot.setOffset(IndexItem.INDEX_SIZE);
rootIndexManager.storeIndex(listRoot);
rootIndexManager.setLength(IndexItem.INDEX_SIZE * 2);
} else {
mapRoot = rootIndexManager.getIndex(0);
listRoot = rootIndexManager.getIndex(IndexItem.INDEX_SIZE);