/** * Count the number of live role instances on this node * @param role role index * @return 0 if there are none, otherwise the #of nodes that are running */ public int getLiveRoleInstances(int role) { NodeEntry nodeEntry = get(role); return (nodeEntry != null ) ? nodeEntry.getLive() : 0; }
/** * Count the number of live role instances on this node * @param role role index * @return 0 if there are none, otherwise the #of nodes that are running */ public int getLiveRoleInstances(int role) { NodeEntry nodeEntry = get(role); return (nodeEntry != null ) ? nodeEntry.getLive() : 0; }
/** * Build a {@link NodeEntryRecord} from a node entry; include whether * the node is in use and when it was last used. * @param entry entry count * @param role role index * @param hostname name * @return the record */ private NodeEntryRecord build(NodeEntry entry, int role, String hostname) { NodeEntryRecord record = new NodeEntryRecord( hostname, role, entry.getLive() > 0, entry.getLastUsed() ); return record; }
/** * Build a {@link NodeEntryRecord} from a node entry; include whether * the node is in use and when it was last used. * @param entry entry count * @param role role index * @param hostname name * @return the record */ private NodeEntryRecord build(NodeEntry entry, int role, String hostname) { NodeEntryRecord record = new NodeEntryRecord( hostname, role, entry.getLive() > 0, entry.getLastUsed() ); return record; }