public class ServiceRegistryInMemoryImpl extends Object implements ServiceRegistry
| Modifier and Type | Field and Description |
|---|---|
protected Job |
currentJob
Holds the current running job
|
static long |
DEFAULT_DISPATCHER_TIMEOUT
Default dispatcher timeout (1 second)
|
protected ScheduledExecutorService |
dispatcher
The thread pool to use for dispatching queued jobs.
|
protected Map<String,HostRegistrationInMemory> |
hosts
The hosts
|
protected AtomicLong |
idCounter
The job identifier
|
protected Incidents |
incidents |
protected static List<Job.Status> |
JOB_STATUSES_INFLUENCING_LOAD_BALANCING
A static list of statuses that influence how load balancing is calculated
|
protected Map<ServiceRegistrationInMemoryImpl,Set<Job>> |
jobHosts
A mapping of services to jobs
|
protected Map<Long,String> |
jobs
The serialized jobs
|
protected OrganizationDirectoryService |
organizationDirectoryService
The organization directory service
|
protected SecurityService |
securityService
An (optional) security service.
|
protected Map<String,List<ServiceRegistrationInMemoryImpl>> |
services
The service registrations
|
protected UserDirectoryService |
userDirectoryService
The user directory service
|
| Constructor and Description |
|---|
ServiceRegistryInMemoryImpl(JobProducer service,
float maxLoad,
SecurityService securityService,
UserDirectoryService userDirectoryService,
OrganizationDirectoryService organizationDirectoryService,
IncidentService incidentService) |
ServiceRegistryInMemoryImpl(JobProducer service,
SecurityService securityService,
UserDirectoryService userDirectoryService,
OrganizationDirectoryService organizationDirectoryService,
IncidentService incidentService) |
| Modifier and Type | Method and Description |
|---|---|
long |
count(String serviceType,
Job.Status status)
Count the number of jobs that match the specified parameters.
|
long |
count(String serviceType,
String host,
String operation,
Job.Status status)
Count the number of jobs executing the given operation in this
Job.Status on this host. |
long |
countByHost(String serviceType,
String host,
Job.Status status)
Count the number of jobs in this
Job.Status on this host |
long |
countByOperation(String serviceType,
String operation,
Job.Status status)
Count the number of jobs running the given operation in this
Job.Status. |
long |
countOfAbnormalServices()
Gets the count of the number of abnormal services across the whole system.
|
Job |
createJob(String type,
String operation)
Create and store a new job that will be dispatched as soon as possible.
|
Job |
createJob(String type,
String operation,
Float jobLoad)
Create and store a new job that will be dispatched as soon as possible.
|
Job |
createJob(String type,
String operation,
List<String> arguments)
Create and store a new job that will be dispatched as soon as possible.
|
Job |
createJob(String type,
String operation,
List<String> arguments,
Float jobLoad)
Create and store a new job that will be dispatched as soon as possible.
|
Job |
createJob(String type,
String operation,
List<String> arguments,
String payload)
Create and store a new job that will be dispatched as soon as possible.
|
Job |
createJob(String type,
String operation,
List<String> arguments,
String payload,
boolean queueable)
Create and store a new job.
|
Job |
createJob(String type,
String operation,
List<String> arguments,
String payload,
boolean queueable,
Float jobLoad)
Create and store a new job.
|
Job |
createJob(String type,
String operation,
List<String> arguments,
String payload,
boolean queueable,
Job parentJob)
Create and store a new job.
|
Job |
createJob(String type,
String operation,
List<String> arguments,
String payload,
boolean queueable,
Job parentJob,
Float jobLoad)
Create and store a new job.
|
Job |
createJob(String type,
String operation,
List<String> arguments,
String payload,
Float jobLoad)
Create and store a new job that will be dispatched as soon as possible.
|
void |
deactivate()
Shuts down this service registry, logging all jobs and their statuses.
|
void |
disableHost(String host)
Disables a Opencast server from service.
|
protected boolean |
dispatchJob(Job job)
Dispatches the job to the least loaded service or throws a
ServiceUnavailableException if there is no
such service. |
void |
dispose()
This method shuts down the service registry.
|
void |
enableHost(String host)
Enable an inactive host as a provider of Opencast services.
|
List<Job> |
getActiveJobs()
Get the list of active jobs.
|
List<Job> |
getChildJobs(long id)
Get all child jobs from a job
|
SystemLoad |
getCurrentHostLoads()
Gets a map of hosts to the number of jobs currently loading that host
|
Job |
getCurrentJob()
Gets the current running job
|
HostRegistration |
getHostRegistration(String hostname)
Finds host registration for the given hostname.
|
List<HostRegistration> |
getHostRegistrations()
Finds all host registrations, including offline hosts and those in maintenance mode.
|
Job |
getJob(long id)
Gets a receipt by its ID, or null if not found
|
int |
getJobCount(String operation)
Return the number of jobs for a specified operation type.
|
List<String> |
getJobPayloads(String operation)
Return the payload of all jobs for a specified operation type.
|
List<String> |
getJobPayloads(String operation,
int limit,
int offset)
Return the payload of a specified number of jobs for a specified operation type.
|
List<Job> |
getJobs(String serviceType,
Job.Status status)
Gets the list of jobs that match the specified parameters.
|
SystemLoad.NodeLoad |
getMaxLoadOnNode(String host)
Returns the maximum load that can be handled by a given node.
|
SystemLoad |
getMaxLoads()
Returns the maximum load that can be handled by the currently registered hosts.
|
float |
getOwnLoad()
Gets the load value for the current host (ie, the host this service registry lives on
|
String |
getRegistryHostname()
Returns the service regstry's hostname.
|
ServiceRegistration |
getServiceRegistration(String serviceType,
String host)
Finds a single service registration by host and type, even if the service is offline or in maintenance mode.
|
List<ServiceRegistration> |
getServiceRegistrations()
Finds all service registrations, including offline services and those in maintenance mode.
|
List<ServiceRegistration> |
getServiceRegistrationsByHost(String host)
Finds the service registrations on the given host, including offline services and those in maintenance mode.
|
List<ServiceRegistration> |
getServiceRegistrationsByLoad(String serviceType)
Finds the service registrations for this kind of job, ordered by load (lightest to heaviest).
|
List<ServiceRegistration> |
getServiceRegistrationsByType(String serviceType)
Finds the service registrations for this kind of job, including offline services and those in maintenance mode.
|
List<ServiceStatistics> |
getServiceStatistics()
Gets performance and runtime statistics for each known service registration.
|
Incidents |
incident()
Return a facility to record job incidents.
|
void |
registerHost(String host,
String address,
String nodeName,
long memory,
int cores,
float maxLoad)
Registers a host as a provider of Opencast services.
|
ServiceRegistration |
registerService(JobProducer localService)
Method to register locally running services.
|
ServiceRegistration |
registerService(JobProducer localService,
float maxLoad)
Method to register locally running services.
|
ServiceRegistration |
registerService(String serviceType,
String host,
String path)
Registers a host to handle a specific type of job
|
ServiceRegistration |
registerService(String serviceType,
String host,
String path,
boolean jobProducer)
Registers a host to handle a specific type of job
|
void |
removeJobs(List<Long> ids)
Deletes the given jobs from the service registry
|
void |
removeParentlessJobs(int lifetime)
Removes all jobs which do not have a parent job (except workflow instance jobs) and which have passed their
lifetime.
|
void |
sanitize(String serviceType,
String host)
Sets the given service to NORMAL state
|
void |
setCurrentJob(Job job)
Sets the current running job
|
void |
setMaintenanceStatus(String host,
boolean maintenance)
Sets a registered host's maintenance status
|
void |
setSecurityService(SecurityService securityService)
Sets the security service.
|
void |
unregisterHost(String host)
Removes an Opencast server from service.
|
void |
unregisterService(JobProducer localService)
Removes the job producer from the service registry.
|
void |
unRegisterService(String serviceType,
String host)
Unregisters a host from handling a specific type of job
|
Job |
updateJob(Job job)
Update the job in the database
|
public static final long DEFAULT_DISPATCHER_TIMEOUT
protected Map<String,HostRegistrationInMemory> hosts
protected Map<String,List<ServiceRegistrationInMemoryImpl>> services
protected Map<ServiceRegistrationInMemoryImpl,Set<Job>> jobHosts
protected ScheduledExecutorService dispatcher
protected AtomicLong idCounter
protected Job currentJob
protected SecurityService securityService
protected UserDirectoryService userDirectoryService
protected OrganizationDirectoryService organizationDirectoryService
protected Incidents incidents
protected static final List<Job.Status> JOB_STATUSES_INFLUENCING_LOAD_BALANCING
public ServiceRegistryInMemoryImpl(JobProducer service, float maxLoad, SecurityService securityService, UserDirectoryService userDirectoryService, OrganizationDirectoryService organizationDirectoryService, IncidentService incidentService) throws ServiceRegistryException
ServiceRegistryExceptionpublic ServiceRegistryInMemoryImpl(JobProducer service, SecurityService securityService, UserDirectoryService userDirectoryService, OrganizationDirectoryService organizationDirectoryService, IncidentService incidentService) throws ServiceRegistryException
ServiceRegistryExceptionpublic void dispose()
public void enableHost(String host) throws ServiceRegistryException, NotFoundException
enableHost in interface ServiceRegistryhost - The base URL for this serverServiceRegistryException - if communication with the service registry failsNotFoundException - if the host does not existServiceRegistry.enableHost(String)public void disableHost(String host) throws ServiceRegistryException, NotFoundException
disableHost in interface ServiceRegistryhost - The base URL for this serverServiceRegistryException - if communication with the service registry failsNotFoundException - if the host does not existServiceRegistry.disableHost(String)public void registerHost(String host, String address, String nodeName, long memory, int cores, float maxLoad) throws ServiceRegistryException
registerHost in interface ServiceRegistryhost - The base URL for this serveraddress - The IP address of this hostnodeName - Human readable description of this nodememory - The allocated memory of this hostcores - The available cores of this hostmaxLoad - the maximum load this host can supportServiceRegistryException - if communication with the service registry failsServiceRegistry.registerHost(String, String, String, long, int, float)public void unregisterHost(String host) throws ServiceRegistryException
unregisterHost in interface ServiceRegistryhost - The base URL for this serverServiceRegistryException - if communication with the service registry failsServiceRegistry.unregisterHost(java.lang.String)public ServiceRegistration registerService(JobProducer localService) throws ServiceRegistryException
localService - the service instanceServiceRegistryExceptionpublic ServiceRegistration registerService(JobProducer localService, float maxLoad) throws ServiceRegistryException
localService - the service instancemaxLoad - the maximum load the host can supportServiceRegistryExceptionpublic void unregisterService(JobProducer localService) throws ServiceRegistryException
localService - the serviceServiceRegistryException - if removing the service failspublic ServiceRegistration registerService(String serviceType, String host, String path) throws ServiceRegistryException
registerService in interface ServiceRegistryserviceType - The job typehost - The base URL where the service that can handle this service type can be foundpath - The path to the service endpointServiceRegistryException - if communication with the service registry failsServiceRegistry.registerService(java.lang.String, java.lang.String,
java.lang.String)public ServiceRegistration registerService(String serviceType, String host, String path, boolean jobProducer) throws ServiceRegistryException
registerService in interface ServiceRegistryserviceType - The service typehost - The base URL where the service that can handle this job type can be foundpath - The path to the service endpointjobProducer - Whether this service registration produces Jobs to track long running operationsServiceRegistryException - if communication with the service registry failsServiceRegistry.registerService(java.lang.String, java.lang.String,
java.lang.String, boolean)public void unRegisterService(String serviceType, String host) throws ServiceRegistryException
unRegisterService in interface ServiceRegistryserviceType - The service typehost - The base URL where the service that can handle this job type can be foundServiceRegistryException - if communication with the service registry failsServiceRegistry.unRegisterService(java.lang.String, java.lang.String)public void setMaintenanceStatus(String host, boolean maintenance) throws NotFoundException
setMaintenanceStatus in interface ServiceRegistryhost - The base URL where the service that can handle this service type can be foundmaintenance - the new maintenance status for this serviceNotFoundException - if the host does not existServiceRegistry.setMaintenanceStatus(java.lang.String, boolean)public Job createJob(String type, String operation) throws ServiceRegistryException
ServiceRegistry.createJob(String, String, List, String, boolean) with an empty argument list.
Note that this job will be linked to the current job as its parent. Use
ServiceRegistry.createJob(String, String, List, String, boolean, Job) and pass null as the job if you don't
need the link.
createJob in interface ServiceRegistrytype - the type of service responsible for this joboperation - the operation for this service to runServiceRegistryException - if there is a problem creating the jobServiceRegistry.createJob(java.lang.String, java.lang.String)public Job createJob(String type, String operation, Float jobLoad) throws ServiceRegistryException
ServiceRegistry.createJob(String, String, List, String, boolean) with an empty argument list.
Note that this job will be linked to the current job as its parent. Use
ServiceRegistry.createJob(String, String, List, String, boolean, Job) and pass null as the job if you don't
need the link.
createJob in interface ServiceRegistrytype - the type of service responsible for this joboperation - the operation for this service to runjobLoad - the load caused by this job, roughly equivalent to the number of cores used this jobServiceRegistryException - if there is a problem creating the jobServiceRegistry.createJob(java.lang.String, java.lang.String,
Float)public Job createJob(String type, String operation, List<String> arguments) throws ServiceRegistryException
ServiceRegistry.createJob(String, String, List, String, boolean).
Note that this job will be linked to the current job as its parent. Use
ServiceRegistry.createJob(String, String, List, String, boolean, Job) and pass null as the job if you don't
need the link.
createJob in interface ServiceRegistrytype - the type of service responsible for this joboperation - the operation for this service to runarguments - the arguments to the operationServiceRegistryException - if there is a problem creating the jobServiceRegistry.createJob(java.lang.String, java.lang.String,
java.util.List)public Job createJob(String type, String operation, List<String> arguments, Float jobLoad) throws ServiceRegistryException
ServiceRegistry.createJob(String, String, List, String, boolean).
Note that this job will be linked to the current job as its parent. Use
ServiceRegistry.createJob(String, String, List, String, boolean, Job) and pass null as the job if you don't
need the link.
createJob in interface ServiceRegistrytype - the type of service responsible for this joboperation - the operation for this service to runarguments - the arguments to the operationjobLoad - the load caused by this job, roughly equivalent to the number of cores used this jobServiceRegistryException - if there is a problem creating the jobServiceRegistry.createJob(java.lang.String, java.lang.String,
java.util.List, Float)public Job createJob(String type, String operation, List<String> arguments, String payload) throws ServiceRegistryException
ServiceRegistry.createJob(String, String, List, String, boolean). The job will carry the given payload from the beginning.
Note that this job will be linked to the current job as its parent. Use
ServiceRegistry.createJob(String, String, List, String, boolean, Job) and pass null as the job if you don't
need the link.
createJob in interface ServiceRegistrytype - the type of service responsible for this joboperation - the operation for this service to runarguments - the arguments to the operationpayload - an optional initial payloadServiceRegistryException - if there is a problem creating the jobServiceRegistry.createJob(java.lang.String, java.lang.String,
java.util.List, java.lang.String)public Job createJob(String type, String operation, List<String> arguments, String payload, Float jobLoad) throws ServiceRegistryException
ServiceRegistry.createJob(String, String, List, String, boolean). The job will carry the given payload from the beginning.
Note that this job will be linked to the current job as its parent. Use
ServiceRegistry.createJob(String, String, List, String, boolean, Job) and pass null as the job if you don't
need the link.
createJob in interface ServiceRegistrytype - the type of service responsible for this joboperation - the operation for this service to runarguments - the arguments to the operationpayload - an optional initial payloadjobLoad - the load caused by this job, roughly equivalent to the number of cores used this jobServiceRegistryException - if there is a problem creating the jobServiceRegistry.createJob(java.lang.String, java.lang.String,
java.util.List, java.lang.String, Float)public Job createJob(String type, String operation, List<String> arguments, String payload, boolean queueable) throws ServiceRegistryException
enqueueImmediately is true, the job will be in the
Job.Status.QUEUED state and will be dispatched as soon as possible. Otherwise, it will be
Job.Status.INSTANTIATED.
Note that this job will be linked to the current job as its parent. Use
ServiceRegistry.createJob(String, String, List, String, boolean, Job) and pass null as the job if you don't
need the link.
createJob in interface ServiceRegistrytype - the type of service responsible for this joboperation - the operation for this service to runarguments - the arguments to the operationpayload - an optional initial payloadqueueable - whether the job can be enqueued for dispatch. If false, the job's initial state will be
Job.Status.INSTANTIATED and will not be dispatched.ServiceRegistryException - if there is a problem creating the jobServiceRegistry.createJob(java.lang.String, java.lang.String,
java.util.List, java.lang.String, boolean)public Job createJob(String type, String operation, List<String> arguments, String payload, boolean queueable, Float jobLoad) throws ServiceRegistryException
enqueueImmediately is true, the job will be in the
Job.Status.QUEUED state and will be dispatched as soon as possible. Otherwise, it will be
Job.Status.INSTANTIATED.
Note that this job will be linked to the current job as its parent. Use
ServiceRegistry.createJob(String, String, List, String, boolean, Job) and pass null as the job if you don't
need the link.
createJob in interface ServiceRegistrytype - the type of service responsible for this joboperation - the operation for this service to runarguments - the arguments to the operationpayload - an optional initial payloadqueueable - whether the job can be enqueued for dispatch. If false, the job's initial state will be
Job.Status.INSTANTIATED and will not be dispatched.jobLoad - the load caused by this job, roughly equivalent to the number of cores used this jobServiceRegistryException - if there is a problem creating the jobServiceRegistry.createJob(java.lang.String, java.lang.String,
java.util.List, java.lang.String, boolean, Float)public Job createJob(String type, String operation, List<String> arguments, String payload, boolean queueable, Job parentJob) throws ServiceRegistryException
enqueueImmediately is true, the job will be in the
Job.Status.QUEUED state and will be dispatched as soon as possible. Otherwise, it will be
Job.Status.INSTANTIATED.createJob in interface ServiceRegistrytype - the type of service responsible for this joboperation - the operation for this service to runarguments - the arguments to the operationpayload - an optional initial payloadqueueable - whether the job can be enqueued for dispatch. If false, the job's initial state will be
Job.Status.INSTANTIATED and will not be dispatched.parentJob - the parent jobServiceRegistryException - if there is a problem creating the jobServiceRegistry.createJob(java.lang.String, java.lang.String,
java.util.List, java.lang.String, boolean, org.opencastproject.job.api.Job)public Job createJob(String type, String operation, List<String> arguments, String payload, boolean queueable, Job parentJob, Float jobLoad) throws ServiceRegistryException
enqueueImmediately is true, the job will be in the
Job.Status.QUEUED state and will be dispatched as soon as possible. Otherwise, it will be
Job.Status.INSTANTIATED.createJob in interface ServiceRegistrytype - the type of service responsible for this joboperation - the operation for this service to runarguments - the arguments to the operationpayload - an optional initial payloadqueueable - whether the job can be enqueued for dispatch. If false, the job's initial state will be
Job.Status.INSTANTIATED and will not be dispatched.parentJob - the parent jobjobLoad - the load caused by this job, roughly equivalent to the number of cores used this jobServiceRegistryException - if there is a problem creating the jobServiceRegistry.createJob(java.lang.String, java.lang.String,
java.util.List, java.lang.String, boolean, org.opencastproject.job.api.Job, Float)public void removeJobs(List<Long> ids) throws NotFoundException, ServiceRegistryException
ServiceRegistryremoveJobs in interface ServiceRegistryids - the job idsNotFoundExceptionServiceRegistryExceptionprotected boolean dispatchJob(Job job) throws ServiceUnavailableException, ServiceRegistryException, UndispatchableJobException
ServiceUnavailableException if there is no
such service.job - the job to dispatchServiceUnavailableException - if no service is available to dispatch the jobServiceRegistryException - if the service registrations are unavailable or dispatching of the job failsUndispatchableJobExceptionpublic Job updateJob(Job job) throws NotFoundException, ServiceRegistryException
updateJob in interface ServiceRegistryNotFoundException - if the job does not existServiceRegistryException - if there is a problem updating the jobServiceRegistry.updateJob(org.opencastproject.job.api.Job)public Job getJob(long id) throws NotFoundException, ServiceRegistryException
getJob in interface ServiceRegistryid - the job idNotFoundExceptionServiceRegistryExceptionServiceRegistry.getJob(long)public List<Job> getChildJobs(long id) throws ServiceRegistryException
getChildJobs in interface ServiceRegistryid - the parent job idServiceRegistryException - if there is a problem accessing the service registryServiceRegistry.getChildJobs(long)public List<Job> getJobs(String serviceType, Job.Status status) throws ServiceRegistryException
getJobs in interface ServiceRegistryserviceType - The jobs run by this type of service. If null, jobs from all hosts will be returned.status - The status of the jobs. If null, jobs in all status will be returned.ServiceRegistryException - if there is a problem accessing the service registryServiceRegistry.getJobs(java.lang.String,
org.opencastproject.job.api.Job.Status)public List<String> getJobPayloads(String operation) throws ServiceRegistryException
ServiceRegistrygetJobPayloads in interface ServiceRegistryoperation - Operation type to get payload forServiceRegistryException - if there is a problem accessing the service registrypublic List<String> getJobPayloads(String operation, int limit, int offset) throws ServiceRegistryException
ServiceRegistrygetJobPayloads in interface ServiceRegistryoperation - Operation type to get payload forlimit - How many results to returnoffset - Offset for the set of returned resultsServiceRegistryException - if there is a problem accessing the service registrypublic int getJobCount(String operation) throws ServiceRegistryException
ServiceRegistrygetJobCount in interface ServiceRegistryoperation - Operation type to check forServiceRegistryExceptionpublic List<Job> getActiveJobs() throws ServiceRegistryException
getActiveJobs in interface ServiceRegistryServiceRegistryException - if there is a problem accessing the service registryServiceRegistry.getActiveJobs()public Incidents incident()
ServiceRegistryincident in interface ServiceRegistryIncidentpublic List<ServiceRegistration> getServiceRegistrationsByLoad(String serviceType) throws ServiceRegistryException
getServiceRegistrationsByLoad in interface ServiceRegistryserviceType - The type of service that must be handled by the hostsServiceRegistryException - if there is a problem accessing the service registryServiceRegistry.getServiceRegistrationsByLoad(java.lang.String)public List<ServiceRegistration> getServiceRegistrationsByType(String serviceType) throws ServiceRegistryException
getServiceRegistrationsByType in interface ServiceRegistryserviceType - The type of service that must be handled by the hostsServiceRegistryException - if there is a problem accessing the service registryServiceRegistry.getServiceRegistrationsByType(java.lang.String)public List<ServiceRegistration> getServiceRegistrationsByHost(String host) throws ServiceRegistryException
getServiceRegistrationsByHost in interface ServiceRegistryhost - The hostServiceRegistryException - if there is a problem accessing the service registryServiceRegistry.getServiceRegistrationsByHost(java.lang.String)public ServiceRegistration getServiceRegistration(String serviceType, String host) throws ServiceRegistryException
getServiceRegistration in interface ServiceRegistryserviceType - The type of servicehost - the base URL of the hostServiceRegistryException - if there is a problem accessing the service registryServiceRegistry.getServiceRegistration(java.lang.String,
java.lang.String)public List<ServiceRegistration> getServiceRegistrations() throws ServiceRegistryException
getServiceRegistrations in interface ServiceRegistryServiceRegistryException - if there is a problem accessing the service registryServiceRegistry.getServiceRegistrations()public List<ServiceStatistics> getServiceStatistics() throws ServiceRegistryException
getServiceStatistics in interface ServiceRegistryServiceRegistryException - if there is a problem accessing the service registryServiceRegistry.getServiceStatistics()public long countOfAbnormalServices()
throws ServiceRegistryException
countOfAbnormalServices in interface ServiceRegistryServiceRegistryExceptionServiceRegistry.countOfAbnormalServices()public long count(String serviceType, Job.Status status) throws ServiceRegistryException
count in interface ServiceRegistryserviceType - The jobs run by this type of service. If null, the returned count will refer to all types of jobs.status - The status of the receipts. If null, the returned count will refer to jobs in any status.ServiceRegistryException - if there is a problem accessing the service registryServiceRegistry.count(java.lang.String,
org.opencastproject.job.api.Job.Status)public long countByOperation(String serviceType, String operation, Job.Status status) throws ServiceRegistryException
Job.Status.countByOperation in interface ServiceRegistryserviceType - The jobs run by this type of serviceoperation - the operationstatus - The status of the jobsServiceRegistryException - if there is a problem accessing the service registryServiceRegistry.countByOperation(java.lang.String, java.lang.String,
org.opencastproject.job.api.Job.Status)public long countByHost(String serviceType, String host, Job.Status status) throws ServiceRegistryException
Job.Status on this hostcountByHost in interface ServiceRegistryserviceType - The jobs run by this type of servicehost - The server that created and will be handling the jobstatus - The status of the jobsServiceRegistryException - if there is a problem accessing the service registryServiceRegistry.countByHost(java.lang.String, java.lang.String,
org.opencastproject.job.api.Job.Status)public long count(String serviceType, String host, String operation, Job.Status status) throws ServiceRegistryException
Job.Status on this host.count in interface ServiceRegistryserviceType - The jobs run by this type of servicehost - The server that created and will be handling the joboperation - the operationstatus - The status of the jobsServiceRegistryException - if there is a problem accessing the service registryServiceRegistry.count(java.lang.String, java.lang.String,
java.lang.String, org.opencastproject.job.api.Job.Status)public void deactivate()
public SystemLoad getMaxLoads() throws ServiceRegistryException
getMaxLoads in interface ServiceRegistryServiceRegistryException - if communication with the service registry failsServiceRegistry.getMaxLoads()public SystemLoad.NodeLoad getMaxLoadOnNode(String host) throws ServiceRegistryException
getMaxLoadOnNode in interface ServiceRegistryhost - The base URL for this serverServiceRegistryException - if communication with the service registry failsServiceRegistry.getMaxLoadOnNode(java.lang.String)public void setSecurityService(SecurityService securityService)
securityService - the securityService to setpublic void sanitize(String serviceType, String host)
ServiceRegistrysanitize in interface ServiceRegistryserviceType - the service typehost - the hostpublic Job getCurrentJob()
ServiceRegistrygetCurrentJob in interface ServiceRegistrypublic void setCurrentJob(Job job)
ServiceRegistrysetCurrentJob in interface ServiceRegistryjob - the current jobpublic List<HostRegistration> getHostRegistrations() throws ServiceRegistryException
ServiceRegistrygetHostRegistrations in interface ServiceRegistryServiceRegistryException - if there is a problem accessing the service registrypublic HostRegistration getHostRegistration(String hostname) throws ServiceRegistryException
ServiceRegistrygetHostRegistration in interface ServiceRegistryhostname - to lookupServiceRegistryException - if there is a problem accessing the service registry or the hostname is not foundpublic SystemLoad getCurrentHostLoads()
ServiceRegistrygetCurrentHostLoads in interface ServiceRegistrypublic void removeParentlessJobs(int lifetime)
throws ServiceRegistryException
ServiceRegistryremoveParentlessJobs in interface ServiceRegistrylifetime - lifetime in daysServiceRegistryException - if removing the jobs failspublic float getOwnLoad()
ServiceRegistrygetOwnLoad in interface ServiceRegistrypublic String getRegistryHostname()
ServiceRegistrygetRegistryHostname in interface ServiceRegistryCopyright © 2009–2020 Opencast Project. All rights reserved.