use of org.talend.designer.hdfsbrowse.hadoop.service.HadoopServiceProperties in project tbd-studio-se by Talend.
the class CheckHadoopServicesDialog method getServiceBeans.
private List<HadoopServiceBean> getServiceBeans() {
List<HadoopServiceBean> checkedServiceBeans = new ArrayList<HadoopServiceBean>(CheckedServiceRegistryReader.getInstance().getCheckedServiceBeans());
Iterator<HadoopServiceBean> beansIterator = checkedServiceBeans.iterator();
while (beansIterator.hasNext()) {
HadoopServiceBean serviceBean = beansIterator.next();
serviceBean.setChecked(false);
serviceBean.setErrorMsg(null);
HadoopServiceProperties serviceProperties = serviceTypeToProperties.get(serviceBean.getServiceType());
if (serviceProperties != null) {
serviceBean.setServiceProperties(serviceProperties);
} else {
beansIterator.remove();
}
}
return checkedServiceBeans;
}
use of org.talend.designer.hdfsbrowse.hadoop.service.HadoopServiceProperties in project tbd-studio-se by Talend.
the class HadoopClusterService method getHadoopSSLParameters.
@Override
public Map<String, String> getHadoopSSLParameters(String clusterId) {
Map<String, String> sslParameters = new HashMap<>();
HadoopClusterConnection hcConnection = HCRepositoryUtil.getRelativeHadoopClusterConnection(clusterId);
if (hcConnection == null) {
Item hcItem = getHadoopClusterBySubitemId(clusterId);
if (hcItem != null) {
hcConnection = HCRepositoryUtil.getRelativeHadoopClusterConnection(hcItem.getProperty().getId());
}
}
if (hcConnection != null && hcConnection.isUseWebHDFSSSL()) {
HadoopServiceProperties nnProperties = new HadoopServiceProperties();
ContextType contextType = null;
if (hcConnection.isContextMode()) {
contextType = ConnectionContextHelper.getContextTypeForContextMode(hcConnection, true);
}
nnProperties.setContextType(contextType);
nnProperties.setWebHDFSSSLTrustStorePath(hcConnection.getWebHDFSSSLTrustStorePath());
nnProperties.setWebHDFSSSLTrustStorePassword(hcConnection.getWebHDFSSSLTrustStorePassword());
sslParameters.put(ConnParameterKeys.CONN_PARA_KEY_WEBHDFS_SSL_TRUST_STORE_PATH, nnProperties.getWebHDFSSSLTrustStorePath());
sslParameters.put(ConnParameterKeys.CONN_PARA_KEY_WEBHDFS_SSL_TRUST_STORE_PASSWORD, nnProperties.getWebHDFSSSLTrustStorePassword());
}
return sslParameters;
}
use of org.talend.designer.hdfsbrowse.hadoop.service.HadoopServiceProperties in project tbd-studio-se by Talend.
the class KnoxInfoForm method checkServices.
private void checkServices() {
Map<EHadoopServiceType, HadoopServiceProperties> serviceTypeToProperties = new HashMap<EHadoopServiceType, HadoopServiceProperties>();
HadoopServiceProperties nnProperties = new HadoopServiceProperties();
initCommonProperties(nnProperties);
nnProperties.setKnoxURL(knoxURLText.getText());
nnProperties.setKnoxUser(knoxUserText.getText());
nnProperties.setKnoxPassword(knoxPasswordText.getText());
nnProperties.setKnoxDirectory(knoxDirectoryText.getText());
serviceTypeToProperties.put(EHadoopServiceType.KNOX_RESOURCE_MANAGER, nnProperties);
serviceTypeToProperties.put(EHadoopServiceType.KNOX_NAMENODE, nnProperties);
new CheckHadoopServicesDialog(getShell(), serviceTypeToProperties).open();
}
use of org.talend.designer.hdfsbrowse.hadoop.service.HadoopServiceProperties in project tbd-studio-se by Talend.
the class HadoopServerUtil method testKnoxConnection.
/**
* DOC ycbai Comment method "testConnection".
*
* Test whether can connect to HDFS.
*
* @return
*/
public static ConnectionStatus testKnoxConnection(HDFSConnectionBean connection) {
ConnectionStatus connectionStatus = new ConnectionStatus();
connectionStatus.setResult(false);
String errorMsg = "Cannot connect to HDFS \"" + connection.getNameNodeURI() + "\". Please check the connection parameters. ";
try {
HadoopServiceProperties serviceProperties = new HadoopServiceProperties();
BeanUtils.copyProperties(serviceProperties, connection);
serviceProperties.setVersion(connection.getDfVersion());
serviceProperties.setKnoxURL(connection.getParameters().get(ConnParameterKeys.CONN_PARA_KEY_KNOX_URL));
serviceProperties.setKnoxUser(connection.getParameters().get(ConnParameterKeys.CONN_PARA_KEY_KNOX_USER));
serviceProperties.setKnoxPassword(connection.getParameters().get(ConnParameterKeys.CONN_PARA_KEY_KNOX_PASSWORD));
serviceProperties.setKnoxDirectory(connection.getParameters().get(ConnParameterKeys.CONN_PARA_KEY_KNOX_DIRECTORY));
CheckedKnoxNamenodeProvider hadoopKnox = new CheckedKnoxNamenodeProvider();
connectionStatus.setResult(hadoopKnox.checkService(serviceProperties, 1000));
connectionStatus.setMessageException("Connection successful");
} catch (HadoopServerException | InvocationTargetException | IllegalAccessException e) {
connectionStatus.setMessageException(ExceptionUtils.getFullStackTrace(e));
}
return connectionStatus;
}
use of org.talend.designer.hdfsbrowse.hadoop.service.HadoopServiceProperties in project tbd-studio-se by Talend.
the class GoogleDataprocInfoForm method checkServices.
private void checkServices() {
Map<EHadoopServiceType, HadoopServiceProperties> serviceTypeToProperties = new HashMap<EHadoopServiceType, HadoopServiceProperties>();
HadoopServiceProperties nnProperties = new HadoopServiceProperties();
initCommonProperties(nnProperties);
nnProperties.setProjectId(projectIdNameText.getText());
nnProperties.setRegion(regionNameText.getText());
nnProperties.setClusterName(clusterIdNameText.getText());
serviceTypeToProperties.put(EHadoopServiceType.GOOGLE_DATAPROC, nnProperties);
new CheckHadoopServicesDialog(getShell(), serviceTypeToProperties).open();
}
Aggregations