Package org.apache.hadoop.hbase.util

Examples of org.apache.hadoop.hbase.util.ManualEnvironmentEdge.incValue()


      timeStamp = EnvironmentEdgeManager.currentTimeMillis();
      this.store.add(new KeyValue(row, family, qf1, timeStamp, (byte[]) null));
      this.store.add(new KeyValue(row, family, qf2, timeStamp, (byte[]) null));
      this.store.add(new KeyValue(row, family, qf3, timeStamp, (byte[]) null));
      flush(i);
      mee.incValue(sleepTime);
    }
    // move time forward a bit more, so that the first file is expired
    mee.incValue(1);

    // Verify the total number of store files
View Full Code Here


      this.store.add(new KeyValue(row, family, qf3, timeStamp, (byte[]) null));
      flush(i);
      mee.incValue(sleepTime);
    }
    // move time forward a bit more, so that the first file is expired
    mee.incValue(1);

    // Verify the total number of store files
    assertEquals(storeFileNum, this.store.getStorefiles().size());

    // Each compaction request will find one expired store file and delete it
View Full Code Here

      // It is an empty store file.
      assertEquals(0, this.store.getStorefiles().get(0).getReader()
          .getEntries());

      // Let the next store file expired.
      mee.incValue(sleepTime);
    }
  }

  public void testLowestModificationTime() throws Exception {
    Configuration conf = HBaseConfiguration.create();
View Full Code Here

    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);
View Full Code Here


    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

    fs.addToFailedServers(ia);
    Assert.assertTrue( fs.isFailedServer(ia) );
    Assert.assertTrue( fs.isFailedServer(ia2) );

    ee.incValue( 1 );
    Assert.assertTrue( fs.isFailedServer(ia) );
    Assert.assertTrue( fs.isFailedServer(ia2) );

    ee.incValue( HBaseClient.FAILED_SERVER_EXPIRY_DEFAULT + 1 );
    Assert.assertFalse( fs.isFailedServer(ia) );
View Full Code Here

    ee.incValue( 1 );
    Assert.assertTrue( fs.isFailedServer(ia) );
    Assert.assertTrue( fs.isFailedServer(ia2) );

    ee.incValue( HBaseClient.FAILED_SERVER_EXPIRY_DEFAULT + 1 );
    Assert.assertFalse( fs.isFailedServer(ia) );
    Assert.assertFalse( fs.isFailedServer(ia2) );

    fs.addToFailedServers(ia);
    fs.addToFailedServers(ia3);
View Full Code Here

    Assert.assertTrue( fs.isFailedServer(ia) );
    Assert.assertTrue( fs.isFailedServer(ia2) );
    Assert.assertTrue( fs.isFailedServer(ia3) );
    Assert.assertTrue( fs.isFailedServer(ia4) );

    ee.incValue( HBaseClient.FAILED_SERVER_EXPIRY_DEFAULT + 1 );
    Assert.assertFalse( fs.isFailedServer(ia) );
    Assert.assertFalse( fs.isFailedServer(ia2) );
    Assert.assertFalse( fs.isFailedServer(ia3) );
    Assert.assertFalse( fs.isFailedServer(ia4) );
View Full Code Here

    EnvironmentEdgeManager.injectEdge(mee);
    LOG.info("first get");
    table.get(new Get(ROW));

    LOG.info("first get - changing the time & sleeping");
    mee.incValue(idleTime + 1000);
    Thread.sleep(1500); // we need to wait a little for the connection to be seen as idle.
                        // 1500 = sleep time in RpcClient#waitForWork + a margin

    LOG.info("second get - connection has been marked idle in the middle");
    // To check that the connection actually became idle would need to read some private
View Full Code Here

    LOG.info("second get - connection has been marked idle in the middle");
    // To check that the connection actually became idle would need to read some private
    //  fields of RpcClient.
    table.get(new Get(ROW));
    mee.incValue(idleTime + 1000);

    LOG.info("third get - connection is idle, but the reader doesn't know yet");
    // We're testing here a special case:
    //  time limit reached BUT connection not yet reclaimed AND a new call.
    //  in this situation, we don't close the connection, instead we use it immediately.
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.