@Override final public File getFile() { final IBufferStrategy tmp = getBufferStrategy(); if (tmp == null) return null; return tmp.getFile(); }
@Override final public File getFile() { final IBufferStrategy tmp = getBufferStrategy(); if (tmp == null) return null; return tmp.getFile(); }
@Override public void sample() { final AbstractJournal jnl = ref.get(); if (jnl != null) { final IBufferStrategy bufferStrategy = jnl.getBufferStrategy(); if (bufferStrategy != null) { final BufferMode bufferMode = bufferStrategy.getBufferMode(); if (bufferMode != null) { setValue(bufferMode.toString()); } } } } });
@Override public void sample() { final AbstractJournal jnl = ref.get(); if (jnl != null) { final IBufferStrategy bufferStrategy = jnl.getBufferStrategy(); if (bufferStrategy != null) { final BufferMode bufferMode = bufferStrategy.getBufferMode(); if (bufferMode != null) { setValue(bufferMode.toString()); } } } } });
/** * Return both root blocks (atomically - used by HA). * <p> * Note: This takes a lock to ensure that the root blocks are consistent * with a commit point on the backing store. */ protected IRootBlockView[] getRootBlocks() { final Lock lock = _fieldReadWriteLock.readLock(); lock.lock(); try { final ChecksumUtility checker = ChecksumUtility.getCHK(); final IRootBlockView rb0 = new RootBlockView( true/* rootBlock0 */, getBufferStrategy() .readRootBlock(true/* rootBlock0 */), checker); final IRootBlockView rb1 = new RootBlockView( false/* rootBlock0 */, getBufferStrategy() .readRootBlock(false/* rootBlock0 */), checker); return new IRootBlockView[] { rb0, rb1 }; } finally { lock.unlock(); } }
/** * Return both root blocks (atomically - used by HA). * <p> * Note: This takes a lock to ensure that the root blocks are consistent * with a commit point on the backing store. */ protected IRootBlockView[] getRootBlocks() { final Lock lock = _fieldReadWriteLock.readLock(); lock.lock(); try { final ChecksumUtility checker = ChecksumUtility.getCHK(); final IRootBlockView rb0 = new RootBlockView( true/* rootBlock0 */, getBufferStrategy() .readRootBlock(true/* rootBlock0 */), checker); final IRootBlockView rb1 = new RootBlockView( false/* rootBlock0 */, getBufferStrategy() .readRootBlock(false/* rootBlock0 */), checker); return new IRootBlockView[] { rb0, rb1 }; } finally { lock.unlock(); } }
@Override public IHAReadResponse call() throws Exception { if (haLog.isInfoEnabled()) haLog.info("token=" + token); quorum.assertQuorum(token); // final ILRUCache<Long, Object> cache = (LRUNexus.INSTANCE // == null) ? null // : LRUNexus.getCache(jnl); // // Object obj = cache.get(addr); // // if(obj != null && obj instanceof IDataRecordAccess) { // // return ((IDataRecordAccess)obj).data(); // // } // read from the local store. final ByteBuffer b = ((IHABufferStrategy) getBufferStrategy()) .readFromLocalStore(addr); final byte[] a = BytesUtil.toArray(b); // cache.putIfAbsent(addr, b); return new HAReadResponse(a); } });
@Override public IHAReadResponse call() throws Exception { if (haLog.isInfoEnabled()) haLog.info("token=" + token); quorum.assertQuorum(token); // final ILRUCache<Long, Object> cache = (LRUNexus.INSTANCE // == null) ? null // : LRUNexus.getCache(jnl); // // Object obj = cache.get(addr); // // if(obj != null && obj instanceof IDataRecordAccess) { // // return ((IDataRecordAccess)obj).data(); // // } // read from the local store. final ByteBuffer b = ((IHABufferStrategy) getBufferStrategy()) .readFromLocalStore(addr); final byte[] a = BytesUtil.toArray(b); // cache.putIfAbsent(addr, b); return new HAReadResponse(a); } });
.getBufferStrategy() : store);
log.info(""); final IBufferStrategy bufferStrategy = getBufferStrategy();
log.info(""); final IBufferStrategy bufferStrategy = getBufferStrategy();
.getBufferStrategy() : store);
if (getBufferStrategy() instanceof IRWStrategy) {
if (getBufferStrategy() instanceof IRWStrategy) {
throw new IllegalStateException(); final IBufferStrategy backingBuffer = getBufferStrategy();
throw new IllegalStateException(); final IBufferStrategy backingBuffer = getBufferStrategy();
final long sequence = ((IHABufferStrategy) getBufferStrategy()) .getCurrentBlockSequence();
final long sequence = ((IHABufferStrategy) getBufferStrategy()) .getCurrentBlockSequence();
try { final ISnapshotData tm = new SnapshotData(); final IBufferStrategy bs = getBufferStrategy();
try { final ISnapshotData tm = new SnapshotData(); final IBufferStrategy bs = getBufferStrategy();