@Test public void testRemoveData() throws TTException { DumbData[][] datas = CoreTestHelper.createTestData(mHolder); List<DumbData> list = CoreTestHelper.combineDatas(datas); final IBucketWriteTrx wtx = mHolder.getSession().beginBucketWtx(); int elementsDeleted = 10; int revisions = 1; for (int i = 0; i < revisions; i++) { for (int j = 0; j < elementsDeleted; j++) { int nextElementKey = (int) Math.abs((CoreTestHelper.random .nextLong() + 1) % list.size()); if (list.get(nextElementKey) != null) { wtx.removeData(list.get(nextElementKey)); list.set(nextElementKey, null); } } CoreTestHelper.checkStructure(list, wtx, 0); wtx.commit(); CoreTestHelper.checkStructure(list, wtx, 0); final IBucketReadTrx rtx = mHolder.getSession().beginBucketRtx( mHolder.getSession().getMostRecentVersion()); CoreTestHelper.checkStructure(list, rtx, 0); rtx.close(); } wtx.close(); final IBucketReadTrx rtx = mHolder.getSession().beginBucketRtx( mHolder.getSession().getMostRecentVersion()); CoreTestHelper.checkStructure(list, rtx, 0); }
@Override public void removeData(final IData pData) throws TTException { checkState(!mDelegate.isClosed(), "Transaction already closed"); checkNotNull(pData); final long dataBucketKey = pData.getDataKey() >> IConstants.INDIRECT_BUCKET_COUNT[3]; LogValue container = prepareDataBucket(pData.getDataKey()); final IData delData = new DeletedData(pData.getDataKey()); ((DataBucket)container.getComplete()).setData(dataBucketOffset(pData.getDataKey()), delData); ((DataBucket)container.getModified()).setData(dataBucketOffset(pData.getDataKey()), delData); mLog.put(new LogKey(false, IConstants.INDIRECT_BUCKET_COUNT.length, dataBucketKey), container); }
BucketWriteTrx implements IBucketWriteTrx { @Override public void removeData(final IData pData) throws TTException { checkState(!mDelegate.isClosed(), "Transaction already closed"); checkNotNull(pData); final long dataBucketKey = pData.getDataKey() >> IConstants.INDIRECT_BUCKET_COUNT[3]; LogValue container = prepareDataBucket(pData.getDataKey()); final IData delData = new DeletedData(pData.getDataKey()); ((DataBucket)container.getComplete()).setData(dataBucketOffset(pData.getDataKey()), delData); ((DataBucket)container.getModified()).setData(dataBucketOffset(pData.getDataKey()), delData); mLog.put(new LogKey(false, IConstants.INDIRECT_BUCKET_COUNT.length, dataBucketKey), container); } }
BucketWriteTrx implements IBucketWriteTrx { @Override public void removeData(final IData pData) throws TTException { checkState(!mDelegate.isClosed(), "Transaction already closed"); checkNotNull(pData); final long dataBucketKey = pData.getDataKey() >> IConstants.INDIRECT_BUCKET_COUNT[3]; LogValue container = prepareDataBucket(pData.getDataKey()); final IData delData = new DeletedData(pData.getDataKey()); ((DataBucket)container.getComplete()).setData(dataBucketOffset(pData.getDataKey()), delData); ((DataBucket)container.getModified()).setData(dataBucketOffset(pData.getDataKey()), delData); mLog.put(new LogKey(false, IConstants.INDIRECT_BUCKET_COUNT.length, dataBucketKey), container); } protected  BucketWriteTrx(final ISession pSession, final UberBucket pUberBucket,
        final IBackendWriter pWriter, final long pRepresentRev); }
BucketWriteTrx implements IBucketWriteTrx { @Override public void removeData(final IData pData) throws TTException { checkState(!mDelegate.isClosed(), "Transaction already closed"); checkNotNull(pData); final long dataBucketKey = pData.getDataKey() >> IConstants.INDIRECT_BUCKET_COUNT[3]; LogValue container = prepareDataBucket(pData.getDataKey()); final IData delData = new DeletedData(pData.getDataKey()); ((DataBucket)container.getComplete()).setData(dataBucketOffset(pData.getDataKey()), delData); ((DataBucket)container.getModified()).setData(dataBucketOffset(pData.getDataKey()), delData); mLog.put(new LogKey(false, IConstants.INDIRECT_BUCKET_COUNT.length, dataBucketKey), container); } 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 { @Override public void removeData(final IData pData) throws TTException { checkState(!mDelegate.isClosed(), "Transaction already closed"); checkNotNull(pData); final long dataBucketKey = pData.getDataKey() >> IConstants.INDIRECT_BUCKET_COUNT[3]; LogValue container = prepareDataBucket(pData.getDataKey()); final IData delData = new DeletedData(pData.getDataKey()); ((DataBucket)container.getComplete()).setData(dataBucketOffset(pData.getDataKey()), delData); ((DataBucket)container.getModified()).setData(dataBucketOffset(pData.getDataKey()), delData); mLog.put(new LogKey(false, IConstants.INDIRECT_BUCKET_COUNT.length, dataBucketKey), container); } 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();  }