Examples of AdminProtocol


Examples of com.alibaba.wasp.fserver.AdminProtocol

   * @param egi
   * @throws java.io.IOException
   */
  public void closeEntityGroup(final ServerName sn, final EntityGroupInfo egi)
      throws IOException {
    AdminProtocol admin = this.connection.getAdmin(sn.getHostname(),
        sn.getPort());
    // Close the entityGroup without updating zk state.
    ProtobufUtil.closeEntityGroup(admin, egi, false);
  }
View Full Code Here

Examples of com.alibaba.wasp.fserver.AdminProtocol

    if (null == serverName || ("").equals(serverName.trim())) {
      throw new IllegalArgumentException(
          "The servername cannot be null or empty.");
    }
    ServerName sn = new ServerName(serverName);
    AdminProtocol admin = this.connection.getAdmin(sn.getHostname(),
        sn.getPort());
    CloseEncodedEntityGroupRequest request = RequestConverter
        .buildCloseEncodedEntityGroupRequest(encodedEntityGroupName, false);
    try {
      CloseEncodedEntityGroupResponse response = admin.closeEncodedEntityGroup(
          null, request);
      boolean success = response.getSuccess();
      if (!success) {
        LOG.error("Not able to close the entityGroup " + encodedEntityGroupName
            + ".");
View Full Code Here

Examples of com.alibaba.wasp.fserver.AdminProtocol

  /**
   * Get all the online entityGroups on a entityGroup server.
   */
  public List<EntityGroupInfo> getOnlineEntityGroups(final ServerName sn)
      throws IOException {
    AdminProtocol admin = this.connection.getAdmin(sn.getHostname(),
        sn.getPort());
    return ProtobufUtil.getOnlineEntityGroups(admin);
  }
View Full Code Here

Examples of com.alibaba.wasp.fserver.AdminProtocol

    }
  }

  private void split(final ServerName sn, final EntityGroupInfo egi,
      byte[] splitPoint) throws IOException {
    AdminProtocol admin = this.connection.getAdmin(sn.getHostname(),
        sn.getPort());
    ProtobufUtil.split(admin, egi, splitPoint);
  }
View Full Code Here

Examples of com.alibaba.wasp.fserver.AdminProtocol

   */
  public synchronized void stopEntityGroupServer(final String hostnamePort)
      throws IOException {
    String hostname = Addressing.parseHostname(hostnamePort);
    int port = Addressing.parsePort(hostnamePort);
    AdminProtocol admin = this.connection.getAdmin(hostname, port);
    StopServerRequest request = RequestConverter
        .buildStopServerRequest("Called by admin client "
            + this.connection.toString());
    try {
      admin.stopServer(null, request);
    } catch (ServiceException se) {
      throw ProtobufUtil.getRemoteException(se);
    }
  }
View Full Code Here

Examples of com.alibaba.wasp.fserver.AdminProtocol

   *          that needs to be present in the offline node when FS tries to
   *          change the state from OFFLINE to other states.
   */
  public EntityGroupOpeningState sendEntityGroupOpen(final ServerName server,
      EntityGroupInfo entityGroup, 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 EntityGroupOpeningState.FAILED_OPENING;
    }
    OpenEntityGroupRequest request = RequestConverter
        .buildOpenEntityGroupRequest(entityGroup, versionOfOfflineNode);
    try {
      OpenEntityGroupResponse response = admin.openEntityGroup(null, request);
      return ResponseConverter.getEntityGroupOpeningState(response);
    } catch (ServiceException se) {
      throw ProtobufUtil.getRemoteException(se);
    }
  }
View Full Code Here

Examples of com.alibaba.wasp.fserver.AdminProtocol

   *          info of a list of entityGroups to open
   * @return a list of entityGroup opening states
   */
  public List<EntityGroupOpeningState> sendEntityGroupsOpen(ServerName server,
      List<EntityGroupInfo> entityGroupOpenInfos) 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;
    }

    OpenEntityGroupRequest request = RequestConverter
        .buildOpenEntityGroupRequest(entityGroupOpenInfos);
    try {
      OpenEntityGroupResponse response = admin.openEntityGroup(null, request);
      return ResponseConverter.getEntityGroupOpeningStateList(response);
    } catch (ServiceException se) {
      throw ProtobufUtil.getRemoteException(se);
    }
  }
View Full Code Here

Examples of com.alibaba.wasp.fserver.AdminProtocol

      EntityGroupInfo entityGroup, 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 entityGroup "
          + entityGroup.getEntityGroupNameAsString()
          + " failed because no RPC connection found to this server");
View Full Code Here

Examples of com.alibaba.wasp.fserver.AdminProtocol

  public boolean sendEnableTable(ServerName server, String tableName)
      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 enableTable RPC to server "
          + server.toString()
          + " failed because no RPC connection found to this server");
    }

    com.alibaba.wasp.protobuf.generated.FServerAdminProtos.EnableTableRequest request = RequestConverter
        .buildServerEnableTableRequest(tableName);
    try {
      return admin.enableServerTable(null, request).getSuccess();
    } catch (ServiceException e) {
      throw ProtobufUtil.getRemoteException(e);
    }
  }
View Full Code Here

Examples of com.alibaba.wasp.fserver.AdminProtocol

  public boolean sendDisableTable(ServerName server, String tableName)
      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 disableTable RPC to server "
          + server.toString()
          + " failed because no RPC connection found to this server");
    }

    com.alibaba.wasp.protobuf.generated.FServerAdminProtos.DisableTableRequest request = RequestConverter
        .buildServerDisableTableRequest(tableName);
    try {
      return admin.disableServerTable(null, request).getSuccess();
    } catch (ServiceException e) {
      throw ProtobufUtil.getRemoteException(e);
    }
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.