use of com.swiftmq.impl.store.standard.cache.Page in project swiftmq-ce by iitsoftware.
the class ReferenceMap method dump.
public synchronized void dump() {
if (ctx.traceSpace.enabled)
ctx.traceSpace.trace("sys$store", toString() + "/dump ...");
for (Iterator iter = map.entrySet().iterator(); iter.hasNext(); ) {
Map.Entry entry = (Map.Entry) iter.next();
Integer rootPageNo = (Integer) entry.getKey();
MessagePageReference ref = (MessagePageReference) entry.getValue();
try {
Page p = ctx.cacheManager.fetchAndPin(rootPageNo.intValue());
MessagePage mp = new MessagePage(p);
if (ctx.traceSpace.enabled)
ctx.traceSpace.trace("sys$store", toString() + "/dump, rootPageNo=" + rootPageNo + ", ref=" + ref + ", mp=" + mp);
ctx.cacheManager.unpin(rootPageNo.intValue());
} catch (Exception e) {
e.printStackTrace();
}
}
if (ctx.traceSpace.enabled)
ctx.traceSpace.trace("sys$store", toString() + "/dump done");
}
use of com.swiftmq.impl.store.standard.cache.Page in project swiftmq-ce by iitsoftware.
the class PageOutputStream method flipPage.
private void flipPage() throws IOException {
try {
Page page = ctx.cacheManager.createAndPin();
page.dirty = true;
page.empty = false;
if (rootPageNo == -1)
rootPageNo = page.pageNo;
pages.add(page);
MessagePage mp = new MessagePage(page);
if (actPage != null) {
actPage.setNextPage(page.pageNo);
mp.setPrevPage(actPage.page.pageNo);
journal.add(new UpdatePortionLogAction(actPage.page.pageNo, 0, null, getPortion()));
} else
mp.setPrevPage(-1);
mp.setNextPage(-1);
actPage = mp;
available = Page.PAGE_SIZE - MessagePage.START_DATA;
pos = MessagePage.START_DATA;
journal.add(new InsertLogAction(page.pageNo));
} catch (Exception e) {
e.printStackTrace();
throw new IOException(e.toString());
}
}
use of com.swiftmq.impl.store.standard.cache.Page in project swiftmq-ce by iitsoftware.
the class UpdateLogAction method readContent.
/**
* @param in
* @throws IOException
*/
protected void readContent(DataInput in) throws IOException {
beforeImage = new Page();
beforeImage.read(in);
afterImage = new Page();
afterImage.read(in);
}
Aggregations