summaryrefslogtreecommitdiff
path: root/src/mongo/s/cursors.h
diff options
context:
space:
mode:
authorRen <renctan@gmail.com>2012-03-02 12:07:47 -0500
committerRandolph Tan <randolph@10gen.com>2012-03-02 16:03:57 -0500
commit42642db1e2772b66e30870f50619bbbf58bc98ec (patch)
treeb5a96a08106b4ceef7e05255def550894932c37f /src/mongo/s/cursors.h
parentb4e9b28b111c177565c68de3939b4af096451a0c (diff)
downloadmongo-42642db1e2772b66e30870f50619bbbf58bc98ec.tar.gz
SERVER-5157 Cursor id is being stored at mongos after reply is sent to client
Diffstat (limited to 'src/mongo/s/cursors.h')
-rw-r--r--src/mongo/s/cursors.h27
1 files changed, 25 insertions, 2 deletions
diff --git a/src/mongo/s/cursors.h b/src/mongo/s/cursors.h
index 862f3731031..ee27421983d 100644
--- a/src/mongo/s/cursors.h
+++ b/src/mongo/s/cursors.h
@@ -37,15 +37,38 @@ namespace mongo {
long long getId();
/**
+ * @return the cumulative number of documents seen by this cursor.
+ */
+ int getTotalSent() const;
+
+ /**
+ * Sends queries to the shards, gather the result for this batch and sends the response
+ * to the socket.
+ *
* @return whether there is more data left
*/
- bool sendNextBatch( Request& r ) { return sendNextBatch( r , _ntoreturn ); }
- bool sendNextBatch( Request& r , int ntoreturn );
+ bool sendNextBatchAndReply( Request& r );
+
+ /**
+ * Sends queries to the shards and gather the result for this batch.
+ *
+ * @param r The request object from the client
+ * @param ntoreturn Number of documents to return
+ * @param buffer The buffer to use to store the results.
+ * @param docCount This will contain the number of documents gathered for this batch after
+ * a successful call.
+ *
+ * @return true if this is not the final batch.
+ */
+ bool sendNextBatch( Request& r, int ntoreturn, BufBuilder& buffer, int& docCount );
void accessed();
/** @return idle time in ms */
long long idleTime( long long now );
+ // The default initial buffer size for sending responses.
+ static const int INIT_REPLY_BUFFER_SIZE;
+
protected:
ClusteredCursor * _cursor;