Class DefaultGridServiceManager
- All Implemented Interfaces:
AdminAware,AgentGridComponent,DiscoverableComponent,DumpProvider,GridComponent,GridServiceManager,InternalGridServiceManager,InternalMachineAware,InternalOperatingSystemAware,InternalOperatingSystemInfoProvider,InternalAgentGridComponent,InternalDiscoverableComponent,InternalGridComponent,InternalTransportAware,InternalTransportInfoProvider,InternalVirtualMachineAware,InternalVirtualMachineInfoProvider,InternalZoneAware,LogProviderGridComponent,MachineAware,MetricProvider,OperatingSystemAware,TransportAware,VirtualMachineAware,ZoneAware
- Author:
- kimchy
-
Field Summary
Fields inherited from class org.openspaces.admin.internal.support.AbstractGridComponent
admin -
Constructor Summary
ConstructorsConstructorDescriptionDefaultGridServiceManager(ServiceID serviceID, com.gigaspaces.grid.gsm.GSM gsm, InternalAdmin admin, int agentId, String agentUid, JVMDetails jvmDetails) -
Method Summary
Modifier and TypeMethodDescriptionvoiddecrementInstance(ProcessingUnitInstance processingUnitInstance) booleandecrementPlannedInstances(ProcessingUnit processingUnit) Decrements a planned instance if the number of planned instances is less then the actual instances to maintain.booleandeleteResource(String resourceName) deleteUndeployedPuData(String puName) Delete data of a given undeployed tiered storage processing unitdeploy(ApplicationDeployment deployment) Deploys an application consisting of one or more processing unit deployments.deploy(ApplicationDeployment applicationDeployment, long timeout, TimeUnit timeUnit) Deploys an application consisting of one or more processing unit deployments.deploy(Application application, ProcessingUnitDeploymentTopology deploymentTopology, long timeout, TimeUnit timeUnit) deploy(ApplicationConfig applicationConfig) Deploys an application consisting of one or more processing unit deployments.deploy(ApplicationConfig applicationConfig, long timeout, TimeUnit timeUnit) Deploys an application consisting of one or more processing unit deployments.deploy(ProcessingUnitDeployment deployment) Deploys a processing unit based on the processing unit deployment information on the given grid service manager (it will act as the primary GSM for the deployed processing unit).deploy(ProcessingUnitDeployment deployment, long timeout, TimeUnit timeUnit) Deploys a processing unit based on the processing unit deployment information on the given grid service manager (it will act as the primary GSM for the deployed processing unit).deploy(ProcessingUnitConfigHolder puConfigHolder) Deploys a new processing unit based on the specified configurationdeploy(ProcessingUnitConfigHolder puConfigHolder, long timeout, TimeUnit timeUnit) Deploys a new processing unit based on the specified configurationdeploy(SpaceDeployment deployment) Deploys a space based on the space deployment information on the given grid service manager (it will act as the primary GSM for the deployed processing unit).deploy(SpaceDeployment deployment, long timeout, TimeUnit timeUnit) Deploys a space based on the space deployment information on the given grid service manager (it will act as the primary GSM for the deployed processing unit).voiddestroyInstance(ProcessingUnitInstance processingUnitInstance) voidvoidbooleangenerateDump(String cause, Map<String, Object> context) Generates dump for all the provided dump processors.Generates dump for the provided processors.longorg.jini.rio.monitor.event.EventsgetEvents(int maxEvents) com.gigaspaces.grid.gsm.GSMgetGSM()getUid()Returns the unique id of the grid component.inthashCode()voidincrementInstance(ProcessingUnit processingUnit) booleanbooleanisDeployed(String processingUnitName) Determine if this deployment is known to this GSM.String[]logEntries(LogEntryMatcher matcher) Returns the log entries matching the given matcher for the specific grid component.logEntriesDirect(LogEntryMatcher matcher) Same asLogProviderGridComponent.logEntries(com.gigaspaces.log.LogEntryMatcher), but does not try and get the logs from the agent.voidvoidrelocate(ProcessingUnitInstance processingUnitInstance, GridServiceContainer gridServiceContainer) voidrunGc()voidsetUndeployedInstanceIp(String puName, String instanceId, String ip, boolean validateHost) Set ip of an instance in an undeployed tiered storage processing unit.voidsetUndeployedLeader(String puName, int partitionId, String instanceId) Set leader of a partition in an undeployed tiered storage processing unit.static org.jini.rio.core.OperationalStringtoOperationalString(Properties props, Properties contextProperties) Invoked via reflection from GSCImplstatic org.jini.rio.core.OperationalStringtoOperationalString(Deploy deploy, ProcessingUnitConfig puConfig, String applicationName, String[] groups, LookupLocator[] locators, com.gigaspaces.grid.gsm.GSM gsm) static org.jini.rio.core.OperationalStringtoOperationalString(Deploy deploy, ProcessingUnitConfig puConfig, String applicationName, String[] groups, LookupLocator[] locators, com.gigaspaces.grid.gsm.GSM gsm, List<InstanceSLA> instanceSLAS) voidUndeploys the processing unit based on its name.Methods inherited from class org.openspaces.admin.internal.support.AbstractAgentGridComponent
getAgentId, getAgentUid, getGridServiceAgent, kill, restart, setGridServiceAgentMethods inherited from class org.openspaces.admin.internal.support.AbstractGridComponent
addZone, assertStateChangesPermitted, getAdmin, getJVMDetails, getMachine, getOperatingSystem, getTransport, getVirtualMachine, getZones, isDiscovered, setDiscovered, setMachine, setOperatingSystem, setTransport, setVirtualMachineMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.openspaces.admin.AdminAware
getAdminMethods inherited from interface org.openspaces.admin.AgentGridComponent
getAgentId, getGridServiceAgent, kill, restartMethods inherited from interface org.openspaces.admin.DiscoverableComponent
isDiscoveredMethods inherited from interface org.openspaces.admin.internal.support.InternalAgentGridComponent
getAgentUid, setGridServiceAgentMethods inherited from interface org.openspaces.admin.internal.support.InternalDiscoverableComponent
setDiscoveredMethods inherited from interface org.openspaces.admin.internal.machine.InternalMachineAware
setMachineMethods inherited from interface org.openspaces.admin.internal.os.InternalOperatingSystemAware
setOperatingSystemMethods inherited from interface org.openspaces.admin.internal.transport.InternalTransportAware
setTransportMethods inherited from interface org.openspaces.admin.internal.vm.InternalVirtualMachineAware
setVirtualMachineMethods inherited from interface org.openspaces.admin.internal.vm.InternalVirtualMachineInfoProvider
getJVMDetailsMethods inherited from interface org.openspaces.admin.internal.zone.InternalZoneAware
addZoneMethods inherited from interface org.openspaces.admin.machine.MachineAware
getMachineMethods inherited from interface org.openspaces.admin.os.OperatingSystemAware
getOperatingSystemMethods inherited from interface org.openspaces.admin.transport.TransportAware
getTransportMethods inherited from interface org.openspaces.admin.vm.VirtualMachineAware
getVirtualMachine
-
Constructor Details
-
DefaultGridServiceManager
public DefaultGridServiceManager(ServiceID serviceID, com.gigaspaces.grid.gsm.GSM gsm, InternalAdmin admin, int agentId, String agentUid, JVMDetails jvmDetails) throws RemoteException - Throws:
RemoteException
-
-
Method Details
-
getDriver
- Specified by:
getDriverin interfaceInternalGridServiceManager
-
getUid
Description copied from interface:GridComponentReturns the unique id of the grid component.- Specified by:
getUidin interfaceGridComponent- Specified by:
getUidin interfaceInternalVirtualMachineInfoProvider
-
getServiceID
- Specified by:
getServiceIDin interfaceInternalGridServiceManager
-
getGSM
public com.gigaspaces.grid.gsm.GSM getGSM()- Specified by:
getGSMin interfaceInternalGridServiceManager
-
deploy
Description copied from interface:GridServiceManagerDeploys a space based on the space deployment information on the given grid service manager (it will act as the primary GSM for the deployed processing unit).The deployment process will wait indefinitely and return the actual processing unit that can be used.
Note, deploying just a space is simply deploying a built in processing unit that starts just an embedded space.
- Specified by:
deployin interfaceGridServiceManager
-
deploy
Description copied from interface:GridServiceManagerDeploys a space based on the space deployment information on the given grid service manager (it will act as the primary GSM for the deployed processing unit).The deployment process will wait for the given timeout and return the actual processing unit that can be used.
Note, deploying just a space is simply deploying a built in processing unit that starts just an embedded space.
- Specified by:
deployin interfaceGridServiceManager
-
deploy
Description copied from interface:GridServiceManagerDeploys a processing unit based on the processing unit deployment information on the given grid service manager (it will act as the primary GSM for the deployed processing unit).The deployment process will wait indefinitely and return the actual processing unit that can be used.
- Specified by:
deployin interfaceGridServiceManager
-
deploy
Description copied from interface:GridServiceManagerDeploys a processing unit based on the processing unit deployment information on the given grid service manager (it will act as the primary GSM for the deployed processing unit).The deployment process will wait for the given timeout and return the actual processing unit that can be used.
- Specified by:
deployin interfaceGridServiceManager
-
deploy
Description copied from interface:GridServiceManagerDeploys a new processing unit based on the specified configuration- Specified by:
deployin interfaceGridServiceManager
-
deploy
public ProcessingUnit deploy(ProcessingUnitConfigHolder puConfigHolder, long timeout, TimeUnit timeUnit) Description copied from interface:GridServiceManagerDeploys a new processing unit based on the specified configurationThe deployment process will wait for the given timeout and return the actual processing unit that can be used.
- Specified by:
deployin interfaceGridServiceManager
-
toOperationalString
public static org.jini.rio.core.OperationalString toOperationalString(Properties props, Properties contextProperties) throws Exception Invoked via reflection from GSCImpl- Throws:
Exception
-
toOperationalString
public static org.jini.rio.core.OperationalString toOperationalString(Deploy deploy, ProcessingUnitConfig puConfig, String applicationName, String[] groups, LookupLocator[] locators, com.gigaspaces.grid.gsm.GSM gsm) throws Exception - Throws:
Exception
-
toOperationalString
public static org.jini.rio.core.OperationalString toOperationalString(Deploy deploy, ProcessingUnitConfig puConfig, String applicationName, String[] groups, LookupLocator[] locators, com.gigaspaces.grid.gsm.GSM gsm, List<InstanceSLA> instanceSLAS) throws Exception - Throws:
Exception
-
undeploy
Description copied from interface:GridServiceManagerUndeploys the processing unit based on its name.// wait for the lookup event of the processing unit by name. ProcessingUnit pu = admin.getProcessingUnits().waitFor("mypuname"); // wait for the lookup event of the grid service manager that manages the processing unit. pu.waitForManaged(); // undeploy the processing unit. pu.undeploy();- Specified by:
undeployin interfaceGridServiceManager
-
destroyInstance
- Specified by:
destroyInstancein interfaceInternalGridServiceManager
-
decrementPlannedInstances
Description copied from interface:InternalGridServiceManagerDecrements a planned instance if the number of planned instances is less then the actual instances to maintain.- Specified by:
decrementPlannedInstancesin interfaceInternalGridServiceManager- Returns:
trueif a planned instance was successfully decremented;falseplanned instances hasn't changed.
-
decrementInstance
- Specified by:
decrementInstancein interfaceInternalGridServiceManager
-
incrementInstance
- Specified by:
incrementInstancein interfaceInternalGridServiceManager
-
relocate
public void relocate(ProcessingUnitInstance processingUnitInstance, GridServiceContainer gridServiceContainer) - Specified by:
relocatein interfaceInternalGridServiceManager- Parameters:
processingUnitInstance- The processing unit instance to relocategridServiceContainer- The GSC to relocate to, ornullif the GSM should decide on a suitable GSC to relocate to.
-
logEntries
Description copied from interface:LogProviderGridComponentReturns the log entries matching the given matcher for the specific grid component. If it is managed by aGridServiceAgent, will get the log through it instead of creating a load on the actual grid component.- Specified by:
logEntriesin interfaceLogProviderGridComponent- Throws:
AdminException
-
logEntriesDirect
Description copied from interface:LogProviderGridComponentSame asLogProviderGridComponent.logEntries(com.gigaspaces.log.LogEntryMatcher), but does not try and get the logs from the agent.- Specified by:
logEntriesDirectin interfaceLogProviderGridComponent- Throws:
AdminException
-
reloadMetricConfiguration
- Specified by:
reloadMetricConfigurationin interfaceMetricProvider- Throws:
AdminException
-
generateDump
Description copied from interface:DumpProviderGenerates dump for all the provided dump processors. Note, this will include a heap dump which can consume time and potentially be of very large size- Specified by:
generateDumpin interfaceDumpProvider- Parameters:
cause- The cause that this dump was generatedcontext- Allows to provide specific parameters to specific processors- Throws:
AdminException
-
generateDump
public DumpResult generateDump(String cause, Map<String, Object> context, String... processors) throws AdminExceptionDescription copied from interface:DumpProviderGenerates dump for the provided processors. The current list of processors include:- summary: General summary information of the process.
- network: Information on the network layer of the process and the OS network stats.
- thread: Thread dump of the process.
- heap: Heap dump of the process. Note, this is a heavy operation and can produce very large dump files
- log: Adds all the log files of the process to the dump file.
- processingUnits: Dump of all the processing units (applicable only for GSCs) information.
- Specified by:
generateDumpin interfaceDumpProvider- Parameters:
cause- The cause this dump was generated.context- Allows to provide specific parameters to specific processors.processors- The list of processors to be used.- Throws:
AdminException
-
getNIODetails
- Specified by:
getNIODetailsin interfaceInternalTransportInfoProvider- Throws:
RemoteException
-
getNIOStatistics
- Specified by:
getNIOStatisticsin interfaceInternalTransportInfoProvider- Throws:
RemoteException
-
enableLRMIMonitoring
- Specified by:
enableLRMIMonitoringin interfaceInternalTransportInfoProvider- Throws:
RemoteException
-
disableLRMIMonitoring
- Specified by:
disableLRMIMonitoringin interfaceInternalTransportInfoProvider- Throws:
RemoteException
-
fetchLRMIMonitoringDetails
- Specified by:
fetchLRMIMonitoringDetailsin interfaceInternalTransportInfoProvider- Throws:
RemoteException
-
getCurrentTimeInMillis
- Specified by:
getCurrentTimeInMillisin interfaceInternalOperatingSystemInfoProvider- Throws:
RemoteException
-
getOSDetails
- Specified by:
getOSDetailsin interfaceInternalOperatingSystemInfoProvider- Throws:
RemoteException
-
getOSStatistics
- Specified by:
getOSStatisticsin interfaceInternalOperatingSystemInfoProvider- Throws:
RemoteException
-
getJVMStatistics
- Specified by:
getJVMStatisticsin interfaceInternalVirtualMachineInfoProvider- Throws:
RemoteException
-
runGc
- Specified by:
runGcin interfaceInternalVirtualMachineInfoProvider- Throws:
RemoteException
-
listDeployDir
- Specified by:
listDeployDirin interfaceInternalGridServiceManager
-
equals
-
hashCode
public int hashCode() -
isDeployed
Description copied from interface:GridServiceManagerDetermine if this deployment is known to this GSM.- Specified by:
isDeployedin interfaceGridServiceManager- Parameters:
processingUnitName- the name of the deployed processing unit.- Returns:
trueif this deployment is known;falseotherwise.
-
deploy
public Application deploy(ApplicationDeployment deployment) throws ApplicationAlreadyDeployedException, ProcessingUnitAlreadyDeployedException Description copied from interface:GridServiceManagerDeploys an application consisting of one or more processing unit deployments.The deployment process will wait indefinitely
- Specified by:
deployin interfaceGridServiceManager- Returns:
- An application containing the actual processing units that can be used.
- Throws:
ApplicationAlreadyDeployedException- - Application with the same name has already been deployed.ProcessingUnitAlreadyDeployedException- - Processing unit with the same name has already been deployed. Processing Unit names are globally unique (regardless of the application name)
-
deploy
public Application deploy(ApplicationConfig applicationConfig) throws ApplicationAlreadyDeployedException, ProcessingUnitAlreadyDeployedException Description copied from interface:GridServiceManagerDeploys an application consisting of one or more processing unit deployments.The deployment process will wait indefinitely
- Specified by:
deployin interfaceGridServiceManager- Returns:
- An application containing the actual processing units that can be used.
- Throws:
ApplicationAlreadyDeployedException- - Application with the same name has already been deployed.ProcessingUnitAlreadyDeployedException- - Processing unit with the same name has already been deployed. Processing Unit names are globally unique (regardless of the application name)
-
deploy
public Application deploy(ApplicationDeployment applicationDeployment, long timeout, TimeUnit timeUnit) throws ApplicationAlreadyDeployedException, ProcessingUnitAlreadyDeployedException Description copied from interface:GridServiceManagerDeploys an application consisting of one or more processing unit deployments.The deployment process will wait for the given timeout
- Specified by:
deployin interfaceGridServiceManager- Returns:
- An application containing the actual processing units that can be used or null if timeout expired.
- Throws:
ApplicationAlreadyDeployedException- - Application with the same name has already been deployed.ProcessingUnitAlreadyDeployedException- - Processing unit with the same name has already been deployed. Processing Unit names are globally unique (regardless of the application name)
-
deploy
public Application deploy(ApplicationConfig applicationConfig, long timeout, TimeUnit timeUnit) throws ApplicationAlreadyDeployedException, ProcessingUnitAlreadyDeployedException Description copied from interface:GridServiceManagerDeploys an application consisting of one or more processing unit deployments.The deployment process will wait for the given timeout
- Specified by:
deployin interfaceGridServiceManager- Returns:
- An application configuration containing the actual processing units that can be used or null if timeout expired.
- Throws:
ApplicationAlreadyDeployedException- - Application with the same name has already been deployed.ProcessingUnitAlreadyDeployedException- - Processing unit with the same name has already been deployed. Processing Unit names are globally unique (regardless of the application name)
-
isActiveManager
public boolean isActiveManager()- Specified by:
isActiveManagerin interfaceGridServiceManager- Returns:
trueif managing at least one deployment ;falseotherwise
-
deleteResource
- Specified by:
deleteResourcein interfaceGridServiceManager- Returns:
trueif successfully deleted the resource folder from the deploy folder ;falseotherwise
-
getUnDeployedPus
- Specified by:
getUnDeployedPusin interfaceGridServiceManager- Returns:
- List of persistent undeployed processing units
-
deleteUndeployedPuData
Description copied from interface:GridServiceManagerDelete data of a given undeployed tiered storage processing unit- Specified by:
deleteUndeployedPuDatain interfaceGridServiceManager- Returns:
- response of deletion status for each pu instance
-
setUndeployedLeader
Description copied from interface:GridServiceManagerSet leader of a partition in an undeployed tiered storage processing unit.- Specified by:
setUndeployedLeaderin interfaceGridServiceManager
-
setUndeployedInstanceIp
public void setUndeployedInstanceIp(String puName, String instanceId, String ip, boolean validateHost) Description copied from interface:GridServiceManagerSet ip of an instance in an undeployed tiered storage processing unit.- Specified by:
setUndeployedInstanceIpin interfaceGridServiceManager
-
deploy
public ProcessingUnit deploy(Application application, ProcessingUnitDeploymentTopology deploymentTopology, long timeout, TimeUnit timeUnit) - Specified by:
deployin interfaceInternalGridServiceManager
-
getCodeBaseURL
- Specified by:
getCodeBaseURLin interfaceInternalGridServiceManager
-
getEvents
public org.jini.rio.monitor.event.Events getEvents(int maxEvents) - Specified by:
getEventsin interfaceInternalGridServiceManager
-