Class ServiceRegistryInMemoryImpl
java.lang.Object
org.opencastproject.serviceregistry.api.ServiceRegistryInMemoryImpl
- All Implemented Interfaces:
ServiceRegistry
Simple and in-memory implementation of a the service registry intended for testing scenarios.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected JobHolds the current running jobstatic final longDefault dispatcher timeout (1 second)protected ScheduledExecutorServiceThe thread pool to use for dispatching queued jobs.protected Map<String, HostRegistrationInMemory> The hostsprotected AtomicLongThe job identifierprotected Incidentsprotected static final List<Job.Status> A static list of statuses that influence how load balancing is calculatedprotected Map<ServiceRegistrationInMemoryImpl, Set<Job>> A mapping of services to jobsThe serialized jobsprotected OrganizationDirectoryServiceThe organization directory serviceprotected SecurityServiceAn (optional) security service.protected Map<String, List<ServiceRegistrationInMemoryImpl>> The service registrationsprotected UserDirectoryServiceThe user directory service -
Constructor Summary
ConstructorsConstructorDescriptionServiceRegistryInMemoryImpl(JobProducer service, float maxLoad, SecurityService securityService, UserDirectoryService userDirectoryService, OrganizationDirectoryService organizationDirectoryService, IncidentService incidentService) ServiceRegistryInMemoryImpl(JobProducer service, SecurityService securityService, UserDirectoryService userDirectoryService, OrganizationDirectoryService organizationDirectoryService, IncidentService incidentService) -
Method Summary
Modifier and TypeMethodDescriptionlongcount(String serviceType, String host, String operation, Job.Status status) Count the number of jobs executing the given operation in thisJob.Statuson this host.longcount(String serviceType, Job.Status status) Count the number of jobs that match the specified parameters.Count active jobs and group them by organization and host.countActiveTypeByOrganization(String operation) Count active jobs of a given operation type and group them by organization.longcountByHost(String serviceType, String host, Job.Status status) Count the number of jobs in thisJob.Statuson this hostlongcountByOperation(String serviceType, String operation, Job.Status status) Count the number of jobs running the given operation in thisJob.Status.Create and store a new job that will be dispatched as soon as possible.Create and store a new job that will be dispatched as soon as possible.Create and store a new job that will be dispatched as soon as possible.Create and store a new job.createJob(String type, String operation, List<String> arguments, String payload, boolean queueable, Float jobLoad) Create and store a new job.createJob(String type, String operation, List<String> arguments, String payload, boolean queueable, Job parentJob, Float jobLoad) Create and store a new job.voidShuts down this service registry, logging all jobs and their statuses.voiddisableHost(String host) Disables a Opencast server from service.protected booleandispatchJob(Job job) Dispatches the job to the least loaded service or throws aServiceUnavailableExceptionif there is no such service.voiddispose()This method shuts down the service registry.voidenableHost(String host) Enable an inactive host as a provider of Opencast services.Get the list of active jobs.getChildJobs(long id) Get all child jobs from a jobGets a map of hosts to the number of jobs currently loading that hostGets the current running jobgetHostRegistration(String hostname) Finds host registration for the given hostname.Finds all host registrations, including offline hosts and those in maintenance mode.Get statistics about jobs active on hosts.getJob(long id) Gets a receipt by its ID, or null if not foundintgetJobCount(String operation) Return the number of jobs for a specified operation type.getJobPayloads(String operation) Return the payload of all jobs for a specified operation type.getJobPayloads(String operation, int limit, int offset) Return the payload of a specified number of jobs for a specified operation type.getJobs(String serviceType, Job.Status status) Gets the list of jobs that match the specified parameters.getMaxLoadOnNode(String host) Returns the maximum load that can be handled by a given node.Returns the maximum load that can be handled by the currently registered hosts.floatGets the load value for the current host (ie, the host this service registry lives onReturns the service regstry's hostname.getServiceRegistration(String serviceType, String host) Finds a single service registration by host and type, even if the service is offline or in maintenance mode.Finds all service registrations, including offline services and those in maintenance mode.Finds the service registrations on the given host, including offline services and those in maintenance mode.getServiceRegistrationsByLoad(String serviceType) Finds the service registrations for this kind of job, ordered by load (lightest to heaviest).getServiceRegistrationsByType(String serviceType) Finds the service registrations for this kind of job, including offline services and those in maintenance mode.Gets performance and runtime statistics for each known service registration.incident()Return a facility to record job incidents.voidregisterHost(String host, String address, String nodeName, long memory, int cores, float maxLoad) Registers a host as a provider of Opencast services.registerService(String serviceType, String host, String path) Registers a host to handle a specific type of jobregisterService(String serviceType, String host, String path, boolean jobProducer) Registers a host to handle a specific type of jobregisterService(JobProducer localService) Method to register locally running services.registerService(JobProducer localService, float maxLoad) Method to register locally running services.voidremoveJobs(List<Long> ids) Deletes the given jobs from the service registryvoidremoveParentlessJobs(int lifetime) Removes all jobs which do not have a parent job (except workflow instance jobs) and which have passed their lifetime.voidSets the given service to NORMAL statevoidsetCurrentJob(Job job) Sets the current running jobvoidsetMaintenanceStatus(String host, boolean maintenance) Sets a registered host's maintenance statusvoidsetSecurityService(SecurityService securityService) Sets the security service.voidunregisterHost(String host) Removes an Opencast server from service.voidunregisterService(JobProducer localService) Removes the job producer from the service registry.voidunRegisterService(String serviceType, String host) Unregisters a host from handling a specific type of jobUpdate the job in the database
-
Field Details
-
DEFAULT_DISPATCHER_TIMEOUT
public static final long DEFAULT_DISPATCHER_TIMEOUTDefault dispatcher timeout (1 second)- See Also:
-
hosts
The hosts -
services
The service registrations -
jobs
The serialized jobs -
jobHosts
A mapping of services to jobs -
dispatcher
The thread pool to use for dispatching queued jobs. -
idCounter
The job identifier -
currentJob
Holds the current running job -
securityService
An (optional) security service. If set to a non-null value, this will be used to obtain the current user when creating new jobs. -
userDirectoryService
The user directory service -
organizationDirectoryService
The organization directory service -
incidents
-
JOB_STATUSES_INFLUENCING_LOAD_BALANCING
A static list of statuses that influence how load balancing is calculated
-
-
Constructor Details
-
ServiceRegistryInMemoryImpl
public ServiceRegistryInMemoryImpl(JobProducer service, float maxLoad, SecurityService securityService, UserDirectoryService userDirectoryService, OrganizationDirectoryService organizationDirectoryService, IncidentService incidentService) throws ServiceRegistryException - Throws:
ServiceRegistryException
-
ServiceRegistryInMemoryImpl
public ServiceRegistryInMemoryImpl(JobProducer service, SecurityService securityService, UserDirectoryService userDirectoryService, OrganizationDirectoryService organizationDirectoryService, IncidentService incidentService) throws ServiceRegistryException - Throws:
ServiceRegistryException
-
-
Method Details
-
dispose
public void dispose()This method shuts down the service registry. -
enableHost
Enable an inactive host as a provider of Opencast services.- Specified by:
enableHostin interfaceServiceRegistry- Parameters:
host- The base URL for this server- Throws:
ServiceRegistryException- if communication with the service registry failsNotFoundException- if the host does not exist- See Also:
-
disableHost
Disables a Opencast server from service.- Specified by:
disableHostin interfaceServiceRegistry- Parameters:
host- The base URL for this server- Throws:
ServiceRegistryException- if communication with the service registry failsNotFoundException- if the host does not exist- See Also:
-
registerHost
public void registerHost(String host, String address, String nodeName, long memory, int cores, float maxLoad) throws ServiceRegistryException Registers a host as a provider of Opencast services.- Specified by:
registerHostin interfaceServiceRegistry- Parameters:
host- 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 support- Throws:
ServiceRegistryException- if communication with the service registry fails- See Also:
-
unregisterHost
Removes an Opencast server from service.- Specified by:
unregisterHostin interfaceServiceRegistry- Parameters:
host- The base URL for this server- Throws:
ServiceRegistryException- if communication with the service registry fails- See Also:
-
registerService
public ServiceRegistration registerService(JobProducer localService) throws ServiceRegistryException Method to register locally running services.- Parameters:
localService- the service instance- Returns:
- the service registration
- Throws:
ServiceRegistryException
-
registerService
public ServiceRegistration registerService(JobProducer localService, float maxLoad) throws ServiceRegistryException Method to register locally running services.- Parameters:
localService- the service instancemaxLoad- the maximum load the host can support- Returns:
- the service registration
- Throws:
ServiceRegistryException
-
unregisterService
Removes the job producer from the service registry.- Parameters:
localService- the service- Throws:
ServiceRegistryException- if removing the service fails
-
registerService
public ServiceRegistration registerService(String serviceType, String host, String path) throws ServiceRegistryException Registers a host to handle a specific type of job- Specified by:
registerServicein interfaceServiceRegistry- Parameters:
serviceType- The job typehost- The base URL where the service that can handle this service type can be foundpath- The path to the service endpoint- Returns:
- the service registration
- Throws:
ServiceRegistryException- if communication with the service registry fails- See Also:
-
registerService
public ServiceRegistration registerService(String serviceType, String host, String path, boolean jobProducer) throws ServiceRegistryException Registers a host to handle a specific type of job- Specified by:
registerServicein interfaceServiceRegistry- Parameters:
serviceType- 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 producesJobs to track long running operations- Returns:
- the service registration
- Throws:
ServiceRegistryException- if communication with the service registry fails- See Also:
-
unRegisterService
Unregisters a host from handling a specific type of job- Specified by:
unRegisterServicein interfaceServiceRegistry- Parameters:
serviceType- The service typehost- The base URL where the service that can handle this job type can be found- Throws:
ServiceRegistryException- if communication with the service registry fails- See Also:
-
setMaintenanceStatus
Sets a registered host's maintenance status- Specified by:
setMaintenanceStatusin interfaceServiceRegistry- Parameters:
host- The base URL where the service that can handle this service type can be foundmaintenance- the new maintenance status for this service- Throws:
NotFoundException- if the host does not exist- See Also:
-
createJob
Create and store a new job that will be dispatched as soon as possible. This is equivalent to callingServiceRegistry.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.
- Specified by:
createJobin interfaceServiceRegistry- Parameters:
type- the type of service responsible for this joboperation- the operation for this service to run- Returns:
- the job
- Throws:
ServiceRegistryException- if there is a problem creating the job- See Also:
-
createJob
public Job createJob(String type, String operation, List<String> arguments) throws ServiceRegistryException Create and store a new job that will be dispatched as soon as possible. This is equivalent to callingServiceRegistry.createJob(String, String, List, String, boolean).Note that this job will be linked to the current job as its parent.
- Specified by:
createJobin interfaceServiceRegistry- Parameters:
type- the type of service responsible for this joboperation- the operation for this service to runarguments- the arguments to the operation- Returns:
- the job
- Throws:
ServiceRegistryException- if there is a problem creating the job- See Also:
-
createJob
public Job createJob(String type, String operation, List<String> arguments, Float jobLoad) throws ServiceRegistryException Create and store a new job that will be dispatched as soon as possible. This is equivalent to callingServiceRegistry.createJob(String, String, List, String, boolean).Note that this job will be linked to the current job as its parent.
- Specified by:
createJobin interfaceServiceRegistry- Parameters:
type- 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 job- Returns:
- the job
- Throws:
ServiceRegistryException- if there is a problem creating the job- See Also:
-
createJob
public Job createJob(String type, String operation, List<String> arguments, String payload) throws ServiceRegistryException - Throws:
ServiceRegistryException
-
createJob
public Job createJob(String type, String operation, List<String> arguments, String payload, boolean queueable) throws ServiceRegistryException Create and store a new job. IfenqueueImmediatelyis true, the job will be in theJob.Status.QUEUEDstate and will be dispatched as soon as possible. Otherwise, it will beJob.Status.INSTANTIATED.Note that this job will be linked to the current job as its parent.
- Specified by:
createJobin interfaceServiceRegistry- Parameters:
type- 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 beJob.Status.INSTANTIATEDand will not be dispatched.- Returns:
- the job
- Throws:
ServiceRegistryException- if there is a problem creating the job- See Also:
-
createJob
public Job createJob(String type, String operation, List<String> arguments, String payload, boolean queueable, Float jobLoad) throws ServiceRegistryException Create and store a new job. IfenqueueImmediatelyis true, the job will be in theJob.Status.QUEUEDstate and will be dispatched as soon as possible. Otherwise, it will beJob.Status.INSTANTIATED.Note that this job will be linked to the current job as its parent.
- Specified by:
createJobin interfaceServiceRegistry- Parameters:
type- 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 beJob.Status.INSTANTIATEDand will not be dispatched.jobLoad- the load caused by this job, roughly equivalent to the number of cores used this job- Returns:
- the job
- Throws:
ServiceRegistryException- if there is a problem creating the job- See Also:
-
createJob
public Job createJob(String type, String operation, List<String> arguments, String payload, boolean queueable, Job parentJob, Float jobLoad) throws ServiceRegistryException Create and store a new job. IfenqueueImmediatelyis true, the job will be in theJob.Status.QUEUEDstate and will be dispatched as soon as possible. Otherwise, it will beJob.Status.INSTANTIATED.- Specified by:
createJobin interfaceServiceRegistry- Parameters:
type- 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 beJob.Status.INSTANTIATEDand will not be dispatched.parentJob- the parent jobjobLoad- the load caused by this job, roughly equivalent to the number of cores used this job- Returns:
- the job
- Throws:
ServiceRegistryException- if there is a problem creating the job- See Also:
-
removeJobs
Description copied from interface:ServiceRegistryDeletes the given jobs from the service registry- Specified by:
removeJobsin interfaceServiceRegistry- Parameters:
ids- the job ids- Throws:
NotFoundExceptionServiceRegistryException
-
dispatchJob
protected boolean dispatchJob(Job job) throws ServiceUnavailableException, ServiceRegistryException, UndispatchableJobException Dispatches the job to the least loaded service or throws aServiceUnavailableExceptionif there is no such service.- Parameters:
job- the job to dispatch- Returns:
- whether the job was dispatched
- Throws:
ServiceUnavailableException- if no service is available to dispatch the jobServiceRegistryException- if the service registrations are unavailable or dispatching of the job failsUndispatchableJobException
-
updateJob
Update the job in the database- Specified by:
updateJobin interfaceServiceRegistry- Parameters:
job-- Returns:
- the updated job
- Throws:
NotFoundException- if the job does not existServiceRegistryException- if there is a problem updating the job- See Also:
-
getJob
Gets a receipt by its ID, or null if not found- Specified by:
getJobin interfaceServiceRegistry- Parameters:
id- the job id- Returns:
- the job or null
- Throws:
NotFoundExceptionServiceRegistryException- See Also:
-
getChildJobs
Get all child jobs from a job- Specified by:
getChildJobsin interfaceServiceRegistry- Parameters:
id- the parent job id- Returns:
- a list of the child jobs ordered by execution
- Throws:
ServiceRegistryException- if there is a problem accessing the service registry- See Also:
-
getJobs
Gets the list of jobs that match the specified parameters.- Specified by:
getJobsin interfaceServiceRegistry- Parameters:
serviceType- 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.- Returns:
- the jobs matching these criteria
- Throws:
ServiceRegistryException- if there is a problem accessing the service registry- See Also:
-
getJobPayloads
Description copied from interface:ServiceRegistryReturn the payload of all jobs for a specified operation type.- Specified by:
getJobPayloadsin interfaceServiceRegistry- Parameters:
operation- Operation type to get payload for- Returns:
- Serialized workflows
- Throws:
ServiceRegistryException- if there is a problem accessing the service registry
-
getJobPayloads
public List<String> getJobPayloads(String operation, int limit, int offset) throws ServiceRegistryException Description copied from interface:ServiceRegistryReturn the payload of a specified number of jobs for a specified operation type.- Specified by:
getJobPayloadsin interfaceServiceRegistry- Parameters:
operation- Operation type to get payload forlimit- How many results to returnoffset- Offset for the set of returned results- Returns:
- Serialized workflows
- Throws:
ServiceRegistryException- if there is a problem accessing the service registry
-
getJobCount
Description copied from interface:ServiceRegistryReturn the number of jobs for a specified operation type.- Specified by:
getJobCountin interfaceServiceRegistry- Parameters:
operation- Operation type to check for- Returns:
- Number of jobs for the specified operation type.
- Throws:
ServiceRegistryException
-
getActiveJobs
Get the list of active jobs.- Specified by:
getActiveJobsin interfaceServiceRegistry- Returns:
- list of active jobs
- Throws:
ServiceRegistryException- if there is a problem accessing the service registry- See Also:
-
incident
Description copied from interface:ServiceRegistryReturn a facility to record job incidents.- Specified by:
incidentin interfaceServiceRegistry- See Also:
-
getServiceRegistrationsByLoad
public List<ServiceRegistration> getServiceRegistrationsByLoad(String serviceType) throws ServiceRegistryException Finds the service registrations for this kind of job, ordered by load (lightest to heaviest).- Specified by:
getServiceRegistrationsByLoadin interfaceServiceRegistry- Parameters:
serviceType- The type of service that must be handled by the hosts- Returns:
- A list of hosts that handle this job type, in order of their running and queued job load
- Throws:
ServiceRegistryException- if there is a problem accessing the service registry- See Also:
-
getServiceRegistrationsByType
public List<ServiceRegistration> getServiceRegistrationsByType(String serviceType) throws ServiceRegistryException Finds the service registrations for this kind of job, including offline services and those in maintenance mode.- Specified by:
getServiceRegistrationsByTypein interfaceServiceRegistry- Parameters:
serviceType- The type of service that must be handled by the hosts- Returns:
- A list of hosts that handle this job type
- Throws:
ServiceRegistryException- if there is a problem accessing the service registry- See Also:
-
getServiceRegistrationsByHost
public List<ServiceRegistration> getServiceRegistrationsByHost(String host) throws ServiceRegistryException Finds the service registrations on the given host, including offline services and those in maintenance mode.- Specified by:
getServiceRegistrationsByHostin interfaceServiceRegistry- Parameters:
host- The host- Returns:
- A list of service registrations on a single host
- Throws:
ServiceRegistryException- if there is a problem accessing the service registry- See Also:
-
getServiceRegistration
public ServiceRegistration getServiceRegistration(String serviceType, String host) throws ServiceRegistryException Finds a single service registration by host and type, even if the service is offline or in maintenance mode.- Specified by:
getServiceRegistrationin interfaceServiceRegistry- Parameters:
serviceType- The type of servicehost- the base URL of the host- Returns:
- The service registration, or null
- Throws:
ServiceRegistryException- if there is a problem accessing the service registry- See Also:
-
getServiceRegistrations
Finds all service registrations, including offline services and those in maintenance mode.- Specified by:
getServiceRegistrationsin interfaceServiceRegistry- Returns:
- A list of service registrations
- Throws:
ServiceRegistryException- if there is a problem accessing the service registry- See Also:
-
getServiceStatistics
Gets performance and runtime statistics for each known service registration.- Specified by:
getServiceStatisticsin interfaceServiceRegistry- Returns:
- the service statistics
- Throws:
ServiceRegistryException- if there is a problem accessing the service registry- See Also:
-
count
Count the number of jobs that match the specified parameters.- Specified by:
countin interfaceServiceRegistry- Parameters:
serviceType- 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.- Returns:
- the number of jobs
- Throws:
ServiceRegistryException- if there is a problem accessing the service registry- See Also:
-
countByOperation
public long countByOperation(String serviceType, String operation, Job.Status status) throws ServiceRegistryException Count the number of jobs running the given operation in thisJob.Status.- Specified by:
countByOperationin interfaceServiceRegistry- Parameters:
serviceType- The jobs run by this type of serviceoperation- the operationstatus- The status of the jobs- Returns:
- the number of jobs
- Throws:
ServiceRegistryException- if there is a problem accessing the service registry- See Also:
-
countByHost
public long countByHost(String serviceType, String host, Job.Status status) throws ServiceRegistryException Count the number of jobs in thisJob.Statuson this host- Specified by:
countByHostin interfaceServiceRegistry- Parameters:
serviceType- The jobs run by this type of servicehost- The server that created and will be handling the jobstatus- The status of the jobs- Returns:
- the number of jobs
- Throws:
ServiceRegistryException- if there is a problem accessing the service registry- See Also:
-
count
public long count(String serviceType, String host, String operation, Job.Status status) throws ServiceRegistryException Count the number of jobs executing the given operation in thisJob.Statuson this host.- Specified by:
countin interfaceServiceRegistry- Parameters:
serviceType- The jobs run by this type of servicehost- The server that created and will be handling the joboperation- the operationstatus- The status of the jobs- Returns:
- the number of jobs
- Throws:
ServiceRegistryException- if there is a problem accessing the service registry- See Also:
-
deactivate
public void deactivate()Shuts down this service registry, logging all jobs and their statuses. -
getMaxLoads
Returns the maximum load that can be handled by the currently registered hosts. Note that this load is *not* 1-to-1 equivalent with number of jobs. A job may take up more than one load.- Specified by:
getMaxLoadsin interfaceServiceRegistry- Returns:
- the total load that can be processed concurrently
- Throws:
ServiceRegistryException- if communication with the service registry fails- See Also:
-
getMaxLoadOnNode
Returns the maximum load that can be handled by a given node. Note that this load is *not* 1-to-1 equivalent with number of jobs. A job may take up more than one load.- Specified by:
getMaxLoadOnNodein interfaceServiceRegistry- Parameters:
host- The base URL for this server- Returns:
- the total load that can be processed concurrently on that node
- Throws:
ServiceRegistryException- if communication with the service registry fails- See Also:
-
setSecurityService
Sets the security service.- Parameters:
securityService- the securityService to set
-
sanitize
Description copied from interface:ServiceRegistrySets the given service to NORMAL state- Specified by:
sanitizein interfaceServiceRegistry- Parameters:
serviceType- the service typehost- the host
-
getCurrentJob
Description copied from interface:ServiceRegistryGets the current running job- Specified by:
getCurrentJobin interfaceServiceRegistry- Returns:
- the current job
-
setCurrentJob
Description copied from interface:ServiceRegistrySets the current running job- Specified by:
setCurrentJobin interfaceServiceRegistry- Parameters:
job- the current job
-
getHostRegistrations
Description copied from interface:ServiceRegistryFinds all host registrations, including offline hosts and those in maintenance mode.- Specified by:
getHostRegistrationsin interfaceServiceRegistry- Returns:
- A list of host registrations
- Throws:
ServiceRegistryException- if there is a problem accessing the service registry
-
getHostStatistics
Description copied from interface:ServiceRegistryGet statistics about jobs active on hosts.- Specified by:
getHostStatisticsin interfaceServiceRegistry- Returns:
- Host statistics
-
getHostRegistration
Description copied from interface:ServiceRegistryFinds host registration for the given hostname.- Specified by:
getHostRegistrationin interfaceServiceRegistry- Parameters:
hostname- to lookup- Returns:
- host registrations
- Throws:
ServiceRegistryException- if there is a problem accessing the service registry or the hostname is not found
-
getCurrentHostLoads
Description copied from interface:ServiceRegistryGets a map of hosts to the number of jobs currently loading that host- Specified by:
getCurrentHostLoadsin interfaceServiceRegistry- Returns:
- the map of hosts to job counts
-
removeParentlessJobs
Description copied from interface:ServiceRegistryRemoves all jobs which do not have a parent job (except workflow instance jobs) and which have passed their lifetime.- Specified by:
removeParentlessJobsin interfaceServiceRegistry- Parameters:
lifetime- lifetime in days- Throws:
ServiceRegistryException- if removing the jobs fails
-
countActiveByOrganizationAndHost
Description copied from interface:ServiceRegistryCount active jobs and group them by organization and host.- Specified by:
countActiveByOrganizationAndHostin interfaceServiceRegistry- Returns:
- Map of organizations, hosts and the number of jobs.
-
countActiveTypeByOrganization
Description copied from interface:ServiceRegistryCount active jobs of a given operation type and group them by organization.- Specified by:
countActiveTypeByOrganizationin interfaceServiceRegistry- Returns:
- Map of organizations and the number of jobs.
-
getOwnLoad
public float getOwnLoad()Description copied from interface:ServiceRegistryGets the load value for the current host (ie, the host this service registry lives on- Specified by:
getOwnLoadin interfaceServiceRegistry- Returns:
- the load value for this host
-
getRegistryHostname
Description copied from interface:ServiceRegistryReturns the service regstry's hostname. This can be used to fetch the list of services on the local host.- Specified by:
getRegistryHostnamein interfaceServiceRegistry- Returns:
- The hostname that the service registry is running on.
-