This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Two approaches to getting the list of nodes automatically. | |
# Some stuff re: roles from serverspec-example repository | |
... | |
def hdfsnodes() | |
# Requires special access to HDFS reporting tool... | |
clusterreport,nodesreport = `sudo su hdfs -c 'hdfs dfsadmin -report'`.split("\n\n-------------------------------------------------\n") | |
nodesreplist=nodesreport.strip.split("\n") | |
nodenamelist = nodesreplist.grep(/Name/) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'spec_helper' | |
require 'nokogiri' # For XML parsing of config files | |
describe "Processor count" do | |
# I hate calling out directly from Ruby like this | |
# but the function: "command('nproc')" was returning strings I couldn't cast | |
describe `nproc`.to_i do | |
it { should >= 12 } | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'spec_helper' | |
require 'nokogiri' | |
describe file('/etc/hadoop/conf/hdfs-site.xml') do | |
it {should be_file} | |
it {should contain /dfs.datanode.max.transfer.threads/} | |
it do | |
doc = Nokogiri::XML(File.read("/etc/hadoop/conf/hdfs-site.xml")) | |
val=doc.xpath("//property[name='dfs.datanode.max.transfer.threads']/value").text.to_i | |
expect(val).to be >= 4096 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'spec_helper' | |
describe "Node Memory Availability" do | |
describe host_inventory['memory']['total'].delete('kB').to_i do | |
it { should > 0 } | |
end | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT (?nrEdges/(?nrNodes *(?nrNodes - 1.0)) AS ?graphDensity) | |
FROM <graphName> | |
WHERE { | |
{ SELECT (COUNT (*) AS ?nrEdges) (COUNT (DISTINCT ?person) AS ?nrNodes) | |
WHERE { ?person <knows> ?anotherPerson . } | |
} | |
} |