Skip to content

Commit d5cb6e7

Browse files
author
Ankit Gupta
committed
Assert on key size in multiget
1 parent 65fba4b commit d5cb6e7

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

java/org/rocksdb/RocksDB.java

+4
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,8 @@ public byte[] get(ReadOptions opt, byte[] key) throws RocksDBException {
171171
*/
172172
public Map<byte[], byte[]> multiGet(List<byte[]> keys)
173173
throws RocksDBException {
174+
assert(keys.size() != 0);
175+
174176
List<byte[]> values = multiGet(
175177
nativeHandle_, keys, keys.size());
176178

@@ -199,6 +201,8 @@ public Map<byte[], byte[]> multiGet(List<byte[]> keys)
199201
*/
200202
public Map<byte[], byte[]> multiGet(ReadOptions opt, List<byte[]> keys)
201203
throws RocksDBException {
204+
assert(keys.size() != 0);
205+
202206
List<byte[]> values = multiGet(
203207
nativeHandle_, opt.nativeHandle_, keys, keys.size());
204208

0 commit comments

Comments
 (0)