public static String addressToString(final long address, final long timestamp) {
return String.format("JournalAddress %,d{%,d}", address, timestamp);
}
private Exchange getExchange(final int treeHandle, final long from, final long timestamp) throws PersistitException {
final TreeDescriptor td = _support.getPersistit().getJournalManager().lookupTreeHandle(treeHandle);
if (td == null) {
throw new CorruptJournalException("Tree handle " + treeHandle + " is undefined at "
+ addressToString(from, timestamp));
}
final Volume volume = _support.getPersistit().getJournalManager().volumeForHandle(td.getVolumeHandle());
if (volume == null) {
throw new CorruptJournalException("Volume handle " + td.getVolumeHandle() + " is undefined at "
+ addressToString(from, timestamp));
}
if (VolumeStructure.DIRECTORY_TREE_NAME.equals(td.getTreeName())) {
return volume.getStructure().directoryExchange();
} else {
final Exchange exchange = _support.getPersistit().getExchange(volume, td.getTreeName(), true);
exchange.ignoreTransactions();
return exchange;
}
}