ActiveState(final OutMessage outMessage) { namespace = outMessage.getNamespace(); opCode = outMessage.getOpCode(); query = outMessage.getQuery(); numDocuments = outMessage.getNumDocuments(); this.startTime = System.nanoTime(); this.threadName = Thread.currentThread().getName(); }
private synchronized Response findOne(DB db, String coll, DBObject q) throws IOException { OutMessage msg = OutMessage.query(db.getCollection(coll), 0, 0, -1, q, null, Bytes.MAX_OBJECT_SIZE); try { return call(msg, db.getCollection(coll), null); } finally { msg.doneWithMessage(); } }