1
0

[HUDI-3980] Suport kerberos hbase index (#5464)

- Add configurations in HoodieHBaseIndexConfig.java to support kerberos hbase connection.

Co-authored-by: xicm <xicm@asiainfo.com>
This commit is contained in:
xi chaomin
2022-05-14 19:37:31 +08:00
committed by GitHub
parent 52e63b39d6
commit 6e16e719cd
3 changed files with 96 additions and 3 deletions

View File

@@ -157,6 +157,33 @@ public class HoodieHBaseIndexConfig extends HoodieConfig {
.withDocumentation("When set to true, the rollback method will delete the last failed task index. "
+ "The default value is false. Because deleting the index will add extra load on the Hbase cluster for each rollback");
public static final ConfigProperty<String> SECURITY_AUTHENTICATION = ConfigProperty
.key("hoodie.index.hbase.security.authentication")
.defaultValue("simple")
.withDocumentation("Property to decide if the hbase cluster secure authentication is enabled or not. "
+ "Possible values are 'simple' (no authentication), and 'kerberos'.");
public static final ConfigProperty<String> KERBEROS_USER_KEYTAB = ConfigProperty
.key("hoodie.index.hbase.kerberos.user.keytab")
.noDefaultValue()
.withDocumentation("File name of the kerberos keytab file for connecting to the hbase cluster.");
public static final ConfigProperty<String> KERBEROS_USER_PRINCIPAL = ConfigProperty
.key("hoodie.index.hbase.kerberos.user.principal")
.noDefaultValue()
.withDocumentation("The kerberos principal name for connecting to the hbase cluster.");
public static final ConfigProperty<String> REGIONSERVER_PRINCIPAL = ConfigProperty
.key("hoodie.index.hbase.regionserver.kerberos.principal")
.noDefaultValue()
.withDocumentation("The value of hbase.regionserver.kerberos.principal in hbase cluster.");
public static final ConfigProperty<String> MASTER_PRINCIPAL = ConfigProperty
.key("hoodie.index.hbase.master.kerberos.principal")
.noDefaultValue()
.withDocumentation("The value of hbase.master.kerberos.principal in hbase cluster.");
/**
* @deprecated Use {@link #ZKQUORUM} and its methods instead
*/
@@ -444,6 +471,31 @@ public class HoodieHBaseIndexConfig extends HoodieConfig {
return this;
}
public Builder hbaseSecurityAuthentication(String authentication) {
hBaseIndexConfig.setValue(SECURITY_AUTHENTICATION, authentication);
return this;
}
public Builder hbaseKerberosUserKeytab(String keytab) {
hBaseIndexConfig.setValue(KERBEROS_USER_KEYTAB, keytab);
return this;
}
public Builder hbaseKerberosUserPrincipal(String principal) {
hBaseIndexConfig.setValue(KERBEROS_USER_PRINCIPAL, principal);
return this;
}
public Builder hbaseKerberosRegionserverPrincipal(String principal) {
hBaseIndexConfig.setValue(REGIONSERVER_PRINCIPAL, principal);
return this;
}
public Builder hbaseKerberosMasterPrincipal(String principal) {
hBaseIndexConfig.setValue(MASTER_PRINCIPAL, principal);
return this;
}
/**
* <p>
* Method to set maximum QPS allowed per Region Server. This should be same across various jobs. This is intended to

View File

@@ -1488,6 +1488,26 @@ public class HoodieWriteConfig extends HoodieConfig {
return getBoolean(HoodieHBaseIndexConfig.COMPUTE_QPS_DYNAMICALLY);
}
public String getHBaseIndexSecurityAuthentication() {
return getString(HoodieHBaseIndexConfig.SECURITY_AUTHENTICATION);
}
public String getHBaseIndexKerberosUserKeytab() {
return getString(HoodieHBaseIndexConfig.KERBEROS_USER_KEYTAB);
}
public String getHBaseIndexKerberosUserPrincipal() {
return getString(HoodieHBaseIndexConfig.KERBEROS_USER_PRINCIPAL);
}
public String getHBaseIndexRegionserverPrincipal() {
return getString(HoodieHBaseIndexConfig.REGIONSERVER_PRINCIPAL);
}
public String getHBaseIndexMasterPrincipal() {
return getString(HoodieHBaseIndexConfig.MASTER_PRINCIPAL);
}
public int getHBaseIndexDesiredPutsTime() {
return getInt(HoodieHBaseIndexConfig.DESIRED_PUTS_TIME_IN_SECONDS);
}