@Override public String getClusterId() { return delegate.getClusterId(); }
@Override public KCluster kcluster(final KObjectKey object) { return new KClusterImpl(object.getClusterId()); }
@Override public String getClusterId() { return delegate.getClusterId(); }
@Override public String getClusterId() { return delegate.getClusterId(); }
@Override public String getClusterId() { return delegate.getClusterId(); }
@Override public String getClusterId() { return delegate.getClusterId(); }
private void doRename(KObjectKey from, KObject to) { this.provider.rename(from.getClusterId(), from.getId(), to); }
private void doRename(KObjectKey from, KObject to) { this.provider.rename(from.getClusterId(), from.getId(), to); }
protected boolean exists(KObjectKey from) { return this.provider.exists(from.getClusterId(), from.getId()); }
private void doDelete(KObjectKey objectKey) { this.provider.delete(objectKey.getClusterId(), objectKey.getId()); }
private void doDelete(KObjectKey objectKey) { this.provider.delete(objectKey.getClusterId(), objectKey.getId()); }
@Override public void delete(KObjectKey objectKey) { KCluster index = new KClusterImpl(objectKey.getClusterId()); doOrDeferAction(index, new DeletedEvent(objectKey)); }
@Override public void delete(KObjectKey objectKey) { KCluster index = new KClusterImpl(objectKey.getClusterId()); doOrDeferAction(index, new DeletedEvent(objectKey)); }
@Override public void rename(KObjectKey from, KObject to) { checkNotNull("from", from); checkNotNull("to", to); checkCondition("renames are allowed only from same cluster", from.getClusterId().equals(to.getClusterId())); KCluster index = new KClusterImpl(from.getClusterId()); doOrDeferAction(index, new RenamedEvent(from, to)); }
@Test public void deleteNeverCalledWhenBatchAborted() throws Exception { deleteDeferredInBatchMode(); indexEngine.abort(cluster); verify(provider, never()).delete(kObjectKey.getClusterId(), kObjectKey.getId()); }
@Test public void deleteDeferredInBatchMode() throws Exception { indexEngine.startBatch(cluster); indexEngine.delete(kObjectKey); verify(provider, never()).delete(kObjectKey.getClusterId(), kObjectKey.getId()); }
@Test public void deleteNeverCalledWhenBatchAborted() throws Exception { deleteDeferredInBatchMode(); indexEngine.abort(cluster); verify(provider, never()).delete(kObjectKey.getClusterId(), kObjectKey.getId()); }
@Test public void deleteDeferredInBatchMode() throws Exception { indexEngine.startBatch(cluster); indexEngine.delete(kObjectKey); verify(provider, never()).delete(kObjectKey.getClusterId(), kObjectKey.getId()); }
@Test public void deleteCalledWhenBatchCommitted() throws Exception { deleteDeferredInBatchMode(); indexEngine.commit(cluster, TEST_INDEXER); verify(provider).delete(kObjectKey.getClusterId(), kObjectKey.getId()); }
@Test public void deleteCalledWhenBatchCommitted() throws Exception { deleteDeferredInBatchMode(); indexEngine.commit(cluster, TEST_INDEXER); verify(provider).delete(kObjectKey.getClusterId(), kObjectKey.getId()); }