Package net.opentsdb.storage

Examples of net.opentsdb.storage.MockBase


  /**
   * Mocks classes for testing the storage calls
   */
  private void setupStorage(final boolean default_get,
      final boolean default_put) throws Exception {
    storage = new MockBase(default_get, default_put, true, true);
   
    byte[] key = new byte[] { 0, 1 };
    // set pre-test values
    storage.addColumn(key, "tree".getBytes(MockBase.ASCII()),
        (byte[])TreetoStorageJson.invoke(buildTestTree()));
View Full Code Here


    final Config config = new Config(false);
    PowerMockito.whenNew(HBaseClient.class)
      .withArguments(anyString(), anyString()).thenReturn(client);
    tsdb = new TSDB(config);
   
    storage = new MockBase(tsdb, client, true, true, true, true);
   
    storage.addColumn(new byte[] { 0, 0, 1 }, NAME_FAMILY,
        "metrics".getBytes(MockBase.ASCII()),
        "sys.cpu.0".getBytes(MockBase.ASCII()));
    storage.addColumn(new byte[] { 0, 0, 1 }, NAME_FAMILY,
View Full Code Here

    final Config config = new Config(false);
    PowerMockito.whenNew(HBaseClient.class)
      .withArguments(anyString(), anyString()).thenReturn(client);
    tsdb = new TSDB(config);
   
    storage = new MockBase(tsdb, client, true, true, true, true);
   
    // add a global
    storage.addColumn(
        new byte[] { 0, 0, 0, (byte) 0x4F, (byte) 0x29, (byte) 0xD2, 0 },
        new byte[] { 1, 0, 0 },
View Full Code Here

    }
  }
 
  @Before
  public void before() throws Exception {
    storage = new MockBase(true, true, true, true);
    treebuilder = new TreeBuilder(storage.getTSDB(), tree);
    PowerMockito.spy(Tree.class);
    PowerMockito.doReturn(Deferred.fromResult(tree)).when(Tree.class,
        "fetchTree", (TSDB)any(), anyInt());
   
View Full Code Here

  // Helper functions. //
  // ----------------- //
 
  @SuppressWarnings("unchecked")
  private void setQueryStorage() throws Exception {
    storage = new MockBase(tsdb, client, true, true, true, true);
    storage.setFamily("t".getBytes(MockBase.ASCII()));

    PowerMockito.mockStatic(IncomingDataPoints.class);  
    PowerMockito.doAnswer(
        new Answer<byte[]>() {
View Full Code Here

  public void before() throws Exception {
    final Config config = new Config(false);
    PowerMockito.whenNew(HBaseClient.class)
      .withArguments(anyString(), anyString()).thenReturn(client);
    tsdb = new TSDB(config);
    storage = new MockBase(tsdb, client, true, true, true, true);
  }
View Full Code Here

   * Configures storage for the addPoint() tests to validate that we're storing
   * data points correctly.
   */
  @SuppressWarnings("unchecked")
  private void setupAddPointStorage() throws Exception {
    storage = new MockBase(tsdb, client, true, true, true, true);
   
    PowerMockito.mockStatic(IncomingDataPoints.class);  
    final byte[] row = new byte[] { 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1};
    PowerMockito.doAnswer(
        new Answer<byte[]>() {
View Full Code Here

    final HBaseClient client = mock(HBaseClient.class);
    final Config config = new Config(false);
    PowerMockito.whenNew(HBaseClient.class)
      .withArguments(anyString(), anyString()).thenReturn(client);
   
    storage = new MockBase(new TSDB(config), client, true, true, true, true);
   
    Branch branch = new Branch(1);
    TreeMap<Integer, String> path = new TreeMap<Integer, String>();
    path.put(0, "ROOT");
    path.put(1, "sys");
View Full Code Here

    }
  }

  @SuppressWarnings("unchecked")
  private void setQueryStorage() throws Exception {
    storage = new MockBase(tsdb, client, true, true, true, true);
    storage.setFamily("t".getBytes(MockBase.ASCII()));

    PowerMockito.mockStatic(IncomingDataPoints.class);
    PowerMockito.doAnswer(
        new Answer<byte[]>() {
View Full Code Here

    final Config config = new Config(false);
    PowerMockito.whenNew(HBaseClient.class)
      .withArguments(anyString(), anyString()).thenReturn(client);
    tsdb = new TSDB(config);
   
    storage = new MockBase(tsdb, client, true, true, true, true);
   
    storage.addColumn(new byte[] { 0, 0, 1 },
        NAME_FAMILY,
        "metrics".getBytes(MockBase.ASCII()),
        "sys.cpu.0".getBytes(MockBase.ASCII()));
View Full Code Here

TOP

Related Classes of net.opentsdb.storage.MockBase

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.