12 Star 22 Fork 7

科学大数据开源社区/事例数据库-EventDB

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
create_table 1.01 KB
一键复制 编辑 原始数据 按行查看 历史
Ashin 提交于 6年前 . init
#!/usr/bin/python
# -*- coding: UTF-8 -*-
import ConfigParser
from optparse import OptionParser
import sys
import os
import ROOT
import struct
import happybase
from datetime import datetime,timedelta
#加载配置信息
config = ConfigParser.ConfigParser()
config.readfp(open('./config.ini','r'))
#hbase信息
hbase_host = config.get('DB','host')
hbase_port = int(config.get('DB', 'port'))
table_prefix = config.get('DB','table_prefix')
table_prefix_separator = config.get('DB','table_prefix_separator')
hbase_timeout = int(config.get('DB','timeout'))
#hdfs信息
hdfs_host = config.get('HDFS','host')
hdfs_port = int(config.get('HDFS','port'))
hdfs_user = config.get('HDFS', 'user')
eventdb_dir = config.get('HDFS','eventdb_dir')
new_table = sys.argv[1]
conn = happybase.Connection(host = hbase_host, port = hbase_port, table_prefix = table_prefix, table_prefix_separator = table_prefix_separator)
conn.create_table(new_table, {'data': dict(max_versions = 1)})
print "Connect to HBase. table '%s' has been created."%(new_table)
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Java
1
https://gitee.com/opensci/eventdb.git
git@gitee.com:opensci/eventdb.git
opensci
eventdb
事例数据库-EventDB
master

搜索帮助