/** * 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); }