Examples of TreeRule


Examples of net.opentsdb.tree.TreeRule

  }
 
  @Test
  public void storeRule() throws Exception {
    setupStorage();
    final TreeRule rule = new TreeRule(1);
    rule.setLevel(1);
    rule.setOrder(0);
    rule.setType(TreeRuleType.METRIC);
    rule.setNotes("Just some notes");
    assertTrue(rule.syncToStorage(storage.getTSDB(), false).joinUninterruptibly());
    assertEquals(3, storage.numColumns(new byte[] { 0, 1 }));
  }
View Full Code Here

Examples of net.opentsdb.tree.TreeRule

  }
 
  @Test
  public void storeRuleMege() throws Exception {
    setupStorage();
    final TreeRule rule = new TreeRule(1);
    rule.setLevel(2);
    rule.setOrder(1);
    rule.setNotes("Just some notes");
    assertTrue(rule.syncToStorage(storage.getTSDB(), false).joinUninterruptibly());
    assertEquals(2, storage.numColumns(new byte[] { 0, 1 }));
    final TreeRule stored = JSON.parseToObject(
        storage.getColumn(new byte[] { 0, 1 },
        "tree_rule:2:1".getBytes(MockBase.ASCII())), TreeRule.class);
    assertEquals("Host owner", stored.getDescription());
    assertEquals("Just some notes", stored.getNotes());
  }
View Full Code Here

Examples of net.opentsdb.tree.TreeRule

  }
 
  @Test (expected = IllegalArgumentException.class)
  public void storeRuleBadID0() throws Exception {
    setupStorage();
    final TreeRule rule = new TreeRule(0);
    rule.syncToStorage(storage.getTSDB(), false);
  }
View Full Code Here

Examples of net.opentsdb.tree.TreeRule

  }
 
  @Test (expected = IllegalArgumentException.class)
  public void storeRuleBadID65536() throws Exception {
    setupStorage();
    final TreeRule rule = new TreeRule(65536);
    rule.syncToStorage(storage.getTSDB(), false);
  }
View Full Code Here

Examples of net.opentsdb.tree.TreeRule

  }
 
  @Test (expected = IllegalStateException.class)
  public void storeRuleNoChanges() throws Exception {
    setupStorage();
    final TreeRule rule = TreeRule.fetchRule(storage.getTSDB(), 1, 2, 1)
      .joinUninterruptibly();
    rule.syncToStorage(storage.getTSDB(), false);
  }
View Full Code Here

Examples of net.opentsdb.tree.TreeRule

  }
 
  @Test (expected = IllegalArgumentException.class)
  public void storeRuleInvalidType() throws Exception {
    setupStorage();
    final TreeRule rule = new TreeRule(1);
    rule.setLevel(1);
    rule.setOrder(0);
    rule.setNotes("Just some notes");
    rule.syncToStorage(storage.getTSDB(), false).joinUninterruptibly();
  }
View Full Code Here

Examples of net.opentsdb.tree.TreeRule

  }
 
  @Test (expected = IllegalArgumentException.class)
  public void storeRuleInvalidMissingFieldTagk() throws Exception {
    setupStorage();
    final TreeRule rule = new TreeRule(1);
    rule.setLevel(1);
    rule.setOrder(0);
    rule.setType(TreeRuleType.TAGK);
    rule.setNotes("Just some notes");
    rule.syncToStorage(storage.getTSDB(), false).joinUninterruptibly();
  }
View Full Code Here

Examples of net.opentsdb.tree.TreeRule

  }
 
  @Test (expected = IllegalArgumentException.class)
  public void storeRuleInvalidMissingFieldTagkCustom() throws Exception {
    setupStorage();
    final TreeRule rule = new TreeRule(1);
    rule.setLevel(1);
    rule.setOrder(0);
    rule.setType(TreeRuleType.TAGK_CUSTOM);
    rule.setNotes("Just some notes");
    rule.syncToStorage(storage.getTSDB(), false).joinUninterruptibly();
  }
View Full Code Here

Examples of net.opentsdb.tree.TreeRule

  }
 
  @Test (expected = IllegalArgumentException.class)
  public void storeRuleInvalidMissingFieldTagvCustom() throws Exception {
    setupStorage();
    final TreeRule rule = new TreeRule(1);
    rule.setLevel(1);
    rule.setOrder(0);
    rule.setType(TreeRuleType.TAGV_CUSTOM);
    rule.setNotes("Just some notes");
    rule.syncToStorage(storage.getTSDB(), false).joinUninterruptibly();
  }
View Full Code Here

Examples of net.opentsdb.tree.TreeRule

  }
 
  @Test (expected = IllegalArgumentException.class)
  public void storeRuleInvalidMissingFieldMetricCustom() throws Exception {
    setupStorage();
    final TreeRule rule = new TreeRule(1);
    rule.setLevel(1);
    rule.setOrder(0);
    rule.setType(TreeRuleType.METRIC_CUSTOM);
    rule.setNotes("Just some notes");
    rule.syncToStorage(storage.getTSDB(), false).joinUninterruptibly();
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.