This is an automated email from the ASF dual-hosted git repository.
ctubbsii pushed a commit to branch 2.1
in repository https://gitbox.apache.org/repos/asf/accumulo.git
The following commit(s) were added to refs/heads/2.1 by this push:
new 05e4693ef6 Simplify isPropertySet and remove redundant code (#3530)
05e4693ef6 is described below
commit 05e4693ef6dd868237ad1e16ec3107f48ee89067
Author: Christopher Tubbs <[email protected]>
AuthorDate: Fri Jun 23 17:12:40 2023 -0400
Simplify isPropertySet and remove redundant code (#3530)
* Simplify ZooBasedConfiguration's implementation of isPropertySet, and
* Remove TableConfiguration's redundant implementation, as it's the same
as its super class (it just didn't look the same until it was
simplified)
---
.../apache/accumulo/server/conf/TableConfiguration.java | 14 --------------
.../apache/accumulo/server/conf/ZooBasedConfiguration.java | 10 +---------
2 files changed, 1 insertion(+), 23 deletions(-)
diff --git
a/server/base/src/main/java/org/apache/accumulo/server/conf/TableConfiguration.java
b/server/base/src/main/java/org/apache/accumulo/server/conf/TableConfiguration.java
index 1321902bc0..b793719cb2 100644
---
a/server/base/src/main/java/org/apache/accumulo/server/conf/TableConfiguration.java
+++
b/server/base/src/main/java/org/apache/accumulo/server/conf/TableConfiguration.java
@@ -80,20 +80,6 @@ public class TableConfiguration extends
ZooBasedConfiguration {
newDeriver(conf -> createCryptoService(conf, tableId,
context.getCryptoFactory()));
}
- @Override
- public boolean isPropertySet(Property prop) {
- if (_isPropertySet(prop)) {
- return true;
- }
-
- return getParent().isPropertySet(prop);
- }
-
- private boolean _isPropertySet(Property property) {
- Map<String,String> propMap = getSnapshot();
- return propMap.get(property.getKey()) != null;
- }
-
@Override
public String get(Property property) {
String value = _get(property);
diff --git
a/server/base/src/main/java/org/apache/accumulo/server/conf/ZooBasedConfiguration.java
b/server/base/src/main/java/org/apache/accumulo/server/conf/ZooBasedConfiguration.java
index 15126c806a..24cbe7260c 100644
---
a/server/base/src/main/java/org/apache/accumulo/server/conf/ZooBasedConfiguration.java
+++
b/server/base/src/main/java/org/apache/accumulo/server/conf/ZooBasedConfiguration.java
@@ -141,15 +141,7 @@ public class ZooBasedConfiguration extends
AccumuloConfiguration {
@Override
public boolean isPropertySet(final Property property) {
-
- Map<String,String> theseProps = getSnapshot();
-
- if (theseProps.get(property.getKey()) != null) {
- return true;
- }
-
- return getParent().isPropertySet(property);
-
+ return getSnapshot().get(property.getKey()) != null ||
getParent().isPropertySet(property);
}
public @NonNull Map<String,String> getSnapshot() {