Package net.opentsdb.tree

Examples of net.opentsdb.tree.Tree


  }
 
  @Test (expected = IllegalStateException.class)
  public void storeTreeNoChanges() throws Exception {
    setupStorage(true, true);
    final Tree tree = buildTestTree();
    tree.storeTree(storage.getTSDB(), false);
    tree.storeTree(storage.getTSDB(), false);
  }
View Full Code Here


  }
 
  @Test (expected = IllegalArgumentException.class)
  public void storeTreeTreeID0() throws Exception {
    setupStorage(true, true);
    final Tree tree = buildTestTree();
    tree.setTreeId(0);
    tree.storeTree(storage.getTSDB(), false);
  }
View Full Code Here

  }
 
  @Test (expected = IllegalArgumentException.class)
  public void storeTreeTreeID655536() throws Exception {
    setupStorage(true, true);
    final Tree tree = buildTestTree();
    tree.setTreeId(655536);
    tree.storeTree(storage.getTSDB(), false);
  }
View Full Code Here

  }
 
  @Test
  public void flushCollisions() throws Exception {
    setupStorage(true, true);
    final Tree tree = buildTestTree();
    tree.setStoreFailures(true);
    tree.addCollision("010203", "AABBCCDD");
    assertNotNull(tree.flushCollisions(storage.getTSDB())
        .joinUninterruptibly());
    assertEquals(4, storage.numRows());
    assertEquals(3, storage.numColumns(new byte[] { 0, 1, 1 }));
  }
View Full Code Here

  }
 
  @Test
  public void flushCollisionsDisabled() throws Exception {
    setupStorage(true, true);
    final Tree tree = buildTestTree();
    tree.addCollision("010203", "AABBCCDD");
    assertNotNull(tree.flushCollisions(storage.getTSDB())
        .joinUninterruptibly());
    assertEquals(4, storage.numRows());
    assertEquals(2, storage.numColumns(new byte[] { 0, 1, 1 }));
  }
View Full Code Here

  }
 
  @Test
  public void flushCollisionsWCollisionExisting() throws Exception {
    setupStorage(true, true);
    final Tree tree = buildTestTree();
    tree.addCollision("010101", "AAAAAA");
    assertNotNull(tree.flushCollisions(storage.getTSDB())
        .joinUninterruptibly());
    assertEquals(4, storage.numRows());
    assertEquals(2, storage.numColumns(new byte[] { 0, 1, 1 }));
  }
View Full Code Here

  }
 
  @Test
  public void flushNotMatched() throws Exception {
    setupStorage(true, true);
    final Tree tree = buildTestTree();
    tree.setStoreFailures(true);
    tree.addNotMatched("010203", "Failed rule 2:2");
    assertNotNull(tree.flushNotMatched(storage.getTSDB())
        .joinUninterruptibly());
    assertEquals(4, storage.numRows());
    assertEquals(3, storage.numColumns(new byte[] { 0, 1, 2 }));
  }
View Full Code Here

  }
 
  @Test
  public void flushNotMatchedDisabled() throws Exception {
    setupStorage(true, true);
    final Tree tree = buildTestTree();
    tree.addNotMatched("010203", "Failed rule 2:2");
    assertNotNull(tree.flushNotMatched(storage.getTSDB())
        .joinUninterruptibly());
    assertEquals(4, storage.numRows());
    assertEquals(2, storage.numColumns(new byte[] { 0, 1, 2 }));
  }
View Full Code Here

  }
 
  @Test
  public void flushNotMatchedWNotMatchedExisting() throws Exception {
    setupStorage(true, true);
    final Tree tree = buildTestTree();
    tree.addNotMatched("010101", "Failed rule 4:4");
    assertNotNull(tree.flushNotMatched(storage.getTSDB())
        .joinUninterruptibly());
    assertEquals(4, storage.numRows());
    assertEquals(2, storage.numColumns(new byte[] { 0, 1, 2 }));
  }
View Full Code Here

    assertEquals(TreeRuleType.METRIC, rule.getType());
  }
 
  @Test
  public void getRuleNullSet() throws Exception {
    final Tree tree = buildTestTree();
    Field rules = Tree.class.getDeclaredField("rules");
    rules.setAccessible(true);
    rules.set(tree, null);
    rules.setAccessible(false);
    assertNull(tree.getRule(3, 0));
  }
View Full Code Here

TOP

Related Classes of net.opentsdb.tree.Tree

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.