def get_failed_downloads(start_date, end_date): """Get the failed downloads between start_date and end_date.""" gw = SystemGateway() downloads = [] for shard_id in get_shard_ids(): downloads.extend(list(gw.get_failed_downloads( shard_id, start_date, end_date))) return downloads
def get_failed_downloads(start_date, end_date): """Get the failed downloads between start_date and end_date.""" gw = SystemGateway() downloads = [] for shard_id in get_shard_ids(): downloads.extend( list(gw.get_failed_downloads(shard_id, start_date, end_date))) return downloads
def get_shard_resources(): """Get testresources for shard databases""" resources = [] for shard in get_shard_ids(): r = DatabaseResource(dbname=shard, schema_modules=[shard_schema, txlog_schema], store_name=shard, tx_manager=storage_tm) resources.append((shard, r)) return resources
def get_shard_resources(): """Get testresources for shard databases""" resources = [] for shard in get_shard_ids(): r = DatabaseResource( dbname=shard, schema_modules=[shard_schema, txlog_schema], store_name=shard, tx_manager=storage_tm) resources.append((shard, r)) return resources
def test_stores(self): """Make sure we get the stores work""" #run through all the shards and try to talk to them for k in dbm.get_shard_ids(): s = dbm.get_shard_store(k) s.execute('SELECT 1') #make sure get_shard_store is working as designed s1 = dbm.get_shard_store('shard0') s2 = dbm.get_shard_store('shard0') #even though they are different, they are the same self.assertTrue(s1 is s2) s3 = dbm.get_shard_store('shard1') self.assertFalse(s1 is s3)
def delete_all_data(): """Delete all data from the database.""" # they must be reversed to avoid dependency issues fsync_main().delete(get_admin_store('storage')) for shard_id in get_shard_ids(): fsync_shard().delete(get_admin_store(shard_id))