Package org.apache.hadoop.hbase.client

Examples of org.apache.hadoop.hbase.client.AdminProtocol


          + " for table " + HRegionInfo.getTableName(regionName) + ", start key [" +
          Bytes.toString(HRegionInfo.getStartKey(regionName)) + "]");
      return null;
    }

    AdminProtocol client = connection.getAdmin(regionLoc.getServerName());
    ServerInfo info = ProtobufUtil.getServerInfo(client);
    return ProtobufUtil.toServerName(info.getServerName());
  }
View Full Code Here


          sleepMultiplier++;
        }
        continue;
      }
      try {
        AdminProtocol rrs = getRS();
        ReplicationProtbufUtil.replicateWALEntry(rrs,
            Arrays.copyOf(this.entriesArray, currentNbEntries));
        if (this.lastLoggedPosition != this.repLogReader.getPosition()) {
          this.manager.logPositionAndCleanOldLogs(this.currentPath,
              this.peerClusterZnode, this.repLogReader.getPosition(),
View Full Code Here

  public boolean isSlaveDown() throws InterruptedException {
    final CountDownLatch latch = new CountDownLatch(1);
    Thread pingThread = new Thread() {
      public void run() {
        try {
          AdminProtocol rrs = getRS();
          // Dummy call which should fail
          ProtobufUtil.getServerInfo(rrs);
          latch.countDown();
        } catch (IOException ex) {
          if (ex instanceof RemoteException) {
View Full Code Here

   * when RS tries to change the state from OFFLINE to other states.
   */
  public RegionOpeningState sendRegionOpen(final ServerName server,
      HRegionInfo region, int versionOfOfflineNode)
  throws IOException {
    AdminProtocol admin = getServerConnection(server);
    if (admin == null) {
      LOG.warn("Attempting to send OPEN RPC to server " + server.toString() +
        " failed because no RPC connection found to this server");
      return RegionOpeningState.FAILED_OPENING;
    }
    OpenRegionRequest request =
      RequestConverter.buildOpenRegionRequest(region, versionOfOfflineNode);
    try {
      OpenRegionResponse response = admin.openRegion(null, request);
      return ResponseConverter.getRegionOpeningState(response);
    } catch (ServiceException se) {
      throw ProtobufUtil.getRemoteException(se);
    }
  }
View Full Code Here

   * @return a list of region opening states
   */
  public List<RegionOpeningState> sendRegionOpen(ServerName server,
      List<Pair<HRegionInfo, Integer>> regionOpenInfos)
  throws IOException {
    AdminProtocol admin = getServerConnection(server);
    if (admin == null) {
      LOG.warn("Attempting to send OPEN RPC to server " + server.toString() +
        " failed because no RPC connection found to this server");
      return null;
    }

    OpenRegionRequest request =
      RequestConverter.buildOpenRegionRequest(regionOpenInfos);
    try {
      OpenRegionResponse response = admin.openRegion(null, request);
      return ResponseConverter.getRegionOpeningStateList(response);
    } catch (ServiceException se) {
      throw ProtobufUtil.getRemoteException(se);
    }
  }
View Full Code Here

   * @throws IOException
   */
  public boolean sendRegionClose(ServerName server, HRegionInfo region,
    int versionOfClosingNode, ServerName dest, boolean transitionInZK) throws IOException {
    if (server == null) throw new NullPointerException("Passed server is null");
    AdminProtocol admin = getServerConnection(server);
    if (admin == null) {
      throw new IOException("Attempting to send CLOSE RPC to server " +
        server.toString() + " for region " +
        region.getRegionNameAsString() +
        " failed because no RPC connection found to this server");
View Full Code Here

      HRegionInfo region_b, boolean forcible) throws IOException {
    if (server == null)
      throw new NullPointerException("Passed server is null");
    if (region_a == null || region_b == null)
      throw new NullPointerException("Passed region is null");
    AdminProtocol admin = getServerConnection(server);
    if (admin == null) {
      throw new IOException("Attempting to send MERGE REGIONS RPC to server "
          + server.toString() + " for region "
          + region_a.getRegionNameAsString() + ","
          + region_b.getRegionNameAsString()
View Full Code Here

    * @throws RetriesExhaustedException wrapping a ConnectException if failed
    * putting up proxy.
    */
  private AdminProtocol getServerConnection(final ServerName sn)
  throws IOException {
    AdminProtocol admin = this.serverConnections.get(sn);
    if (admin == null) {
      LOG.debug("New connection to " + sn.toString());
      admin = this.connection.getAdmin(sn);
      this.serverConnections.put(sn, admin);
    }
View Full Code Here

  private AdminProtocol getCachedConnection(ServerName sn)
  throws IOException {
    if (sn == null) {
      return null;
    }
    AdminProtocol protocol = null;
    try {
      protocol = connection.getAdmin(sn);
    } catch (RetriesExhaustedException e) {
      if (e.getCause() != null && e.getCause() instanceof ConnectException) {
        // Catch this; presume it means the cached connection has gone bad.
View Full Code Here

   * @throws IOException
   * @throws InterruptedException
   */
  public boolean verifyMetaRegionLocation(final long timeout)
  throws InterruptedException, IOException {
    AdminProtocol connection = null;
    try {
      connection = waitForMetaServerConnection(timeout);
    } catch (NotAllMetaRegionsOnlineException e) {
      // Pass
    } catch (ServerNotRunningYetException e) {
View Full Code Here

TOP

Related Classes of org.apache.hadoop.hbase.client.AdminProtocol

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.