TBD-3909 fix: Impala principal is not contained in the exported context

and Impala principal text box can not be edited after exported context.
when we click revert button,Impala principal text box should return
original value.
https://jira.talendforge.org/browse/TBD-3909
This commit is contained in:
GL
2016-08-05 10:10:05 +08:00
parent 4c6580a0d2
commit 3831d758bf
2 changed files with 15 additions and 0 deletions

View File

@@ -1273,6 +1273,12 @@ public final class DBConnectionContextUtils {
ContextParameterUtils.getOriginalValue(contextType, maprticket_Duration));
}
// for Impala
if (EDatabaseTypeName.IMPALA.equals(EDatabaseTypeName.getTypeFromDbType(conn.getDatabaseType()))) {
String impalaPrin = conn.getParameters().get(ConnParameterKeys.IMPALA_AUTHENTICATION_PRINCIPLA);
conn.getParameters().put(ConnParameterKeys.IMPALA_AUTHENTICATION_PRINCIPLA,
ContextParameterUtils.getOriginalValue(contextType, impalaPrin));
}
// revert the context value in the hadoop properties dialog if it is hive or hbase
String hadoopPropertiesJson = transformContextModeToOriginal(getHiveOrHbaseHadoopProperties(conn), contextType);
setAdditionalHadoopProperties(conn, hadoopPropertiesJson);

View File

@@ -2376,6 +2376,11 @@ public class DatabaseForm extends AbstractForm {
}
}
private void adaptImpalaHadoopPartEditable() {
useKerberosForImpala.setEnabled(!isContextMode());
impalaPrincipalTxt.setEditable(!isContextMode());
}
private void updateHadoopProperties(boolean isEditable) {
refreshHadoopProperties();
refreshHiveJdbcProperties();
@@ -5795,6 +5800,10 @@ public class DatabaseForm extends AbstractForm {
adaptHbaseHadoopPartEditable();
updateHadoopProperties(!isContextMode());
}
if (isImpalaDBConnSelected()) {
adaptImpalaHadoopPartEditable();
updateHadoopProperties(!isContextMode());
}
}
public boolean isDbTypenull() {