tarantool / cartridge-springdata

Spring Data Tarantool

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Truncate doesn't work for RetryingTarantoolClient

ArtDu opened this issue · comments

There is a line that this is a temporary hack, but in order not to lose and forget, I will add a ticket for this problem

@Override
public void truncate(String spaceName) {
//FIXME implement truncate in cartridge-driver and remove this temporary hack
if (tarantoolClient instanceof ProxyTarantoolClient) {
boolean result = executeSync(() -> tarantoolClient.callForSingleResult(
"crud.truncate",
Collections.singletonList(spaceName), Boolean.class));
if (!result) {
throw new TarantoolSpaceOperationException("CRUD failed to truncate space " + spaceName);
}
} else {
throw new UnsupportedOperationException("Truncate operation is not supported in the driver yet");
}
}