Package org.apache.hadoop.hbase

Examples of org.apache.hadoop.hbase.TableName


    delete.deleteFamily(fam1);
    doTestDelete_AndPostInsert(delete);
  }

  public void doTestDelete_AndPostInsert(Delete delete) throws IOException, InterruptedException {
    TableName tableName = TableName.valueOf(name.getMethodName());
    this.region = initHRegion(tableName, getName(), conf, fam1);
    try {
      EnvironmentEdgeManagerTestHelper.injectEdge(new IncrementingEnvironmentEdge());
      Put put = new Put(row);
      put.add(fam1, qual1, value1);
View Full Code Here


    }
  }

  @Test
  public void testDelete_CheckTimestampUpdated() throws IOException {
    TableName tableName = TableName.valueOf(name.getMethodName());
    byte[] row1 = Bytes.toBytes("row1");
    byte[] col1 = Bytes.toBytes("col1");
    byte[] col2 = Bytes.toBytes("col2");
    byte[] col3 = Bytes.toBytes("col3");
View Full Code Here

   *
   * @throws Exception
   */
  @Test
  public void testStatusSettingToAbortIfAnyExceptionDuringRegionInitilization() throws Exception {
    TableName tableName = TableName.valueOf(name.getMethodName());
    HRegionInfo info = null;
    try {
      FileSystem fs = Mockito.mock(FileSystem.class);
      Mockito.when(fs.exists((Path) Mockito.anyObject())).thenThrow(new IOException());
      HTableDescriptor htd = new HTableDescriptor(tableName);
View Full Code Here

  private void durabilityTest(String method, Durability tableDurability,
      Durability mutationDurability, long timeout, boolean expectAppend, final boolean expectSync,
      final boolean expectSyncFromLogSyncer) throws Exception {
    method = method + "_" + tableDurability.name() + "_" + mutationDurability.name();
    TableName tableName = TableName.valueOf(method);
    byte[] family = Bytes.toBytes("family");
    Path logDir = new Path(new Path(DIR + method), "log");
    HLog hlog = HLogFactory.createHLog(fs, logDir, UUID.randomUUID().toString(), conf);
    final HLog log = spy(hlog);
    this.region = initHRegion(tableName.getName(), HConstants.EMPTY_START_ROW,
        HConstants.EMPTY_END_ROW, method, conf, false, tableDurability, log,
        new byte[][] { family });

    Put put = new Put(Bytes.toBytes("r1"));
    put.add(family, Bytes.toBytes("q1"), Bytes.toBytes("v1"));
View Full Code Here

   */
  // Disabled because fails sporadically.  Is this test right?  Timing-wise, there could be no
  // files in a column family on initial creation -- as suggested by Matteo.
  @Ignore @Test(timeout=120000)
  public void testQuarantineMissingFamdir() throws Exception {
    TableName table = TableName.valueOf(name.getMethodName());
    ExecutorService exec = new ScheduledThreadPoolExecutor(10);
    // inject a fault in the hfcc created.
    final FileSystem fs = FileSystem.get(conf);
    HBaseFsck hbck = new HBaseFsck(conf, exec) {
      @Override
View Full Code Here

  /**
   * After a region is split, it should not be able to assign again
   */
  @Test
  public void testSplitRegionNotAssignable() throws Exception {
    final TableName tableName =
        TableName.valueOf("testSplitRegionWithNoStoreFiles");
    // Create table then get the single region for our new table.
    HTable t = createTableAndWait(tableName.getName(), CF);
    try {
      List<HRegion> regions = cluster.getRegions(tableName);
      int regionServerIndex = cluster.getServerWith(regions.get(0).getRegionName());
      HRegionServer regionServer = cluster.getRegionServer(regionServerIndex);
      insertData(tableName.getName(), admin, t);
      // Turn off balancer so it doesn't cut in and mess up our placements.
      admin.setBalancerRunning(false, true);
      // Turn off the meta scanner so it don't remove parent on us.
      cluster.getMaster().setCatalogJanitorEnabled(false);
      final HRegion region = findSplittableRegion(regions);
View Full Code Here

   * This creates a table and simulates the race situation where a concurrent compaction or split
   * has removed a region dir before the corruption checker got to it.
   */
  @Test(timeout=120000)
  public void testQuarantineMissingRegionDir() throws Exception {
    TableName table = TableName.valueOf(name.getMethodName());
    ExecutorService exec = new ScheduledThreadPoolExecutor(10);
    // inject a fault in the hfcc created.
    final FileSystem fs = FileSystem.get(conf);
    HBaseFsck hbck = new HBaseFsck(conf, exec) {
      @Override
View Full Code Here

  /**
   * Test fixing lingering reference file.
   */
  @Test
  public void testLingeringReferenceFile() throws Exception {
    TableName table =
        TableName.valueOf("testLingeringReferenceFile");
    try {
      setupTable(table);
      assertEquals(ROWKEYS.length, countRows());

View Full Code Here

  /**
   * Test mission REGIONINFO_QUALIFIER in hbase:meta
   */
  @Test
  public void testMissingRegionInfoQualifier() throws Exception {
    TableName table =
        TableName.valueOf("testMissingRegionInfoQualifier");
    try {
      setupTable(table);

      // Mess it up by removing the RegionInfo for one region.
View Full Code Here

  @Test
  public void testTableWithNoRegions() throws Exception {
    // We might end up with empty regions in a table
    // see also testNoHdfsTable()
    TableName table =
        TableName.valueOf(name.getMethodName());
    try {
      // create table with one region
      HTableDescriptor desc = new HTableDescriptor(table);
      HColumnDescriptor hcd = new HColumnDescriptor(Bytes.toString(FAM));
View Full Code Here

TOP

Related Classes of org.apache.hadoop.hbase.TableName

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.