本文整理汇总了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();
}
}
示例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;
}