示例#1
0
    def please(self):
        host = 'localhost'
        table = Config().dataset()

        # confirm.
        print "reset will *wipe all data* in dataset '%s'." % table
        print "ARE YOU QUITE SURE? ('yes' to confirm.)"

        try:
            response = sys.stdin.readline().strip()
            if response.lower() not in ["yes", "yes!"]:
                print 'phew!'
                sys.exit(0)
        except KeyboardInterrupt:
            print 'hyorgh!'
            sys.exit(0)

        # disable+drop.
        try:
            print "ok, wiping!"
            ZohmgHBase.delete_table(table)
            # recreate.
            print
            print "recreating."
            Setup().go()
        except Exception, e:
            print 'reset failed :-('
            print 'error: ' + str(e)
            sys.exit(1)
示例#2
0
文件: setup.py 项目: avtobiff/zohmg
    def go(self):
        dataset = Config().config['dataset']
        column_family = ["unit"]

        print "creating table '%s'" % dataset
        ZohmgHBase.create_table(dataset, column_family)
        print 'ok.'
示例#3
0
    def go(self):
        dataset = Config().config['dataset']
        column_family = ["unit"]

        print "creating table '%s'" % dataset
        ZohmgHBase.create_table(dataset, column_family)
        print 'ok.'