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)
def go(self): dataset = Config().config['dataset'] column_family = ["unit"] print "creating table '%s'" % dataset ZohmgHBase.create_table(dataset, column_family) print 'ok.'