Пример #1
0
  @Override
  public boolean isOnlyMaster(NodeId nodeId) {
    BasicDBObject query = new BasicDBObject();
    query.put("type", NodeImpl.Type.SERVER.toString());
    query.put("last_seen", new BasicDBObject("$gte", Tools.getUTCTimestamp() - pingTimeout));
    query.put("node_id", new BasicDBObject("$ne", nodeId.toString()));
    query.put("is_master", true);

    return query(NodeImpl.class, query).size() == 0;
  }
Пример #2
0
 @Override
 public Node byNodeId(NodeId nodeId) throws NodeNotFoundException {
   return byNodeId(nodeId.toString());
 }