/* the same as superclass's localTarget, but with the more specfic NN type */
        protected override HAServiceTarget DataToTarget(byte[] data)
        {
            HAZKInfoProtos.ActiveNodeInfo proto;
            try
            {
                proto = HAZKInfoProtos.ActiveNodeInfo.ParseFrom(data);
            }
            catch (InvalidProtocolBufferException)
            {
                throw new RuntimeException("Invalid data in ZK: " + StringUtils.ByteToHexString(data
                                                                                                ));
            }
            NNHAServiceTarget ret = new NNHAServiceTarget(conf, proto.GetNameserviceId(), proto
                                                          .GetNamenodeId());
            IPEndPoint addressFromProtobuf = new IPEndPoint(proto.GetHostname(), proto.GetPort
                                                                ());

            if (!addressFromProtobuf.Equals(ret.GetAddress()))
            {
                throw new RuntimeException("Mismatched address stored in ZK for " + ret + ": Stored protobuf was "
                                           + proto + ", address from our own " + "configuration for this NameNode was " +
                                           ret.GetAddress());
            }
            ret.SetZkfcPort(proto.GetZkfcPort());
            return(ret);
        }
 /// <exception cref="System.IO.IOException"/>
 protected override void InitRPC()
 {
     base.InitRPC();
     localNNTarget.SetZkfcPort(rpcServer.GetAddress().Port);
 }