You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@accumulo.apache.org by GitBox <gi...@apache.org> on 2018/04/19 17:00:07 UTC

[GitHub] keith-turner commented on a change in pull request #430: #408 - Removed uses of deprecated ClientConfiguration

keith-turner commented on a change in pull request #430:  #408 - Removed uses of deprecated ClientConfiguration
URL: https://github.com/apache/accumulo/pull/430#discussion_r182815150
 
 

 ##########
 File path: core/src/main/java/org/apache/accumulo/core/client/impl/ClientConfConverter.java
 ##########
 @@ -229,6 +239,37 @@ public void getProperties(Map<String,String> props, Predicate<String> filter) {
         return null;
       }
     };
+  }
+
+  public static ClientConfiguration toClientConf(AccumuloConfiguration conf) {
+    ClientConfiguration clientConf = ClientConfiguration.create();
 
+    // Servers will only have the full principal in their configuration -- parse the
+    // primary and realm from it.
+    final String serverPrincipal = conf.get(Property.GENERAL_KERBEROS_PRINCIPAL);
+
+    final KerberosName krbName;
+    try {
+      krbName = new KerberosName(serverPrincipal);
+      clientConf.setProperty(ClientConfiguration.ClientProperty.KERBEROS_SERVER_PRIMARY, krbName.getServiceName());
+    } catch (Exception e) {
 
 Review comment:
   This seems overly broad, is there something more specific to do? Could empty case be checked for?  Is there a more specific exception to catch?  Also could log exception at debug.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services