Search in sources :

Example 6 with EnvironmentImpl

use of jetbrains.exodus.env.EnvironmentImpl in project xodus by JetBrains.

the class ProcessRunner method step.

private void step() throws Exception {
    Entity entity = txn.newEntity("Person");
    entity.setProperty("name", "Vadim");
    entity.setProperty("password", "dummypassword");
    byte[] blob = new byte[1024 * 1024];
    Arrays.fill(blob, (byte) 1);
    entity.setBlob("weight", new ByteArrayInputStream(blob));
    txn.flush();
    // txn.flush() can skip writing to file, manual flush is required
    ((EnvironmentImpl) store.getEnvironment()).flushAndSync();
}
Also used : Entity(jetbrains.exodus.entitystore.Entity) ByteArrayInputStream(java.io.ByteArrayInputStream) EnvironmentImpl(jetbrains.exodus.env.EnvironmentImpl)

Aggregations

EnvironmentImpl (jetbrains.exodus.env.EnvironmentImpl)6 ExodusException (jetbrains.exodus.ExodusException)2 EnvironmentConfig (jetbrains.exodus.env.EnvironmentConfig)2 ByteArrayInputStream (java.io.ByteArrayInputStream)1 Job (jetbrains.exodus.core.execution.Job)1 JobProcessor (jetbrains.exodus.core.execution.JobProcessor)1 JobProcessorExceptionHandler (jetbrains.exodus.core.execution.JobProcessorExceptionHandler)1 MultiThreadDelegatingJobProcessor (jetbrains.exodus.core.execution.MultiThreadDelegatingJobProcessor)1 Entity (jetbrains.exodus.entitystore.Entity)1 Log (jetbrains.exodus.log.Log)1 NotNull (org.jetbrains.annotations.NotNull)1