/** * Return true if the address is marked as committed in the {@link RWStore} * in memory bit maps. * * @param addr * The address. */ public boolean isCommitted(final long addr) { return m_store.isCommitted(decodeAddr(addr)); }
public long getPhysicalAddress(final long addr) { // extract the latched address. final int rwaddr = decodeAddr(addr); // obtain the byte offset on the file. return m_store.physicalAddress(rwaddr); }
/** * An assert oriented method that allows a finite number of addresses * to be monitored to ensure it is not freed. * * @param addr - address to be locked * @return true - for use in assert statement */ public boolean lockAddress(final long addr) { m_store.lockAddress(decodeAddr(addr)); return true; }
public long getPhysicalAddress(final long addr) { // extract the latched address. final int rwaddr = decodeAddr(addr); // obtain the byte offset on the file. return m_store.physicalAddress(rwaddr); }
/** * Return true if the address is marked as committed in the {@link RWStore} * in memory bit maps. * * @param addr * The address. */ public boolean isCommitted(final long addr) { return m_store.isCommitted(decodeAddr(addr)); }
/** * Return <code>true</code> iff the address was in the write cache as of the * moment the write cache was inspected. * * @param addr * The address. */ public boolean inWriteCache(final long addr) { return m_store.inWriteCache(decodeAddr(addr)); }
/** * An assert oriented method that allows a finite number of addresses * to be monitored to ensure it is not freed. * * @param addr - address to be locked * @return true - for use in assert statement */ public boolean lockAddress(final long addr) { m_store.lockAddress(decodeAddr(addr)); return true; }
/** * Return <code>true</code> iff the address was in the write cache as of the * moment the write cache was inspected. * * @param addr * The address. */ public boolean inWriteCache(final long addr) { return m_store.inWriteCache(decodeAddr(addr)); }
/** * Must check whether there are existing transactions which may access * this data, and if not free immediately, otherwise defer. */ public void delete(final long addr, final IAllocationContext context) { final int rwaddr = decodeAddr(addr); final int sze = decodeSize(addr); if (rwaddr == 0L) throw new IllegalArgumentException( AbstractBufferStrategy.ERR_ADDRESS_IS_NULL); if (sze == 0) throw new IllegalArgumentException( AbstractBufferStrategy.ERR_BAD_RECORD_SIZE); m_store.free(rwaddr, sze, context); }
/** * Must check whether there are existing transactions which may access * this data, and if not free immediately, otherwise defer. */ public void delete(final long addr, final IAllocationContext context) { final int rwaddr = decodeAddr(addr); final int sze = decodeSize(addr); if (rwaddr == 0L) throw new IllegalArgumentException( AbstractBufferStrategy.ERR_ADDRESS_IS_NULL); if (sze == 0) throw new IllegalArgumentException( AbstractBufferStrategy.ERR_BAD_RECORD_SIZE); m_store.free(rwaddr, sze, context); }
public ByteBuffer readFromLocalStore(final long addr) throws InterruptedException { final int rwaddr = decodeAddr(addr); final int sze = decodeSize(addr); if (rwaddr == 0L) throw new IllegalArgumentException( AbstractBufferStrategy.ERR_ADDRESS_IS_NULL); if (sze == 0) throw new IllegalArgumentException( AbstractBufferStrategy.ERR_BAD_RECORD_SIZE); /** * Allocate buffer to include checksum to allow single read but then * return ByteBuffer excluding those bytes */ // final byte buf[] = new byte[sze + 4]; // 4 bytes for checksum // // m_store.getData(rwaddr, buf, 0, sze+4); // // return ByteBuffer.wrap(buf, 0, sze); return m_store.getData(rwaddr, sze); }
public ByteBuffer readFromLocalStore(final long addr) throws InterruptedException { final int rwaddr = decodeAddr(addr); final int sze = decodeSize(addr); if (rwaddr == 0L) throw new IllegalArgumentException( AbstractBufferStrategy.ERR_ADDRESS_IS_NULL); if (sze == 0) throw new IllegalArgumentException( AbstractBufferStrategy.ERR_BAD_RECORD_SIZE); /** * Allocate buffer to include checksum to allow single read but then * return ByteBuffer excluding those bytes */ // final byte buf[] = new byte[sze + 4]; // 4 bytes for checksum // // m_store.getData(rwaddr, buf, 0, sze+4); // // return ByteBuffer.wrap(buf, 0, sze); return m_store.getData(rwaddr, sze); }