Skip to content

Commit

Permalink
Feature/upgrade aerospike clients (#161)
Browse files Browse the repository at this point in the history
* Adding a latitude and longitude validation (otherwise Aerospike Client will throw an exception).

* Upgrade Aerospike client versions:
aerospike-client 4.4.18 -> 5.0.5
aerospike-reactor-client 4.4.10 -> 5.0.3

* Part of the upgrade required a Playtika embedded aerospike-server version configuration in bootstrap.properties file.
  • Loading branch information
roimenashe authored Mar 14, 2021
1 parent ab13f5f commit 398d428
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 5 deletions.
4 changes: 2 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@

<properties>
<source.level>1.8</source.level>
<aerospike>4.4.18</aerospike>
<aerospike-reactor>4.4.10</aerospike-reactor>
<aerospike>5.0.5</aerospike>
<aerospike-reactor>5.0.3</aerospike-reactor>

<springdata.commons>2.4.5</springdata.commons>
<springdata.keyvalue>2.4.5</springdata.keyvalue>
Expand Down
1 change: 1 addition & 0 deletions src/main/resources/bootstrap.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
embedded.aerospike.dockerImage=aerospike/aerospike-server:5.5.0.3
Original file line number Diff line number Diff line change
Expand Up @@ -117,12 +117,19 @@ private void setupGeoData() {
for (int i = 0; i < RECORD_COUNT; i++) {
double lng = -122 + (0.1 * i);
double lat = 37.5 + (0.1 * i);
Bin bin = Bin.asGeoJSON(GEO_BIN_NAME, buildGeoValue(lng, lat));
client.put(null, new Key(namespace, GEO_SET, keyPrefix + i), bin);
client.put(null, new Key(namespace, INDEXED_GEO_SET, keyPrefix + i), bin);
if (isLatLngValidPair(lng, lat)) {
Bin bin = Bin.asGeoJSON(GEO_BIN_NAME, buildGeoValue(lng, lat));
client.put(null, new Key(namespace, GEO_SET, keyPrefix + i), bin);
client.put(null, new Key(namespace, INDEXED_GEO_SET, keyPrefix + i), bin);
}
}
}

private boolean isLatLngValidPair(double lng, double lat) {
return (-180 <= lng && lng <= 180
&& -90 <= lat && lat <= 90);
}

private void setupSpecialCharsData() {
Key ewsKey = new Key(namespace, SPECIAL_CHAR_SET, "ends-with-star");
Bin ewsBin = new Bin(SPECIAL_CHAR_BIN, "abcd.*");
Expand Down

0 comments on commit 398d428

Please sign in to comment.