|
85 | 85 |
|
86 | 86 | import scala.Tuple2; |
87 | 87 |
|
| 88 | +import static org.apache.hadoop.fs.CommonConfigurationKeysPublic.HADOOP_SECURITY_AUTHENTICATION; |
| 89 | +import static org.apache.hadoop.hbase.HConstants.ZOOKEEPER_QUORUM; |
| 90 | +import static org.apache.hadoop.hbase.HConstants.ZOOKEEPER_ZNODE_PARENT; |
| 91 | +import static org.apache.hadoop.hbase.HConstants.ZOOKEEPER_CLIENT_PORT; |
| 92 | +import static org.apache.hadoop.hbase.security.SecurityConstants.MASTER_KRB_PRINCIPAL; |
| 93 | +import static org.apache.hadoop.hbase.security.SecurityConstants.REGIONSERVER_KRB_PRINCIPAL; |
| 94 | +import static org.apache.hadoop.hbase.security.User.HBASE_SECURITY_AUTHORIZATION_CONF_KEY; |
| 95 | +import static org.apache.hadoop.hbase.security.User.HBASE_SECURITY_CONF_KEY; |
| 96 | + |
88 | 97 | /** |
89 | 98 | * Hoodie Index implementation backed by HBase. |
90 | 99 | */ |
@@ -145,22 +154,22 @@ public HBaseIndexQPSResourceAllocator createQPSResourceAllocator(HoodieWriteConf |
145 | 154 | private Connection getHBaseConnection() { |
146 | 155 | Configuration hbaseConfig = HBaseConfiguration.create(); |
147 | 156 | String quorum = config.getHbaseZkQuorum(); |
148 | | - hbaseConfig.set("hbase.zookeeper.quorum", quorum); |
| 157 | + hbaseConfig.set(ZOOKEEPER_QUORUM, quorum); |
149 | 158 | String zkZnodeParent = config.getHBaseZkZnodeParent(); |
150 | 159 | if (zkZnodeParent != null) { |
151 | | - hbaseConfig.set("zookeeper.znode.parent", zkZnodeParent); |
| 160 | + hbaseConfig.set(ZOOKEEPER_ZNODE_PARENT, zkZnodeParent); |
152 | 161 | } |
153 | 162 | String port = String.valueOf(config.getHbaseZkPort()); |
154 | | - hbaseConfig.set("hbase.zookeeper.property.clientPort", port); |
| 163 | + hbaseConfig.set(ZOOKEEPER_CLIENT_PORT, port); |
155 | 164 |
|
156 | 165 | try { |
157 | 166 | String authentication = config.getHBaseIndexSecurityAuthentication(); |
158 | 167 | if (authentication.equals("kerberos")) { |
159 | | - hbaseConfig.set("hbase.security.authentication", "kerberos"); |
160 | | - hbaseConfig.set("hadoop.security.authentication", "kerberos"); |
161 | | - hbaseConfig.set("hbase.security.authorization", "true"); |
162 | | - hbaseConfig.set("hbase.regionserver.kerberos.principal", config.getHBaseIndexRegionserverPrincipal()); |
163 | | - hbaseConfig.set("hbase.master.kerberos.principal", config.getHBaseIndexMasterPrincipal()); |
| 168 | + hbaseConfig.set(HBASE_SECURITY_CONF_KEY, "kerberos"); |
| 169 | + hbaseConfig.set(HADOOP_SECURITY_AUTHENTICATION, "kerberos"); |
| 170 | + hbaseConfig.set(HBASE_SECURITY_AUTHORIZATION_CONF_KEY, "true"); |
| 171 | + hbaseConfig.set(REGIONSERVER_KRB_PRINCIPAL, config.getHBaseIndexRegionserverPrincipal()); |
| 172 | + hbaseConfig.set(MASTER_KRB_PRINCIPAL, config.getHBaseIndexMasterPrincipal()); |
164 | 173 |
|
165 | 174 | String principal = config.getHBaseIndexKerberosUserPrincipal(); |
166 | 175 | String keytab = SparkFiles.get(config.getHBaseIndexKerberosUserKeytab()); |
|
0 commit comments