public class MockProvisionerTenantStore extends Object
Modifier and Type | Method and Description |
---|---|
void |
deleteTenant(String tenantId)
Delete a tenant from the store.
|
Set<String> |
getAssignedTenants()
Get all tenants that have been assigned workers.
|
int |
getAssignedWorkers(String tenantId)
Get the number of workers assigned to the given tenant.
|
static MockProvisionerTenantStore |
getInstance()
Get the instance of the store.
|
Set<String> |
getLiveTenants()
Get all tenants that have live running workers.
|
int |
getLiveWorkers(String tenantId)
Get the number of live workers running for the given tenant.
|
Map<String,Integer> |
getUsage()
Get a mapping of tenant to number of live running workers.
|
void |
setAssignedWorkers(String tenantId,
int numWorkers)
Set the number of assigned workers for a given tenant.
|
void |
setLiveTenantWorkers(String tenantId,
int numWorkers)
Set the number of live workers running for a given tenant.
|
public static MockProvisionerTenantStore getInstance()
public int getAssignedWorkers(String tenantId)
tenantId
- Id of the tenant to get the number of workers forpublic int getLiveWorkers(String tenantId)
tenantId
- Id of the tenant to get the number of live workers forpublic Set<String> getAssignedTenants()
public Set<String> getLiveTenants()
public void setAssignedWorkers(String tenantId, int numWorkers)
tenantId
- Id of the tenant to assign workers tonumWorkers
- Number of workers the tenant should havepublic void deleteTenant(String tenantId)
tenantId
- Id of the tenant to deletepublic void setLiveTenantWorkers(String tenantId, int numWorkers)
tenantId
- Id of the tenant to set the number of live workers fornumWorkers
- Number of live workers running for the tenantCopyright © 2013-2016 Cask Data, Inc. Licensed under the Apache License, Version 2.0.