while (hashChunk.length() < places_)
hashChunk = "0" + hashChunk;
String server = serverStrategy_ == null ? server_ : serverStrategy_.getServerForHashChunk(hashChunk);
DbDirectory dbdir = getDbDirectoryForHashChunk(hashChunk);
String dbName = baseName_ + "-" + hashChunk + ".nsf";
Database database = session_.getDatabase(server, dbName, true);
if (!database.isOpen()) {
database = createDatabase(dbdir, dbName);
}
dbCache_.put(dbName, database);
}
} else {
Database database = session_.getDatabase(server_, baseName_ + ".nsf");
if (!database.isOpen()) {
database = createDatabase(getDbDirectoryForHashChunk(null), baseName_ + ".nsf");
}
dbCache_.put(baseName_ + ".nsf", database);
}
}