use of org.iq80.leveldb.Options in project EventHub by Codecademy.
the class UserStorageModule method getIdMap.
@Provides
public IdMap getIdMap(@Named("eventhub.userstorage.directory") String userStorageDirectory) throws IOException {
String filename = userStorageDirectory + "/id_map.db";
// noinspection ResultOfMethodCallIgnored
new File(userStorageDirectory).mkdirs();
Options options = new Options();
options.createIfMissing(true);
return IdMap.create(new DB(JniDBFactory.factory.open(new File(filename), options)));
}
use of org.iq80.leveldb.Options in project EventHub by Codecademy.
the class PropertiesIndexModule method getPropertiesIndex.
@Provides
public PropertiesIndex getPropertiesIndex(@Named("eventhub.directory") String eventIndexDirectory) throws IOException {
// noinspection ResultOfMethodCallIgnored
new File(eventIndexDirectory).mkdirs();
Options options = new Options();
options.createIfMissing(true);
return new PropertiesIndex(new DB(JniDBFactory.factory.open(new File(eventIndexDirectory + "/properties_index.db"), options)));
}
Aggregations