@Test public void testGetData() throws TTException { DumbData[][] datas = CoreTestHelper.createTestData(mHolder); BucketReadTrxTest.testGet(mHolder.getSession(), datas); List<DumbData> list = CoreTestHelper.combineDatas(datas); final IBucketWriteTrx wtx = mHolder.getSession().beginBucketWtx(); CoreTestHelper.checkStructure(list, wtx, 0); }
public IData getData(final long pDataKey) throws TTIOException { checkState(!mDelegate.isClosed(), "Transaction already closed"); final long dataBucketKey = pDataKey >> IConstants.INDIRECT_BUCKET_COUNT[3]; final int dataBucketOffset = dataBucketOffset(pDataKey); final LogKey key = new LogKey(false, IConstants.INDIRECT_BUCKET_COUNT.length, dataBucketKey); LogValue container = mLog.get(key); IData item = null; if (container.getModified() != null) { if (((DataBucket)container.getModified()).getData(dataBucketOffset) == null) { item = ((DataBucket)container.getComplete()).getData(dataBucketOffset); } else { item = ((DataBucket)container.getModified()).getData(dataBucketOffset); } checkNotNull(item, "Item must be set!"); item = mDelegate.checkItemIfDeleted(item); } else { container = mFormerLog.get(key); if (container.getModified() != null) { if (((DataBucket)container.getModified()).getData(dataBucketOffset) == null) { item = clone(((DataBucket)container.getComplete())).getData(dataBucketOffset); } else { item = clone(((DataBucket)container.getComplete())).getData(dataBucketOffset); } checkNotNull(item, "Item must be set!"); item = mDelegate.checkItemIfDeleted(item); } else { item = mDelegate.getData(pDataKey); } } return item; }
BucketWriteTrx implements IBucketWriteTrx { public IData getData(final long pDataKey) throws TTIOException { checkState(!mDelegate.isClosed(), "Transaction already closed"); final long dataBucketKey = pDataKey >> IConstants.INDIRECT_BUCKET_COUNT[3]; final int dataBucketOffset = dataBucketOffset(pDataKey); final LogKey key = new LogKey(false, IConstants.INDIRECT_BUCKET_COUNT.length, dataBucketKey); LogValue container = mLog.get(key); IData item = null; if (container.getModified() != null) { if (((DataBucket)container.getModified()).getData(dataBucketOffset) == null) { item = ((DataBucket)container.getComplete()).getData(dataBucketOffset); } else { item = ((DataBucket)container.getModified()).getData(dataBucketOffset); } checkNotNull(item, "Item must be set!"); item = mDelegate.checkItemIfDeleted(item); } else { container = mFormerLog.get(key); if (container.getModified() != null) { if (((DataBucket)container.getModified()).getData(dataBucketOffset) == null) { item = clone(((DataBucket)container.getComplete())).getData(dataBucketOffset); } else { item = clone(((DataBucket)container.getComplete())).getData(dataBucketOffset); } checkNotNull(item, "Item must be set!"); item = mDelegate.checkItemIfDeleted(item); } else { item = mDelegate.getData(pDataKey); } } return item; } }
BucketWriteTrx implements IBucketWriteTrx { public IData getData(final long pDataKey) throws TTIOException { checkState(!mDelegate.isClosed(), "Transaction already closed"); final long dataBucketKey = pDataKey >> IConstants.INDIRECT_BUCKET_COUNT[3]; final int dataBucketOffset = dataBucketOffset(pDataKey); final LogKey key = new LogKey(false, IConstants.INDIRECT_BUCKET_COUNT.length, dataBucketKey); LogValue container = mLog.get(key); IData item = null; if (container.getModified() != null) { if (((DataBucket)container.getModified()).getData(dataBucketOffset) == null) { item = ((DataBucket)container.getComplete()).getData(dataBucketOffset); } else { item = ((DataBucket)container.getModified()).getData(dataBucketOffset); } checkNotNull(item, "Item must be set!"); item = mDelegate.checkItemIfDeleted(item); } else { container = mFormerLog.get(key); if (container.getModified() != null) { if (((DataBucket)container.getModified()).getData(dataBucketOffset) == null) { item = clone(((DataBucket)container.getComplete())).getData(dataBucketOffset); } else { item = clone(((DataBucket)container.getComplete())).getData(dataBucketOffset); } checkNotNull(item, "Item must be set!"); item = mDelegate.checkItemIfDeleted(item); } else { item = mDelegate.getData(pDataKey); } } return item; } protected  BucketWriteTrx(final ISession pSession, final UberBucket pUberBucket,
        final IBackendWriter pWriter, final long pRepresentRev); }
BucketWriteTrx implements IBucketWriteTrx { public IData getData(final long pDataKey) throws TTIOException { checkState(!mDelegate.isClosed(), "Transaction already closed"); final long dataBucketKey = pDataKey >> IConstants.INDIRECT_BUCKET_COUNT[3]; final int dataBucketOffset = dataBucketOffset(pDataKey); final LogKey key = new LogKey(false, IConstants.INDIRECT_BUCKET_COUNT.length, dataBucketKey); LogValue container = mLog.get(key); IData item = null; if (container.getModified() != null) { if (((DataBucket)container.getModified()).getData(dataBucketOffset) == null) { item = ((DataBucket)container.getComplete()).getData(dataBucketOffset); } else { item = ((DataBucket)container.getModified()).getData(dataBucketOffset); } checkNotNull(item, "Item must be set!"); item = mDelegate.checkItemIfDeleted(item); } else { container = mFormerLog.get(key); if (container.getModified() != null) { if (((DataBucket)container.getModified()).getData(dataBucketOffset) == null) { item = clone(((DataBucket)container.getComplete())).getData(dataBucketOffset); } else { item = clone(((DataBucket)container.getComplete())).getData(dataBucketOffset); } checkNotNull(item, "Item must be set!"); item = mDelegate.checkItemIfDeleted(item); } else { item = mDelegate.getData(pDataKey); } } return item; } protected  BucketWriteTrx(final ISession pSession, final UberBucket pUberBucket,
        final IBackendWriter pWriter, final long pRepresentRev); long setData(final IData pData); @Override void removeData(final IData pData); IData getData(final long pDataKey); @Override void commit(); @Override void commitBlocked(); void clearLog(); @Override boolean close(); @Override long incrementDataKey(); @Override long getRevision(); @Override boolean isClosed(); @Override MetaBucket getMetaBucket(); @Override String toString(); }
BucketWriteTrx implements IBucketWriteTrx { public IData getData(final long pDataKey) throws TTIOException { checkState(!mDelegate.isClosed(), "Transaction already closed"); final long dataBucketKey = pDataKey >> IConstants.INDIRECT_BUCKET_COUNT[3]; final int dataBucketOffset = dataBucketOffset(pDataKey); final LogKey key = new LogKey(false, IConstants.INDIRECT_BUCKET_COUNT.length, dataBucketKey); LogValue container = mLog.get(key); IData item = null; if (container.getModified() != null) { if (((DataBucket)container.getModified()).getData(dataBucketOffset) == null) { item = ((DataBucket)container.getComplete()).getData(dataBucketOffset); } else { item = ((DataBucket)container.getModified()).getData(dataBucketOffset); } checkNotNull(item, "Item must be set!"); item = mDelegate.checkItemIfDeleted(item); } else { container = mFormerLog.get(key); if (container.getModified() != null) { if (((DataBucket)container.getModified()).getData(dataBucketOffset) == null) { item = clone(((DataBucket)container.getComplete())).getData(dataBucketOffset); } else { item = clone(((DataBucket)container.getComplete())).getData(dataBucketOffset); } checkNotNull(item, "Item must be set!"); item = mDelegate.checkItemIfDeleted(item); } else { item = mDelegate.getData(pDataKey); } } return item; } protected  BucketWriteTrx(final ISession pSession, final UberBucket pUberBucket,
        final IBackendWriter pWriter, final long pRepresentRev); long setData(final IData pData); @Override void removeData(final IData pData); IData getData(final long pDataKey); @Override void commit(); @Override void commitBlocked(); void clearLog(); @Override boolean close(); @Override long incrementDataKey(); @Override long getRevision(); @Override boolean isClosed(); @Override MetaBucket getMetaBucket(); @Override String toString();  }