From 607053d20692e133c065cb969f524fef80fc88dd Mon Sep 17 00:00:00 2001 From: Ivan Bella Date: Thu, 18 Apr 2024 13:37:53 +0000 Subject: [PATCH] Added comments --- .../AccumuloClientConfiguration.java | 69 +++++++++++++++++++ 1 file changed, 69 insertions(+) diff --git a/src/main/java/datawave/webservice/common/connection/AccumuloClientConfiguration.java b/src/main/java/datawave/webservice/common/connection/AccumuloClientConfiguration.java index 7a037ee..9925b03 100644 --- a/src/main/java/datawave/webservice/common/connection/AccumuloClientConfiguration.java +++ b/src/main/java/datawave/webservice/common/connection/AccumuloClientConfiguration.java @@ -7,17 +7,38 @@ import org.apache.accumulo.core.client.ScannerBase; import org.apache.log4j.Logger; +/** + * This class will capture scanner hints per table and the consistency level per table. This will be used by the WrappedAccumuloClient to setup scanners as they + * are created. + */ public class AccumuloClientConfiguration { private Logger log = Logger.getLogger(AccumuloClientConfiguration.class); private Map> hintsByTable = new HashMap<>(); private Map consistencyByTable = new HashMap<>(); + /** + * Construct an empty configuration + */ public AccumuloClientConfiguration() {} + /** + * Construct a configuration with the specified hints per table + * + * @param hints + * A map of table to the hints map + */ public AccumuloClientConfiguration(Map> hints) { this(hints, Collections.emptyMap()); } + /** + * Construct a configuration with the specified hints and consistency levels + * + * @param hints + * A map of table to hints map + * @param levels + * A map of table to consistency level + */ public AccumuloClientConfiguration(Map> hints, Map levels) { for (String table : hints.keySet()) { putHints(table, hints.get(table)); @@ -27,6 +48,14 @@ public AccumuloClientConfiguration(Map> hints, Map hints) { if (hints != null && !hints.isEmpty()) { if (hintsByTable.containsKey(table)) { @@ -67,6 +128,14 @@ public void addHints(String table, Map hints) { } } + /** + * Replace a set of hints for a table. This will remove previously configured hints for this table. + * + * @param table + * The table + * @param hints + * The hints + */ public void putHints(String table, Map hints) { if (hints == null || hints.isEmpty()) { hintsByTable.remove(table);