当前位置: 首页>>代码示例>>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;未经允许,请勿转载。