Skip to content
This repository has been archived by the owner on Sep 8, 2023. It is now read-only.

Commit

Permalink
update tests to reflect changed close_mutator semantics
Browse files Browse the repository at this point in the history
  • Loading branch information
tylerkovacs committed Sep 2, 2009
1 parent bdc5823 commit a4d4767
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
6 changes: 5 additions & 1 deletion lib/active_record/connection_adapters/hypertable_adapter.rb
Expand Up @@ -598,7 +598,11 @@ def open_mutator(table_name, flags=0, flush_interval=0)
@connection.open_mutator(table_name, flags, flush_interval)
end

def close_mutator(mutator, flush=1)
# Flush is always called in a mutator's destructor due to recent
# no_log_sync changes. Adding an explicit flush here just adds
# one round trip for an extra flush call, so change the default to
# flush=0. Consider removing this argument and always sending 0.
def close_mutator(mutator, flush=0)
@connection.close_mutator(mutator, flush)
end

Expand Down
2 changes: 1 addition & 1 deletion lib/hypertable/thrift_client.rb
Expand Up @@ -41,7 +41,7 @@ def with_mutator(table, flags=0, flush_interval=0)
begin
yield mutator
ensure
close_mutator(mutator, 1)
close_mutator(mutator, 0)
end
end

Expand Down
4 changes: 2 additions & 2 deletions test/thrift_client_test.rb
Expand Up @@ -220,7 +220,7 @@ class ThriftClientTest < Test::Unit::TestCase

should "insert a cell using set_cell" do
Hypertable.with_thrift_client("localhost", 38080) do |client|
mutator = client.open_mutator('thrift_test')
mutator = client.open_mutator('thrift_test', 0, 0)
cell1 = Hypertable::ThriftGen::Cell.new
cell1.row_key = 'k1'
cell1.column_family = 'col'
Expand Down Expand Up @@ -270,7 +270,7 @@ class ThriftClientTest < Test::Unit::TestCase

should "insert cells using set_cells" do
Hypertable.with_thrift_client("localhost", 38080) do |client|
mutator = client.open_mutator('thrift_test')
mutator = client.open_mutator('thrift_test', 0, 0)
cell1 = Hypertable::ThriftGen::Cell.new
cell1.row_key = 'k1'
cell1.column_family = 'col'
Expand Down

0 comments on commit a4d4767

Please sign in to comment.