Package org.apache.hadoop.hbase.regionserver

Examples of org.apache.hadoop.hbase.regionserver.SplitTransaction$DaughterOpener


      return;
    }
    LOG.trace("Entering preRollBack for the table " + userTableName + " for the region "
        + region.getRegionInfo());
    SplitInfo splitInfo = splitThreadLocal.get();
    SplitTransaction splitTransaction = splitInfo.getSplitTransaction();
    try {
      if (splitTransaction != null) {
        splitTransaction.rollback(rs, rs);
        LOG.info("preRollBack successfully done for the table " + userTableName
            + " for the region " + region.getRegionInfo());
      }
    } catch (Exception e) {
      LOG.error(
        "Error while rolling back the split failure for index region "
            + splitTransaction.getParent(), e);
      rs.abort("Abort; we got an error during rollback of index");
    }
  }
View Full Code Here


      p.add(Bytes.toBytes("col1"), Bytes.toBytes("ql"), Bytes.toBytes("test_val"));
      table.put(p);
    }
    List<HRegion> regions = UTIL.getMiniHBaseCluster().getRegions(Bytes.toBytes(userTableName));
    HRegionServer rs = UTIL.getMiniHBaseCluster().getRegionServer(0);
    SplitTransaction st = null;

    st = new MockedSplitTransaction(regions.get(0), null) {
      @Override
      protected void splitStoreFiles(final Path splitdir, final List<StoreFile> hstoreFilesToSplit)
          throws IOException {
        throw new IOException();
      }
    };

    try {
      st.execute(rs, rs);
    } catch (IOException e) {
      st.rollback(rs, rs);
    }

    count = manager.getTableRegionCount(userTableName);
    Assert.assertEquals(1, count);
  }
View Full Code Here

  private HRegion [] split(final HRegion r, final byte [] splitRow)
      throws IOException {

    HRegion[] regions = new HRegion[2];

    SplitTransaction st = new SplitTransaction(r, splitRow);
    int i = 0;

    if (!st.prepare()) {
      // test fails.
      assertTrue(false);
    }
    try {
      Server mockServer = Mockito.mock(Server.class);
      when(mockServer.getConfiguration()).thenReturn(
          TEST_UTIL.getConfiguration());
      PairOfSameType<HRegion> daughters = st.execute(mockServer, null);
      for (HRegion each_daughter: daughters) {
        regions[i] = each_daughter;
        i++;
      }
    } catch (IOException ioe) {
View Full Code Here

  private HRegion [] split(final HRegion r, final byte [] splitRow)
      throws IOException {

    HRegion[] regions = new HRegion[2];

    SplitTransaction st = new SplitTransaction(r, splitRow);
    int i = 0;

    if (!st.prepare()) {
      // test fails.
      assertTrue(false);
    }
    try {
      Server mockServer = Mockito.mock(Server.class);
      when(mockServer.getConfiguration()).thenReturn(
          TEST_UTIL.getConfiguration());
      PairOfSameType<HRegion> daughters = st.execute(mockServer, null);
      for (HRegion each_daughter: daughters) {
        regions[i] = each_daughter;
        i++;
      }
    } catch (IOException ioe) {
View Full Code Here

  private HRegion [] split(final HRegion r, final byte [] splitRow)
      throws IOException {

    HRegion[] regions = new HRegion[2];

    SplitTransaction st = new SplitTransaction(r, splitRow);
    int i = 0;

    if (!st.prepare()) {
      // test fails.
      assertTrue(false);
    }
    try {
      Server mockServer = Mockito.mock(Server.class);
      when(mockServer.getConfiguration()).thenReturn(
          TEST_UTIL.getConfiguration());
      PairOfSameType<HRegion> daughters = st.execute(mockServer, null);
      for (HRegion each_daughter: daughters) {
        regions[i] = each_daughter;
        i++;
      }
    } catch (IOException ioe) {
View Full Code Here

TOP

Related Classes of org.apache.hadoop.hbase.regionserver.SplitTransaction$DaughterOpener

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.