@Override public void removeObjectId(List<ExistenceUpdate> existenceUpdates) { List<TenantRowColumnTimestampRemove<TenantIdAndCentricId, ObjectId, String>> batch = new ArrayList<>(); for (ExistenceUpdate existenceUpdate : existenceUpdates) { batch.add(new TenantRowColumnTimestampRemove<>(existenceUpdate.tenantId, existenceUpdate.objectId, EXISTS, new ConstantTimestamper(existenceUpdate.timestamp))); if (LOG.isTraceEnabled()) { LOG.trace("Object REMOVED:{} time:{}", new Object[]{existenceUpdate.objectId, existenceUpdate.timestamp}); } } updatedStore.multiRowsMultiRemove(batch); }
public void clear(TenantIdAndCentricId tenantIdAndCentricId, ObjectId viewId, final long timestamp) throws IOException { final List<RowColumnTimestampRemove<ImmutableByteArray, ImmutableByteArray>> removes = new ArrayList<>(); final ConstantTimestamper constantTimestamper = new ConstantTimestamper(timestamp - 1); final ImmutableByteArray rowKey = rowKey(viewId); viewValueStore.getEntrys(tenantIdAndCentricId, rowKey(viewId), null, Long.MAX_VALUE, 1000, false, null, null, new CallbackStream<ColumnValueAndTimestamp<ImmutableByteArray, ViewValue, Long>>() { @Override public ColumnValueAndTimestamp<ImmutableByteArray, ViewValue, Long> callback(ColumnValueAndTimestamp<ImmutableByteArray, ViewValue, Long> v) throws Exception { if (v != null && v.getTimestamp() < timestamp) { removes.add(new RowColumnTimestampRemove<>(rowKey, v.getColumn(), constantTimestamper)); } return v; } }); viewValueStore.multiRowsMultiRemove(tenantIdAndCentricId, removes); }
public void remove(TenantIdAndCentricId tenantIdAndCentricId, List<ViewWriteFieldChange> removes) throws IOException { MultiRemove<ImmutableByteArray, ImmutableByteArray> rawRemoves = new MultiRemove<>(); for (ViewWriteFieldChange change : removes) { rawRemoves.add(rowKey(change.getViewObjectId()), columnKey(change.getModelPathIdHashcode(), change.getModelPathInstanceIds()), new ConstantTimestamper(change.getTimestamp())); LOG.debug("VVS:REMOVED {}", change); } List<RowColumnTimestampRemove<ImmutableByteArray, ImmutableByteArray>> took = rawRemoves.take(); viewValueStore.multiRowsMultiRemove(tenantIdAndCentricId, took); }