[
https://issues.apache.org/jira/browse/HBASE-19619?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16304198#comment-16304198
]
Guanghao Zhang commented on HBASE-19619:
----------------------------------------
ns_set2 ==> ns_set
{code}
244 ns_set = rpc.getNamespaces
245 ns_set2 = java.util.HashSet.new
246 unless ns_set.nil?
247 ns_set.each do |n|
248 ns_set2.add(n) if !namespaces.include? n
249 end
250 end
{code}
For the above code in remove_peer_namespaces, we can make it simple and
readable.
{code}
ns_set = rpc.getNamespaces
unless ns_set.nil?
ns_set = java.util.HashSet.new(ns_set)
namespaces.each do |n|
ns_set.remove(n)
end
end
{code}
> Modify replication_admin.rb to use ReplicationPeerConfigBuilder
> ---------------------------------------------------------------
>
> Key: HBASE-19619
> URL: https://issues.apache.org/jira/browse/HBASE-19619
> Project: HBase
> Issue Type: Bug
> Reporter: Ted Yu
> Assignee: Ted Yu
> Priority: Critical
> Fix For: 2.0.0-beta-1
>
> Attachments: 19619.v1.txt, 19619.v10.txt, 19619.v11.txt,
> 19619.v12.txt, 19619.v2.txt, 19619.v3.txt, 19619.v4.txt, 19619.v5.txt,
> 19619.v7.txt, 19619.v8.txt
>
>
> Here is the error:
> {code}
> Error:
> test_append_peer_namespaces:_works_with_namespaces_array(Hbase::ReplicationAdminTest):
> Java::JavaLang::UnsupportedOperationException:
> java.util.Collections$UnmodifiableCollection.add(java/util/Collections.java:1055)
> java.lang.reflect.Method.invoke(java/lang/reflect/Method.java:498)
> org.jruby.javasupport.JavaMethod.invokeDirectWithExceptionHandling(org/jruby/javasupport/JavaMethod.java:453)
> org.jruby.javasupport.JavaMethod.invokeDirect(org/jruby/javasupport/JavaMethod.java:314)
> RUBY.block in
> add_peer_namespaces(/home/jenkins/jenkins-slave/workspace/HBase-Flaky-Tests/hbase-shell/src/main/ruby/hbase/replication_admin.rb:226)
> org.jruby.RubyArray.each(org/jruby/RubyArray.java:1734)
> org.jruby.RubyArray$INVOKER$i$0$0$each.call(org/jruby/RubyArray$INVOKER$i$0$0$each.gen)
> RUBY.add_peer_namespaces(/home/jenkins/jenkins-slave/workspace/HBase-Flaky-Tests/hbase-shell/src/main/ruby/hbase/replication_admin.rb:225)
> RUBY.command(/home/jenkins/jenkins-slave/workspace/HBase-Flaky-Tests/hbase-shell/src/main/ruby/shell/commands/append_peer_namespaces.rb:40)
> org.jruby.RubyClass.finvoke(org/jruby/RubyClass.java:522)
> {code}
> The cause was due to adding to UnmodifiableCollection
--
This message was sent by Atlassian JIRA
(v6.4.14#64029)