Permalink
Browse files

Merge branch 'master' of https://github.com/christkv/node-mongodb-native

  • Loading branch information...
2 parents 42e71b2 + cb84de7 commit ad66f48b44e5b9f8543d4628ef729f40348c733e @mrkurt mrkurt committed Apr 12, 2012
Showing with 148 additions and 15 deletions.
  1. +2 −0 HISTORY
  2. +3 −1 dev/tools/build-docs.js
  3. +1 −1 docs/sphinx-docs/conf.py
  4. +61 −1 lib/mongodb/connection/repl_set.js
  5. +80 −11 lib/mongodb/connection/server.js
  6. +1 −1 package.json
View
@@ -1,3 +1,5 @@
+0.9.9.8 2012-04-12
+------------------
- _id=0 is being turned into an ObjectID (Issue #551)
- fix for error in GridStore write method (Issue #559)
- Fix for reading a GridStore from arbitrary, non-chunk aligned offsets, added test (Issue #563, https://github.com/subroutine)
View
@@ -19,7 +19,9 @@ var apiClasses = [
{tag:"cursorstream", path:"./lib/mongodb/cursorstream.js"},
{tag:"gridstore", path:"./lib/mongodb/gridfs/gridstore.js"},
{tag:"readstream", path:"./lib/mongodb/gridfs/readstream.js"},
- {tag:"grid", path:"./lib/mongodb/gridfs/grid.js"}
+ {tag:"grid", path:"./lib/mongodb/gridfs/grid.js"},
+ {tag:"server", path:"./lib/mongodb/connection/server.js"},
+ {tag:"replset", path:"./lib/mongodb/connection/repl_set.js"}
];
// All test files
View
@@ -50,7 +50,7 @@
# The short X.Y version.
version = '0.9'
# The full version, including alpha/beta/rc tags.
-release = '0.9.9.7'
+release = '0.9.9.8'
# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
@@ -31,7 +31,7 @@ const STATE_ROLLBACK = 9;
* - **rs_name** {String}, the name of the replicaset to connect to.
* - **readPreference** {String}, the prefered read preference (Server.READ_PRIMARY, Server.READ_SECONDARY, Server.READ_SECONDARY_ONLY).
* - **read_secondary** {Boolean, deprecated}, allow reads from secondary.
- * - **strategy** {String}, selection strategy for reads choose between (ping and statistical)
+ * - **strategy** {String, default:null}, selection strategy for reads choose between (ping and statistical, default is round-robin)
*
* @class Represents a Replicaset Configuration
* @param {Array} list of server objects participating in the replicaset.
@@ -242,8 +242,14 @@ var ReplSet = exports.ReplSet = function(servers, options) {
this._replicasetTimeoutId = null;
};
+/**
+ * @ignore
+ */
inherits(ReplSet, EventEmitter);
+/**
+ * @ignore
+ */
// Allow setting the read preference at the replicaset level
ReplSet.prototype.setReadPreference = function(preference) {
// Set read preference
@@ -255,30 +261,51 @@ ReplSet.prototype.setReadPreference = function(preference) {
}
}
+/**
+ * @ignore
+ */
// Return the used state
ReplSet.prototype._isUsed = function() {
return this._used;
}
+/**
+ * @ignore
+ */
ReplSet.prototype.setTarget = function(target) {
this.target = target;
};
+/**
+ * @ignore
+ */
ReplSet.prototype.isConnected = function() {
// Return the state of the replicaset server
return this.primary != null && this._state.master != null && this._state.master.isConnected();
}
+/**
+ * @ignore
+ */
Server.prototype.isSetMember = function() {
return false;
}
+/**
+ * @ignore
+ */
ReplSet.prototype.isPrimary = function(config) {
return this.readSecondary && this.secondaries.length > 0 ? false : true;
}
+/**
+ * @ignore
+ */
ReplSet.prototype.isReadPrimary = ReplSet.prototype.isPrimary;
+/**
+ * @ignore
+ */
// Clean up dead connections
var cleanupConnections = ReplSet.cleanupConnections = function(connections, addresses, byTags) {
// Ensure we don't have entries in our set with dead connections
@@ -298,6 +325,9 @@ var cleanupConnections = ReplSet.cleanupConnections = function(connections, addr
}
}
+/**
+ * @ignore
+ */
var cleanupTags = ReplSet._cleanupTags = function(server, byTags) {
var serverTagKeys = Object.keys(server.tags);
// Iterate over all server tags and remove any instances for that tag that matches the current
@@ -328,6 +358,9 @@ var cleanupTags = ReplSet._cleanupTags = function(server, byTags) {
}
}
+/**
+ * @ignore
+ */
ReplSet.prototype.allServerInstances = function() {
var self = this;
// Close all the servers (concatenate entire list of servers first for ease)
@@ -358,6 +391,9 @@ ReplSet.prototype.allServerInstances = function() {
return allServers;
}
+/**
+ * @ignore
+ */
// Ensure no callback is left hanging when we have an error
var __executeAllCallbacksWithError = function(dbInstance, error) {
var keys = Object.keys(dbInstance._callBackStore._notReplied);
@@ -370,6 +406,9 @@ var __executeAllCallbacksWithError = function(dbInstance, error) {
}
}
+/**
+ * @ignore
+ */
ReplSet.prototype.connect = function(parent, options, callback) {
var self = this;
var dateStamp = new Date().getTime();
@@ -976,13 +1015,19 @@ ReplSet.prototype.connect = function(parent, options, callback) {
};
}
+/**
+ * @ignore
+ */
ReplSet.prototype.checkoutWriter = function() {
// Establish connection
var connection = this._state.master != null ? this._state.master.checkoutWriter() : null;
// Return the connection
return connection;
}
+/**
+ * @ignore
+ */
ReplSet.prototype.checkoutReader = function() {
var connection = null;
// If we have specified to read from a secondary server grab a random one and read
@@ -1033,6 +1078,9 @@ ReplSet.prototype.checkoutReader = function() {
return connection;
}
+/**
+ * @ignore
+ */
ReplSet.prototype.allRawConnections = function() {
// Neeed to build a complete list of all raw connections, start with master server
var allConnections = [];
@@ -1058,6 +1106,9 @@ ReplSet.prototype.allRawConnections = function() {
return allConnections;
}
+/**
+ * @ignore
+ */
ReplSet.prototype.enableRecordQueryStats = function(enable) {
// Set the global enable record query stats
this.recordQueryStats = enable;
@@ -1076,10 +1127,16 @@ ReplSet.prototype.enableRecordQueryStats = function(enable) {
}
}
+/**
+ * @ignore
+ */
ReplSet.prototype.disconnect = function(callback) {
this.close(callback);
}
+/**
+ * @ignore
+ */
ReplSet.prototype.close = function(callback) {
var self = this;
// Set server status as disconnected
@@ -1131,5 +1188,8 @@ ReplSet.prototype.close = function(callback) {
}
}
+/**
+ * @ignore
+ */
// Backward compatibility
exports.ReplSetServers = ReplSet;
Oops, something went wrong.

0 comments on commit ad66f48

Please sign in to comment.