You are viewing a plain text version of this content. The canonical link for it is here.
Posted to gitbox@hive.apache.org by "kgyrtkirk (via GitHub)" <gi...@apache.org> on 2023/02/02 10:38:22 UTC

[GitHub] [hive] kgyrtkirk commented on a diff in pull request #4002: HIVE-26985: Create a trackable hive configuration object

kgyrtkirk commented on code in PR #4002:
URL: https://github.com/apache/hive/pull/4002#discussion_r1094344239


##########
common/src/java/org/apache/hadoop/hive/conf/HiveConf.java:
##########
@@ -6331,29 +6333,76 @@ public ZooKeeperHiveHelper getZKConfig() {
       .trustStorePassword(trustStorePassword).build();
   }
 
-  public HiveConf() {
+  public static HiveConf create() {
+    HiveConf conf = new HiveConf();
+    if (conf.isPropertyTrackingEnabled()) {
+      return new TrackedHiveConf();
+    }
+    return conf;
+  }
+
+  public static HiveConf create(Class<?> cls) {
+    HiveConf conf = new HiveConf(cls);
+    if (conf.isPropertyTrackingEnabled()) {
+      return new TrackedHiveConf(cls);
+    }
+    return conf;
+  }
+
+  public static HiveConf create(Configuration other, Class<?> cls) {
+    if (other.getBoolean(ConfVars.HIVE_CONF_PROPERTY_TRACKING.varname, false)) {
+      return new TrackedHiveConf(other, cls);
+    }
+    return new HiveConf(other, cls);
+  }
+
+  public static HiveConf create(HiveConf other) {
+    if (other.isPropertyTrackingEnabled()) {
+      return new TrackedHiveConf(other);
+    }
+    return new HiveConf(other);
+  }
+
+  private boolean isPropertyTrackingEnabled() {
+    return getBoolVar(ConfVars.HIVE_CONF_PROPERTY_TRACKING);
+  }
+
+  /**
+   * @deprecated This method will become private eventually; Use {@link #create()} instead.
+   */
+  @Deprecated
+  protected HiveConf() {

Review Comment:
   I think there are other options than making HiveConf protected - and I don't think its worth to break all 3rd party extensions for a rarely used debug feature (-1)
   
   https://issues.apache.org/jira/browse/HIVE-26985?focusedCommentId=17683330&page=com.atlassian.jira.plugin.system.issuetabpanels%3Acomment-tabpanel#comment-17683330



-- 
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.

To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org