Commit Graph

155 Commits

Author SHA1 Message Date
Tyler Brock
b70c9ce152 RUBY-406 enhancements to :secondary_only read preference
Improved implementation
-- read_preference :secondary_only is now communicated via invocation
of ReplSetConnection#checkout_secondary

Better tests
-- ensures reads go to secondaries
-- ensures reads do not go to primaries
2012-02-18 16:51:57 -05:00
Kyle Banker
b79d408a11 Enable log duration by default for :debug-level logging. 2012-02-16 14:01:09 -05:00
Cyril Mougel
84c8e7cae2 add log_duration system to add time spend in database 2012-02-03 18:02:14 +01:00
Ben Symonds
4ae41edfe4 send the instrument payload even if no logger, for benefit of anyone hooking into instrument method. also matches behaviour of insert, update, remove methods 2011-12-13 18:39:23 +00:00
Kyle Banker
b6ff77fcbc RUBY-379 RUBY-381 reconnect on 'not master' errors (fix close connection logic) 2011-12-05 15:25:37 -05:00
Kyle Banker
03303b8409 RUBY-374 Close connection on SystemStackError, NoMemoryError, and SystemCallError 2011-12-02 15:37:05 -05:00
Kyle Banker
fa10508f07 Remove thread-local map and socket map (complexity creep). 2011-11-18 15:47:06 -05:00
Kyle Banker
1146e5692a RUBY-341 fix :max_scan and :show_disk_loc 2011-11-15 16:24:21 -05:00
Kyle Banker
f668678fd1 Store sockets in thread-local variables when possible.
Allow connection pools to grow if needed. All this minimizes
the number of locks required and reduces the waiting time
for these locks.
2011-11-03 18:37:23 -04:00
Kyle Banker
14593954fa RUBY-352 Ensure commands are sent to primary. 2011-10-26 10:28:06 -04:00
Kyle Banker
78dd5035d7 minor fix 2011-10-17 14:49:44 -05:00
Kyle Banker
7a11bb18a9 Ensure that cursor requiring getmore ops will not
be affected by replica set refresh.

Prep for sending commands to secondaries.
2011-10-17 14:41:09 -04:00
Kyle Banker
e678bac75e RUBY-306 clean up logging. 2011-09-07 17:14:53 -04:00
Kyle Banker
75941ad2a3 minor: Cursor cleanup 2011-09-07 10:17:24 -04:00
Kyle Banker
1c439df278 RUBY-312 Enable exhaust-mode queries. 2011-09-07 10:02:10 -04:00
Kyle Banker
7ac19f1bfa minor: Cursor#next over Cursor#next_document 2011-09-06 16:23:55 -04:00
Kyle Banker
50c38c6c6b RUBY-284 document :read API 2011-09-06 14:58:03 -04:00
Kyle Banker
046038e18d RUBY-297 when possible, include error codes and
return objects in exception classes.
2011-09-06 14:22:50 -04:00
Kyle Banker
834b0db0af RUBY-307 Collection#count should take a query, skip, and limit. 2011-09-06 11:38:19 -04:00
Kyle Banker
45c40e7267 RUBY-320 RUBY-284 initial cascading read API. Mapping sockets to pools. 2011-08-29 17:49:58 -04:00
Kyle Banker
82b103752e RUBY-289 ensure that negative limit is logged 2011-08-08 18:31:30 -04:00
Kyle Banker
b32f895ed6 RUBY-288 ensure we cannot modify with add_option or remove_option after iteration starts. 2011-08-05 18:22:09 -04:00
Kyle Banker
1142c33910 RUBY-288 Cursor#remove_option 2011-08-05 18:15:48 -04:00
Kyle Banker
96b39313bf RUBY-267 Cursor#alive? 2011-08-05 17:54:38 -04:00
Kyle Banker
eecb1d35de Revert "RUBY-167 Cursor#alive?"
This reverts commit 91308cdc60.
Wrong JIRA Issue
2011-08-05 17:52:44 -04:00
Kyle Banker
91308cdc60 RUBY-167 Cursor#alive? 2011-08-05 17:51:37 -04:00
Kyle Banker
237dc98fbf RUBY-283 add_option for cursors. Deprecate Cursor#query_opts. 2011-08-05 11:52:45 -04:00
Karl Seguin
7783cebfdf batch_size is taken into account when limit is 0/not set 2011-06-16 22:21:40 +08:00
Kyle Banker
b8ab13e7f9 Revert "RUBY-267 Cursor#alive?"
This reverts commit 05dfef2f11.
This adds new functionality and thus must wait for the 1.4 release.
2011-05-10 15:58:23 -04:00
Kyle Banker
05dfef2f11 RUBY-267 Cursor#alive? 2011-05-10 15:45:32 -04:00
Kyle Banker
9a80fbaa66 RUBY-266 support maxscan, showDiskLoc, and returnKey 2011-05-10 15:40:06 -04:00
Kyle Banker
604d0f60ed RUBY-261 Cursor#close hits secondary when appropriate. 2011-05-10 14:21:23 -04:00
Kyle Banker
2bfe205c51 Merged wpiekutowski's commits to enable warnings
on test suite and clean up some code.

Conflicts:
	test/cursor_test.rb
2011-03-23 16:02:04 -04:00
John Nunemaker
53ad43fedc Added transformer concept.
Can be passed to find/find_one, which in turn is passed to cursor. It is an optional block that makes it easier to turn documents that are returned into hashes.

cursor = collection.find({...}, :transformer => Proc.new { |doc| User.load(doc) })
cursor.next # returns instance of User instead of ordered hash

This will allow MongoMapper, ToyStore and other object mappers to take better advantage of Cursors. No more calling to_a and mapping to instances.
2011-03-23 15:26:34 -04:00
Kyle Banker
8df0ff23f5 RUBY-249 Alias Cursor#next for Cursor#next_document 2011-03-15 14:24:34 -04:00
Wojciech Piekutowski
62900acb4b Initialize @cursor_id 2011-02-20 17:03:32 +01:00
Wojciech Piekutowski
5dfac28dd4 Fix Mongo::Cursor#query_options_hash 2011-02-20 16:22:39 +01:00
Kyle Banker
d63cf18042 minor: note 2011-02-02 09:51:13 -05:00
Kyle Banker
9c83ca6b3e minor style and doc fixes. warning about logging performance issues. 2011-01-31 15:51:39 -05:00
Steve Sloan
8a7296599b Refactored logging of DB operations to use Connection#instrument.
This allows for easy overriding, e.g. to ActiveSupport notifications.
2011-01-31 15:13:12 -05:00
Kyle Banker
0d91faf6b1 RUBY-226 minor: license update 2011-01-17 12:26:32 -05:00
Kyle Banker
a197ea7852 RUBY-219 minor: use opts instead of options throughout 2011-01-05 11:30:20 -05:00
Kyle Banker
fa583762e7 RUBY-203 Use Hash#fetch when possible 2011-01-05 09:34:09 -05:00
Kyle Banker
e621db732e minor: cleanup 2010-11-24 14:01:26 -05:00
Daniel Cooper
df80704f77 Cursor#count now has optional argument to make it take notice of skip and limit 2010-11-24 13:51:05 -05:00
Kyle Banker
1e57ca90e1 Initial commit for reads from rs secondaries 2010-11-16 15:43:59 -05:00
Ijonas Kisselbach
2188522687 removed argument type checks from Cursor.skip() and Cursor.limit() due to clash with JRuby's redefining of Integer 2010-11-11 15:20:08 -05:00
Evgeny Shadchnev
8c96f5d52f removed batch_size accessor that's overridden by a method anyway 2010-11-11 15:08:24 -05:00
Evgeny Shadchnev
af0822f476 initializing query_run and closed before they are first used 2010-11-11 15:08:01 -05:00
Kyle Banker
c984af4ff0 Fixed bug passing :timeout to Cursor. Added tests. 2010-11-04 17:26:21 -04:00