apache / accumulo

Apache Accumulo
https://accumulo.apache.org
Apache License 2.0
1.08k stars 445 forks source link

Consistent naming of Utility classes #2519

Open milleruntime opened 2 years ago

milleruntime commented 2 years ago

It would be nice if all of our static utility classes were named consistently *Util.java while other plain old Java Object (POJO) type classes were named differently. Most of them seem to follow this naming convention but not all. We have about 50 utility classes.

09:49:00 (main) ~/workspace/accumulo$ find core/src/main/java/org/apache/accumulo/core/util/ -name "*Util.java" 
core/src/main/java/org/apache/accumulo/core/util/ShutdownUtil.java
core/src/main/java/org/apache/accumulo/core/util/TextUtil.java
core/src/main/java/org/apache/accumulo/core/util/cleaner/CleanerUtil.java
core/src/main/java/org/apache/accumulo/core/util/ByteBufferUtil.java
core/src/main/java/org/apache/accumulo/core/util/AddressUtil.java
core/src/main/java/org/apache/accumulo/core/util/CompletableFutureUtil.java
core/src/main/java/org/apache/accumulo/core/util/ThriftMessageUtil.java
core/src/main/java/org/apache/accumulo/core/util/MonitorUtil.java
core/src/main/java/org/apache/accumulo/core/util/NumUtil.java
core/src/main/java/org/apache/accumulo/core/util/compaction/ExternalCompactionUtil.java
core/src/main/java/org/apache/accumulo/core/util/LocalityGroupUtil.java

AdminUtil is a POJO so should probably be renamed. The advantage of renaming classes is so its clear which classes are static utilities and which are objects that can be shared, instantiated and made private final members of other classes.

ctubbsii commented 2 years ago

I'm generally in favor of consistent naming. However, we have a ton of classes, so naming consistency is going to be hard no matter what conventions we use, because there are always going to be classes that don't fall clearly into one category vs. another, when trying to name them consistently. So, I wouldn't spend too much effort on this. Actually, this one could be very disruptive if too many changes are made, and may not be a substantial net benefit.

ctubbsii commented 2 years ago

Also, I think this might be either too large, or too poorly defined, to be considered a "good first issue".