예제 #1
0
	def remove_AcmeDb(self, num_of_cust):
		"""
		Drop all AcmeAir databases
		"""
		acmeair = AcmeAirUtils()
		if acmeair.is_acmeair_running() != 0:
			acmeair.stop_acmeair()
			
		cloudantUtils = CloudantDbUtils(test_properties)
		cloudantUtils.drop_all_databases()		
예제 #2
0
    def remove_AcmeDb(self, num_of_cust):
        """
		Drop all AcmeAir databases
		"""
        acmeair = AcmeAirUtils()
        if acmeair.is_acmeair_running() != 0:
            acmeair.stop_acmeair()

        cloudantUtils = CloudantDbUtils(test_properties)
        cloudantUtils.drop_all_databases()
예제 #3
0
		finally:
			acmeair.stop_acmeair()
	
	
if  __name__ =='__main__':
	"""
	Utility to create test databases and load data
	"""
	import argparse
	parser = argparse.ArgumentParser(description="Utility to load AcmeAir data required for python spark-cloudant tests")
	group = parser.add_mutually_exclusive_group(required=True)
	group.add_argument('-cleanup', action='store_true', help='Drop all test databases')
	group.add_argument('-load', help='Reset and Load databases with the given # of users. -load 0 to just recreate databases and indexes.', type=int)
	args = parser.parse_args()

	dataloader = DataLoader()
	
	if args.load is not None:
		if args.load == 0:
			cloudantUtils = CloudantDbUtils(test_properties)
			cloudantUtils.reset_databases()
		else:			
			dataloader.load_AcmeData(args.load)
			dataloader.load_SpecCharValuePredicateData()
		
	elif args.cleanup:
		cloudantUtils = CloudantDbUtils(test_properties)
		cloudantUtils.drop_all_databases()

예제 #4
0
	"""
    import argparse
    parser = argparse.ArgumentParser(
        description=
        "Utility to load AcmeAir data required for python spark-cloudant tests"
    )
    group = parser.add_mutually_exclusive_group(required=True)
    group.add_argument('-cleanup',
                       action='store_true',
                       help='Drop all test databases')
    group.add_argument(
        '-load',
        help=
        'Reset and Load databases with the given # of users. -load 0 to just recreate databases and indexes.',
        type=int)
    args = parser.parse_args()

    dataloader = DataLoader()

    if args.load is not None:
        if args.load == 0:
            cloudantUtils = CloudantDbUtils(test_properties)
            cloudantUtils.reset_databases()
        else:
            dataloader.load_AcmeData(args.load)
            dataloader.load_SpecCharValuePredicateData()

    elif args.cleanup:
        cloudantUtils = CloudantDbUtils(test_properties)
        cloudantUtils.drop_all_databases()