當前位置: 首頁>>代碼示例>>Java>>正文


Java ConnectorClusterConfig.getClusterOptions方法代碼示例

本文整理匯總了Java中com.stratio.crossdata.common.connector.ConnectorClusterConfig.getClusterOptions方法的典型用法代碼示例。如果您正苦於以下問題:Java ConnectorClusterConfig.getClusterOptions方法的具體用法?Java ConnectorClusterConfig.getClusterOptions怎麽用?Java ConnectorClusterConfig.getClusterOptions使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在com.stratio.crossdata.common.connector.ConnectorClusterConfig的用法示例。


在下文中一共展示了ConnectorClusterConfig.getClusterOptions方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: connect

import com.stratio.crossdata.common.connector.ConnectorClusterConfig; //導入方法依賴的package包/類
@Override public void connect(ICredentials credentials, ConnectorClusterConfig config) throws ConnectionException {
    try {
        synchronized (LOCK) {
            if (!managers.containsKey(config.getName())) {
                String host = "127.0.0.1";
                if (config.getClusterOptions() != null && config.getClusterOptions().containsKey("host")) {
                    host = config.getClusterOptions().get("host");
                }
                String login = "xdbot";
                if (config.getConnectorOptions() != null && config.getConnectorOptions().containsKey("name")) {
                    login = config.getConnectorOptions().get("name");
                }
                LOG.info("host: " + host + " login: " + login);
                IRCManager manager = new IRCManager(host, login);
                try {
                    manager.connect();
                    managers.put(config.getName(), manager);
                } catch (Exception e) {
                    throw new ConnectionException(e);
                }
            }
        }
    }catch (Exception ex){
        ex.printStackTrace();
    }
}
 
開發者ID:aagea,項目名稱:crossdata-connector-irc,代碼行數:27,代碼來源:IRCConnector.java

示例2: DeepConnection

import com.stratio.crossdata.common.connector.ConnectorClusterConfig; //導入方法依賴的package包/類
/**
 * Constructor using credentials and cluster config.
 *
 * @param credentials
 *            the credentials.
 * @param config
 *            The cluster configuration.
 */
public DeepConnection(ICredentials credentials, ConnectorClusterConfig config)
		throws ConnectionException {

	if (credentials != null) {
		// TODO check the credentials
	}

	Map<String, String> clusterOptions = config.getClusterOptions();
	Map<String, String> connectorOptions = config.getConnectorOptions();
	// Creating a configuration for the Extractor and initialize it
	ExtractorConfig<Cells> extractorconfig = new ExtractorConfig<>(Cells.class);
	String extractorImplClassName = clusterOptions.get(DeepConnectorConstants.EXTRACTOR_IMPL_CLASS);

	if (extractorImplClassName == null) {
		throw new ConnectionException("Unknown data source, please add it to the configuration.");
	}
	Map<String,Serializable> values = returnConfig(clusterOptions);
	values.put(DeepConnectorConstants.PROPERTY_DEFAULT_LIMIT,connectorOptions.get(DeepConnectorConstants
			.PROPERTY_DEFAULT_LIMIT));
	extractorconfig.setValues(values);

	extractorconfig.setExtractorImplClassName(extractorImplClassName);

	this.extractorConfig = extractorconfig;

	this.isConnect = true;
}
 
開發者ID:Stratio,項目名稱:stratio-connector-deep,代碼行數:36,代碼來源:DeepConnection.java


注:本文中的com.stratio.crossdata.common.connector.ConnectorClusterConfig.getClusterOptions方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。