+ ACTIVE_STANDBY_ELECTOR_LOCK; byte[] data = zk.getData(path, zkw, new Stat()); ActiveRMInfoProto proto = ActiveRMInfoProto.parseFrom(data); proto.getRmId(); LOG.info("Active RmId : " + proto.getRmId());
+ ACTIVE_STANDBY_ELECTOR_LOCK; byte[] data = zk.getData(path, zkw, new Stat()); ActiveRMInfoProto proto = ActiveRMInfoProto.parseFrom(data); proto.getRmId(); LOG.info("Active RmId : " + proto.getRmId());
+ ACTIVE_STANDBY_ELECTOR_LOCK; byte[] data = zk.getData(path, zkw, new Stat()); ActiveRMInfoProto proto = ActiveRMInfoProto.parseFrom(data); proto.getRmId(); LOG.info("Active RmId : " + proto.getRmId());
private boolean isParentZnodeSafe(String clusterId) throws InterruptedException, IOException, KeeperException { byte[] data; try { data = elector.getActiveData(); } catch (ActiveStandbyElector.ActiveNotFoundException e) { // no active found, parent znode is safe return true; } YarnServerResourceManagerServiceProtos.ActiveRMInfoProto proto; try { proto = YarnServerResourceManagerServiceProtos.ActiveRMInfoProto .parseFrom(data); } catch (InvalidProtocolBufferException e) { LOG.error("Invalid data in ZK: " + StringUtils.byteToHexString(data)); return false; } // Check if the passed proto corresponds to an RM in the same cluster if (!proto.getClusterId().equals(clusterId)) { LOG.error("Mismatched cluster! The other RM seems " + "to be from a different cluster. Current cluster = " + clusterId + "Other RM's cluster = " + proto.getClusterId()); return false; } return true; }
private boolean isParentZnodeSafe(String clusterId) throws InterruptedException, IOException, KeeperException { byte[] data; try { data = elector.getActiveData(); } catch (ActiveStandbyElector.ActiveNotFoundException e) { // no active found, parent znode is safe return true; } YarnServerResourceManagerServiceProtos.ActiveRMInfoProto proto; try { proto = YarnServerResourceManagerServiceProtos.ActiveRMInfoProto .parseFrom(data); } catch (InvalidProtocolBufferException e) { LOG.error("Invalid data in ZK: " + StringUtils.byteToHexString(data)); return false; } // Check if the passed proto corresponds to an RM in the same cluster if (!proto.getClusterId().equals(clusterId)) { LOG.error("Mismatched cluster! The other RM seems " + "to be from a different cluster. Current cluster = " + clusterId + "Other RM's cluster = " + proto.getClusterId()); return false; } return true; }
private boolean isParentZnodeSafe(String clusterId) throws InterruptedException, IOException, KeeperException { byte[] data; try { data = elector.getActiveData(); } catch (ActiveStandbyElector.ActiveNotFoundException e) { // no active found, parent znode is safe return true; } YarnServerResourceManagerServiceProtos.ActiveRMInfoProto proto; try { proto = YarnServerResourceManagerServiceProtos.ActiveRMInfoProto .parseFrom(data); } catch (InvalidProtocolBufferException e) { LOG.error("Invalid data in ZK: " + StringUtils.byteToHexString(data)); return false; } // Check if the passed proto corresponds to an RM in the same cluster if (!proto.getClusterId().equals(clusterId)) { LOG.error("Mismatched cluster! The other RM seems " + "to be from a different cluster. Current cluster = " + clusterId + "Other RM's cluster = " + proto.getClusterId()); return false; } return true; }