示例#1
0
 @Override
 public final void readPage(ByteBuffer buf, long pageId) {
   try {
     fc.read(buf, pageId * PAGE_SIZE);
     if (DBStatistics.isEnabled()) {
       statNRead++;
       statNReadUnique.put(pageId, null);
     }
   } catch (IOException e) {
     throw DBLogger.newFatal("Error loading Page: " + pageId, e);
   }
 }
示例#2
0
 @Override
 public final void write(ByteBuffer buf, long pageId) {
   try {
     if (pageId < 0) {
       return;
     }
     if (DBStatistics.isEnabled()) {
       statNWrite++;
     }
     fc.write(buf, pageId * PAGE_SIZE);
   } catch (IOException e) {
     throw DBLogger.newFatal("Error writing page: " + pageId, e);
   }
 }