public interface ProvisionerStore
extends com.google.common.util.concurrent.Service
Modifier and Type | Method and Description |
---|---|
void |
deleteProvisioner(String id)
Delete the provisioner with the given id.
|
Collection<Provisioner> |
getAllProvisioners()
Get all provisioners in the system.
|
int |
getFreeCapacity()
Get the total amount of free capacity available across all provisioners.
|
int |
getNumAssignedWorkers(String tenantID)
Get the number of workers assigned to the given tenant across all provisioners.
|
Provisioner |
getProvisioner(String id)
Get the provisioner for the given id.
|
Collection<Provisioner> |
getProvisionersWithFreeCapacity()
Get all provisioners that have free capacity above zero.
|
Collection<Provisioner> |
getTenantProvisioners(String tenantId)
Get all provisioners that are assigned workers for the given tenant.
|
Collection<Provisioner> |
getTimedOutProvisioners(long idleTimestamp)
Get all provisioners that have not sent a heartbeat since the given timestamp in milliseconds.
|
void |
setHeartbeat(String provisionerId,
long ts)
Set the last heartbeat time of the given provisioner to the given timestamp in milliseconds.
|
void |
writeProvisioner(Provisioner provisioner)
Write the given provisioner.
|
Collection<Provisioner> getAllProvisioners() throws IOException
IOException
Collection<Provisioner> getProvisionersWithFreeCapacity() throws IOException
IOException
Collection<Provisioner> getTimedOutProvisioners(long idleTimestamp) throws IOException
idleTimestamp
- Timestamp to use as a cutoff. Provisioners that have not sent a heartbeat since this timestamp
are returnedIOException
Collection<Provisioner> getTenantProvisioners(String tenantId) throws IOException
tenantId
- Id of the tenant to get provisioners forIOException
Provisioner getProvisioner(String id) throws IOException
id
- Id of the provisioner to getIOException
void writeProvisioner(Provisioner provisioner) throws IOException
provisioner
- Provisioner to writeIOException
void deleteProvisioner(String id) throws IOException
id
- Id of the provisioner to deleteIOException
void setHeartbeat(String provisionerId, long ts) throws IOException
provisionerId
- Id of the provisioner whose heartbeat time should be setts
- Timestamp in milliseconds to set the heartbeat time toIOException
int getFreeCapacity() throws IOException
IOException
int getNumAssignedWorkers(String tenantID) throws IOException
tenantID
- Id of the tenant to get the number of assigned workers forIOException
Copyright © 2013-2016 Cask Data, Inc. Licensed under the Apache License, Version 2.0.