GemFire 6.6.1

com.gemstone.gemfire.admin
Interface AdminDistributedSystem


public interface AdminDistributedSystem

Administrative interface for managing an entire GemFire distributed system. This interface should not be confused with DistributedSystem that represents a connection to a GemFire distributed system.

Since:
3.5
See Also:
AdminDistributedSystemFactory

Method Summary
 void addAlertListener(AlertListener listener)
          Registers an AlertListener that will receive all alerts that are at or above the alert level.
 void addCacheListener(SystemMemberCacheListener listener)
          Registers a cache event listener.
 CacheServer addCacheServer()
          Deprecated. as of 5.7 use addCacheVm() instead.
 CacheVm addCacheVm()
          Creates a new cache vm that is ready to configure and start.
 DistributionLocator addDistributionLocator()
          Creates a new DistributionLocator that is ready to configure and start.
 void addMembershipListener(SystemMembershipListener listener)
          Registers a listener that receives callbacks when a member joins or leaves the distributed system.
 BackupStatus backupAllMembers(File targetDir)
          Backup the persistent files for all of the members of the distributed system that the admin member connected to.
 Map<DistributedMember,Set<PersistentID>> compactAllDiskStores()
          Compact the persistent files for all of the members of the distributed system that the admin member connected to.
 void connect()
          Connects to the distributed system.
 void disconnect()
          Disconnects from the distributed system.
 String displayMergedLogs()
          Merges and returns all system logs as a single formatted log.
 AlertLevel getAlertLevel()
          Returns the lowest level of alerts that should be delivered to the AlertListeners registered on this AdminDistributedSystem.
 String getAlertLevelAsString()
          Returns the lowest level of alerts that should be delivered to the AlertListeners registered on this AdminDistributedSystem.
 CacheServer[] getCacheServers()
          Deprecated. as of 5.7 use getCacheVms() instead.
 CacheServer[] getCacheServers(String durableClientId)
          Returns all the cache server members of the distributed system which are hosting a client queue for the particular durable-client having the given durableClientId
 CacheVm[] getCacheVms()
          Returns all of the dedicated cache server vm members of the distributed system.
 DistributedSystemConfig getConfig()
          Returns this system's configuration .
 DistributionLocator[] getDistributionLocators()
          Returns array of DistributionLocators administered by this AdminDistributedSystem.
 GemFireHealth getGemFireHealth()
          Returns an object for monitoring the health of GemFire.
 String getId()
          Retrieves the unique id for this system.
 String getLatestAlert()
          Display in readable format the latest Alert in this distributed system.
 Properties getLicense()
          Retrieves the license information for this installation of GemFire.
 String getLocators()
          Retrieves comma-delimited list locators to be used if multi-cast port is zero.
 LogWriter getLogWriter()
          Returns this connection's LogWriter; null if not connected.
 String getMcastAddress()
          Retrieves the multicast address in use by this system.
 int getMcastPort()
          Retrieves the multicast port in use by this system.
 Set<PersistentID> getMissingPersistentMembers()
          Retrieve the set of persistent files that the existing members are waiting for.
 String getName()
          Retrieves display friendly name for this system.
 String getRemoteCommand()
          Retrieves the remote command and formatting this system should use to access and/or manipulate resources on remote machines.
 SystemMember[] getSystemMemberApplications()
          Retrieves SystemMember instances for every application that is running and currently connection to this system.
 boolean isConnected()
          Returns true if this is currently connected to the system.
 boolean isMcastDiscovery()
          Returns true if this system is using multicast instead of locators for discovery
 boolean isMcastEnabled()
          Returns true if this system has enabled the use of multicast for communications
 boolean isRunning()
          Returns true if any members of this system are currently running.
 SystemMember lookupSystemMember(DistributedMember distributedMember)
          Returns the administrative SystemMember specified by the DistributedMember.
 void removeAlertListener(AlertListener listener)
          Unregisters an AlertListener
 void removeCacheListener(SystemMemberCacheListener listener)
          Unregisters a cache listener.
 void removeMembershipListener(SystemMembershipListener listener)
          Unregisters a membership listener
 void revokePersistentMember(InetAddress host, String directory)
          Indicate to the distributed system that persistent files have been lost.
 void setAlertLevel(AlertLevel level)
          Sets the lowest level of alert that should be delivered to the AlertListeners registered on this AdminDistributedSystem.
 void setAlertLevelAsString(String level)
          Sets the lowest level of alert that should be delivered to the AlertListeners registered on this AdminDistributedSystem.
 void setRemoteCommand(String remoteCommand)
          Sets the remote command and formatting this system should use to access and/or manipulate resources on remote machines.
 Set<DistributedMember> shutDownAllMembers()
          Shuts down all the members of the distributed system with a cache that the admin member is connected to, excluding the stand-alone locators.
 void start()
          Starts all managed entities that are not currently running.
 void stop()
          Stops all managed entities that are currently running.
 boolean waitToBeConnected(long timeout)
          Wait for up to a given number of milliseconds for the connection to the distributed system to be made.
 

Method Detail

getId

String getId()
Retrieves the unique id for this system.


getName

String getName()
Retrieves display friendly name for this system. If this administrative VM defined an optional name for its connection to the distributed system, that name will be returned. Otherwise the returned value will be getId().


getRemoteCommand

String getRemoteCommand()
Retrieves the remote command and formatting this system should use to access and/or manipulate resources on remote machines.


setRemoteCommand

void setRemoteCommand(String remoteCommand)
Sets the remote command and formatting this system should use to access and/or manipulate resources on remote machines.


setAlertLevel

void setAlertLevel(AlertLevel level)
Sets the lowest level of alert that should be delivered to the AlertListeners registered on this AdminDistributedSystem. The default level is AlertLevel.WARNING.


getAlertLevel

AlertLevel getAlertLevel()
Returns the lowest level of alerts that should be delivered to the AlertListeners registered on this AdminDistributedSystem.

See Also:
setAlertLevel(com.gemstone.gemfire.admin.AlertLevel)

setAlertLevelAsString

void setAlertLevelAsString(String level)
Sets the lowest level of alert that should be delivered to the AlertListeners registered on this AdminDistributedSystem. The default level is AlertLevel.WARNING.


getAlertLevelAsString

String getAlertLevelAsString()
Returns the lowest level of alerts that should be delivered to the AlertListeners registered on this AdminDistributedSystem.

See Also:
setAlertLevelAsString(java.lang.String)

addAlertListener

void addAlertListener(AlertListener listener)
Registers an AlertListener that will receive all alerts that are at or above the alert level.


removeAlertListener

void removeAlertListener(AlertListener listener)
Unregisters an AlertListener


getMcastAddress

String getMcastAddress()
Retrieves the multicast address in use by this system.


getMcastPort

int getMcastPort()
Retrieves the multicast port in use by this system.


getLocators

String getLocators()
Retrieves comma-delimited list locators to be used if multi-cast port is zero. Format of each locators must be host[port].


isMcastDiscovery

boolean isMcastDiscovery()
Returns true if this system is using multicast instead of locators for discovery


isMcastEnabled

boolean isMcastEnabled()
Returns true if this system has enabled the use of multicast for communications


isRunning

boolean isRunning()
Returns true if any members of this system are currently running.


isConnected

boolean isConnected()
Returns true if this is currently connected to the system.


start

void start()
           throws AdminException
Starts all managed entities that are not currently running.

Throws:
AdminException - If a problem is encountered while starting the managed entities.

stop

void stop()
          throws AdminException
Stops all managed entities that are currently running.

Throws:
AdminException - If a problem is encountered while starting the managed entities.

displayMergedLogs

String displayMergedLogs()
Merges and returns all system logs as a single formatted log.


getLicense

Properties getLicense()
Retrieves the license information for this installation of GemFire.


addDistributionLocator

DistributionLocator addDistributionLocator()
Creates a new DistributionLocator that is ready to configure and start.

It is presumed that the newly-added locator is used to discover members of the distributed system. That is, the host/port of the new locator is appended to the locators attribute of this AdminDistributedSystem.


getDistributionLocators

DistributionLocator[] getDistributionLocators()
Returns array of DistributionLocators administered by this AdminDistributedSystem.


getSystemMemberApplications

SystemMember[] getSystemMemberApplications()
                                           throws AdminException
Retrieves SystemMember instances for every application that is running and currently connection to this system. Note that this list does not include dedicated cache server vms.

Throws:
AdminException

getLatestAlert

String getLatestAlert()
Display in readable format the latest Alert in this distributed system.


getGemFireHealth

GemFireHealth getGemFireHealth()
Returns an object for monitoring the health of GemFire.


connect

void connect()
Connects to the distributed system. This method will return immediately after spawning a background thread that connects to the distributed system. As a result, a AdminDistributedSystem can be "connected" to before any members of the system have been started or have been seen. The waitToBeConnected(long) method will wait for the connection to be made.

See Also:
isConnected(), isRunning(), waitToBeConnected(long)

waitToBeConnected

boolean waitToBeConnected(long timeout)
                          throws InterruptedException
Wait for up to a given number of milliseconds for the connection to the distributed system to be made.

Parameters:
timeout - The number of milliseconds to wait for the connection to to be made.
Returns:
Whether or not the connection was made. false, if the method times out
Throws:
InterruptedException - If the thread invoking this method is interrupted while waiting.
IllegalStateException - If connect() has not yet been called.

disconnect

void disconnect()
Disconnects from the distributed system.


getConfig

DistributedSystemConfig getConfig()
Returns this system's configuration .


getLogWriter

LogWriter getLogWriter()
Returns this connection's LogWriter; null if not connected.


addMembershipListener

void addMembershipListener(SystemMembershipListener listener)
Registers a listener that receives callbacks when a member joins or leaves the distributed system.


removeMembershipListener

void removeMembershipListener(SystemMembershipListener listener)
Unregisters a membership listener

See Also:
addMembershipListener(com.gemstone.gemfire.admin.SystemMembershipListener)

addCacheListener

void addCacheListener(SystemMemberCacheListener listener)
Registers a cache event listener. Does nothing if the listener is already registered. The listeners are called in the order they are registered.

Parameters:
listener - the listener to register.
Since:
5.0

removeCacheListener

void removeCacheListener(SystemMemberCacheListener listener)
Unregisters a cache listener. Does nothing if the listener is not registered.

Parameters:
listener - the listener to unregister.
Since:
5.0

addCacheServer

@Deprecated
CacheServer addCacheServer()
                           throws AdminException
Deprecated. as of 5.7 use addCacheVm() instead.

Creates a new cache server that is ready to configure and start.

Throws:
AdminException
Since:
4.0

getCacheServers

@Deprecated
CacheServer[] getCacheServers()
                              throws AdminException
Deprecated. as of 5.7 use getCacheVms() instead.

Returns all of the dedicated cache server members of the distributed system. Because they are not managed entities, application VMs that host a server cache are not included in the array.

Throws:
AdminException
Since:
4.0

getCacheServers

CacheServer[] getCacheServers(String durableClientId)
                              throws AdminException
Returns all the cache server members of the distributed system which are hosting a client queue for the particular durable-client having the given durableClientId

Parameters:
durableClientId - - durable-id of the client
Returns:
array of CacheServer(s) having the queue for the durable client
Throws:
AdminException
Since:
5.6

addCacheVm

CacheVm addCacheVm()
                   throws AdminException
Creates a new cache vm that is ready to configure and start.

Throws:
AdminException
Since:
5.7

getCacheVms

CacheVm[] getCacheVms()
                      throws AdminException
Returns all of the dedicated cache server vm members of the distributed system. Because they are not managed entities, application VMs that host a server cache are not included in the array.

Throws:
AdminException
Since:
5.7

lookupSystemMember

SystemMember lookupSystemMember(DistributedMember distributedMember)
                                throws AdminException
Returns the administrative SystemMember specified by the DistributedMember.

Parameters:
distributedMember - the distributed member to lookup
Returns:
administrative SystemMember for that distributed member
Throws:
AdminException
Since:
5.0

revokePersistentMember

void revokePersistentMember(InetAddress host,
                            String directory)
                            throws AdminException
Indicate to the distributed system that persistent files have been lost. When a member recovers from a set of persistent files, it will wait for other members that were also persisting the same region to start up. If the persistent files for those other members were lost, this method can be used to tell the remaining members to stop waiting for the lost data.

Parameters:
host - The host of the member whose files were lost.
directory - The directory where those files resided.
Throws:
AdminException
Since:
6.5

getMissingPersistentMembers

Set<PersistentID> getMissingPersistentMembers()
                                              throws AdminException
Retrieve the set of persistent files that the existing members are waiting for. See revokePersistentMember(InetAddress, String)

Returns:
The persistent members that were known to the existing persistent members, when the existing members were last online.
Throws:
AdminException
Since:
6.5

shutDownAllMembers

Set<DistributedMember> shutDownAllMembers()
                                          throws AdminException
Shuts down all the members of the distributed system with a cache that the admin member is connected to, excluding the stand-alone locators. Calling this method will ensure that regions with the DataPolicy.PERSISTENT_PARTITION to be shutdown in a way which allows for a faster recovery when the members are restarted. Killing individual members can lead to inconsistencies in the members persistent data, which gemfire repairs on startup. Calling shutDownAllMembers makes sure that the persistent files are consistent on shutdown, which makes recovery faster.

Returns:
The set of members that were shutdown
Throws:
AdminException
Since:
6.5

backupAllMembers

BackupStatus backupAllMembers(File targetDir)
                              throws AdminException
Backup the persistent files for all of the members of the distributed system that the admin member connected to.

Returns:
The status of the backup, which includes the set of members that were backed up and the set of members that were known to be offline at the time of backup.
Throws:
AdminException
Since:
6.5

compactAllDiskStores

Map<DistributedMember,Set<PersistentID>> compactAllDiskStores()
                                                              throws AdminException
Compact the persistent files for all of the members of the distributed system that the admin member connected to. This is equivalent to calling {DiskStore#forceCompaction} on all members.

Returns:
The set of members that compacted their disk stores.
Throws:
AdminException
Since:
6.5

GemFire 6.6.1

Copyright © 1997-2011 VMware, Inc. All rights reserved.