public class DefaultAdmin extends Object implements InternalAdmin
DEFAULT_HISTORY_SIZE, DEFAULT_MONITOR_INTERVAL
Constructor and Description |
---|
DefaultAdmin(boolean useDaemonThreads,
boolean singleThreadedEventListeners) |
Modifier and Type | Method and Description |
---|---|
void |
addEventListener(AdminEventListener eventListener)
Smart addition of event listeners.
|
void |
addEventListener(AdminEventListener eventListener,
boolean withStatisticsHistory)
Smart addition of event listeners.
|
void |
addGatewayProcessingUnit(GatewayProcessingUnit gatewayProcessingUnit) |
void |
addGridServiceAgent(InternalGridServiceAgent gridServiceAgent,
NIODetails nioDetails,
OSDetails osDetails,
JVMDetails jvmDetails,
String jmxUrl,
String[] zones) |
void |
addGridServiceContainer(InternalGridServiceContainer gridServiceContainer,
NIODetails nioDetails,
OSDetails osDetails,
JVMDetails jvmDetails,
String jmxUrl,
String[] zones) |
void |
addGridServiceManager(InternalGridServiceManager gridServiceManager,
NIODetails nioDetails,
OSDetails osDetails,
JVMDetails jvmDetails,
String jmxUrl,
String[] zones,
boolean acceptVM) |
void |
addGroup(String group) |
void |
addLocator(String locator) |
void |
addLookupService(InternalLookupService lookupService,
NIODetails nioDetails,
OSDetails osDetails,
JVMDetails jvmDetails,
String jmxUrl,
String[] zones) |
void |
addProcessingUnitInstance(InternalProcessingUnitInstance processingUnitInstance,
NIODetails nioDetails,
OSDetails osDetails,
JVMDetails jvmDetails,
String jmxUrl,
String[] zones) |
void |
addSpaceInstance(InternalSpaceInstance spaceInstance,
NIODetails nioDetails,
OSDetails osDetails,
JVMDetails jvmDetails,
String jmxUrl,
String[] zones) |
void |
assertStateChangesPermitted() |
void |
begin() |
void |
close()
Closes the Admin, releasing any resource and stops listening for events from the lookup
service.
|
protected void |
executeScaleThread() |
void |
flushEvents() |
void |
flushScheduleMonitorCorrelatedEvents() |
DumpResult |
generateDump(Set<DumpProvider> dumpProviders,
DumpGeneratedListener listener,
String cause,
Map<String,Object> context,
String... processor)
Generates dump for an explicit set of dump providers.
|
DumpResult |
generateDump(String cause,
Map<String,Object> context)
Generates dump for all the provided dump processors.
|
DumpResult |
generateDump(String cause,
Map<String,Object> context,
String... processor)
Generates dump for the provided processors.
|
AdminFilter |
getAdminFilter() |
org.apache.commons.logging.Log |
getAdminLogger() |
AlertManager |
getAlertManager()
Returns the alert manager through which alert strategies are managed, alerts are fired and
alert events are registered for.
|
Applications |
getApplications() |
org.openspaces.zookeeper.attribute_store.ZooKeeperAttributeStore |
getAttributeStore() |
CredentialsProvider |
getCredentialsProvider() |
long |
getDefaultTimeout() |
TimeUnit |
getDefaultTimeoutTimeUnit() |
DiscoveryService |
getDiscoveryService() |
InternalAdminDriver |
getDriver() |
InternalAdminDriver |
getDriverIfActive() |
int |
getEventListenersCount()
Returns number of registered event listeners.
|
GatewayProcessingUnits |
getGatewayProcessingUnits()
Returns the Gateway Processing Units discovered.
|
Gateways |
getGateways()
Returns the gateways discovered.
|
GridComponent |
getGridComponentByUID(String uid)
Returns the Grid Component represented by this UID; e.g.
|
GridServiceAgents |
getGridServiceAgents()
Returns the grid service agents discovered.
|
GridServiceContainers |
getGridServiceContainers()
Returns the grid service containers discovered.
|
GridServiceManagers |
getGridServiceManagers()
Returns the grid service managers discovered.
|
String[] |
getGroups()
Returns the lookup groups this admin uses.
|
ScheduledThreadPoolExecutor |
getHorizontalScaleScheduledExecutorService() |
LookupLocator[] |
getLocators()
Returns the lookup locators this admin uses.
|
LookupServices |
getLookupServices()
Returns the lookup services discovered.
|
Machines |
getMachines()
Returns the machines discovered.
|
ManagerClusterInfo |
getManagerClusterInfo()
Returns the cluster manager information (if not initialized yet - return null)
|
OperatingSystems |
getOperatingSystems()
Returns the Operating Systems discovered.
|
ProcessingUnitInstance[] |
getOrphanProcessingUnitInstances() |
ProcessingUnits |
getProcessingUnits()
Returns the Processing Units discovered.
|
ScaleManager |
getScaleManager() |
ScaleVerticalManager |
getScaleVerticalManager() |
long |
getScheduledSpaceMonitorInterval() |
ScheduledThreadPoolExecutor |
getScheduler() |
SharedLockProvider |
getSharedLockProvider() |
Spaces |
getSpaces()
Returns the spaces discovered.
|
Transports |
getTransports()
Returns the transports discovered.
|
VirtualMachines |
getVirtualMachines()
Returns the Virtual Machines discovered.
|
Zones |
getZones()
Returns the zones discovered.
|
void |
initManagerClusterInfo(ManagerClusterInfo extractedClusterInfo) |
boolean |
isMonitoring()
Returns
true if statistics are now being monitored. |
boolean |
isSingleThreadedEventListeners() |
void |
login(SecuredService service) |
void |
pushEvent(Object listener,
Runnable notifier) |
void |
pushEventAsFirst(Object listener,
Runnable notifier) |
void |
pushScheduleMonitorCorrelatedEvent(Object listener,
Runnable notifier)
All events that need to be correlated with the Admin ScheduledMonitor polling mechanism.
|
void |
raiseEvent(Object listener,
Runnable notifier) |
void |
removeEventListener(AdminEventListener eventListener)
Smart removal of event listeners.
|
void |
removeGatewayProcessingUnit(String uid) |
void |
removeGridServiceAgent(String uid) |
void |
removeGridServiceContainer(String uid) |
void |
removeGridServiceManager(String uid) |
void |
removeLookupService(String uid) |
void |
removeProcessingUnitInstance(String uid,
boolean removeEmbeddedSpaces) |
void |
removeSpaceInstance(String uid) |
void |
scheduleAdminOperation(Runnable command)
A generic thread pool for network based operations such as creating a new grid service
container.
|
void |
scheduleNonBlockingStateChange(Runnable command)
Any internal admin objects state change must be scheduled using this method.
|
ScheduledFuture<?> |
scheduleOneTimeWithDelayNonBlockingStateChange(Runnable command,
long delay,
TimeUnit unit)
Any internal delayed admin objects state change based on polling must be scheduled using this
method.
|
ScheduledFuture<?> |
scheduleWithFixedDelay(Runnable command,
long initialDelay,
long delay,
TimeUnit unit) |
ScheduledFuture<?> |
scheduleWithFixedDelayNonBlockingStateChange(Runnable command,
long initialDelay,
long delay,
TimeUnit unit)
Any internal admin objects state change based on polling must be scheduled using this method.
|
void |
setAdminFilter(AdminFilter adminFilter) |
void |
setAgentProcessessMonitorInterval(long interval,
TimeUnit timeUnit)
Sets the Grid Service Agent processes monitor (not statistics) interval.
|
void |
setCredentialsProvider(CredentialsProvider credentialsProvider) |
void |
setDefaultTimeout(long timeout,
TimeUnit timeUnit)
The default timeout to be used for operations that have a wait for mechanism, i.e.
|
void |
setDiscoveryServices(Class... discoveryServices)
Set the service types that will be monitored Supported types:
GridServiceAgent ,
GridServiceManager , GridServiceContainer ,
ProcessingUnit , Space |
void |
setProcessingUnitMonitorInterval(long interval,
TimeUnit timeUnit)
Sets the processing unit monitor (not statistics) interval.
|
void |
setSchedulerCorePoolSize(int coreThreads)
The Admin API uses a shared scheduler thread pool to perform *all* scheduled operations
(monitoring, statistics monitoring).
|
void |
setSpaceMonitorInterval(long interval,
TimeUnit timeUnit)
Sets the Space monitor (not statistics) interval.
|
void |
setStatisticsHistorySize(int historySize)
Sets the history size of number of statistics stored.
|
void |
setStatisticsInterval(long interval,
TimeUnit timeUnit)
Sets the statistics interval, automatically updating the monitoring scheduled tasks if
monitoring is enabled.
|
void |
startStatisticsMonitor()
Starts the statistics monitor, starting a scheduled monitor that polls for statistics.
|
void |
stopStatisticsMonitor()
Stops the statistics monitor.
|
InternalAdminDriver |
waitForDriver() |
ManagerClusterInfo |
waitForManagerClusterInfo()
Waits indefinitely for the cluster manager information to be initialized, then return it
|
ManagerClusterInfo |
waitForManagerClusterInfo(long timeout,
TimeUnit timeUnit)
Waits for the specified timeout for the cluster manager information to be initialized, then return it.
|
public DefaultAdmin(boolean useDaemonThreads, boolean singleThreadedEventListeners)
useDaemonThreads
- Sets worker and events threads to be automatically closed
when the process dies.singleThreadedEventListeners
- Enables a single event loop threading model in which all
event listeners and admin state updates are done on the
same thread. The underlying assumption is that event
listeners do not perform an I/O operation so they won't
block the single event thread. Call this method before
begin()public org.apache.commons.logging.Log getAdminLogger()
getAdminLogger
in interface InternalAdmin
public String[] getGroups()
Admin
getGroups
in interface Admin
AdminFactory.addGroup(String)
public LookupLocator[] getLocators()
Admin
getLocators
in interface Admin
AdminFactory.addLocator(String)
public InternalAdminDriver getDriver()
getDriver
in interface InternalAdmin
public ScheduledThreadPoolExecutor getHorizontalScaleScheduledExecutorService()
public InternalAdminDriver waitForDriver()
waitForDriver
in interface InternalAdmin
public void initManagerClusterInfo(ManagerClusterInfo extractedClusterInfo)
initManagerClusterInfo
in interface InternalAdmin
protected void executeScaleThread()
public InternalAdminDriver getDriverIfActive() throws UnknownHostException
UnknownHostException
public ManagerClusterInfo getManagerClusterInfo()
Admin
getManagerClusterInfo
in interface Admin
Admin.waitForManagerClusterInfo()
public ManagerClusterInfo waitForManagerClusterInfo()
Admin
waitForManagerClusterInfo
in interface Admin
public ManagerClusterInfo waitForManagerClusterInfo(long timeout, TimeUnit timeUnit)
Admin
waitForManagerClusterInfo
in interface Admin
public void login(SecuredService service) throws SecurityException, RemoteException
login
in interface InternalAdmin
SecurityException
RemoteException
public void setCredentialsProvider(CredentialsProvider credentialsProvider)
public CredentialsProvider getCredentialsProvider()
getCredentialsProvider
in interface InternalAdmin
public org.openspaces.zookeeper.attribute_store.ZooKeeperAttributeStore getAttributeStore()
getAttributeStore
in interface InternalAdmin
public SharedLockProvider getSharedLockProvider()
getSharedLockProvider
in interface InternalAdmin
public ScaleManager getScaleManager()
getScaleManager
in interface InternalAdmin
public ScaleVerticalManager getScaleVerticalManager()
getScaleVerticalManager
in interface InternalAdmin
public void addGroup(String group)
public void addLocator(String locator)
public void setStatisticsInterval(long interval, TimeUnit timeUnit)
StatisticsMonitor
setStatisticsInterval
in interface StatisticsMonitor
public void setStatisticsHistorySize(int historySize)
StatisticsMonitor
setStatisticsHistorySize
in interface StatisticsMonitor
public void startStatisticsMonitor()
StatisticsMonitor
startStatisticsMonitor
in interface StatisticsMonitor
public void stopStatisticsMonitor()
StatisticsMonitor
stopStatisticsMonitor
in interface StatisticsMonitor
public boolean isMonitoring()
StatisticsMonitor
true
if statistics are now being monitored.isMonitoring
in interface StatisticsMonitor
public void begin()
public void setProcessingUnitMonitorInterval(long interval, TimeUnit timeUnit)
Admin
ProcessingUnit.getStatus()
among other things.
Defaults to 1 second.
setProcessingUnitMonitorInterval
in interface Admin
interval
- The interval to use.timeUnit
- The time unit the interval is at.public void setAgentProcessessMonitorInterval(long interval, TimeUnit timeUnit)
Admin
GridServiceAgent.getProcessesDetails()
.
Defaults to 5 seconds.
setAgentProcessessMonitorInterval
in interface Admin
interval
- The interval to use.timeUnit
- The time unit the interval is at.public long getScheduledSpaceMonitorInterval()
getScheduledSpaceMonitorInterval
in interface InternalAdmin
public long getDefaultTimeout()
getDefaultTimeout
in interface InternalAdmin
public TimeUnit getDefaultTimeoutTimeUnit()
getDefaultTimeoutTimeUnit
in interface InternalAdmin
public DiscoveryService getDiscoveryService()
public void setSpaceMonitorInterval(long interval, TimeUnit timeUnit)
Admin
Defaults to 1 second.
setSpaceMonitorInterval
in interface Admin
interval
- The interval to use.timeUnit
- The time unit the interval is at.public ScheduledThreadPoolExecutor getScheduler()
getScheduler
in interface InternalAdmin
public ScheduledFuture<?> scheduleWithFixedDelay(Runnable command, long initialDelay, long delay, TimeUnit unit)
scheduleWithFixedDelay
in interface InternalAdmin
public void setSchedulerCorePoolSize(int coreThreads)
Admin
Defaults to 10 threads.
setSchedulerCorePoolSize
in interface Admin
coreThreads
- The number of threads the shared scheduler thread pool will use,public void setDefaultTimeout(long timeout, TimeUnit timeUnit)
Admin
setDefaultTimeout
in interface Admin
timeout
- The timeout value to be used as the default operation timeout if non was
provided.timeUnit
- The time-unit corresponding to the timeout.public void close()
Admin
public LookupServices getLookupServices()
Admin
getLookupServices
in interface Admin
public GridServiceAgents getGridServiceAgents()
Admin
getGridServiceAgents
in interface Admin
public GridServiceManagers getGridServiceManagers()
Admin
getGridServiceManagers
in interface Admin
public GridServiceContainers getGridServiceContainers()
Admin
getGridServiceContainers
in interface Admin
public Gateways getGateways()
Admin
getGateways
in interface Admin
public GridComponent getGridComponentByUID(String uid)
Admin
getGridComponentByUID
in interface Admin
uid
- The UID of the service returned by GridComponent.getUid()
;
null
if no representation.GridComponent.getUid()
public Machines getMachines()
Admin
getMachines
in interface Admin
public Zones getZones()
Admin
public Applications getApplications()
getApplications
in interface Admin
public Transports getTransports()
Admin
getTransports
in interface Admin
public VirtualMachines getVirtualMachines()
Admin
getVirtualMachines
in interface Admin
public OperatingSystems getOperatingSystems()
Admin
getOperatingSystems
in interface Admin
public ProcessingUnits getProcessingUnits()
Admin
getProcessingUnits
in interface Admin
public GatewayProcessingUnits getGatewayProcessingUnits()
Admin
getGatewayProcessingUnits
in interface Admin
public Spaces getSpaces()
Admin
public AlertManager getAlertManager()
Admin
getAlertManager
in interface Admin
public void addEventListener(AdminEventListener eventListener)
Admin
AdminEventListener
interface.addEventListener
in interface Admin
Admin.removeEventListener(AdminEventListener)
public void addEventListener(AdminEventListener eventListener, boolean withStatisticsHistory)
Admin
AdminEventListener
interface.addEventListener
in interface Admin
withStatisticsHistory
- if all statistics histories will be fired on registration
statistics listenerAdmin.removeEventListener(AdminEventListener)
public void removeEventListener(AdminEventListener eventListener)
Admin
AdminEventListener
interface.removeEventListener
in interface Admin
Admin.addEventListener(AdminEventListener)
public int getEventListenersCount()
Admin
AdminEventListener
.
Only for calls issued by either addEventListener or removeEventListenergetEventListenersCount
in interface Admin
Admin.addEventListener(AdminEventListener)
,
Admin.removeEventListener(AdminEventListener)
public void pushEvent(Object listener, Runnable notifier)
pushEvent
in interface InternalAdmin
public void pushScheduleMonitorCorrelatedEvent(Object listener, Runnable notifier)
InternalAdmin
pushScheduleMonitorCorrelatedEvent
in interface InternalAdmin
public void pushEventAsFirst(Object listener, Runnable notifier)
pushEventAsFirst
in interface InternalAdmin
public void flushEvents()
public void flushScheduleMonitorCorrelatedEvents()
public void raiseEvent(Object listener, Runnable notifier)
raiseEvent
in interface InternalAdmin
public void scheduleNonBlockingStateChange(Runnable command)
InternalAdmin
scheduleNonBlockingStateChange
in interface InternalAdmin
public void scheduleAdminOperation(Runnable command)
InternalAdmin
scheduleAdminOperation
in interface InternalAdmin
public void assertStateChangesPermitted()
assertStateChangesPermitted
in interface InternalAdmin
public void addGridServiceAgent(InternalGridServiceAgent gridServiceAgent, NIODetails nioDetails, OSDetails osDetails, JVMDetails jvmDetails, String jmxUrl, String[] zones)
addGridServiceAgent
in interface InternalAdmin
public void removeGridServiceAgent(String uid)
removeGridServiceAgent
in interface InternalAdmin
public void addLookupService(InternalLookupService lookupService, NIODetails nioDetails, OSDetails osDetails, JVMDetails jvmDetails, String jmxUrl, String[] zones)
addLookupService
in interface InternalAdmin
public void removeLookupService(String uid)
removeLookupService
in interface InternalAdmin
public void addGridServiceManager(InternalGridServiceManager gridServiceManager, NIODetails nioDetails, OSDetails osDetails, JVMDetails jvmDetails, String jmxUrl, String[] zones, boolean acceptVM)
addGridServiceManager
in interface InternalAdmin
public void removeGridServiceManager(String uid)
removeGridServiceManager
in interface InternalAdmin
public void addGridServiceContainer(InternalGridServiceContainer gridServiceContainer, NIODetails nioDetails, OSDetails osDetails, JVMDetails jvmDetails, String jmxUrl, String[] zones)
addGridServiceContainer
in interface InternalAdmin
public void removeGridServiceContainer(String uid)
removeGridServiceContainer
in interface InternalAdmin
public void addProcessingUnitInstance(InternalProcessingUnitInstance processingUnitInstance, NIODetails nioDetails, OSDetails osDetails, JVMDetails jvmDetails, String jmxUrl, String[] zones)
addProcessingUnitInstance
in interface InternalAdmin
public void removeProcessingUnitInstance(String uid, boolean removeEmbeddedSpaces)
removeProcessingUnitInstance
in interface InternalAdmin
public void addSpaceInstance(InternalSpaceInstance spaceInstance, NIODetails nioDetails, OSDetails osDetails, JVMDetails jvmDetails, String jmxUrl, String[] zones)
addSpaceInstance
in interface InternalAdmin
public void removeSpaceInstance(String uid)
removeSpaceInstance
in interface InternalAdmin
public DumpResult generateDump(Set<DumpProvider> dumpProviders, DumpGeneratedListener listener, String cause, Map<String,Object> context, String... processor) throws AdminException
Admin
generateDump
in interface Admin
AdminException
public DumpResult generateDump(String cause, Map<String,Object> context) throws AdminException
DumpProvider
generateDump
in interface DumpProvider
cause
- The cause that this dump was generatedcontext
- Allows to provide specific parameters to specific processorsAdminException
public DumpResult generateDump(String cause, Map<String,Object> context, String... processor) throws AdminException
DumpProvider
generateDump
in interface DumpProvider
cause
- The cause this dump was generated.context
- Allows to provide specific parameters to specific processors.processor
- The list of processors to be used.AdminException
public ScheduledFuture<?> scheduleWithFixedDelayNonBlockingStateChange(Runnable command, long initialDelay, long delay, TimeUnit unit)
InternalAdmin
scheduleWithFixedDelayNonBlockingStateChange
in interface InternalAdmin
public ScheduledFuture<?> scheduleOneTimeWithDelayNonBlockingStateChange(Runnable command, long delay, TimeUnit unit)
InternalAdmin
scheduleOneTimeWithDelayNonBlockingStateChange
in interface InternalAdmin
public boolean isSingleThreadedEventListeners()
isSingleThreadedEventListeners
in interface InternalAdmin
public void setAdminFilter(AdminFilter adminFilter)
adminFilter
- public AdminFilter getAdminFilter()
getAdminFilter
in interface InternalAdmin
public void addGatewayProcessingUnit(GatewayProcessingUnit gatewayProcessingUnit)
addGatewayProcessingUnit
in interface InternalAdmin
public void removeGatewayProcessingUnit(String uid)
removeGatewayProcessingUnit
in interface InternalAdmin
public ProcessingUnitInstance[] getOrphanProcessingUnitInstances()
getOrphanProcessingUnitInstances
in interface InternalAdmin
public void setDiscoveryServices(Class... discoveryServices)
GridServiceAgent
,
GridServiceManager
, GridServiceContainer
,
ProcessingUnit
, Space
IllegalArgumentException
- if other type is providedCopyright © GigaSpaces.