Fix putIfAbsent API name (#149)

Signed-off-by: Little-Wallace <bupt2013211450@gmail.com>
This commit is contained in:
Wallace 2021-03-25 17:04:12 +08:00 committed by GitHub
parent 762153a550
commit dde59a38f8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 4 deletions

View File

@ -18,7 +18,7 @@ CURRENT_DIR=`pwd`
TIKV_CLIENT_HOME="$(cd "`dirname "$0"`"/..; pwd)"
cd $TIKV_CLIENT_HOME
kvproto_hash=70a5912413a95aa47c069044dd531efa69ad7549
kvproto_hash=6ed99a08e262d8a32d6355dcba91cf99cb92074a
raft_rs_hash=b9891b673573fad77ebcf9bbe0969cf945841926

View File

@ -951,7 +951,7 @@ public class RegionStoreClient extends AbstractRegionStoreClient {
new KVErrorHandler<>(
regionManager, this, resp -> resp.hasRegionError() ? resp.getRegionError() : null);
RawCASResponse resp =
callWithRetry(backOffer, TikvGrpc.getRawCompareAndSetMethod(), factory, handler);
callWithRetry(backOffer, TikvGrpc.getRawCompareAndSwapMethod(), factory, handler);
return rawPutIfAbsentHelper(resp);
} finally {
requestTimer.observeDuration();
@ -970,10 +970,10 @@ public class RegionStoreClient extends AbstractRegionStoreClient {
if (resp.hasRegionError()) {
throw new RegionException(resp.getRegionError());
}
if (!resp.getNotEqual()) {
if (resp.getSucceed()) {
return ByteString.EMPTY;
}
return resp.getValue();
return resp.getPreviousValue();
}
public List<KvPair> rawBatchGet(BackOffer backoffer, List<ByteString> keys) {