DomGarguilo commented on a change in pull request #2116:
URL: https://github.com/apache/accumulo/pull/2116#discussion_r638165618
##########
File path:
core/src/main/java/org/apache/accumulo/core/client/ConditionalWriterConfig.java
##########
@@ -175,4 +190,32 @@ public String getClassLoaderContext() {
return this.classLoaderContext;
}
+ private static <T> T merge(T o1, T o2) {
+ if (o1 != null)
+ return o1;
+ return o2;
+ }
+
+ /**
+ * Merge this ConditionalWriterConfig with another. If config is set in
both, preference will be
+ * given to this config.
+ *
+ * @param other
+ * Another ConditionalWriterConfig
+ * @return Merged ConditionalWriterConfig
+ * @since 2.0.0
+ */
+ public ConditionalWriterConfig merge(ConditionalWriterConfig other) {
+ ConditionalWriterConfig result = new ConditionalWriterConfig();
+ result.timeout = merge(this.timeout, other.timeout);
+ result.maxWriteThreads = merge(this.maxWriteThreads,
other.maxWriteThreads);
+ result.auths = merge(this.auths, other.auths);
Review comment:
You're right. I can change it to `result.auths = this.auths;`
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]