# \#java

**URL:** https://discuss.aerospike.com/tag/java/33.md?match_all_tags=true&tags%5B%5D=java

[Latest](https://discuss.aerospike.com/latest.md) · [Categories](https://discuss.aerospike.com/categories.md) · [Tags](https://discuss.aerospike.com/tags.md)

---

## [KEY\_NOT\_FOUND (Error 2) on put() with UPDATE + EXPECT\_GEN\_EQUAL when record is deleted or expired concurrently](https://discuss.aerospike.com/t/key-not-found-error-2-on-put-with-update-expect-gen-equal-when-record-is-deleted-or-expired-concurrently/12830)

<div class="topic-metadata">

**Author:** [@sumitCentro](https://discuss.aerospike.com/u/sumitCentro)\
**Replies:** 2\
**Last updated:** [May 11, 2026, 5:04pm UTC](https://discuss.aerospike.com/t/key-not-found-error-2-on-put-with-update-expect-gen-equal-when-record-is-deleted-or-expired-concurrently/12830 "2026-05-11T17:04:47Z")

</div>

Summary We are observing KEY\_NOT\_FOUND (ResultCode 2) errors on AerospikeClient.put() calls when using RecordExistsAction.UPDATE combined with GenerationPolicy.EXPECT\_GEN\_EQUAL. Per the Aerospike documentation, RecordEx…

---

## [Possibe behaviour with Aerospike Java client, Statement.setMaxRecords when it's set to 1](https://discuss.aerospike.com/t/possibe-behaviour-with-aerospike-java-client-statement-setmaxrecords-when-its-set-to-1/12815)

<div class="topic-metadata">

**Author:** [@iandntran](https://discuss.aerospike.com/u/iandntran)\
**Replies:** 0\
**Last updated:** [April 21, 2026, 9:22pm UTC](https://discuss.aerospike.com/t/possibe-behaviour-with-aerospike-java-client-statement-setmaxrecords-when-its-set-to-1/12815 "2026-04-21T21:22:36Z")

</div>

Hi, For version info, using the aerospike client version: 9.0.5 (jdk21 version) From reading the javadoc, it states the following for the Statement.setMaxRecords() method: Set maximum number of records returned (for for…

---

## [Aerospike In Memory Sizing](https://discuss.aerospike.com/t/aerospike-in-memory-sizing/12439)

<div class="topic-metadata">

**Author:** [@Bobby\_Harsono](https://discuss.aerospike.com/u/Bobby_Harsono)\
**Replies:** 11\
**Last updated:** [August 19, 2025, 6:41am UTC](https://discuss.aerospike.com/t/aerospike-in-memory-sizing/12439 "2025-08-19T06:41:02Z")

</div>

Im using Aerospike with storage-engine memory, AFAIK all records (primary id + payload) will be stored in memory. I set the storage size to 30GB on Aerospike.conf, however i found out that Aerospike will reserve that ma…

---

## [Error while connecting aerospike to DataGrip](https://discuss.aerospike.com/t/error-while-connecting-aerospike-to-datagrip/12274)

<div class="topic-metadata">

**Author:** [@Manish\_Kumar](https://discuss.aerospike.com/u/Manish_Kumar)\
**Replies:** 0\
**Last updated:** [April 22, 2025, 8:30am UTC](https://discuss.aerospike.com/t/error-while-connecting-aerospike-to-datagrip/12274 "2025-04-22T08:30:50Z")

</div>

I want to connect my aerospike client to dataGrip and have successfully added all the necessary proerpty details and it was able to get the sets from the namespace. but while trying to load the data from any of the set. …

---

## [Batch Writes Thread Executor Overhead: Worth It for Large or Small Batch Sizes?](https://discuss.aerospike.com/t/batch-writes-thread-executor-overhead-worth-it-for-large-or-small-batch-sizes/12124)

<div class="topic-metadata">

**Author:** [@Tamilarasu](https://discuss.aerospike.com/u/Tamilarasu)\
**Replies:** 5\
**Last updated:** [March 4, 2025, 5:01pm UTC](https://discuss.aerospike.com/t/batch-writes-thread-executor-overhead-worth-it-for-large-or-small-batch-sizes/12124 "2025-03-04T17:01:48Z")

</div>

I’m analyzing the client.operate(BatchPolicy policy, List\<BatchRecord\> records) method in Aerospike and found that it calls BatchExecutor.execute(cluster, policy, commands, status), where a new ExecutorService is created…

---

## [Parameter Error when writing a record using RecordExistsAction.REPLACE](https://discuss.aerospike.com/t/parameter-error-when-writing-a-record-using-recordexistsaction-replace/12059)

<div class="topic-metadata">

**Author:** [@shan.p](https://discuss.aerospike.com/u/shan.p)\
**Replies:** 6\
**Last updated:** [January 29, 2025, 4:05am UTC](https://discuss.aerospike.com/t/parameter-error-when-writing-a-record-using-recordexistsaction-replace/12059 "2025-01-29T04:05:49Z")

</div>

Aerospike server version: 6.3 Aerospike Java client version: 6.1.1 When I create or update a record with 3 bins (two string values and one a Map), with WritePolicy having RecordExistsAction.REPLACE: WritePolicy writePo…

---

## [Aerospike Cache for very high rate of updates](https://discuss.aerospike.com/t/aerospike-cache-for-very-high-rate-of-updates/11886)

<div class="topic-metadata">

**Author:** [@ashuk89](https://discuss.aerospike.com/u/ashuk89)\
**Replies:** 1\
**Last updated:** [December 4, 2024, 7:09pm UTC](https://discuss.aerospike.com/t/aerospike-cache-for-very-high-rate-of-updates/11886 "2024-12-04T19:09:24Z")

</div>

We have usecase where we wont want to store text data into database. We explored aerospike and wanted to implement Aerospike Cache for fast retrieval of data, stored in cache. As are not storing data into database, we ha…

---

## [Aeropsike async client is making frequent authentication like several per second](https://discuss.aerospike.com/t/aeropsike-async-client-is-making-frequent-authentication-like-several-per-second/11644)

<div class="topic-metadata">

**Author:** [@Anshul\_Goel](https://discuss.aerospike.com/u/Anshul_Goel)\
**Replies:** 7\
**Last updated:** [October 21, 2024, 4:39pm UTC](https://discuss.aerospike.com/t/aeropsike-async-client-is-making-frequent-authentication-like-several-per-second/11644 "2024-10-21T16:39:04Z")

</div>

We are using aerospike client 6.1.0 and we switched to async client call. Our changes were working fine but we faced issue on server side that there were several authentication logs per second due to which disk was getti…

---

## [Loading Data from Aerospike Failing with Spark Connector](https://discuss.aerospike.com/t/loading-data-from-aerospike-failing-with-spark-connector/11230)

<div class="topic-metadata">

**Author:** [@prithu2212](https://discuss.aerospike.com/u/prithu2212)\
**Replies:** 8\
**Last updated:** [June 28, 2024, 11:09am UTC](https://discuss.aerospike.com/t/loading-data-from-aerospike-failing-with-spark-connector/11230 "2024-06-28T11:09:31Z")

</div>

I’m using Spark to load data from an Aerospike cluster in to dataframe, process it, and write it to another Aerospike cluster. The data has two bins: one with a List of Strings and another with a Map where the keys are S…

---

## [High latency and cpu is not getting utilised completely](https://discuss.aerospike.com/t/high-latency-and-cpu-is-not-getting-utilised-completely/11246)

<div class="topic-metadata">

**Author:** [@Tamilarasu](https://discuss.aerospike.com/u/Tamilarasu)\
**Replies:** 6\
**Last updated:** [June 27, 2024, 8:45pm UTC](https://discuss.aerospike.com/t/high-latency-and-cpu-is-not-getting-utilised-completely/11246 "2024-06-27T20:45:28Z")

</div>

Hi Team, I am trying out the aerospike for our production use case and when i cam hitting the server the cpu usage is not going above 5% due to this latency is very low. Aerospike version - 7.0.0.10 Cluster - 3 node clus…

---

## [Querying for records with a large number of keys](https://discuss.aerospike.com/t/querying-for-records-with-a-large-number-of-keys/11214)

<div class="topic-metadata">

**Author:** [@Brent212](https://discuss.aerospike.com/u/Brent212)\
**Replies:** 7\
**Last updated:** [June 20, 2024, 4:57am UTC](https://discuss.aerospike.com/t/querying-for-records-with-a-large-number-of-keys/11214 "2024-06-20T04:57:09Z")

</div>

I need to query up to 2 million records using a set of keys. Memory restrictions prevent the application from reading them all in at once, so I need to write the record data out to files as it comes in rather than receiv…

---

## [Getting InvalidNamespace: Error 20,1: Partition map empty with java client only, go client is fine](https://discuss.aerospike.com/t/getting-invalidnamespace-error-20-1-partition-map-empty-with-java-client-only-go-client-is-fine/11205)

<div class="topic-metadata">

**Author:** [@bobbyajp](https://discuss.aerospike.com/u/bobbyajp)\
**Replies:** 4\
**Last updated:** [June 13, 2024, 8:10pm UTC](https://discuss.aerospike.com/t/getting-invalidnamespace-error-20-1-partition-map-empty-with-java-client-only-go-client-is-fine/11205 "2024-06-13T20:10:41Z")

</div>

Running a 7.1.0.1 local aero server, the following code in go works (v7 sdk) cp := aero.NewClientPolicy() cp.User = "" cp.Password = "" cp.Timeout = 1 \* time.Second ash := aero.NewHost("127.0.0.1", 3000) client, e…

---

## [RecordExistsAction.CREATE\_ONLY and SendKey isnt working on Java Object Mapper](https://discuss.aerospike.com/t/recordexistsaction-create-only-and-sendkey-isnt-working-on-java-object-mapper/11111)

<div class="topic-metadata">

**Author:** [@vamsi.koneru1](https://discuss.aerospike.com/u/vamsi.koneru1)\
**Replies:** 6\
**Last updated:** [May 17, 2024, 4:10pm UTC](https://discuss.aerospike.com/t/recordexistsaction-create-only-and-sendkey-isnt-working-on-java-object-mapper/11111 "2024-05-17T16:10:44Z")

</div>

Hello, We are using Java Object Mapper to save and read the records from the Database. We have Configured our write policy to make sure we store the key in DB by using writePolicy.sendKey = true; and RecordExistsActio…

---

## [In Java using Batch, query the data using the secondary index](https://discuss.aerospike.com/t/in-java-using-batch-query-the-data-using-the-secondary-index/11042)

<div class="topic-metadata">

**Author:** [@Tom](https://discuss.aerospike.com/u/Tom)\
**Replies:** 15\
**Last updated:** [May 1, 2024, 9:25pm UTC](https://discuss.aerospike.com/t/in-java-using-batch-query-the-data-using-the-secondary-index/11042 "2024-05-01T21:25:57Z")

</div>

Primary Key :: EmployeeIdValueEmployeeIdType Secondary Index :: AlternateEmployeeId 1.we are fetching all the keys from the input and storing it in the KeystoFetch. List\<String\> keysToFetch = new ArrayList\<\>(); …

---

## [Does queryAggregate() return Single or Multiple results or rows from ResultSet](https://discuss.aerospike.com/t/does-queryaggregate-return-single-or-multiple-results-or-rows-from-resultset/10949)

<div class="topic-metadata">

**Author:** [@griffinjm](https://discuss.aerospike.com/u/griffinjm)\
**Replies:** 6\
**Last updated:** [April 11, 2024, 2:20pm UTC](https://discuss.aerospike.com/t/does-queryaggregate-return-single-or-multiple-results-or-rows-from-resultset/10949 "2024-04-11T14:20:47Z")

</div>

Looking for help if anyone can help explain queryAggregate() behaviour in a clustered environment using an aggregation UDF. It’s not exactly clear to me what queryAggregate() returns when multiple nodes are present. The…

---

## [com.aerospike.client.AerospikeException: Error 4,1,30000,30000,30000,2,C1 10.11.153.68 3000: Parameter error](https://discuss.aerospike.com/t/com-aerospike-client-aerospikeexception-error-4-1-30000-30000-30000-2-c1-10-11-153-68-3000-parameter-error/10976)

<div class="topic-metadata">

**Author:** [@shanmugarrm](https://discuss.aerospike.com/u/shanmugarrm)\
**Replies:** 0\
**Last updated:** [April 9, 2024, 7:51pm UTC](https://discuss.aerospike.com/t/com-aerospike-client-aerospikeexception-error-4-1-30000-30000-30000-2-c1-10-11-153-68-3000-parameter-error/10976 "2024-04-09T19:51:41Z")

</div>

I am trying to write a Spring batch code to copy data in Aerospike DB. So trying to use batch write. public void write(Chunk\<? extends List\<AeroSpikeData\>\> chunk) throws Exception { List\<BatchRecord\> records = new A…

---

## [Filters record using the json property when json present in a bin](https://discuss.aerospike.com/t/filters-record-using-the-json-property-when-json-present-in-a-bin/10913)

<div class="topic-metadata">

**Author:** [@amanjain08](https://discuss.aerospike.com/u/amanjain08)\
**Replies:** 3\
**Last updated:** [March 21, 2024, 9:15pm UTC](https://discuss.aerospike.com/t/filters-record-using-the-json-property-when-json-present-in-a-bin/10913 "2024-03-21T21:15:20Z")

</div>

Hi, I have JSON stored in one bin with ‘data’ as key. Now I want to filter records based on one of the JSON property value. bin → "data" : { "entity\_id": "1234567", "store\_id": "", "sub\_merchant\_id": "", …

---

## [Network Disconnection Impact on Cluster State and Data Queries in a Multi-Node Cluster with Replicas](https://discuss.aerospike.com/t/network-disconnection-impact-on-cluster-state-and-data-queries-in-a-multi-node-cluster-with-replicas/10765)

<div class="topic-metadata">

**Author:** [@1028501412](https://discuss.aerospike.com/u/1028501412)\
**Replies:** 1\
**Last updated:** [January 11, 2024, 7:15pm UTC](https://discuss.aerospike.com/t/network-disconnection-impact-on-cluster-state-and-data-queries-in-a-multi-node-cluster-with-replicas/10765 "2024-01-11T19:15:03Z")

</div>

If a cluster with multiple nodes and two replicas experiences a network-related disconnection on one of the nodes, it can lead to an abnormal cluster state where data queries may fail without generating an AerospikeExcep…

---

## [Replacement for PredExp on a List Bin of Strings](https://discuss.aerospike.com/t/replacement-for-predexp-on-a-list-bin-of-strings/10657)

<div class="topic-metadata">

**Author:** [@ag7](https://discuss.aerospike.com/u/ag7)\
**Replies:** 1\
**Last updated:** [November 22, 2023, 8:50pm UTC](https://discuss.aerospike.com/t/replacement-for-predexp-on-a-list-bin-of-strings/10657 "2023-11-22T20:50:59Z")

</div>

Hi Community, I have a bin of type List. I want to query and get the records for which this bin has a value equal to variable ‘val’, lets say. Using PredExp this can be done using - predExps = Arrays.asList( PredEx…

---

## [findByIndexed fails "Id must not be null"](https://discuss.aerospike.com/t/findbyindexed-fails-id-must-not-be-null/10586)

<div class="topic-metadata">

**Author:** [@Hetal\_Rathod](https://discuss.aerospike.com/u/Hetal_Rathod)\
**Replies:** 6\
**Last updated:** [November 20, 2023, 5:02pm UTC](https://discuss.aerospike.com/t/findbyindexed-fails-id-must-not-be-null/10586 "2023-11-20T17:02:46Z")

</div>

Hi Team, Can anyone please help me on the below issue - I am trying to fetch an entity based on an indexed field. Spring Data is actually able to retrieve the entity from Aerospike DB but unfortunately, it is not sendi…

---

## [Java thread blocked infinite in recordSet.next function after executing query](https://discuss.aerospike.com/t/java-thread-blocked-infinite-in-recordset-next-function-after-executing-query/10604)

<div class="topic-metadata">

**Author:** [@sandeep41](https://discuss.aerospike.com/u/sandeep41)\
**Replies:** 2\
**Last updated:** [November 7, 2023, 10:31am UTC](https://discuss.aerospike.com/t/java-thread-blocked-infinite-in-recordset-next-function-after-executing-query/10604 "2023-11-07T10:31:07Z")

</div>

In java aerospike client 6.0.0, thread blocked for infinite time in records.next() call, however we have set totalTimeout in queryPolicy to 30 seconds. This even happened we don’t have any data in the set for a particula…

---

## [Aerospike Filter and Expressions](https://discuss.aerospike.com/t/aerospike-filter-and-expressions/10618)

<div class="topic-metadata">

**Author:** [@Nandish](https://discuss.aerospike.com/u/Nandish)\
**Replies:** 1\
**Last updated:** [November 3, 2023, 4:25pm UTC](https://discuss.aerospike.com/t/aerospike-filter-and-expressions/10618 "2023-11-03T16:25:48Z")

</div>

I have an aerospike client setup in spring boot Java, and I am trying to query a set with one filter and 2 or more expressions since aerospike does not support multiple secondary index filters. Now with this setup , whe…

---

## [Query on the Secondary Index throwing Error: InaccessibleObjectException](https://discuss.aerospike.com/t/query-on-the-secondary-index-throwing-error-inaccessibleobjectexception/10564)

<div class="topic-metadata">

**Author:** [@Kailash\_Kolluru](https://discuss.aerospike.com/u/Kailash_Kolluru)\
**Replies:** 2\
**Last updated:** [October 19, 2023, 5:17pm UTC](https://discuss.aerospike.com/t/query-on-the-secondary-index-throwing-error-inaccessibleobjectexception/10564 "2023-10-19T17:17:43Z")

</div>

We have a Table with Id as primary key. Now, we are trying to add Secondary Index to one column called “userId” and did so by using @Indexed. Even added findByUserId in its repository. But, While Querying with findByUser…

---

## [Does filter expression benifit from secondary index](https://discuss.aerospike.com/t/does-filter-expression-benifit-from-secondary-index/10200)

<div class="topic-metadata">

**Author:** [@dzhhh](https://discuss.aerospike.com/u/dzhhh)\
**Replies:** 3\
**Last updated:** [September 7, 2023, 3:38pm UTC](https://discuss.aerospike.com/t/does-filter-expression-benifit-from-secondary-index/10200 "2023-09-07T15:38:48Z")

</div>

Hi, I need to query data from a set with two bins, one is string type, the other is boolean type. Because of only one bin can be used as filter when query, I use the string-typed bin as filter, and make a filter expressi…

---

## [Atomic map update using java object mapper](https://discuss.aerospike.com/t/atomic-map-update-using-java-object-mapper/10371)

<div class="topic-metadata">

**Author:** [@divik](https://discuss.aerospike.com/u/divik)\
**Replies:** 4\
**Last updated:** [August 22, 2023, 4:44pm UTC](https://discuss.aerospike.com/t/atomic-map-update-using-java-object-mapper/10371 "2023-08-22T16:44:48Z")

</div>

Is it possible to do atomic update on maps stored in aerospike using java object mapper ? I am aware about the atomic updates using java client operate method, wondering if there is a way to do the same using AeroMapper. …

---

## [Recommended way to store a Map\<String, CustomObject\> as bin](https://discuss.aerospike.com/t/recommended-way-to-store-a-map-string-customobject-as-bin/10447)

<div class="topic-metadata">

**Author:** [@divik](https://discuss.aerospike.com/u/divik)\
**Replies:** 0\
**Last updated:** [August 22, 2023, 11:02am UTC](https://discuss.aerospike.com/t/recommended-way-to-store-a-map-string-customobject-as-bin/10447 "2023-08-22T11:02:47Z")

</div>

What is the recommended and performant way to store a Map\<String, CustomObject\> as bin in Aerospike? I need to perform following operations on the bin Fetch the entire map from the record (i.e., fetch the entire bin) u…

---

## [CVE-2023-36480 - Aerospike Java Client vulnerable to unsafe deserialization of server responses](https://discuss.aerospike.com/t/cve-2023-36480-aerospike-java-client-vulnerable-to-unsafe-deserialization-of-server-responses/10391)

<div class="topic-metadata">

**Author:** [@rbotzer](https://discuss.aerospike.com/u/rbotzer)\
**Replies:** 1\
**Last updated:** [August 8, 2023, 2:30am UTC](https://discuss.aerospike.com/t/cve-2023-36480-aerospike-java-client-vulnerable-to-unsafe-deserialization-of-server-responses/10391 "2023-08-08T02:30:49Z")

</div>

On August 4th, 2023, GitHub published CVE-2023-36480, a high severity vulnerability in our Aerospike Java client. GitHub Security Lab had previously notified us that the client is vulnerable to CWE-502. Upon confirming a…

---

## [Query Aerospike DB with Multiple Filters](https://discuss.aerospike.com/t/query-aerospike-db-with-multiple-filters/10367)

<div class="topic-metadata">

**Author:** [@Siva\_Samraj\_S](https://discuss.aerospike.com/u/Siva_Samraj_S)\
**Replies:** 1\
**Last updated:** [July 27, 2023, 12:36am UTC](https://discuss.aerospike.com/t/query-aerospike-db-with-multiple-filters/10367 "2023-07-27T00:36:04Z")

</div>

Team, I have an Aerospike DB with one set. Here by using the Java Client, I am trying to query the data with a date filter and ID filter. But with Aerospike, I couldn’t able to achieve it. Is there any way I can query t…

---

## [100% Read load test in zipfian distribution (80% operation on 20% data) with YCSB benchmark shows 3 times less IOPS. But improves after running 95% Read and 5% Update](https://discuss.aerospike.com/t/100-read-load-test-in-zipfian-distribution-80-operation-on-20-data-with-ycsb-benchmark-shows-3-times-less-iops-but-improves-after-running-95-read-and-5-update/10273)

<div class="topic-metadata">

**Author:** [@Sovit\_Patnaik](https://discuss.aerospike.com/u/Sovit_Patnaik)\
**Replies:** 3\
**Last updated:** [June 20, 2023, 11:50pm UTC](https://discuss.aerospike.com/t/100-read-load-test-in-zipfian-distribution-80-operation-on-20-data-with-ycsb-benchmark-shows-3-times-less-iops-but-improves-after-running-95-read-and-5-update/10273 "2023-06-20T23:50:53Z")

</div>

Hi Community, I am facing a very weird scenario while running 100% Read load test using YCSB specifically using Zipfian distribution (80% operations on 20% records) just after freshly loading the database with records. W…

---

## [Error messaging not descriptive](https://discuss.aerospike.com/t/error-messaging-not-descriptive/10262)

<div class="topic-metadata">

**Author:** [@bala](https://discuss.aerospike.com/u/bala)\
**Replies:** 1\
**Last updated:** [June 16, 2023, 9:33pm UTC](https://discuss.aerospike.com/t/error-messaging-not-descriptive/10262 "2023-06-16T21:33:21Z")

</div>

Getting Below error. Unable to figure out what kind of error is this; If API can improve to be more descriptive on the error messaging; will enhance developer experience. com.aerospike.client.AerospikeException: Error 4…

[Next page](https://discuss.aerospike.com/tag/java/33.md?match_all_tags=true&page=1&tags%5B%5D=java)
