[
https://issues.apache.org/jira/browse/DRILL-6332?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16995603#comment-16995603
]
ASF GitHub Bot commented on DRILL-6332:
---------------------------------------
arina-ielchiieva commented on pull request #1931: DRILL-6332: Allow to provide
two-component Kerberos principals
URL: https://github.com/apache/drill/pull/1931#discussion_r357633880
##########
File path: common/src/main/java/org/apache/drill/common/KerberosUtil.java
##########
@@ -38,29 +38,39 @@
* Returns principal of format primary/instance@REALM.
*
* @param primary non-null primary component
- * @param instance non-null instance component
+ * @param instance non-null instance component, can be empty string
* @param realm non-null realm component
- * @return principal of format primary/instance@REALM
+ * @return principal of format primary/instance@REALM or primary@REALM
*/
public static String getPrincipalFromParts(final String primary, final
String instance, final String realm) {
- return checkNotNull(primary) + "/" +
- checkNotNull(instance) + "@" +
- checkNotNull(realm);
+ checkNotNull(primary);
+ checkNotNull(realm);
+
+ return checkNotNull(primary) +
+ ((instance != "")? "/" + instance: "")
Review comment:
```suggestion
((instance != "") ? "/" + instance : "")
```
----------------------------------------------------------------
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]
> DrillbitStartupException: Failure while initializing values in Drillbit
> -----------------------------------------------------------------------
>
> Key: DRILL-6332
> URL: https://issues.apache.org/jira/browse/DRILL-6332
> Project: Apache Drill
> Issue Type: Improvement
> Components: Server
> Affects Versions: 1.10.0
> Reporter: Hari Sekhon
> Priority: Major
> Attachments: 01.patch
>
>
> Improvement request to make this error more specific so we can tell what is
> causing it:
> {code:java}
> ==> /opt/mapr/drill/drill-1.10.0/logs/drillbit.out <==
> Exception in thread "main"
> org.apache.drill.exec.exception.DrillbitStartupException: Failure while
> initializing values in Drillbit.
> at org.apache.drill.exec.server.Drillbit.start(Drillbit.java:287)
> at org.apache.drill.exec.server.Drillbit.start(Drillbit.java:271)
> at org.apache.drill.exec.server.Drillbit.main(Drillbit.java:267)
> Caused by: java.lang.IllegalStateException
> at com.google.common.base.Preconditions.checkState(Preconditions.java:158)
> at
> org.apache.drill.common.KerberosUtil.splitPrincipalIntoParts(KerberosUtil.java:59)
> at
> org.apache.drill.exec.server.BootStrapContext.login(BootStrapContext.java:130)
> at
> org.apache.drill.exec.server.BootStrapContext.<init>(BootStrapContext.java:77)
> at org.apache.drill.exec.server.Drillbit.<init>(Drillbit.java:94)
> at org.apache.drill.exec.server.Drillbit.start(Drillbit.java:285)
> ... 2 more
> {code}
--
This message was sent by Atlassian Jira
(v8.3.4#803005)