Package org.apache.hadoop.hbase.util

Examples of org.apache.hadoop.hbase.util.ManualEnvironmentEdge


  @SuppressWarnings("unchecked")
  @Test
  public void testMergeExpiredStripes() throws Exception {
    // HBASE-11397
    ManualEnvironmentEdge edge = new ManualEnvironmentEdge();
    long now = defaultTtl + 2;
    edge.setValue(now);
    EnvironmentEdgeManager.injectEdge(edge);
    try {
      StoreFile expiredFile = createFile(), notExpiredFile = createFile();
      when(expiredFile.getReader().getMaxTimestamp()).thenReturn(now - defaultTtl - 1);
      when(notExpiredFile.getReader().getMaxTimestamp()).thenReturn(now - defaultTtl + 1);
View Full Code Here


  }


  @Test
  public void testSortExtract(){
    ManualEnvironmentEdge mee = new ManualEnvironmentEdge();
    EnvironmentEdgeManager.injectEdge(mee);
    mee.setValue(1);

    DeadServer d = new DeadServer();


    d.add(hostname123);
    mee.incValue(1);
    d.add(hostname1234);
    mee.incValue(1);
    d.add(hostname12345);

    List<Pair<ServerName, Long>> copy = d.copyDeadServersSince(2L);
    Assert.assertEquals(2, copy.size());
View Full Code Here

    assertICV(row, fam1, qual1, value+amount);
  }

  public void testIncrementColumnValue_BumpSnapshot() throws IOException {
    ManualEnvironmentEdge mee = new ManualEnvironmentEdge();
    EnvironmentEdgeManagerTestHelper.injectEdge(mee);
    initHRegion(tableName, getName(), fam1);

    long value = 42L;
    long incr = 44L;
View Full Code Here

    initHRegion(tableName, getName(), fam1);

    long value = 1L;
    long amount = 3L;
    long now = EnvironmentEdgeManager.currentTimeMillis();
    ManualEnvironmentEdge mock = new ManualEnvironmentEdge();
    mock.setValue(now);
    EnvironmentEdgeManagerTestHelper.injectEdge(mock);

    // verify we catch an ICV on a put with the same timestamp
    Put put = new Put(row);
    put.add(fam1, qual1, now, Bytes.toBytes(value));
View Full Code Here

      this.region = null;
    }
  }

  public void testIncrementColumnValue_BumpSnapshot() throws IOException {
    ManualEnvironmentEdge mee = new ManualEnvironmentEdge();
    EnvironmentEdgeManagerTestHelper.injectEdge(mee);
    this.region = initHRegion(tableName, getName(), fam1);
    try {
      long value = 42L;
      long incr = 44L;
View Full Code Here

    this.region = initHRegion(tableName, getName(), fam1);
    try {
      long value = 1L;
      long amount = 3L;
      long now = EnvironmentEdgeManager.currentTimeMillis();
      ManualEnvironmentEdge mock = new ManualEnvironmentEdge();
      mock.setValue(now);
      EnvironmentEdgeManagerTestHelper.injectEdge(mock);

      // verify we catch an ICV on a put with the same timestamp
      Put put = new Put(row);
      put.add(fam1, qual1, now, Bytes.toBytes(value));
View Full Code Here

      this.region = null;
    }
  }

  public void testIncrementColumnValue_BumpSnapshot() throws IOException {
    ManualEnvironmentEdge mee = new ManualEnvironmentEdge();
    EnvironmentEdgeManagerTestHelper.injectEdge(mee);
    this.region = initHRegion(tableName, getName(), fam1);
    try {
      long value = 42L;
      long incr = 44L;
View Full Code Here

    this.region = initHRegion(tableName, getName(), fam1);
    try {
      long value = 1L;
      long amount = 3L;
      long now = EnvironmentEdgeManager.currentTimeMillis();
      ManualEnvironmentEdge mock = new ManualEnvironmentEdge();
      mock.setValue(now);
      EnvironmentEdgeManagerTestHelper.injectEdge(mock);

      // verify we catch an ICV on a put with the same timestamp
      Put put = new Put(row);
      put.add(fam1, qual1, now, Bytes.toBytes(value));
View Full Code Here

    assertICV(row, fam1, qual1, value+amount);
  }

  public void testIncrementColumnValue_BumpSnapshot() throws IOException {
    ManualEnvironmentEdge mee = new ManualEnvironmentEdge();
    EnvironmentEdgeManagerTestHelper.injectEdge(mee);
    initHRegion(tableName, getName(), fam1);

    long value = 42L;
    long incr = 44L;
View Full Code Here

      this.region = null;
    }
  }

  public void testIncrementColumnValue_BumpSnapshot() throws IOException {
    ManualEnvironmentEdge mee = new ManualEnvironmentEdge();
    EnvironmentEdgeManagerTestHelper.injectEdge(mee);
    this.region = initHRegion(tableName, getName(), conf, fam1);
    try {
      long value = 42L;
      long incr = 44L;
View Full Code Here

TOP

Related Classes of org.apache.hadoop.hbase.util.ManualEnvironmentEdge

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.