/** * @param hostAndPort Formatted as <code><hostname> ':' <port></code> * @return An InetSocketInstance */ public static InetSocketAddress createInetSocketAddressFromHostAndPortStr( final String hostAndPort) { return new InetSocketAddress(parseHostname(hostAndPort), parsePort(hostAndPort)); }
public static StartcodeAgnosticServerName valueOf(final String hostnameAndPort, long startcode) { return new StartcodeAgnosticServerName(Addressing.parseHostname(hostnameAndPort), Addressing.parsePort(hostnameAndPort), startcode); }
@Override public synchronized void stopRegionServer(final String hostnamePort) throws IOException { String hostname = Addressing.parseHostname(hostnamePort); int port = Addressing.parsePort(hostnamePort); final AdminService.BlockingInterface admin = this.connection.getAdmin(ServerName.valueOf(hostname, port, 0)); // TODO: There is no timeout on this controller. Set one! HBaseRpcController controller = rpcControllerFactory.newController(); controller.setPriority(HConstants.HIGH_QOS); StopServerRequest request = RequestConverter.buildStopServerRequest( "Called by admin client " + this.connection.toString()); try { admin.stopServer(controller, request); } catch (Exception e) { throw ProtobufUtil.handleRemoteException(e); } }
int port = Addressing.parsePort(str); return ServerName.valueOf(hostname, port, -1L);
int port = Addressing.parsePort(str); return ServerName.valueOf(hostname, port, -1L);
@Override public synchronized void stopRegionServer(final String hostnamePort) throws IOException { String hostname = Addressing.parseHostname(hostnamePort); int port = Addressing.parsePort(hostnamePort); final AdminService.BlockingInterface admin = this.connection.getAdmin(ServerName.valueOf(hostname, port, 0)); // TODO: There is no timeout on this controller. Set one! HBaseRpcController controller = rpcControllerFactory.newController(); controller.setPriority(HConstants.HIGH_QOS); StopServerRequest request = RequestConverter.buildStopServerRequest( "Called by admin client " + this.connection.toString()); try { admin.stopServer(controller, request); } catch (Exception e) { throw ProtobufUtil.handleRemoteException(e); } }
int port = Addressing.parsePort(str); return ServerName.valueOf(hostname, port, -1L);
int port = Addressing.parsePort(str); return ServerName.valueOf(hostname, port, -1L);
/** * @param hostAndPort Formatted as <code><hostname> ':' <port></code> * @return An InetSocketInstance */ public static InetSocketAddress createInetSocketAddressFromHostAndPortStr( final String hostAndPort) { return new InetSocketAddress(parseHostname(hostAndPort), parsePort(hostAndPort)); }
/** * @param hostAndPort Formatted as <code><hostname> ':' <port></code> * @return An InetSocketInstance */ public static InetSocketAddress createInetSocketAddressFromHostAndPortStr( final String hostAndPort) { return new InetSocketAddress(parseHostname(hostAndPort), parsePort(hostAndPort)); }
/** * @param hostAndPort Formatted as <code><hostname> ':' <port></code> * @return An InetSocketInstance */ public static InetSocketAddress createInetSocketAddressFromHostAndPortStr( final String hostAndPort) { return new InetSocketAddress(parseHostname(hostAndPort), parsePort(hostAndPort)); }
/** * @param hostAndPort Formatted as <code><hostname> ':' <port></code> * @return An InetSocketInstance */ public static InetSocketAddress createInetSocketAddressFromHostAndPortStr( final String hostAndPort) { return new InetSocketAddress(parseHostname(hostAndPort), parsePort(hostAndPort)); }
public ServerName(final String hostAndPort, final long startCode) { this(Addressing.parseHostname(hostAndPort), Addressing.parsePort(hostAndPort), startCode); }
public ServerName(final String hostAndPort, final long startCode) { this(Addressing.parseHostname(hostAndPort), Addressing .parsePort(hostAndPort), startCode); }
private ServerName(final String hostAndPort, final long startCode) { this(Addressing.parseHostname(hostAndPort), Addressing.parsePort(hostAndPort), startCode); }
/** * Stop the designated regionserver * @param hostnamePort Hostname and port delimited by a <code>:</code> as in * <code>example.org:1234</code> * @throws IOException if a remote or network exception occurs */ public synchronized void stopRegionServer(final String hostnamePort) throws IOException { String hostname = Addressing.parseHostname(hostnamePort); int port = Addressing.parsePort(hostnamePort); HRegionInterface rs = this.connection.getHRegionConnection(hostname, port); rs.stop("Called by admin client " + this.connection.toString()); }
private static ServerName dataToServerName(final byte [] data) { // The str returned could be old style -- pre hbase-1502 -- which was // hostname and port seperated by a colon rather than hostname, port and // startcode delimited by a ','. if (data == null || data.length <= 0) return null; String str = Bytes.toString(data); int index = str.indexOf(ServerName.SERVERNAME_SEPARATOR); if (index != -1) { // Presume its ServerName.toString() format. return ServerName.parseServerName(str); } // Presume it a hostname:port format. String hostname = Addressing.parseHostname(str); int port = Addressing.parsePort(str); return new ServerName(hostname, port, -1L); } }
/** * Stop the designated entityGroupserver * * @param hostnamePort * Hostname and port delimited by a <code>:</code> as in * <code>example.org:1234</code> * @throws java.io.IOException * if a remote or network exception occurs */ 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); } }
/** * Stop the designated regionserver * @param hostnamePort Hostname and port delimited by a <code>:</code> as in * <code>example.org:1234</code> * @throws IOException if a remote or network exception occurs */ @Override public synchronized void stopRegionServer(final String hostnamePort) throws IOException { String hostname = Addressing.parseHostname(hostnamePort); int port = Addressing.parsePort(hostnamePort); AdminService.BlockingInterface admin = this.connection.getAdmin(ServerName.valueOf(hostname, port, 0)); StopServerRequest request = RequestConverter.buildStopServerRequest( "Called by admin client " + this.connection.toString()); try { admin.stopServer(null, request); } catch (ServiceException se) { throw ProtobufUtil.getRemoteException(se); } }
@Override public synchronized void stopRegionServer(final String hostnamePort) throws IOException { String hostname = Addressing.parseHostname(hostnamePort); int port = Addressing.parsePort(hostnamePort); final AdminService.BlockingInterface admin = this.connection.getAdmin(ServerName.valueOf(hostname, port, 0)); // TODO: There is no timeout on this controller. Set one! HBaseRpcController controller = rpcControllerFactory.newController(); controller.setPriority(HConstants.HIGH_QOS); StopServerRequest request = RequestConverter.buildStopServerRequest( "Called by admin client " + this.connection.toString()); try { admin.stopServer(controller, request); } catch (Exception e) { throw ProtobufUtil.handleRemoteException(e); } }