本文整理匯總了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;
}