public class ServiceManager
extends java.lang.Object
| Constructor and Description |
|---|
ServiceManager() |
ServiceManager(JournalSystem journalSystem,
IdGenerator idGenerator) |
| Modifier and Type | Method and Description |
|---|---|
java.lang.String |
bootstrapService(java.lang.String serviceTemplateName,
java.lang.String serviceName)
Bootstrap a service
|
void |
deregisterService(java.lang.String name)
Deregister a service template
|
void |
dump(java.io.DataOutputStream out) |
void |
dumpMeta(java.io.OutputStream out)
Dump ServiceManager info into checkpoint image
|
boolean |
existService(java.lang.String serviceId) |
FileStoreMgr |
getFileStoreMgr(java.lang.String serviceId) |
int |
getServiceCount() |
java.util.Set<java.lang.String> |
getServiceIdSet() |
ServiceInfo |
getServiceInfoById(java.lang.String serviceId)
Get a service info
|
ServiceInfo |
getServiceInfoByName(java.lang.String serviceName)
Get a service info
|
int |
getServiceTemplateCount() |
ShardManager |
getShardManager(java.lang.String serviceId) |
void |
loadMeta(java.io.InputStream in) |
java.util.concurrent.locks.Lock |
readLock() |
void |
registerService(java.lang.String name,
java.util.List<java.lang.String> serviceComponents)
Register a service template
|
void |
replayBootstrapService(Service service) |
void |
replayDeregisterService(java.lang.String name) |
void |
replayRegisterService(ServiceTemplate serviceTemplate) |
void |
replayShutdownService(Service service) |
void |
replayUpdateFileStore(java.lang.String serviceId,
FileStoreInfo fsInfo) |
void |
setShardScheduler(Scheduler shardScheduler) |
void |
shutdownService(java.lang.String serviceId)
Shutdown a service
|
void |
updateFileStore(java.lang.String serviceId,
FileStoreInfo fsInfo) |
java.util.concurrent.locks.Lock |
writeLock() |
public ServiceManager()
public ServiceManager(JournalSystem journalSystem, IdGenerator idGenerator)
public void registerService(java.lang.String name,
java.util.List<java.lang.String> serviceComponents)
throws StarException
name - service template nameserviceComponents - service component that describes this service templateStarException - if service template already existspublic void deregisterService(java.lang.String name)
throws StarException
name - service template nameStarException - if service template does not exist, or
this service template has running servicepublic java.lang.String bootstrapService(java.lang.String serviceTemplateName,
java.lang.String serviceName)
throws StarException
serviceTemplateName - service template nameserviceName - service nameStarException - if service template does not exist, or
this service is already bootstrapedpublic void shutdownService(java.lang.String serviceId)
throws StarException
serviceId - service idStarException - if service does not existpublic ServiceInfo getServiceInfoById(java.lang.String serviceId) throws StarException
serviceId - service idStarException - if service does not existpublic ServiceInfo getServiceInfoByName(java.lang.String serviceName) throws StarException
serviceName - service nameStarException - if service does not existpublic int getServiceTemplateCount()
public int getServiceCount()
public boolean existService(java.lang.String serviceId)
public java.util.concurrent.locks.Lock readLock()
public java.util.concurrent.locks.Lock writeLock()
public void setShardScheduler(Scheduler shardScheduler)
public ShardManager getShardManager(java.lang.String serviceId)
public void replayRegisterService(ServiceTemplate serviceTemplate)
public void replayDeregisterService(java.lang.String name)
public void replayBootstrapService(Service service)
public void replayShutdownService(Service service)
public void replayUpdateFileStore(java.lang.String serviceId,
FileStoreInfo fsInfo)
public void dumpMeta(java.io.OutputStream out)
throws java.io.IOException
out - Output Streamjava.io.IOException - I/O exception
+----------------------+ | SERVICE_MGR_HEADER | (number of service template, number of services) +----------------------+ | SERVICE_MGR_SVC_TMPLS| +--------------------- + | Templates | +----------------------+ | SERVICE_MGR_SVCS | +----------------------+ | Services | +----------------------+ | SERVICE_MGR_SHARD_MGR| +----------------------+ | SERVICE_ID_1 | | SHARDMANAGER_1 | | SERVICE_ID_2 | | SHARDMANAGER_2 | | ... | | SERVICE_ID_N | | SHARDMANAGER_N | +----------------------+
public void loadMeta(java.io.InputStream in)
throws java.io.IOException
java.io.IOExceptionpublic java.util.Set<java.lang.String> getServiceIdSet()
public void updateFileStore(java.lang.String serviceId,
FileStoreInfo fsInfo)
public void dump(java.io.DataOutputStream out)
throws java.io.IOException
java.io.IOExceptionpublic FileStoreMgr getFileStoreMgr(java.lang.String serviceId) throws StarException
StarExceptionCopyright © 2024. All rights reserved.