Java Code Examples for com.datastax.driver.core.PoolingOptions#DEFAULT_MAX_QUEUE_SIZE

The following examples show how to use com.datastax.driver.core.PoolingOptions#DEFAULT_MAX_QUEUE_SIZE . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: SyntheticResultDaoIT.java    From glowroot with Apache License 2.0 6 votes vote down vote up
@BeforeClass
public static void setUp() throws Exception {
    SharedSetupRunListener.startCassandra();
    clusterManager = ClusterManager.create();
    cluster = Clusters.newCluster();
    session = new Session(cluster.newSession(), "glowroot_unit_tests", null,
            PoolingOptions.DEFAULT_MAX_QUEUE_SIZE);
    asyncExecutor = Executors.newCachedThreadPool();
    CentralConfigDao centralConfigDao = new CentralConfigDao(session, clusterManager);
    AgentDisplayDao agentDisplayDao =
            new AgentDisplayDao(session, clusterManager, asyncExecutor, 10);
    AgentConfigDao agentConfigDao =
            new AgentConfigDao(session, agentDisplayDao, clusterManager, 10);
    UserDao userDao = new UserDao(session, clusterManager);
    RoleDao roleDao = new RoleDao(session, clusterManager);
    ConfigRepositoryImpl configRepository =
            new ConfigRepositoryImpl(centralConfigDao, agentConfigDao, userDao, roleDao, "");
    syntheticResultDao = new SyntheticResultDaoImpl(session, configRepository, asyncExecutor,
            Clock.systemClock());
}
 
Example 2
Source File: SchemaUpgradeIT.java    From glowroot with Apache License 2.0 6 votes vote down vote up
@BeforeClass
public static void setUp() throws Exception {
    SharedSetupRunListener.startCassandra();
    cluster = Clusters.newCluster();
    com.datastax.driver.core.Session wrappedSession = cluster.newSession();
    updateSchemaWithRetry(wrappedSession, "drop keyspace if exists glowroot_upgrade_test");
    session = new Session(wrappedSession, "glowroot_upgrade_test", null,
            PoolingOptions.DEFAULT_MAX_QUEUE_SIZE);
    URL url = Resources.getResource("glowroot-0.9.1-schema.cql");
    StringBuilder cql = new StringBuilder();
    for (String line : Resources.readLines(url, UTF_8)) {
        if (line.isEmpty()) {
            session.updateSchemaWithRetry(cql.toString());
            cql.setLength(0);
        } else {
            cql.append('\n');
            cql.append(line);
        }
    }
    restore("glowroot_upgrade_test");
}
 
Example 3
Source File: GaugeValueDaoIT.java    From glowroot with Apache License 2.0 6 votes vote down vote up
@BeforeClass
public static void setUp() throws Exception {
    SharedSetupRunListener.startCassandra();
    clusterManager = ClusterManager.create();
    cluster = Clusters.newCluster();
    session = new Session(cluster.newSession(), "glowroot_unit_tests", null,
            PoolingOptions.DEFAULT_MAX_QUEUE_SIZE);
    asyncExecutor = Executors.newCachedThreadPool();
    CentralConfigDao centralConfigDao = new CentralConfigDao(session, clusterManager);
    AgentDisplayDao agentDisplayDao =
            new AgentDisplayDao(session, clusterManager, asyncExecutor, 10);
    agentConfigDao = new AgentConfigDao(session, agentDisplayDao, clusterManager, 10);
    UserDao userDao = new UserDao(session, clusterManager);
    RoleDao roleDao = new RoleDao(session, clusterManager);
    ConfigRepositoryImpl configRepository = new ConfigRepositoryImpl(centralConfigDao,
            agentConfigDao, userDao, roleDao, "");
    gaugeValueDao = new GaugeValueDaoWithV09Support(ImmutableSet.of(), 0, Clock.systemClock(),
            new GaugeValueDaoImpl(session, configRepository, clusterManager, asyncExecutor,
                    Clock.systemClock()));
}
 
Example 4
Source File: TraceDaoIT.java    From glowroot with Apache License 2.0 6 votes vote down vote up
@BeforeClass
public static void setUp() throws Exception {
    SharedSetupRunListener.startCassandra();
    cluster = Clusters.newCluster();
    session = new Session(cluster.newSession(), "glowroot_unit_tests", null,
            PoolingOptions.DEFAULT_MAX_QUEUE_SIZE);

    clusterManager = ClusterManager.create();
    ConfigRepositoryImpl configRepository = mock(ConfigRepositoryImpl.class);
    when(configRepository.getCentralStorageConfig())
            .thenReturn(ImmutableCentralStorageConfig.builder().build());
    Clock clock = mock(Clock.class);
    when(clock.currentTimeMillis()).thenReturn(200L);
    traceDao = new TraceDaoWithV09Support(ImmutableSet.of(), 0, 0, clock,
            new TraceDaoImpl(session, mock(TransactionTypeDao.class),
                    mock(FullQueryTextDao.class), mock(TraceAttributeNameDao.class),
                    configRepository, clock));
}
 
Example 5
Source File: ConfigRepositoryIT.java    From glowroot with Apache License 2.0 6 votes vote down vote up
@BeforeClass
public static void setUp() throws Exception {
    SharedSetupRunListener.startCassandra();
    clusterManager = ClusterManager.create();
    cluster = Clusters.newCluster();
    session = new Session(cluster.newSession(), "glowroot_unit_tests", null,
            PoolingOptions.DEFAULT_MAX_QUEUE_SIZE);
    session.updateSchemaWithRetry("drop table if exists agent_config");
    session.updateSchemaWithRetry("drop table if exists user");
    session.updateSchemaWithRetry("drop table if exists role");
    session.updateSchemaWithRetry("drop table if exists central_config");
    session.updateSchemaWithRetry("drop table if exists agent");
    asyncExecutor = Executors.newCachedThreadPool();

    CentralConfigDao centralConfigDao = new CentralConfigDao(session, clusterManager);
    AgentDisplayDao agentDisplayDao =
            new AgentDisplayDao(session, clusterManager, MoreExecutors.directExecutor(), 10);
    agentConfigDao = new AgentConfigDao(session, agentDisplayDao, clusterManager, 10);
    UserDao userDao = new UserDao(session, clusterManager);
    RoleDao roleDao = new RoleDao(session, clusterManager);
    configRepository =
            new ConfigRepositoryImpl(centralConfigDao, agentConfigDao, userDao, roleDao, "");
}
 
Example 6
Source File: RoleDaoIT.java    From glowroot with Apache License 2.0 5 votes vote down vote up
@BeforeClass
public static void setUp() throws Exception {
    SharedSetupRunListener.startCassandra();
    cluster = Clusters.newCluster();
    session = new Session(cluster.newSession(), "glowroot_unit_tests", null,
            PoolingOptions.DEFAULT_MAX_QUEUE_SIZE);
    clusterManager = ClusterManager.create();
    roleDao = new RoleDao(session, clusterManager);
}
 
Example 7
Source File: ConfigDaoIT.java    From glowroot with Apache License 2.0 5 votes vote down vote up
@BeforeClass
public static void setUp() throws Exception {
    SharedSetupRunListener.startCassandra();
    clusterManager = ClusterManager.create();
    cluster = Clusters.newCluster();
    session = new Session(cluster.newSession(), "glowroot_unit_tests", null,
            PoolingOptions.DEFAULT_MAX_QUEUE_SIZE);
    asyncExecutor = Executors.newCachedThreadPool();
    AgentDisplayDao agentDisplayDao =
            new AgentDisplayDao(session, clusterManager, MoreExecutors.directExecutor(), 10);
    agentConfigDao = new AgentConfigDao(session, agentDisplayDao, clusterManager, 10);
}
 
Example 8
Source File: EnvironmentDaoIT.java    From glowroot with Apache License 2.0 5 votes vote down vote up
@BeforeClass
public static void setUp() throws Exception {
    SharedSetupRunListener.startCassandra();
    cluster = Clusters.newCluster();
    session = new Session(cluster.newSession(), "glowroot_unit_tests", null,
            PoolingOptions.DEFAULT_MAX_QUEUE_SIZE);

    environmentDao = new EnvironmentDao(session);
}
 
Example 9
Source File: AggregateDaoIT.java    From glowroot with Apache License 2.0 5 votes vote down vote up
@BeforeClass
public static void setUp() throws Exception {
    SharedSetupRunListener.startCassandra();
    clusterManager = ClusterManager.create();
    cluster = Clusters.newCluster();
    session = new Session(cluster.newSession(), "glowroot_unit_tests", null,
            PoolingOptions.DEFAULT_MAX_QUEUE_SIZE);
    asyncExecutor = Executors.newCachedThreadPool();
    CentralConfigDao centralConfigDao = new CentralConfigDao(session, clusterManager);
    AgentDisplayDao agentDisplayDao =
            new AgentDisplayDao(session, clusterManager, asyncExecutor, 10);
    agentConfigDao = new AgentConfigDao(session, agentDisplayDao, clusterManager, 10);
    UserDao userDao = new UserDao(session, clusterManager);
    RoleDao roleDao = new RoleDao(session, clusterManager);
    ConfigRepositoryImpl configRepository =
            new ConfigRepositoryImpl(centralConfigDao, agentConfigDao, userDao, roleDao, "");
    TransactionTypeDao transactionTypeDao =
            new TransactionTypeDao(session, configRepository, clusterManager, 10);
    fullQueryTextDao = new FullQueryTextDao(session, configRepository, asyncExecutor);
    RollupLevelService rollupLevelService =
            new RollupLevelService(configRepository, Clock.systemClock());
    activeAgentDao = new ActiveAgentDao(session, agentDisplayDao, agentConfigDao,
            configRepository, rollupLevelService, Clock.systemClock());
    aggregateDao = new AggregateDaoWithV09Support(ImmutableSet.of(), 0, 0, Clock.systemClock(),
            new AggregateDaoImpl(session, activeAgentDao, transactionTypeDao, fullQueryTextDao,
                    configRepository, asyncExecutor, Clock.systemClock()));
}
 
Example 10
Source File: UserDaoIT.java    From glowroot with Apache License 2.0 5 votes vote down vote up
@BeforeClass
public static void setUp() throws Exception {
    SharedSetupRunListener.startCassandra();
    cluster = Clusters.newCluster();
    session = new Session(cluster.newSession(), "glowroot_unit_tests", null,
            PoolingOptions.DEFAULT_MAX_QUEUE_SIZE);
    clusterManager = ClusterManager.create();
    userDao = new UserDao(session, clusterManager);
}
 
Example 11
Source File: IncidentDaoIT.java    From glowroot with Apache License 2.0 5 votes vote down vote up
@BeforeClass
public static void setUp() throws Exception {
    SharedSetupRunListener.startCassandra();
    cluster = Clusters.newCluster();
    session = new Session(cluster.newSession(), "glowroot_unit_tests", null,
            PoolingOptions.DEFAULT_MAX_QUEUE_SIZE);

    Clock clock = mock(Clock.class);
    when(clock.currentTimeMillis()).thenReturn(345L);
    incidentDao = new IncidentDao(session, clock);
}
 
Example 12
Source File: WebDriverSetup.java    From glowroot with Apache License 2.0 5 votes vote down vote up
private static WebDriverSetup createSetup(boolean shared) throws Exception {
    int uiPort = getAvailablePort();
    File testDir = Files.createTempDir();
    CentralModule centralModule;
    Container container;
    if (useCentral) {
        CassandraWrapper.start();
        Cluster cluster = Cluster.builder().addContactPoint("127.0.0.1").build();
        Session session = new Session(cluster.newSession(), "glowroot_unit_tests", null,
                PoolingOptions.DEFAULT_MAX_QUEUE_SIZE);
        session.updateSchemaWithRetry("drop table if exists agent_config");
        session.updateSchemaWithRetry("drop table if exists user");
        session.updateSchemaWithRetry("drop table if exists role");
        session.updateSchemaWithRetry("drop table if exists central_config");
        session.updateSchemaWithRetry("drop table if exists agent");
        session.close();
        cluster.close();
        int grpcPort = getAvailablePort();
        centralModule = createCentralModule(uiPort, grpcPort);
        container = createContainerReportingToCentral(grpcPort, testDir);
    } else {
        centralModule = null;
        container = createContainer(uiPort, testDir);
    }
    if (SauceLabs.useSauceLabs()) {
        return new WebDriverSetup(centralModule, container, uiPort, shared, null);
    } else {
        return new WebDriverSetup(centralModule, container, uiPort, shared, createWebDriver());
    }
}