Package org.apache.hadoop.hbase.protobuf.generated.ZooKeeperProtos

Examples of org.apache.hadoop.hbase.protobuf.generated.ZooKeeperProtos.MetaRegionServer


  public static ServerName parseFrom(final byte [] data) throws DeserializationException {
    if (data == null || data.length <= 0) return null;
    if (ProtobufUtil.isPBMagicPrefix(data)) {
      int prefixLen = ProtobufUtil.lengthOfPBMagic();
      try {
        MetaRegionServer rss =
          MetaRegionServer.PARSER.parseFrom(data, prefixLen, data.length - prefixLen);
        org.apache.hadoop.hbase.protobuf.generated.HBaseProtos.ServerName sn = rss.getServer();
        return new ServerName(sn.getHostName(), sn.getPort(), sn.getStartCode());
      } catch (InvalidProtocolBufferException e) {
        // A failed parse of the znode is pretty catastrophic. Rather than loop
        // retrying hoping the bad bytes will changes, and rather than change
        // the signature on this method to add an IOE which will send ripples all
View Full Code Here


  public static ServerName parseFrom(final byte [] data) throws DeserializationException {
    if (data == null || data.length <= 0) return null;
    if (ProtobufUtil.isPBMagicPrefix(data)) {
      int prefixLen = ProtobufUtil.lengthOfPBMagic();
      try {
        MetaRegionServer rss =
          MetaRegionServer.PARSER.parseFrom(data, prefixLen, data.length - prefixLen);
        org.apache.hadoop.hbase.protobuf.generated.HBaseProtos.ServerName sn = rss.getServer();
        return valueOf(sn.getHostName(), sn.getPort(), sn.getStartCode());
      } catch (InvalidProtocolBufferException e) {
        // A failed parse of the znode is pretty catastrophic. Rather than loop
        // retrying hoping the bad bytes will changes, and rather than change
        // the signature on this method to add an IOE which will send ripples all
View Full Code Here

  public static ServerName parseFrom(final byte [] data) throws DeserializationException {
    if (data == null || data.length <= 0) return null;
    if (ProtobufUtil.isPBMagicPrefix(data)) {
      int prefixLen = ProtobufUtil.lengthOfPBMagic();
      try {
        MetaRegionServer rss =
          MetaRegionServer.PARSER.parseFrom(data, prefixLen, data.length - prefixLen);
        org.apache.hadoop.hbase.protobuf.generated.HBaseProtos.ServerName sn = rss.getServer();
        return valueOf(sn.getHostName(), sn.getPort(), sn.getStartCode());
      } catch (InvalidProtocolBufferException e) {
        // A failed parse of the znode is pretty catastrophic. Rather than loop
        // retrying hoping the bad bytes will changes, and rather than change
        // the signature on this method to add an IOE which will send ripples all
View Full Code Here

  public static ServerName parseFrom(final byte [] data) throws DeserializationException {
    if (data == null || data.length <= 0) return null;
    if (ProtobufUtil.isPBMagicPrefix(data)) {
      int prefixLen = ProtobufUtil.lengthOfPBMagic();
      try {
        MetaRegionServer rss =
          MetaRegionServer.newBuilder().mergeFrom(data, prefixLen, data.length - prefixLen).build();
        org.apache.hadoop.hbase.protobuf.generated.HBaseProtos.ServerName sn = rss.getServer();
        return new ServerName(sn.getHostName(), sn.getPort(), sn.getStartCode());
      } catch (InvalidProtocolBufferException e) {
        // A failed parse of the znode is pretty catastrophic. Rather than loop
        // retrying hoping the bad bytes will changes, and rather than change
        // the signature on this method to add an IOE which will send ripples all
View Full Code Here

  public static ServerName parseFrom(final byte [] data) throws DeserializationException {
    if (data == null || data.length <= 0) return null;
    if (ProtobufUtil.isPBMagicPrefix(data)) {
      int prefixLen = ProtobufUtil.lengthOfPBMagic();
      try {
        MetaRegionServer rss =
          MetaRegionServer.PARSER.parseFrom(data, prefixLen, data.length - prefixLen);
        org.apache.hadoop.hbase.protobuf.generated.HBaseProtos.ServerName sn = rss.getServer();
        return valueOf(sn.getHostName(), sn.getPort(), sn.getStartCode());
      } catch (InvalidProtocolBufferException e) {
        // A failed parse of the znode is pretty catastrophic. Rather than loop
        // retrying hoping the bad bytes will changes, and rather than change
        // the signature on this method to add an IOE which will send ripples all
View Full Code Here

  public static void setMetaLocation(ZooKeeperWatcher zookeeper,
      ServerName serverName, RegionState.State state) throws KeeperException {
    LOG.info("Setting hbase:meta region location in ZooKeeper as " + serverName);
    // Make the MetaRegionServer pb and then get its bytes and save this as
    // the znode content.
    MetaRegionServer pbrsr = MetaRegionServer.newBuilder()
      .setServer(ProtobufUtil.toServerName(serverName))
      .setRpcVersion(HConstants.RPC_CURRENT_VERSION)
      .setState(state.convert()).build();
    byte[] data = ProtobufUtil.prependPBMagic(pbrsr.toByteArray());
    try {
      ZKUtil.setData(zookeeper, zookeeper.metaServerZNode, data);
    } catch(KeeperException.NoNodeException nne) {
      LOG.debug("META region location doesn't existed, create it");
      ZKUtil.createAndWatch(zookeeper, zookeeper.metaServerZNode, data);
View Full Code Here

  public static ServerName parseFrom(final byte [] data) throws DeserializationException {
    if (data == null || data.length <= 0) return null;
    if (ProtobufUtil.isPBMagicPrefix(data)) {
      int prefixLen = ProtobufUtil.lengthOfPBMagic();
      try {
        MetaRegionServer rss =
          MetaRegionServer.PARSER.parseFrom(data, prefixLen, data.length - prefixLen);
        org.apache.hadoop.hbase.protobuf.generated.HBaseProtos.ServerName sn = rss.getServer();
        return valueOf(sn.getHostName(), sn.getPort(), sn.getStartCode());
      } catch (InvalidProtocolBufferException e) {
        // A failed parse of the znode is pretty catastrophic. Rather than loop
        // retrying hoping the bad bytes will changes, and rather than change
        // the signature on this method to add an IOE which will send ripples all
View Full Code Here

TOP

Related Classes of org.apache.hadoop.hbase.protobuf.generated.ZooKeeperProtos.MetaRegionServer

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.