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

Disable bucket cache on HBase masters #1277

Merged
merged 2 commits into from
Sep 26, 2018
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 2 additions & 1 deletion cookbooks/bcpc-hadoop/recipes/hbase_config.rb
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,8 @@
# If HBASE bucket cache is enabled the properties from this section will be included in hbase-site.xml
#
bucketcache_size = (node['bcpc']['hadoop']['hbase_rs']['mx_dir_mem']['size'] - node['bcpc']['hadoop']['hbase_rs']['hdfs_dir_mem']['size']).floor
if node['bcpc']['hadoop']['hbase']['bucketcache']['enabled'] == true
if node['bcpc']['hadoop']['hbase']['bucketcache']['enabled'] == true &&
node['bcpc']['hadoop']['rs_hosts'].map { |rs| rs.values[0] }.include?(node['fqdn'])
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using include may cause foo-r1n1 to match foo-r1n10. Why not a select over map and look for equality?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think that will happen because the result of a map is an Array.
It will call the include? which falls back to the method in Enumerable.
That returns true if any element in the map results == node['fqdn']

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What Ron said. In the map, I strip the small hashes down to just the value. The result is a String array of just FQDNs. I then do an include? using the fqdn of the node itself to check for a match, which should avoid collisions.

generated_values['hbase.regionserver.global.memstore.upperLimit'] = node['bcpc']['hadoop']['hbase_rs']['memstore']['upperlimit'].to_s
generated_values['hfile.block.cache.size'] = node['bcpc']['hadoop']['hbase']['blockcache']['size'].to_s
generated_values['hbase.bucketcache.size'] = bucketcache_size
Expand Down
4 changes: 0 additions & 4 deletions cookbooks/bcpc-hadoop/recipes/hbase_env.rb
Original file line number Diff line number Diff line change
Expand Up @@ -63,10 +63,6 @@
node.default['bcpc']['hadoop']['hbase']['env']['HBASE_REGIONSERVER_OPTS'] =
node['bcpc']['hadoop']['hbase']['env']['HBASE_REGIONSERVER_OPTS'] +
' -XX:MaxDirectMemorySize=' + node['bcpc']['hadoop']['hbase_rs']['mx_dir_mem']['size'].to_s + 'm'

node.default['bcpc']['hadoop']['hbase']['env']['HBASE_MASTER_OPTS'] =
node['bcpc']['hadoop']['hbase']['env']['HBASE_MASTER_OPTS'] +
' -XX:MaxDirectMemorySize=' + node['bcpc']['hadoop']['hbase_master']['mx_dir_mem']['size'].to_s + 'm'
end

if node[:bcpc][:hadoop][:kerberos][:enable] == true
Expand Down