}
historyLock.readLock().lock();
try {
if (orderedHistoryList == null || orderedHistoryList.size() == 0) {
throw new TransactionIdTooOldException("No data in history.");
}
if (orderedHistoryList.get(0).txnId > txId ||
orderedHistoryList.get(orderedHistoryList.size() - 1).txnId < txId) {
throw new TransactionIdTooOldException("No data in history for txId " + txId);
}
int index = Collections.binarySearch(orderedHistoryList, new HistoryTreeEntry(0, txId, event.type),
comparatorByID);
if (index < 0) {
// If we got here, there are 2 possibilities:
// * The client gave us a bad transaction id.
// * We missed one (or more) transaction(s)
LOG.error("Potential corrupt history. Got request for: " +
NotifierUtils.asString(event) + " and txId: " + txId);
throw new TransactionIdTooOldException(
"Potentially corrupt server history");
}
String dirFormatPath = event.path;
if (!dirFormatPath.endsWith(Path.SEPARATOR)) {