use of org.apache.ignite.configuration.ConnectorConfiguration in project ignite by apache.
the class JdbcMetadataSelfTest method getConfiguration.
/** {@inheritDoc} */
@Override
protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception {
IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName);
TcpDiscoverySpi disco = new TcpDiscoverySpi();
disco.setIpFinder(IP_FINDER);
cfg.setDiscoverySpi(disco);
cfg.setConnectorConfiguration(new ConnectorConfiguration());
return cfg;
}
use of org.apache.ignite.configuration.ConnectorConfiguration in project ignite by apache.
the class JdbcNoDefaultCacheTest method getConfiguration.
/** {@inheritDoc} */
@Override
protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception {
IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName);
cfg.setCacheConfiguration(cacheConfiguration(CACHE1_NAME), cacheConfiguration(CACHE2_NAME));
TcpDiscoverySpi disco = new TcpDiscoverySpi();
disco.setIpFinder(IP_FINDER);
cfg.setDiscoverySpi(disco);
cfg.setConnectorConfiguration(new ConnectorConfiguration());
return cfg;
}
use of org.apache.ignite.configuration.ConnectorConfiguration in project ignite by apache.
the class IgniteKernal method registerExecutorMBeans.
/**
* @param execSvc Public executor service.
* @param sysExecSvc System executor service.
* @param p2pExecSvc P2P executor service.
* @param mgmtExecSvc Management executor service.
* @param restExecSvc Query executor service.
* @param schemaExecSvc Schema executor service.
* @throws IgniteCheckedException If failed.
*/
private void registerExecutorMBeans(ExecutorService execSvc, ExecutorService sysExecSvc, ExecutorService p2pExecSvc, ExecutorService mgmtExecSvc, ExecutorService restExecSvc, ExecutorService qryExecSvc, ExecutorService schemaExecSvc) throws IgniteCheckedException {
pubExecSvcMBean = registerExecutorMBean(execSvc, "GridExecutionExecutor");
sysExecSvcMBean = registerExecutorMBean(sysExecSvc, "GridSystemExecutor");
mgmtExecSvcMBean = registerExecutorMBean(mgmtExecSvc, "GridManagementExecutor");
p2PExecSvcMBean = registerExecutorMBean(p2pExecSvc, "GridClassLoadingExecutor");
qryExecSvcMBean = registerExecutorMBean(qryExecSvc, "GridQueryExecutor");
schemaExecSvcMBean = registerExecutorMBean(schemaExecSvc, "GridSchemaExecutor");
ConnectorConfiguration clientCfg = cfg.getConnectorConfiguration();
if (clientCfg != null)
restExecSvcMBean = registerExecutorMBean(restExecSvc, "GridRestExecutor");
}
use of org.apache.ignite.configuration.ConnectorConfiguration in project ignite by apache.
the class GridTcpRestProtocol method start.
/** {@inheritDoc} */
@SuppressWarnings("BusyWait")
@Override
public void start(final GridRestProtocolHandler hnd) throws IgniteCheckedException {
assert hnd != null;
ConnectorConfiguration cfg = ctx.config().getConnectorConfiguration();
assert cfg != null;
lsnr = new GridTcpRestNioListener(log, this, hnd, ctx);
GridNioParser parser = new GridTcpRestParser(false);
try {
host = resolveRestTcpHost(ctx.config());
SSLContext sslCtx = null;
if (cfg.isSslEnabled()) {
Factory<SSLContext> igniteFactory = ctx.config().getSslContextFactory();
Factory<SSLContext> factory = cfg.getSslFactory();
// This factory deprecated and will be removed.
GridSslContextFactory depFactory = cfg.getSslContextFactory();
if (factory == null && depFactory == null && igniteFactory == null)
// Thrown SSL exception instead of IgniteCheckedException for writing correct warning message into log.
throw new SSLException("SSL is enabled, but SSL context factory is not specified.");
if (factory != null)
sslCtx = factory.create();
else if (depFactory != null)
sslCtx = depFactory.createSslContext();
else
sslCtx = igniteFactory.create();
}
int startPort = cfg.getPort();
int portRange = cfg.getPortRange();
int lastPort = portRange == 0 ? startPort : startPort + portRange - 1;
for (int port0 = startPort; port0 <= lastPort; port0++) {
if (startTcpServer(host, port0, lsnr, parser, sslCtx, cfg)) {
port = port0;
if (log.isInfoEnabled())
log.info(startInfo());
return;
}
}
U.warn(log, "Failed to start TCP binary REST server (possibly all ports in range are in use) " + "[firstPort=" + cfg.getPort() + ", lastPort=" + lastPort + ", host=" + host + ']');
} catch (SSLException e) {
U.warn(log, "Failed to start " + name() + " protocol on port " + port + ": " + e.getMessage(), "Failed to start " + name() + " protocol on port " + port + ". Check if SSL context factory is " + "properly configured.");
} catch (IOException e) {
U.warn(log, "Failed to start " + name() + " protocol on port " + port + ": " + e.getMessage(), "Failed to start " + name() + " protocol on port " + port + ". " + "Check restTcpHost configuration property.");
}
}
use of org.apache.ignite.configuration.ConnectorConfiguration in project ignite by apache.
the class HadoopAbstractSelfTest method getConfiguration.
/** {@inheritDoc} */
@Override
protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception {
IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName);
cfg.setHadoopConfiguration(hadoopConfiguration(igniteInstanceName));
TcpCommunicationSpi commSpi = new TcpCommunicationSpi();
commSpi.setSharedMemoryPort(-1);
cfg.setCommunicationSpi(commSpi);
TcpDiscoverySpi discoSpi = (TcpDiscoverySpi) cfg.getDiscoverySpi();
discoSpi.setIpFinder(IP_FINDER);
if (igfsEnabled())
cfg.setFileSystemConfiguration(igfsConfiguration());
if (restEnabled()) {
ConnectorConfiguration clnCfg = new ConnectorConfiguration();
clnCfg.setPort(restPort++);
cfg.setConnectorConfiguration(clnCfg);
}
cfg.setLocalHost("127.0.0.1");
cfg.setPeerClassLoadingEnabled(false);
return cfg;
}
Aggregations