Get the hdfs keytab. @param conf the storm Configuration @return the keytab
(Map<String, Object> conf)
| 2462 | * @return the keytab |
| 2463 | */ |
| 2464 | public static String getHdfsKeytab(Map<String, Object> conf) { |
| 2465 | String ret; |
| 2466 | |
| 2467 | String blobstoreKeyTab = (String) conf.get(Config.BLOBSTORE_HDFS_KEYTAB); |
| 2468 | String hdfsKeyTab = (String) conf.get(Config.STORM_HDFS_LOGIN_KEYTAB); |
| 2469 | if (blobstoreKeyTab == null && hdfsKeyTab == null) { |
| 2470 | return null; |
| 2471 | } else if (blobstoreKeyTab == null) { |
| 2472 | ret = hdfsKeyTab; |
| 2473 | } else if (hdfsKeyTab == null) { |
| 2474 | LOG.warn("{} is used as the hdfs keytab. Please use {} instead", |
| 2475 | Config.BLOBSTORE_HDFS_KEYTAB, Config.STORM_HDFS_LOGIN_KEYTAB); |
| 2476 | ret = blobstoreKeyTab; |
| 2477 | } else { |
| 2478 | //both not null; |
| 2479 | LOG.warn("Both {} and {} are set. Use {} only.", |
| 2480 | Config.BLOBSTORE_HDFS_KEYTAB, Config.STORM_HDFS_LOGIN_KEYTAB, Config.STORM_HDFS_LOGIN_KEYTAB); |
| 2481 | ret = hdfsKeyTab; |
| 2482 | } |
| 2483 | return ret; |
| 2484 | } |
| 2485 | |
| 2486 | } |