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

Commit fbe2a73

Browse files
committed
[Feedback] - Adjust logic a bit
- Makes it more readable and simpler.
1 parent 78899f6 commit fbe2a73

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

cookbooks/bcpc-hadoop/recipes/hbase_config.rb

+6-2
Original file line numberDiff line numberDiff line change
@@ -134,8 +134,12 @@
134134
# If HBASE bucket cache is enabled the properties from this section will be included in hbase-site.xml
135135
#
136136
bucketcache_size = (node['bcpc']['hadoop']['hbase_rs']['mx_dir_mem']['size'] - node['bcpc']['hadoop']['hbase_rs']['hdfs_dir_mem']['size']).floor
137-
if node['bcpc']['hadoop']['hbase']['bucketcache']['enabled'] == true &&
138-
node['bcpc']['hadoop']['rs_hosts'].map { |rs| rs.values[0] }.include?(node['fqdn'])
137+
bucketcache_enabled = node['bcpc']['hadoop']['hbase']['bucketcache']['enabled']
138+
is_region_server = node['bcpc']['hadoop']['rs_hosts'].any? do |rs|
139+
rs.values[0] == node['fqdn']
140+
end
141+
142+
if bucketcache_enabled && is_region_server
139143
generated_values['hbase.regionserver.global.memstore.upperLimit'] = node['bcpc']['hadoop']['hbase_rs']['memstore']['upperlimit'].to_s
140144
generated_values['hfile.block.cache.size'] = node['bcpc']['hadoop']['hbase']['blockcache']['size'].to_s
141145
generated_values['hbase.bucketcache.size'] = bucketcache_size

0 commit comments

Comments
 (0)