예제 #1
0
파일: reset.py 프로젝트: charles-cai/zohmg
    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.'