Class DefaultGridServiceAgent
java.lang.Object
org.openspaces.admin.internal.support.AbstractGridComponent
org.openspaces.admin.internal.gsa.DefaultGridServiceAgent
- All Implemented Interfaces:
AdminAware,DiscoverableComponent,DumpProvider,GridComponent,GridServiceAgent,InternalGridServiceAgent,InternalMachineAware,InternalOperatingSystemAware,InternalOperatingSystemInfoProvider,InternalDiscoverableComponent,InternalGridComponent,InternalTransportAware,InternalTransportInfoProvider,InternalVirtualMachineAware,InternalVirtualMachineInfoProvider,InternalZoneAware,LogProviderGridComponent,MachineAware,MetricProvider,OperatingSystemAware,TransportAware,VirtualMachineAware,ZoneAware
public class DefaultGridServiceAgent
extends AbstractGridComponent
implements InternalGridServiceAgent
- Author:
- kimchy
-
Field Summary
Fields inherited from class org.openspaces.admin.internal.support.AbstractGridComponent
admin -
Constructor Summary
ConstructorsConstructorDescriptionDefaultGridServiceAgent(ServiceID serviceID, com.gigaspaces.grid.gsa.GSA gsa, InternalAdmin admin, com.gigaspaces.grid.gsa.AgentProcessesDetails processesDetails, JVMDetails jvmDetails) -
Method Summary
Modifier and TypeMethodDescriptionvoidaddAgentGridComponent(InternalAgentGridComponent agentGridComponent) Invoked to mark a child grid component as added to lookup serviceallLogEntries(LogProcessType type, LogEntryMatcher matcher) Extracts all the log entries for the provided process type including both "live" runtime components and ones that are no longer running.voiddeleteTieredStorageSpaceData(String spaceName) Deletes persistent data of a given tiered storage spacevoidvoidgenerateDump(String cause, Map<String, Object> context) Generates dump for all the provided dump processors.Generates dump for the provided processors.longcom.gigaspaces.grid.gsa.GSAgetGSA()com.gigaspaces.grid.gsa.AgentProcessesDetailsReturns all the processes details this agent is currently running.getUid()Returns the unique id of the grid component.intintvoidkill(InternalAgentGridComponent agentGridComponent) voidkillByAgentId(int agentId) Kills a process based on the agent id provided to it.liveLogEntries(LogEntryMatcher matcher) Extracts all the log entries of all the "live" runtime components that this agent is running matching the given matcher.logEntries(LogEntryMatcher matcher) Returns the log entries matching the given matcher for the specific grid component.logEntries(LogProcessType type, long pid, LogEntryMatcher matcher) Extract the log entries matching the provided matcher for the process type and process id.logEntriesDirect(LogEntryMatcher matcher) Same asLogProviderGridComponent.logEntries(com.gigaspaces.log.LogEntryMatcher), but does not try and get the logs from the agent.voidvoidremoveAgentGridComponent(InternalAgentGridComponent agentGridComponent) Invoked to mark a child grid component as removed from lookup servicevoidrestart(InternalAgentGridComponent agentGridComponent) voidrunGc()voidsetProcessesDetails(com.gigaspaces.grid.gsa.AgentProcessesDetails processesDetails) voidshutdown()Shuts down the GSA.voidStarts aGridServiceContainerbased on the provided options.voidStarts aGridServiceManagerbased on the provided options.intstartGridService(GridServiceOptions options) Starts a generic process of a given type.voidstartGridService(LookupServiceOptions options) Starts aLookupServicebased on the provided options.Starts aGridServiceContainerbased on the provided options and waits indefinitely until it is discovered by the admin, which is then returned.startGridServiceAndWait(GridServiceContainerOptions options, long timeout, TimeUnit timeUnit) Starts aGridServiceContainerbased on the provided options and waits for the given timeout (in time unit) until it is discovered by the admin, which is then returned.Starts aGridServiceManagerbased on the provided options and waits indefinitely until it is discovered by the admin, which is then returned.startGridServiceAndWait(GridServiceManagerOptions options, long timeout, TimeUnit timeUnit) Starts aGridServiceManagerbased on the provided options and waits for the given timeout (in time unit) until it is discovered by the admin, which is then returned.Starts aLookupServicebased on the provided options and waits indefinitely until it is discovered by the admin, which is then returned.startGridServiceAndWait(LookupServiceOptions options, long timeout, TimeUnit timeUnit) Starts aLookupServicebased on the provided options and waits for the given timeout (in time unit) until it is discovered by the admin, which is then returned.Methods 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, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.openspaces.admin.AdminAware
getAdminMethods inherited from interface org.openspaces.admin.DiscoverableComponent
isDiscoveredMethods 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
-
DefaultGridServiceAgent
public DefaultGridServiceAgent(ServiceID serviceID, com.gigaspaces.grid.gsa.GSA gsa, InternalAdmin admin, com.gigaspaces.grid.gsa.AgentProcessesDetails processesDetails, JVMDetails jvmDetails)
-
-
Method Details
-
getUid
Description copied from interface:GridComponentReturns the unique id of the grid component.- Specified by:
getUidin interfaceGridComponent- Specified by:
getUidin interfaceInternalVirtualMachineInfoProvider
-
getProcessesDetails
public com.gigaspaces.grid.gsa.AgentProcessesDetails getProcessesDetails()Description copied from interface:GridServiceAgentReturns all the processes details this agent is currently running.- Specified by:
getProcessesDetailsin interfaceGridServiceAgent
-
setProcessesDetails
public void setProcessesDetails(com.gigaspaces.grid.gsa.AgentProcessesDetails processesDetails) - Specified by:
setProcessesDetailsin interfaceInternalGridServiceAgent
-
getServiceID
- Specified by:
getServiceIDin interfaceInternalGridServiceAgent
-
getGSA
public com.gigaspaces.grid.gsa.GSA getGSA()- Specified by:
getGSAin interfaceInternalGridServiceAgent
-
startGridService
Description copied from interface:GridServiceAgentStarts a generic process of a given type.- Specified by:
startGridServicein interfaceGridServiceAgent
-
killByAgentId
public void killByAgentId(int agentId) Description copied from interface:GridServiceAgentKills a process based on the agent id provided to it.- Specified by:
killByAgentIdin interfaceGridServiceAgent
-
startGridService
Description copied from interface:GridServiceAgentStarts aGridServiceManagerbased on the provided options.- Specified by:
startGridServicein interfaceGridServiceAgent
-
logEntries
Description copied from interface:GridServiceAgentExtract the log entries matching the provided matcher for the process type and process id.- Specified by:
logEntriesin interfaceGridServiceAgent
-
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... processor) 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.processor- The list of processors to be used.- Throws:
AdminException
-
liveLogEntries
Description copied from interface:GridServiceAgentExtracts all the log entries of all the "live" runtime components that this agent is running matching the given matcher.- Specified by:
liveLogEntriesin interfaceGridServiceAgent
-
allLogEntries
Description copied from interface:GridServiceAgentExtracts all the log entries for the provided process type including both "live" runtime components and ones that are no longer running.- Specified by:
allLogEntriesin interfaceGridServiceAgent
-
startGridServiceAndWait
Description copied from interface:GridServiceAgentStarts aGridServiceManagerbased on the provided options and waits indefinitely until it is discovered by the admin, which is then returned.- Specified by:
startGridServiceAndWaitin interfaceGridServiceAgent
-
startGridServiceAndWait
public GridServiceManager startGridServiceAndWait(GridServiceManagerOptions options, long timeout, TimeUnit timeUnit) Description copied from interface:GridServiceAgentStarts aGridServiceManagerbased on the provided options and waits for the given timeout (in time unit) until it is discovered by the admin, which is then returned.- Specified by:
startGridServiceAndWaitin interfaceGridServiceAgent
-
startGridService
Description copied from interface:GridServiceAgentStarts aGridServiceContainerbased on the provided options.- Specified by:
startGridServicein interfaceGridServiceAgent
-
internalStartGridService
-
startGridServiceAndWait
Description copied from interface:GridServiceAgentStarts aGridServiceContainerbased on the provided options and waits indefinitely until it is discovered by the admin, which is then returned.- Specified by:
startGridServiceAndWaitin interfaceGridServiceAgent
-
startGridServiceAndWait
public GridServiceContainer startGridServiceAndWait(GridServiceContainerOptions options, long timeout, TimeUnit timeUnit) Description copied from interface:GridServiceAgentStarts aGridServiceContainerbased on the provided options and waits for the given timeout (in time unit) until it is discovered by the admin, which is then returned.- Specified by:
startGridServiceAndWaitin interfaceGridServiceAgent
-
startGridService
Description copied from interface:GridServiceAgentStarts aLookupServicebased on the provided options.- Specified by:
startGridServicein interfaceGridServiceAgent
-
internalStartGridService
-
startGridServiceAndWait
Description copied from interface:GridServiceAgentStarts aLookupServicebased on the provided options and waits indefinitely until it is discovered by the admin, which is then returned.- Specified by:
startGridServiceAndWaitin interfaceGridServiceAgent
-
startGridServiceAndWait
public LookupService startGridServiceAndWait(LookupServiceOptions options, long timeout, TimeUnit timeUnit) Description copied from interface:GridServiceAgentStarts aLookupServicebased on the provided options and waits for the given timeout (in time unit) until it is discovered by the admin, which is then returned.- Specified by:
startGridServiceAndWaitin interfaceGridServiceAgent
-
kill
- Specified by:
killin interfaceInternalGridServiceAgent
-
restart
- Specified by:
restartin interfaceInternalGridServiceAgent
-
shutdown
public void shutdown()Description copied from interface:GridServiceAgentShuts down the GSA.- Specified by:
shutdownin interfaceGridServiceAgent
-
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
-
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
-
removeAgentGridComponent
Description copied from interface:InternalGridServiceAgentInvoked to mark a child grid component as removed from lookup service- Specified by:
removeAgentGridComponentin interfaceInternalGridServiceAgent
-
addAgentGridComponent
Description copied from interface:InternalGridServiceAgentInvoked to mark a child grid component as added to lookup service- Specified by:
addAgentGridComponentin interfaceInternalGridServiceAgent
-
getUnconfirmedRemovedAgentGridComponents
- Specified by:
getUnconfirmedRemovedAgentGridComponentsin interfaceInternalGridServiceAgent- Returns:
- all child grid components marked as removed from lookup service, but are still managed by this agent This is a temporary condition that could happen if the grid component is experiencing GC or has other delays updating the lookup lease.
-
getExactZones
- Specified by:
getExactZonesin interfaceGridServiceAgent- Returns:
- the list of zones that the GSA satisfies
-
getGridServiceContainers
- Specified by:
getGridServiceContainersin interfaceGridServiceAgent- Returns:
- Returns the
GridServiceContainersstarted by thisGridServiceAgent
-
getGridServiceManagers
- Specified by:
getGridServiceManagersin interfaceGridServiceAgent- Returns:
- Returns all the
GridServiceManagersstarted by thisGridServiceAgent
-
getLookupServices
- Specified by:
getLookupServicesin interfaceGridServiceAgent- Returns:
- Returns all the
LookupServicesstarted by thisGridServiceAgent
-
deleteTieredStorageSpaceData
Description copied from interface:InternalGridServiceAgentDeletes persistent data of a given tiered storage space- Specified by:
deleteTieredStorageSpaceDatain interfaceInternalGridServiceAgent
-
getReservationId
- Specified by:
getReservationIdin interfaceInternalGridServiceAgent- Returns:
- The identifies the request to start this grid service agent Used to correlate request to start a new agent with this agent. The agent reservation id can be set by the "com.gs.agent.reservationid" GSA system property, or by setting the GSA_RESERVATION_ID environment variable.
-