/** * Test thread pool size. * * @throws Exception If failed. */ @Test public void testThreadPoolSize() throws Exception { check(new ClientConnectorConfiguration().setThreadPoolSize(0), false); check(new ClientConnectorConfiguration().setThreadPoolSize(-1), false); check(new ClientConnectorConfiguration().setThreadPoolSize(4), true); checkJdbc(null, ClientConnectorConfiguration.DFLT_PORT); }
cliConnCfg.setSocketReceiveBufferSize(sqlConnCfg.getSocketReceiveBufferSize()); cliConnCfg.setTcpNoDelay(sqlConnCfg.isTcpNoDelay()); cliConnCfg.setThreadPoolSize(sqlConnCfg.getThreadPoolSize()); cliConnCfg.setPort(hostAndPort.portFrom()); cliConnCfg.setPortRange(hostAndPort.portTo() - hostAndPort.portFrom()); cliConnCfg.setThreadPoolSize(odbcCfg.getThreadPoolSize()); cliConnCfg.setSocketSendBufferSize(odbcCfg.getSocketSendBufferSize()); cliConnCfg.setSocketReceiveBufferSize(odbcCfg.getSocketReceiveBufferSize());
/** {@inheritDoc} */ @Override protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception { IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName); CacheConfiguration<?, ?> cache = defaultCacheConfiguration(); cache.setCacheMode(PARTITIONED); cache.setBackups(1); cache.setWriteSynchronizationMode(FULL_SYNC); cache.setSqlFunctionClasses(JdbcThinConnectionTimeoutSelfTest.class); cache.setIndexedTypes(Integer.class, Integer.class); cfg.setCacheConfiguration(cache); TcpDiscoverySpi disco = new TcpDiscoverySpi(); disco.setIpFinder(IP_FINDER); cfg.setDiscoverySpi(disco); cfg.setClientConnectorConfiguration(new ClientConnectorConfiguration().setThreadPoolSize(SERVER_THREAD_POOL_SIZE)); return cfg; }
/** {@inheritDoc} */ @Override protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception { IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName); CacheConfiguration<?,?> cache = defaultCacheConfiguration(); cache.setCacheMode(PARTITIONED); cache.setBackups(1); cache.setWriteSynchronizationMode(FULL_SYNC); cache.setSqlFunctionClasses(TestSQLFunctions.class); cache.setIndexedTypes(Integer.class, Integer.class, Long.class, Long.class, String.class, JdbcThinAbstractDmlStatementSelfTest.Person.class); cfg.setCacheConfiguration(cache); TcpDiscoverySpi disco = new TcpDiscoverySpi(); disco.setIpFinder(IP_FINDER); cfg.setDiscoverySpi(disco); cfg.setClientConnectorConfiguration(new ClientConnectorConfiguration(). setThreadPoolSize(SERVER_THREAD_POOL_SIZE)); return cfg; }
/** {@inheritDoc} */ @Override protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception { IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName); CacheConfiguration<?,?> cache = defaultCacheConfiguration(); cache.setCacheMode(PARTITIONED); cache.setBackups(1); cache.setWriteSynchronizationMode(FULL_SYNC); cache.setSqlFunctionClasses(TestSQLFunctions.class); cache.setIndexedTypes(Integer.class, Integer.class, Long.class, Long.class, String.class, JdbcThinAbstractDmlStatementSelfTest.Person.class); cfg.setCacheConfiguration(cache); TcpDiscoverySpi disco = new TcpDiscoverySpi(); disco.setIpFinder(IP_FINDER); cfg.setDiscoverySpi(disco); cfg.setClientConnectorConfiguration(new ClientConnectorConfiguration().setThreadPoolSize(SERVER_THREAD_POOL_SIZE)); return cfg; }
/** * Reads the client connector configuration. * * @param in Reader. * @return Config. */ private static ClientConnectorConfiguration readClientConnectorConfiguration(BinaryRawReader in) { return new ClientConnectorConfiguration() .setHost(in.readString()) .setPort(in.readInt()) .setPortRange(in.readInt()) .setSocketSendBufferSize(in.readInt()) .setSocketReceiveBufferSize(in.readInt()) .setTcpNoDelay(in.readBoolean()) .setMaxOpenCursorsPerConnection(in.readInt()) .setThreadPoolSize(in.readInt()) .setIdleTimeout(in.readLong()) .setThinClientEnabled(in.readBoolean()) .setOdbcEnabled(in.readBoolean()) .setJdbcEnabled(in.readBoolean()); }
cliConnCfg.setSocketReceiveBufferSize(sqlConnCfg.getSocketReceiveBufferSize()); cliConnCfg.setTcpNoDelay(sqlConnCfg.isTcpNoDelay()); cliConnCfg.setThreadPoolSize(sqlConnCfg.getThreadPoolSize()); cliConnCfg.setPort(hostAndPort.portFrom()); cliConnCfg.setPortRange(hostAndPort.portTo() - hostAndPort.portFrom()); cliConnCfg.setThreadPoolSize(odbcCfg.getThreadPoolSize()); cliConnCfg.setSocketSendBufferSize(odbcCfg.getSocketSendBufferSize()); cliConnCfg.setSocketReceiveBufferSize(odbcCfg.getSocketReceiveBufferSize());
/** * Reads the client connector configuration. * * @param in Reader. * @return Config. */ private static ClientConnectorConfiguration readClientConnectorConfiguration(BinaryRawReader in) { return new ClientConnectorConfiguration() .setHost(in.readString()) .setPort(in.readInt()) .setPortRange(in.readInt()) .setSocketSendBufferSize(in.readInt()) .setSocketReceiveBufferSize(in.readInt()) .setTcpNoDelay(in.readBoolean()) .setMaxOpenCursorsPerConnection(in.readInt()) .setThreadPoolSize(in.readInt()) .setIdleTimeout(in.readLong()) .setThinClientEnabled(in.readBoolean()) .setOdbcEnabled(in.readBoolean()) .setJdbcEnabled(in.readBoolean()); }