Package org.apache.blur.agent.cleaners

Examples of org.apache.blur.agent.cleaners.QueriesCleaner


  @Test
  public void shouldExpireOldRunningQueries() {
    Calendar timeOfQuery = TimeHelper.getTimeAgo(3 * 60 * 1000);
    jdbc.update("insert into blur_queries (state, updated_at, created_at) values (?,?,?)", 0, timeOfQuery, timeOfQuery);

    Thread testQueryCleaner = new Thread(new QueriesCleaner(database), "Query Test Thread");
    testQueryCleaner.start();
    try {
      testQueryCleaner.join();
    } catch (InterruptedException e) {
      fail("The test QueriesCleaner failed while waiting for it to finish!");
View Full Code Here


  @Test
  public void shouldNotExpireNewlyRunningQueries() {   
    Calendar timeOfQuery = TimeHelper.getTimeAgo(1 * 60 * 1000);
    jdbc.update("insert into blur_queries (state, updated_at, created_at) values (?,?,?)", 0, timeOfQuery, timeOfQuery);

    Thread testQueryCleaner = new Thread(new QueriesCleaner(database), "Query Test Thread");
    testQueryCleaner.start();
    try {
      testQueryCleaner.join();
    } catch (InterruptedException e) {
      fail("The test QueriesCleaner failed while waiting for it to finish!");
View Full Code Here

    Calendar timeOfQuery = TimeHelper.getTimeAgo(1 * 60 * 1000);
    // a more recent time, for testing to see if a query is updated after it is created
    Calendar timeOfUpdate = TimeHelper.getTimeAgo(1 * 30 * 1000);
    jdbc.update("insert into blur_queries (state, updated_at, created_at) values (?,?,?)", 1, timeOfQuery, timeOfQuery);

    Thread testQueryCleaner = new Thread(new QueriesCleaner(database), "Query Test Thread");
    testQueryCleaner.start();
    try {
      testQueryCleaner.join();
    } catch (InterruptedException e) {
      fail("The test QueriesCleaner failed while waiting for it to finish!");
View Full Code Here

  @Test
  public void shouldDeleteOldQueries() {   
    Calendar timeOfQuery = TimeHelper.getTimeAgo(3 * 60 * 60 * 1000);
    jdbc.update("insert into blur_queries (state, updated_at, created_at) values (?,?,?)", 1, timeOfQuery, timeOfQuery);

    Thread testQueryCleaner = new Thread(new QueriesCleaner(database), "Query Test Thread");
    testQueryCleaner.start();
    try {
      testQueryCleaner.join();
    } catch (InterruptedException e) {
      fail("The test QueriesCleaner failed while waiting for it to finish!");
View Full Code Here

  @Test
  public void shouldNotDeleteYoungQueries() {   
    Calendar timeOfQuery = TimeHelper.getTimeAgo(1 * 60 * 60 * 1000);
    jdbc.update("insert into blur_queries (state, updated_at, created_at) values (?,?,?)", 1, timeOfQuery, timeOfQuery);

    Thread testQueryCleaner = new Thread(new QueriesCleaner(database), "Query Test Thread");
    testQueryCleaner.start();
    try {
      testQueryCleaner.join();
    } catch (InterruptedException e) {
      fail("The test QueriesCleaner failed while waiting for it to finish!");
View Full Code Here

TOP

Related Classes of org.apache.blur.agent.cleaners.QueriesCleaner

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.