/** * This is used only on non transactional paging * * @param page * @param increment * @throws Exception */ @Override public synchronized void pendingCounter(Page page, int increment, long size) throws Exception { if (!persistent) { return; // nothing to be done } PendingCounter pendingInfo = pendingCounters.get((long) page.getPageId()); if (pendingInfo == null) { // We have to make sure this is sync here // not syncing this to disk may cause the page files to be out of sync on pages. // we can't afford the case where a page file is written without a record here long id = storage.storePendingCounter(this.subscriptionID, page.getPageId()); pendingInfo = new PendingCounter(id, increment, size); pendingCounters.put((long) page.getPageId(), pendingInfo); } else { pendingInfo.addAndGet(increment, size); } pendingValue.addAndGet(increment); pendingPersistentSize.addAndGet(size); page.addPendingCounter(this); }