Fix conversion from long to int and back to long again.
This commit is contained in:
Timothy Bish 2016-10-26 13:27:24 -04:00
parent 7c3bb40100
commit 1a91decf9f
1 changed files with 4 additions and 5 deletions

View File

@ -936,17 +936,17 @@ public class KahaDBStore extends MessageDatabase implements PersistenceAdapter,
} else { } else {
indexLock.writeLock().lock(); indexLock.writeLock().lock();
try { try {
return pageFile.tx().execute(new Transaction.CallableClosure<Integer, IOException>() { return pageFile.tx().execute(new Transaction.CallableClosure<Long, IOException>() {
@Override @Override
public Integer execute(Transaction tx) throws IOException { public Long execute(Transaction tx) throws IOException {
StoredDestination sd = getStoredDestination(dest, tx); StoredDestination sd = getStoredDestination(dest, tx);
LastAck cursorPos = getLastAck(tx, sd, subscriptionKey); LastAck cursorPos = getLastAck(tx, sd, subscriptionKey);
if (cursorPos == null) { if (cursorPos == null) {
// The subscription might not exist. // The subscription might not exist.
return 0; return 0l;
} }
return (int) getStoredMessageSize(tx, sd, subscriptionKey); return getStoredMessageSize(tx, sd, subscriptionKey);
} }
}); });
} finally { } finally {
@ -955,7 +955,6 @@ public class KahaDBStore extends MessageDatabase implements PersistenceAdapter,
} }
} }
protected void recoverMessageStoreSubMetrics() throws IOException { protected void recoverMessageStoreSubMetrics() throws IOException {
if (isEnableSubscriptionStatistics()) { if (isEnableSubscriptionStatistics()) {