private static String getClusterId(byte[] data) throws DeserializationException { if (data == null || data.length == 0) { return null; } data = removeMetaData(data); return ClusterId.parseFrom(data).toString(); }
public static String readClusterIdZNode(ZKWatcher watcher) throws KeeperException { if (ZKUtil.checkExists(watcher, watcher.getZNodePaths().clusterIdZNode) != -1) { byte [] data; try { data = ZKUtil.getData(watcher, watcher.getZNodePaths().clusterIdZNode); } catch (InterruptedException e) { Thread.currentThread().interrupt(); return null; } if (data != null) { try { return ClusterId.parseFrom(data).toString(); } catch (DeserializationException e) { throw ZKUtil.convert(e); } } } return null; }
.collect(Collectors.toList())); if (proto.hasClusterId()) { builder.setClusterId(ClusterId.convert(proto.getClusterId()).toString());
@Override protected void chore() { if (!isConnected()) { return; } List<ServerName> sns = generateDeadServersListToSend(); if (sns.isEmpty()) { // Nothing to send. Done. return; } final long curTime = EnvironmentEdgeManager.currentTime(); if (lastMessageTime > curTime - messagePeriod) { // We already sent something less than 10 second ago. Done. return; } // Ok, we're going to send something then. lastMessageTime = curTime; // We're reusing an existing protobuf message, but we don't send everything. // This could be extended in the future, for example if we want to send stuff like the // hbase:meta server name. publisher.publish(ClusterMetricsBuilder.newBuilder() .setHBaseVersion(VersionInfo.getVersion()) .setClusterId(master.getMasterFileSystem().getClusterId().toString()) .setMasterName(master.getServerName()) .setDeadServerNames(sns) .build()); }
status.setStatus("Publishing Cluster ID " + clusterId + " in ZooKeeper"); ZKClusterId.setClusterId(this.zooKeeper, fileSystemManager.getClusterId()); this.clusterId = clusterId.toString();
private static String getClusterId(byte[] data) throws DeserializationException { if (data == null || data.length == 0) { return null; } data = removeMetaData(data); return ClusterId.parseFrom(data).toString(); }
.collect(Collectors.toList())); if (proto.hasClusterId()) { builder.setClusterId(ClusterId.convert(proto.getClusterId()).toString());
private static String getClusterId(byte[] data) throws DeserializationException { if (data == null || data.length == 0) { return null; } data = removeMetaData(data); return ClusterId.parseFrom(data).toString(); }
public static String readClusterIdZNode(ZooKeeperWatcher watcher) throws KeeperException { if (ZKUtil.checkExists(watcher, watcher.clusterIdZNode) != -1) { byte [] data; try { data = ZKUtil.getData(watcher, watcher.clusterIdZNode); } catch (InterruptedException e) { Thread.currentThread().interrupt(); return null; } if (data != null) { try { return ClusterId.parseFrom(data).toString(); } catch (DeserializationException e) { throw ZKUtil.convert(e); } } } return null; }
public static String readClusterIdZNode(ZKWatcher watcher) throws KeeperException { if (ZKUtil.checkExists(watcher, watcher.getZNodePaths().clusterIdZNode) != -1) { byte [] data; try { data = ZKUtil.getData(watcher, watcher.getZNodePaths().clusterIdZNode); } catch (InterruptedException e) { Thread.currentThread().interrupt(); return null; } if (data != null) { try { return ClusterId.parseFrom(data).toString(); } catch (DeserializationException e) { throw ZKUtil.convert(e); } } } return null; }
.collect(Collectors.toList())); if (proto.hasClusterId()) { builder.setClusterId(ClusterId.convert(proto.getClusterId()).toString());
master.getMasterFileSystem().getClusterId().toString(), null, sns,
ClusterId.convert(proto.getClusterId()).toString(),servers,deadServers, ProtobufUtil.toServerName(proto.getMaster()),backupMasters,rit,masterCoprocessors, proto.getBalancerOn());
fileSystemManager.getClusterId().toString() : null; Map<String, RegionState> regionsInTransition = assignmentManager != null ? assignmentManager.getRegionStates().getRegionsInTransition() : null;