list.add(newRoot);
return containerRoot;
}
void removeRoot(IndexManager containerIndexManager, ContainerId key) throws IOException {
StoreEntry oldRoot = map.remove(key);
if (oldRoot != null) {
dataManager.removeInterestInFile(oldRoot.getKeyFile());
// get the container root
IndexItem containerRoot = containerIndexManager.getIndex(oldRoot.getValueOffset());
if (containerRoot != null) {
containerIndexManager.freeIndex(containerRoot);
}
int index = list.indexOf(oldRoot);
IndexItem prev = index > 0 ? (IndexItem)list.get(index - 1) : root;