Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion hbase-shell/src/main/ruby/hbase/table.rb
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,11 @@ def _deleteall_internal(row, column = nil,
# delete operation doesn't need read permission. Retaining the read check for
# meta table as a part of HBASE-5837.
if is_meta_table?
raise ArgumentError, 'Row Not Found' if _get_internal(row).nil?
if row.is_a?(Hash) and row.key?('ROWPREFIXFILTER')
raise ArgumentError, 'deleteall with ROWPREFIXFILTER in hbase:meta is not allowed.'
else
raise ArgumentError, 'Row Not Found' if _get_internal(row).nil?
end
end
if row.is_a?(Hash)
_deleterows_internal(row, column, timestamp, args, all_version)
Expand Down
7 changes: 7 additions & 0 deletions hbase-shell/src/test/ruby/hbase/table_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,13 @@ def teardown
assert_nil(res2)
end

define_test "deleteall with row prefix in hbase:meta should not be allowed." do
assert_raise(ArgumentError) do
@meta_table = table('hbase:meta')
@meta_table.deleteall({ROWPREFIXFILTER => "test_meta"})
end
end

define_test "append should work with value" do
@test_table.append("123", 'x:cnt2', '123')
assert_equal("123123", @test_table._append_internal("123", 'x:cnt2', '123'))
Expand Down