Search in sources :

Example 1 with Persistit

use of com.persistit.Persistit in project sonarqube by SonarSource.

the class StoragesManager method initPersistit.

private void initPersistit() {
    try {
        tempDir = tempFolder.newDir("caches");
        persistit = new Persistit();
        persistit.setPersistitLogger(new Slf4jAdapter(LoggerFactory.getLogger("PERSISTIT")));
        Properties props = new Properties();
        props.setProperty("datapath", tempDir.getAbsolutePath());
        props.setProperty("logpath", "${datapath}/log");
        props.setProperty("logfile", "${logpath}/persistit_${timestamp}.log");
        props.setProperty("buffer.count.8192", "10");
        props.setProperty("journalpath", "${datapath}/journal");
        props.setProperty("tmpvoldir", "${datapath}");
        props.setProperty("volume.1", "${datapath}/persistit,create,pageSize:8192,initialPages:10,extensionPages:100,maximumPages:25000");
        props.setProperty("jmx", "false");
        persistit.setProperties(props);
        persistit.initialize();
    } catch (Exception e) {
        throw new IllegalStateException("Fail to start caches", e);
    }
}
Also used : Slf4jAdapter(com.persistit.logging.Slf4jAdapter) Persistit(com.persistit.Persistit) Properties(java.util.Properties) PersistitException(com.persistit.exception.PersistitException)

Example 2 with Persistit

use of com.persistit.Persistit in project xodus by JetBrains.

the class JMHPersistItTokyoCabinetBenchmarkBase method createEnvironment.

private void createEnvironment() throws IOException, PersistitException {
    closeDb();
    temporaryFolder = new TemporaryFolder();
    temporaryFolder.create();
    persistit = new Persistit();
    persistit.setPersistitLogger(new Slf4jAdapter(LoggerFactory.getLogger("PERSISTIT")));
    Properties props = new Properties();
    props.setProperty("datapath", temporaryFolder.getRoot().getAbsolutePath());
    props.setProperty("logpath", "${datapath}/log");
    props.setProperty("logfile", "${logpath}/persistit_${timestamp}.log");
    props.setProperty("buffer.count.8192", "5000");
    props.setProperty("journalpath", "${datapath}/journal");
    props.setProperty("tmpvoldir", "${datapath}");
    props.setProperty("volume.1", "${datapath}/persistit,create,pageSize:8192,initialPages:10,extensionPages:100,maximumPages:25000");
    props.setProperty("jmx", "false");
    persistit.setProperties(props);
    persistit.initialize();
    volume = persistit.createTemporaryVolume();
}
Also used : Slf4jAdapter(com.persistit.logging.Slf4jAdapter) Persistit(com.persistit.Persistit) TemporaryFolder(org.junit.rules.TemporaryFolder) Properties(java.util.Properties)

Aggregations

Persistit (com.persistit.Persistit)2 Slf4jAdapter (com.persistit.logging.Slf4jAdapter)2 Properties (java.util.Properties)2 PersistitException (com.persistit.exception.PersistitException)1 TemporaryFolder (org.junit.rules.TemporaryFolder)1