use of jetbrains.exodus.log.LogConfig in project xodus by JetBrains.
the class LogRecoveryTest method cutAndCheckLastLoggableIncomplete.
private void cutAndCheckLastLoggableIncomplete(int cutSize, int max) {
openStoreAutoCommit("new_store", StoreConfig.WITHOUT_DUPLICATES);
/*final Iterator<Loggable> itr = getLog().getLoggablesIterator(0);
while (itr.hasNext()) {
final Loggable next = itr.next();
System.out.println(next.getType() + " @ " + next.getAddress());
}*/
assertLoggableTypes(getLog(), 0, seq);
env.close();
final StreamCipherProvider cipherProvider = env.getCipherProvider();
final byte[] cipherKey = env.getCipherKey();
final long cipherBasicIV = env.getCipherBasicIV();
env = null;
final long size = reader.getBlocks(0).iterator().next().length();
writer.openOrCreateBlock(0, size - cutSize);
writer.close();
// only 'max' first loggables should remain
final LogConfig config = LogConfig.create(reader, writer).setCipherProvider(cipherProvider).setCipherKey(cipherKey).setCipherBasicIV(cipherBasicIV);
final Log newLog = Environments.newLogInstance(config);
newLog.setHighAddress(newLog.getTip(), newLog.getTip().approvedHighAddress);
assertLoggableTypes(max, newLog.getLoggableIterator(0), seq);
}
use of jetbrains.exodus.log.LogConfig in project xodus by JetBrains.
the class TreeBaseTest method createLog.
private void createLog() {
LogConfig config = createLogConfig();
config.setLocation(tempFolder.getPath());
log = Environments.newLogInstance(config);
}
use of jetbrains.exodus.log.LogConfig in project xodus by JetBrains.
the class BTreeReclaimSpecialTest method createLogConfig.
@Override
protected LogConfig createLogConfig() {
LogConfig result = super.createLogConfig();
result.setFileSize(1);
return result;
}
Aggregations