Closed justinplus closed 5 years ago
The key's maximum size is documented in javadocs for all key constructors. The existing exception in combination with the documentation is sufficient. From the javadocs:
The key is converted to bytes to compute the digest. The key's byte size is limited to the current thread's buffer size (min 8KB). To store keys > 8KB, do one of the following:
Set once:
ThreadLocalData.DefaultBufferSize = maxKeySize + maxSetNameSize + 1;
Or for every key:
int len = key.length() + setName.length() + 1; if (len > ThreadLocalData.getBuffer().length)) ThreadLocalData.resizeBuffer(len);
what's the problem with adding validation of input parameters? this is standard for any public api.
Hi Aerospike team,
I discovered that if the key is String, and its size is too long, Aerospike client throws
ArrayIndexOutOfBoundsException
. Is it better to throw other more meaningful exception instead?ps: I'm using version 4.1.7.
Thank you, Justin