*
* @return whether the serverName currently hosts the entityGroup
*/
private boolean isCarryingEntityGroup(ServerName serverName,
EntityGroupInfo egInfo) {
EntityGroupTransaction rt = null;
try {
byte[] data = ZKAssign.getData(watcher, egInfo.getEncodedName());
// This call can legitimately come by null
rt = data == null ? null : EntityGroupTransaction.parseFrom(data);
} catch (KeeperException e) {
server.abort("Exception reading unassigned node for entityGroup="
+ egInfo.getEncodedName(), e);
} catch (DeserializationException e) {
server.abort("Exception parsing unassigned node for entityGroup="
+ egInfo.getEncodedName(), e);
}
ServerName addressFromZK = rt != null ? rt.getServerName() : null;
if (addressFromZK != null) {
// if we get something from ZK, we will use the data
boolean matchZK = (addressFromZK != null && addressFromZK
.equals(serverName));
LOG.debug("based on ZK, current entityGroup="