Package org.apache.hadoop.hbase

Examples of org.apache.hadoop.hbase.HMsg


    reportClose(region, null);
  }

  /* Add to the outbound message buffer */
  private void reportClose(final HRegionInfo region, final byte[] message) {
    outboundMsgs.add(new HMsg(HMsg.Type.MSG_REPORT_CLOSE, region, message));
  }
View Full Code Here


   * updated the meta or root regions, and the master will pick that up on its
   * next rescan of the root or meta tables.
   */
  void reportSplit(HRegionInfo oldRegion, HRegionInfo newRegionA,
      HRegionInfo newRegionB) {
    outboundMsgs.add(new HMsg(HMsg.Type.MSG_REPORT_SPLIT, oldRegion,
      (oldRegion.getRegionNameAsString() + " split; daughters: " +
        newRegionA.getRegionNameAsString() + ", " +
        newRegionB.getRegionNameAsString()).getBytes()));
    outboundMsgs.add(new HMsg(HMsg.Type.MSG_REPORT_OPEN, newRegionA));
    outboundMsgs.add(new HMsg(HMsg.Type.MSG_REPORT_OPEN, newRegionB));
  }
View Full Code Here

   * and then while the region is being opened, it is called from the Worker
   * thread that is running the region open.
   * @param hri Region to add the message for
   */
  protected void addProcessingMessage(final HRegionInfo hri) {
    getOutboundMsgs().add(new HMsg(HMsg.Type.MSG_REPORT_PROCESS_OPEN, hri));
  }
View Full Code Here

    LOG.info("Assigning region " + Bytes.toString(regionName) + " to " + serverName);
    rs.setPendingOpen(serverName);
    this.regionsInTransition.put(regionName, rs);
    this.historian.addRegionAssignment(rs.getRegionInfo(),
        serverName);
    returnMsgs.add(new HMsg(HMsg.Type.MSG_REGION_OPEN, rs.getRegionInfo()));
  }
View Full Code Here

        continue;
      }
      LOG.debug("Going to close region " +
          currentRegion.getRegionNameAsString());
      // make a message to close the region
      returnMsgs.add(new HMsg(HMsg.Type.MSG_REGION_CLOSE, currentRegion,
        OVERLOADED, inSafeMode()));
      // mark the region as closing
      setClosing(serverName, currentRegion, false);
      setPendingClose(currentRegion.getRegionName());
      // increment the count of regions we've marked
View Full Code Here

        Pair<HRegionInfo,HServerAddress> pair = i.next();
        if (addr.equals(pair.getSecond())) {
          if (LOG.isDebugEnabled()) {
            LOG.debug("Sending " + msg + " " + pair.getFirst() + " to " + addr);
          }
          returnMsgs.add(new HMsg(msg, pair.getFirst(), inSafeMode()));
          i.remove();
        }
      }
    }
  }
View Full Code Here

    }

    synchronized (master.regionManager) {
      // Tell the region server to close regions that we have marked for closing.
      for (HRegionInfo i: master.regionManager.getMarkedToClose(serverName)) {
        returnMsgs.add(new HMsg(HMsg.Type.MSG_REGION_CLOSE, i,
            master.regionManager.inSafeMode()));
        // Transition the region from toClose to closing state
        master.regionManager.setPendingClose(i.getRegionName());
      }
View Full Code Here

        // This Region should not have been opened.
        // Ask the server to shut it down, but don't report it as closed. 
        // Otherwise the HMaster will think the Region was closed on purpose,
        // and then try to reopen it elsewhere; that's not what we want.
        returnMsgs.add(new HMsg(HMsg.Type.MSG_REGION_CLOSE_WITHOUT_REPORT,
            region, "Duplicate assignment".getBytes(),
            master.regionManager.inSafeMode()));
      } else {
        if (region.isRootRegion()) {
          // it was assigned, and it's not a duplicate assignment, so take it out
View Full Code Here

        LOG.info("assigning region " +
          Bytes.toString(regionInfo.getRegionName())+
          " to server " + serverName);
        unassignedRegions.put(regionInfo, Long.valueOf(now));
        this.historian.addRegionAssignment(regionInfo, serverName);
        returnMsgs.add(new HMsg(HMsg.Type.MSG_REGION_OPEN, regionInfo));
        if (--nregions <= 0) {
          break;
        }
      }
    }
View Full Code Here

      LOG.info("assigning region " +
          Bytes.toString(regionInfo.getRegionName()) +
          " to the only server " + serverName);
      unassignedRegions.put(regionInfo, Long.valueOf(now));
      this.historian.addRegionAssignment(regionInfo, serverName);
      returnMsgs.add(new HMsg(HMsg.Type.MSG_REGION_OPEN, regionInfo));
    }
  }
View Full Code Here

TOP

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

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.