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 InternalAdminpublic String[] getGroups()
AdmingetGroups in interface AdminAdminFactory.addGroup(String)public LookupLocator[] getLocators()
AdmingetLocators in interface AdminAdminFactory.addLocator(String)public InternalAdminDriver getDriver()
getDriver in interface InternalAdminpublic ScheduledThreadPoolExecutor getHorizontalScaleScheduledExecutorService()
public InternalAdminDriver waitForDriver()
waitForDriver in interface InternalAdminpublic void initManagerClusterInfo(ManagerClusterInfo extractedClusterInfo)
initManagerClusterInfo in interface InternalAdminprotected void executeScaleThread()
public InternalAdminDriver getDriverIfActive() throws UnknownHostException
UnknownHostExceptionpublic ManagerClusterInfo getManagerClusterInfo()
AdmingetManagerClusterInfo in interface AdminAdmin.waitForManagerClusterInfo()public ManagerClusterInfo waitForManagerClusterInfo()
AdminwaitForManagerClusterInfo in interface Adminpublic ManagerClusterInfo waitForManagerClusterInfo(long timeout, TimeUnit timeUnit)
AdminwaitForManagerClusterInfo in interface Adminpublic void login(SecuredService service) throws SecurityException, RemoteException
login in interface InternalAdminSecurityExceptionRemoteExceptionpublic void setCredentialsProvider(CredentialsProvider credentialsProvider)
public CredentialsProvider getCredentialsProvider()
getCredentialsProvider in interface InternalAdminpublic org.openspaces.zookeeper.attribute_store.ZooKeeperAttributeStore getAttributeStore()
getAttributeStore in interface InternalAdminpublic SharedLockProvider getSharedLockProvider()
getSharedLockProvider in interface InternalAdminpublic ScaleManager getScaleManager()
getScaleManager in interface InternalAdminpublic ScaleVerticalManager getScaleVerticalManager()
getScaleVerticalManager in interface InternalAdminpublic void addGroup(String group)
public void addLocator(String locator)
public void setStatisticsInterval(long interval,
TimeUnit timeUnit)
StatisticsMonitorsetStatisticsInterval in interface StatisticsMonitorpublic void setStatisticsHistorySize(int historySize)
StatisticsMonitorsetStatisticsHistorySize in interface StatisticsMonitorpublic void startStatisticsMonitor()
StatisticsMonitorstartStatisticsMonitor in interface StatisticsMonitorpublic void stopStatisticsMonitor()
StatisticsMonitorstopStatisticsMonitor in interface StatisticsMonitorpublic boolean isMonitoring()
StatisticsMonitortrue if statistics are now being monitored.isMonitoring in interface StatisticsMonitorpublic void begin()
public void setProcessingUnitMonitorInterval(long interval,
TimeUnit timeUnit)
AdminProcessingUnit.getStatus()
among other things.
Defaults to 1 second.
setProcessingUnitMonitorInterval in interface Admininterval - The interval to use.timeUnit - The time unit the interval is at.public void setAgentProcessessMonitorInterval(long interval,
TimeUnit timeUnit)
AdminGridServiceAgent.getProcessesDetails().
Defaults to 5 seconds.
setAgentProcessessMonitorInterval in interface Admininterval - The interval to use.timeUnit - The time unit the interval is at.public long getScheduledSpaceMonitorInterval()
getScheduledSpaceMonitorInterval in interface InternalAdminpublic long getDefaultTimeout()
getDefaultTimeout in interface InternalAdminpublic TimeUnit getDefaultTimeoutTimeUnit()
getDefaultTimeoutTimeUnit in interface InternalAdminpublic DiscoveryService getDiscoveryService()
public void setSpaceMonitorInterval(long interval,
TimeUnit timeUnit)
AdminDefaults to 1 second.
setSpaceMonitorInterval in interface Admininterval - The interval to use.timeUnit - The time unit the interval is at.public ScheduledThreadPoolExecutor getScheduler()
getScheduler in interface InternalAdminpublic ScheduledFuture<?> scheduleWithFixedDelay(Runnable command, long initialDelay, long delay, TimeUnit unit)
scheduleWithFixedDelay in interface InternalAdminpublic void setSchedulerCorePoolSize(int coreThreads)
AdminDefaults to 10 threads.
setSchedulerCorePoolSize in interface AdmincoreThreads - The number of threads the shared scheduler thread pool will use,public void setDefaultTimeout(long timeout,
TimeUnit timeUnit)
AdminsetDefaultTimeout in interface Admintimeout - 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()
Adminpublic LookupServices getLookupServices()
AdmingetLookupServices in interface Adminpublic GridServiceAgents getGridServiceAgents()
AdmingetGridServiceAgents in interface Adminpublic GridServiceManagers getGridServiceManagers()
AdmingetGridServiceManagers in interface Adminpublic GridServiceContainers getGridServiceContainers()
AdmingetGridServiceContainers in interface Adminpublic Gateways getGateways()
AdmingetGateways in interface Adminpublic GridComponent getGridComponentByUID(String uid)
AdmingetGridComponentByUID in interface Adminuid - The UID of the service returned by GridComponent.getUid();
null if no representation.GridComponent.getUid()public Machines getMachines()
AdmingetMachines in interface Adminpublic Zones getZones()
Adminpublic Applications getApplications()
getApplications in interface Adminpublic Transports getTransports()
AdmingetTransports in interface Adminpublic VirtualMachines getVirtualMachines()
AdmingetVirtualMachines in interface Adminpublic OperatingSystems getOperatingSystems()
AdmingetOperatingSystems in interface Adminpublic ProcessingUnits getProcessingUnits()
AdmingetProcessingUnits in interface Adminpublic GatewayProcessingUnits getGatewayProcessingUnits()
AdmingetGatewayProcessingUnits in interface Adminpublic Spaces getSpaces()
Adminpublic AlertManager getAlertManager()
AdmingetAlertManager in interface Adminpublic void addEventListener(AdminEventListener eventListener)
AdminAdminEventListener interface.addEventListener in interface AdminAdmin.removeEventListener(AdminEventListener)public void addEventListener(AdminEventListener eventListener, boolean withStatisticsHistory)
AdminAdminEventListener interface.addEventListener in interface AdminwithStatisticsHistory - if all statistics histories will be fired on registration
statistics listenerAdmin.removeEventListener(AdminEventListener)public void removeEventListener(AdminEventListener eventListener)
AdminAdminEventListener interface.removeEventListener in interface AdminAdmin.addEventListener(AdminEventListener)public int getEventListenersCount()
AdminAdminEventListener.
Only for calls issued by either addEventListener or removeEventListenergetEventListenersCount in interface AdminAdmin.addEventListener(AdminEventListener),
Admin.removeEventListener(AdminEventListener)public void pushEvent(Object listener, Runnable notifier)
pushEvent in interface InternalAdminpublic void pushScheduleMonitorCorrelatedEvent(Object listener, Runnable notifier)
InternalAdminpushScheduleMonitorCorrelatedEvent in interface InternalAdminpublic void pushEventAsFirst(Object listener, Runnable notifier)
pushEventAsFirst in interface InternalAdminpublic void flushEvents()
public void flushScheduleMonitorCorrelatedEvents()
public void raiseEvent(Object listener, Runnable notifier)
raiseEvent in interface InternalAdminpublic void scheduleNonBlockingStateChange(Runnable command)
InternalAdminscheduleNonBlockingStateChange in interface InternalAdminpublic void scheduleAdminOperation(Runnable command)
InternalAdminscheduleAdminOperation in interface InternalAdminpublic void assertStateChangesPermitted()
assertStateChangesPermitted in interface InternalAdminpublic void addGridServiceAgent(InternalGridServiceAgent gridServiceAgent, NIODetails nioDetails, OSDetails osDetails, JVMDetails jvmDetails, String jmxUrl, String[] zones)
addGridServiceAgent in interface InternalAdminpublic void removeGridServiceAgent(String uid)
removeGridServiceAgent in interface InternalAdminpublic void addLookupService(InternalLookupService lookupService, NIODetails nioDetails, OSDetails osDetails, JVMDetails jvmDetails, String jmxUrl, String[] zones)
addLookupService in interface InternalAdminpublic void removeLookupService(String uid)
removeLookupService in interface InternalAdminpublic void addGridServiceManager(InternalGridServiceManager gridServiceManager, NIODetails nioDetails, OSDetails osDetails, JVMDetails jvmDetails, String jmxUrl, String[] zones, boolean acceptVM)
addGridServiceManager in interface InternalAdminpublic void removeGridServiceManager(String uid)
removeGridServiceManager in interface InternalAdminpublic void addGridServiceContainer(InternalGridServiceContainer gridServiceContainer, NIODetails nioDetails, OSDetails osDetails, JVMDetails jvmDetails, String jmxUrl, String[] zones)
addGridServiceContainer in interface InternalAdminpublic void removeGridServiceContainer(String uid)
removeGridServiceContainer in interface InternalAdminpublic void addProcessingUnitInstance(InternalProcessingUnitInstance processingUnitInstance, NIODetails nioDetails, OSDetails osDetails, JVMDetails jvmDetails, String jmxUrl, String[] zones)
addProcessingUnitInstance in interface InternalAdminpublic void removeProcessingUnitInstance(String uid, boolean removeEmbeddedSpaces)
removeProcessingUnitInstance in interface InternalAdminpublic void addSpaceInstance(InternalSpaceInstance spaceInstance, NIODetails nioDetails, OSDetails osDetails, JVMDetails jvmDetails, String jmxUrl, String[] zones)
addSpaceInstance in interface InternalAdminpublic void removeSpaceInstance(String uid)
removeSpaceInstance in interface InternalAdminpublic DumpResult generateDump(Set<DumpProvider> dumpProviders, DumpGeneratedListener listener, String cause, Map<String,Object> context, String... processor) throws AdminException
AdmingenerateDump in interface AdminAdminExceptionpublic DumpResult generateDump(String cause, Map<String,Object> context) throws AdminException
DumpProvidergenerateDump in interface DumpProvidercause - The cause that this dump was generatedcontext - Allows to provide specific parameters to specific processorsAdminExceptionpublic DumpResult generateDump(String cause, Map<String,Object> context, String... processor) throws AdminException
DumpProvidergenerateDump in interface DumpProvidercause - The cause this dump was generated.context - Allows to provide specific parameters to specific processors.processor - The list of processors to be used.AdminExceptionpublic ScheduledFuture<?> scheduleWithFixedDelayNonBlockingStateChange(Runnable command, long initialDelay, long delay, TimeUnit unit)
InternalAdminscheduleWithFixedDelayNonBlockingStateChange in interface InternalAdminpublic ScheduledFuture<?> scheduleOneTimeWithDelayNonBlockingStateChange(Runnable command, long delay, TimeUnit unit)
InternalAdminscheduleOneTimeWithDelayNonBlockingStateChange in interface InternalAdminpublic boolean isSingleThreadedEventListeners()
isSingleThreadedEventListeners in interface InternalAdminpublic void setAdminFilter(AdminFilter adminFilter)
adminFilter - public AdminFilter getAdminFilter()
getAdminFilter in interface InternalAdminpublic void addGatewayProcessingUnit(GatewayProcessingUnit gatewayProcessingUnit)
addGatewayProcessingUnit in interface InternalAdminpublic void removeGatewayProcessingUnit(String uid)
removeGatewayProcessingUnit in interface InternalAdminpublic ProcessingUnitInstance[] getOrphanProcessingUnitInstances()
getOrphanProcessingUnitInstances in interface InternalAdminpublic void setDiscoveryServices(Class... discoveryServices)
GridServiceAgent,
GridServiceManager, GridServiceContainer,
ProcessingUnit, SpaceIllegalArgumentException - if other type is providedCopyright © GigaSpaces.