Exemple #1
0
                    help='Incremental database update using rsync checksum')
parser.add_argument('--drop',
                    action='store_true',
                    help='Drop database on Target server before copy')
parser.add_argument('--sleep',
                    metavar='s',
                    type=int,
                    nargs='?',
                    default=30,
                    help='Time to wait between polling for results')

args = parser.parse_args()
logging.debug(args)

logging.info("Connecting to hive")
hive = HiveInstance(args.hive_uri[0])

input = {"source_db_uri": args.source_db_uri[0]}
if args.target_db_uri != None:
    input['target_db_uri'] = args.target_db_uri[0]
if args.only_tables != None:
    input['only_tables'] = args.only_tables[0]
if args.skip_tables != None:
    input['skip_tables'] = args.skip_tables[0]
if args.update != None:
    input['update'] = args.update
if args.drop != None:
    input['drop'] = args.drop

logging.info("Submitting job with arguments " + str(input))
job = hive.create_job('copy_database', input)
                    metavar='g',
                    type=str,
                    nargs='+',
                    help='Test group(s) to run')
parser.add_argument('--sleep',
                    metavar='s',
                    type=int,
                    nargs='?',
                    default=30,
                    help='Time to wait between polling for results')

args = parser.parse_args()
logging.debug(args)

logging.info("Connecting to hive")
hive = HiveInstance(args.hive_uri[0])

input = {"db_uri": args.db_uri[0]}
if args.test != None:
    input['hc_names'] = args.test
if args.group != None:
    input['hc_groups'] = args.group

logging.info("Submitting job with arguments " + str(input))
job = hive.create_job('run_standalone_healthcheck', input)

logging.info("Job submitted with ID " + str(job.job_id))

output = None
while True:
    logging.info("Sleeping for %ds" % args.sleep)