示例#1
0
  def load_binary_table(self, api, cluster_name):
    today = datetime.now().strftime('%Y%m%d')
    tomorrow = (datetime.now() + timedelta(days=1)).strftime('%Y%m%d')

    api.putRow(cluster_name, 'document_demo', today, {'doc:txt': 'Hue is awesome!'})
    api.putRow(cluster_name, 'document_demo', today, {'doc:json': '{"user": "******", "coolness": "extra"}'})
    api.putRow(cluster_name, 'document_demo', tomorrow, {'doc:version': '<xml>I like HBase</xml>'})
    api.putRow(cluster_name, 'document_demo', tomorrow, {'doc:version': '<xml>I LOVE HBase</xml>'})

    root = os.path.join(get_apps_root(), 'hbase', 'example', 'documents')

    api.putRow(cluster_name, 'document_demo', today, {'doc:img': open(root + '/hue-logo.png', "rb").read()})
    api.putRow(cluster_name, 'document_demo', today, {'doc:html': open(root + '/gethue.com.html', "rb").read()})
    api.putRow(cluster_name, 'document_demo', today, {'doc:pdf': open(root + '/gethue.pdf', "rb").read()})
示例#2
0
 def load_analytics_table(self, api, cluster_name):
     table_data = os.path.join(get_apps_root(), 'hbase', 'example',
                               'analytics', 'hbase-analytics.tsv')
     api.bulkUpload(cluster_name, 'analytics_demo', open(table_data))
示例#3
0
 def load_analytics_table(self, api, cluster_name):
   table_data = os.path.join(get_apps_root(), 'hbase', 'example', 'analytics', 'hbase-analytics.tsv')
   api.bulkUpload(cluster_name, 'analytics_demo', open(table_data))