Package org.apache.hadoop.hbase.regionserver

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


  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

  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

  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

    LOG.trace("Entering preSplitBeforePONR for the table " + userTableName + " for the region "
        + region.getRegionInfo());
    String indexTableName = IndexUtils.getIndexTableName(userTableName);
    if (indexManager.getIndicesForTable(userTableName) != null) {
      HRegion indexRegion = null;
      SplitTransaction st = null;
      try {
        indexRegion = getIndexRegion(rs, region.getStartKey(), indexTableName);
        if (null != indexRegion) {
          LOG.info("Flushing the cache for the index table " + indexTableName + " for the region "
              + indexRegion.getRegionInfo());
          indexRegion.flushcache();
          if (LOG.isInfoEnabled()) {
            LOG.info("Forcing split for the index table " + indexTableName + " with split key "
                + Bytes.toString(splitKey));
          }
          st = new SplitTransaction(indexRegion, splitKey);
          if (!st.prepare()) {
            LOG.error("Prepare for the index table " + indexTableName
                + " failed. So returning null. ");
            return null;
          }
          indexRegion.forceSplit(splitKey);
          PairOfSameType<HRegion> daughterRegions = st.stepsBeforeAddingPONR(rs, rs, false);
          SplitInfo splitInfo = splitThreadLocal.get();
          splitInfo.setDaughtersAndTransaction(daughterRegions, st);
          LOG.info("Daughter regions created for the index table " + indexTableName
              + " for the region " + indexRegion.getRegionInfo());
          return splitInfo;
        } else {
          LOG.error("IndexRegion for the table " + indexTableName + " is null. So returning null. ");
          return null;
        }
      } catch (Exception ex) {
        LOG.error("Error while spliting the indexTabRegion or not able to get the indexTabRegion:"
            + indexRegion != null ? indexRegion.getRegionName() : "", ex);
        st.rollback(rs, rs);
        return null;
      }
    }
    LOG.trace("Indexes for the table " + userTableName
        + " are null. So returning the empty SplitInfo");
View Full Code Here

      return;
    }
    LOG.trace("Entering postSplit for the table " + userTableName + " for the region "
        + region.getRegionInfo());
    IndexManager indexManager = IndexManager.getInstance();
    SplitTransaction splitTransaction = null;
    if (indexManager.getIndicesForTable(userTableName) != null) {
      try {
        SplitInfo splitInfo = splitThreadLocal.get();
        splitTransaction = splitInfo.getSplitTransaction();
        PairOfSameType<HRegion> daughters = splitInfo.getDaughters();
        if (splitTransaction != null && daughters != null) {
          splitTransaction.stepsAfterPONR(rs, rs, daughters);
          LOG.info("Daughter regions are opened and split transaction finished"
              + " for zknodes for index table " + indexTableName + " for the region "
              + region.getRegionInfo());
        }
      } catch (Exception ex) {
View Full Code Here

TOP

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

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.