hbase hadoop code for showing data code not working on a database
Budget: $10 – $30 USD
#Your code goes here
import 'org.apache.hadoop.hbase.client.HTable'
import 'org.apache.hadoop.hbase.client.Put'
def jbytes(*args)
args.map { |arg| arg.to_s.to_java_bytes }
end
def put_many(table_name, row, column_values)
table = HTable.new(@hbase.configuration, table_name)
p = Put.new(*jbytes(row))
column_values.each do |column, value|
family, qualifier = column.split(':')
p.add(jbytes(family, qualifier), jbytes(value))
end
table.put(p)
end
# Call put_many function with sample data
put_many 'wiki', 'DevOps', {
"text:" => "What DevOps IaC do you use?",
"revision:author" => "Frayad Gebrehana",
"revision:comment" => "Terraform"
}
# Get data from the 'wiki' table
get 'wiki', 'DevOps'
#Do not remove the exit call below
exit
import 'org.apache.hadoop.hbase.client.HTable'
import 'org.apache.hadoop.hbase.client.Put'
def jbytes(*args)
args.map { |arg| arg.to_s.to_java_bytes }
end
def put_many(table_name, row, column_values)
table = HTable.new(@hbase.configuration, table_name)
p = Put.new(*jbytes(row))
column_values.each do |column, value|
family, qualifier = column.split(':')
p.add(jbytes(family, qualifier), jbytes(value))
end
table.put(p)
end
# Call put_many function with sample data
put_many 'wiki', 'DevOps', {
"text:" => "What DevOps IaC do you use?",
"revision:author" => "Frayad Gebrehana",
"revision:comment" => "Terraform"
}
# Get data from the 'wiki' table
get 'wiki', 'DevOps'
#Do not remove the exit call below
exit