tarantool/tarantool-java

Deprecate upsert with a key (from tarantool 1.6.6)

開放

#248 建立於 2019年11月22日

 (0 則留言) (0 個反應) (0 位負責人)Java (20 個分叉)auto 404
backlogcode healthenhancementgood first issueprio1

倉庫指標

星標
 (52 顆星)
PR 合併指標
 (PR 指標待抓取)

描述

Tarantool-java version: 1.9.3.

Cited from Tarantool 1.6.7 release notes:

The syntax of upsert command has been changed and an extra key argument was removed from it. The primary key for look up is now always taken from the tuple, which is the second argument of upsert. upsert() was added fairly late at a release cycle and the design had an obvious bug which we had to fix. Sorry for this.

See also https://github.com/tarantool/tarantool/issues/1070

The connector provides upsert() method with a key argument:

https://github.com/tarantool/tarantool-java/blob/56c28a3b27167d39bf23293acd4127ddb1e56ecf/src/main/java/org/tarantool/AbstractTarantoolOps.java#L39-L41

This is harmless, because those arguments are packed into a map and deprecated key field is ignored by tarantool 1.6.7 and above. However this API can confuse a user.

I propose to overload upsert method w/o key argument to don't bother a user with providing some value for key. This will also save some CPU cycles on encoding a request and several bytes in outgoing packets.

We also should cleanly state in javadoc that the old upsert method is deprecated and should be used only for tarantool 1.6.6 and below. We cannot remove the method, because the connector should be backward compatible.

貢獻者指南