diff --git a/java/client/src/main/java/glide/api/models/commands/scan/ScanOptions.java b/java/client/src/main/java/glide/api/models/commands/scan/ScanOptions.java
index 6fffc46f35..0bdddd5ed4 100644
--- a/java/client/src/main/java/glide/api/models/commands/scan/ScanOptions.java
+++ b/java/client/src/main/java/glide/api/models/commands/scan/ScanOptions.java
@@ -60,6 +60,8 @@ public String[] toArgs() {
return super.toArgs();
}
+ private final Boolean allowNonCoveredSlots;
+
/**
* @return the pattern used for the MATCH filter.
*/
@@ -86,4 +88,11 @@ public Long getCount() {
public ObjectType getType() {
return type;
}
+
+ /**
+ * @return whether allow non covered slots.
+ */
+ public Boolean getAllowNonCoveredSlots() {
+ return allowNonCoveredSlots;
+ }
}
diff --git a/java/client/src/main/java/glide/managers/CommandManager.java b/java/client/src/main/java/glide/managers/CommandManager.java
index d069c6bd72..47b0de7d75 100644
--- a/java/client/src/main/java/glide/managers/CommandManager.java
+++ b/java/client/src/main/java/glide/managers/CommandManager.java
@@ -428,6 +428,10 @@ protected CommandRequest.Builder prepareCursorRequest(
clusterScanBuilder.setObjectType(options.getType().getNativeName());
}
+ if (options.getAllowNonCoveredSlots() != null) {
+ clusterScanBuilder.setAllowNonCoveredSlots(options.getAllowNonCoveredSlots());
+ }
+
return CommandRequest.newBuilder().setClusterScan(clusterScanBuilder.build());
}
diff --git a/java/integTest/src/test/java/glide/TestUtilities.java b/java/integTest/src/test/java/glide/TestUtilities.java
index ea03632c39..bcf984b1fe 100644
--- a/java/integTest/src/test/java/glide/TestUtilities.java
+++ b/java/integTest/src/test/java/glide/TestUtilities.java
@@ -452,4 +452,43 @@ public static String getServerVersion(@NonNull final BaseClient client) {
}
return null;
}
+
+ /**
+ * Helper function to get a number of nodes, and ask the cluster till we get the number of nodes
+ *
+ * @param clusterClient Glide cluster client to be used for executing custom command
+ * @param count number of nodes expected
+ * @return true if we get the number of expected nodes
+ */
+ @SneakyThrows
+ public static boolean waitForClusterReady(GlideClusterClient clusterClient, int count) {
+ long timeout = 20000; // 20 seconds
+ long startTime = System.currentTimeMillis();
+
+ while (true) {
+ if (System.currentTimeMillis() - startTime > timeout) {
+ return false;
+ }
+ ClusterValue