Search in sources :

Example 1 with HadoopServiceProperties

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;
}
Also used : HadoopServiceBean(org.talend.designer.hdfsbrowse.hadoop.service.HadoopServiceBean) ArrayList(java.util.ArrayList) HadoopServiceProperties(org.talend.designer.hdfsbrowse.hadoop.service.HadoopServiceProperties)

Example 2 with HadoopServiceProperties

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;
}
Also used : ContextItem(org.talend.core.model.properties.ContextItem) HadoopClusterConnectionItem(org.talend.repository.model.hadoopcluster.HadoopClusterConnectionItem) Item(org.talend.core.model.properties.Item) DatabaseConnectionItem(org.talend.core.model.properties.DatabaseConnectionItem) HadoopSubConnectionItem(org.talend.repository.model.hadoopcluster.HadoopSubConnectionItem) ConnectionItem(org.talend.core.model.properties.ConnectionItem) ContextType(org.talend.designer.core.model.utils.emf.talendfile.ContextType) HashMap(java.util.HashMap) HadoopClusterConnection(org.talend.repository.model.hadoopcluster.HadoopClusterConnection) HadoopServiceProperties(org.talend.designer.hdfsbrowse.hadoop.service.HadoopServiceProperties)

Example 3 with HadoopServiceProperties

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();
}
Also used : HashMap(java.util.HashMap) CheckHadoopServicesDialog(org.talend.designer.hdfsbrowse.hadoop.service.check.CheckHadoopServicesDialog) EHadoopServiceType(org.talend.designer.hdfsbrowse.hadoop.service.EHadoopServiceType) HadoopServiceProperties(org.talend.designer.hdfsbrowse.hadoop.service.HadoopServiceProperties)

Example 4 with HadoopServiceProperties

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;
}
Also used : HadoopServerException(org.talend.designer.hdfsbrowse.exceptions.HadoopServerException) HadoopServiceProperties(org.talend.designer.hdfsbrowse.hadoop.service.HadoopServiceProperties) CheckedKnoxNamenodeProvider(org.talend.designer.hdfsbrowse.hadoop.service.check.provider.CheckedKnoxNamenodeProvider) ConnectionStatus(org.talend.core.repository.model.connection.ConnectionStatus) InvocationTargetException(java.lang.reflect.InvocationTargetException)

Example 5 with HadoopServiceProperties

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();
}
Also used : HashMap(java.util.HashMap) CheckHadoopServicesDialog(org.talend.designer.hdfsbrowse.hadoop.service.check.CheckHadoopServicesDialog) EHadoopServiceType(org.talend.designer.hdfsbrowse.hadoop.service.EHadoopServiceType) HadoopServiceProperties(org.talend.designer.hdfsbrowse.hadoop.service.HadoopServiceProperties)

Aggregations

HadoopServiceProperties (org.talend.designer.hdfsbrowse.hadoop.service.HadoopServiceProperties)7 HashMap (java.util.HashMap)4 EHadoopServiceType (org.talend.designer.hdfsbrowse.hadoop.service.EHadoopServiceType)4 CheckHadoopServicesDialog (org.talend.designer.hdfsbrowse.hadoop.service.check.CheckHadoopServicesDialog)3 InvocationTargetException (java.lang.reflect.InvocationTargetException)1 ArrayList (java.util.ArrayList)1 INode (org.talend.core.model.process.INode)1 ConnectionItem (org.talend.core.model.properties.ConnectionItem)1 ContextItem (org.talend.core.model.properties.ContextItem)1 DatabaseConnectionItem (org.talend.core.model.properties.DatabaseConnectionItem)1 Item (org.talend.core.model.properties.Item)1 ConnectionStatus (org.talend.core.repository.model.connection.ConnectionStatus)1 IDesignerCoreService (org.talend.designer.core.IDesignerCoreService)1 ContextType (org.talend.designer.core.model.utils.emf.talendfile.ContextType)1 HadoopServerException (org.talend.designer.hdfsbrowse.exceptions.HadoopServerException)1 HadoopServiceBean (org.talend.designer.hdfsbrowse.hadoop.service.HadoopServiceBean)1 CheckedKnoxNamenodeProvider (org.talend.designer.hdfsbrowse.hadoop.service.check.provider.CheckedKnoxNamenodeProvider)1 HadoopClusterConnection (org.talend.repository.model.hadoopcluster.HadoopClusterConnection)1 HadoopClusterConnectionItem (org.talend.repository.model.hadoopcluster.HadoopClusterConnectionItem)1 HadoopSubConnectionItem (org.talend.repository.model.hadoopcluster.HadoopSubConnectionItem)1