|
Groovy Documentation | |||||||
FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | PROPERTY | CONSTR | METHOD | DETAIL: FIELD | PROPERTY | CONSTR | METHOD |
java.lang.Objectorg.linkedin.glu.agent.server.AgentMain
class AgentMain
This is the main class to start the agent.
Field Summary | |
---|---|
static java.lang.String |
MODULE
|
protected AgentImpl |
_agent
|
protected AgentContextImpl |
_agentContext
|
protected java.lang.String |
_agentName
|
protected AgentProperties |
_agentProperties
|
protected java.io.File |
_agentTempDir
|
protected java.lang.Object |
_config
|
protected DualWriteStorage |
_dwStorage
|
protected java.lang.String |
_fabric
|
protected java.lang.Object |
_lock
|
protected java.io.File |
_persistentPropertiesFile
|
protected long |
_pid
|
protected Agent |
_proxiedAgent
|
protected boolean |
_receivedShutdown
|
protected java.lang.Object |
_restServer
|
protected java.lang.Shutdown |
_shutdown
|
protected Sigar |
_sigar
|
protected Storage |
_storage
|
protected java.lang.Object |
_urlFactory
|
protected IZKClient |
_zkClient
|
protected java.lang.String |
_zooKeeperRoot
|
protected groovy.lang.Closure |
hostnameFactory
|
static Logger |
log
|
Property Summary | |
---|---|
java.lang.Object |
stop
|
Constructor Summary | |
AgentMain()
|
Method Summary | |
---|---|
java.lang.Object
|
awaitTermination()
|
protected java.lang.String
|
computeAgentEphemeralPath()
|
protected java.lang.String
|
computeFabric(java.lang.Object configFromCli, java.lang.Object config)
Computes the fabric |
protected java.lang.Object
|
computeHostnameFactory(java.util.Properties config)
Use the |
protected java.lang.String
|
computeZKAgentFabricPath()
|
protected java.lang.String
|
computeZooKeeperStoragePath()
|
void
|
configure(java.util.Map config)
|
protected CommandManager
|
createCommandsManager(ShellImpl rootShell, ScriptManager scriptManager, AbstractScriptFactoryFactory scriptFactoryFactory)
|
protected ShellImpl
|
createRootShell()
|
protected Shell
|
createShell(ShellImpl rootShell, java.lang.String root)
|
protected Sigar
|
createSigar()
Create Sigar. |
protected Storage
|
createStorage()
|
protected IZKClient
|
createZooKeeperClient(java.lang.Object config)
|
protected ZooKeeperStorage
|
createZooKeeperStorage()
|
protected java.io.File
|
fetchFile(java.lang.Object fileLocation, java.lang.Object checksum)
|
java.lang.String
|
getAgentName()
|
protected long
|
getAgentPid()
|
java.lang.String
|
getFabric()
|
protected java.lang.Object
|
getOneWayCodec()
|
protected java.lang.String
|
getPassword(java.lang.Object config, java.lang.String name)
|
java.lang.String
|
getPrefix()
|
protected java.lang.Object
|
getRemoteConfigCodec()
|
protected java.lang.Object
|
getTwoWayCodec()
|
java.lang.Object
|
getUrlFactory()
|
java.lang.String
|
getZookeeperRoot()
|
void
|
init(java.lang.Object args)
|
java.io.File
|
loadPersistentProperties(java.util.Properties config, java.util.Properties persistentProperties)
Loads the persistent properties which will serve as default values for whatever is not specified. |
static void
|
main(java.lang.Object args)
|
protected java.util.Properties
|
mergeConfig(java.util.Properties higherPriorityConfig, java.util.Properties lowerPriorityConfig)
The goal of this method is to merge the configuration in the following fashion: all
properties that are in the |
void
|
onConnected()
|
void
|
onDisconnected()
|
protected java.lang.Object
|
readConfig(java.lang.Object url, java.util.Properties properties)
|
java.lang.Object
|
registerTerminationHandler()
|
java.io.File
|
savePersistentProperties(java.lang.Object config, AgentProperties agentProperties)
|
void
|
setUrlFactory(java.lang.Object urlFactory)
|
java.lang.Object
|
start()
|
java.lang.Object
|
start(boolean withTerminationHandler)
|
java.lang.Object
|
startAndWait()
|
java.lang.Object
|
startRestServer()
|
protected void
|
startZooKeeperMonitor()
The purpose of this code is to try to drill down on glu-210 (Agent not recreating ephemeral node after ZK outage) |
static java.lang.Object
|
staticReadConfig(java.lang.Object url, java.util.Properties properties)
|
protected void
|
toCanonicalPath(java.lang.Object config, java.lang.Object name)
Make sure that the paths are canonical (no .. or links) |
protected void
|
toCanonicalPath(java.util.Properties config)
Make sure that the paths are canonical (no .. or links) |
Methods inherited from class java.lang.Object | |
---|---|
java.lang.Object#wait(), java.lang.Object#wait(long), java.lang.Object#wait(long, int), java.lang.Object#equals(java.lang.Object), java.lang.Object#toString(), java.lang.Object#hashCode(), java.lang.Object#getClass(), java.lang.Object#notify(), java.lang.Object#notifyAll() |
Field Detail |
---|
public static final java.lang.String MODULE
protected AgentImpl _agent
protected AgentContextImpl _agentContext
protected java.lang.String _agentName
protected AgentProperties _agentProperties
protected java.io.File _agentTempDir
protected java.lang.Object _config
protected DualWriteStorage _dwStorage
protected java.lang.String _fabric
protected final java.lang.Object _lock
protected java.io.File _persistentPropertiesFile
protected long _pid
protected Agent _proxiedAgent
protected boolean _receivedShutdown
protected java.lang.Object _restServer
protected java.lang.Shutdown _shutdown
protected Sigar _sigar
protected Storage _storage
protected java.lang.Object _urlFactory
protected IZKClient _zkClient
protected java.lang.String _zooKeeperRoot
protected groovy.lang.Closure hostnameFactory
public static final Logger log
Property Detail |
---|
java.lang.Object stop
Constructor Detail |
---|
AgentMain()
Method Detail |
---|
java.lang.Object awaitTermination()
protected java.lang.String computeAgentEphemeralPath()
protected java.lang.String computeFabric(java.lang.Object configFromCli, java.lang.Object config)
protected java.lang.Object computeHostnameFactory(java.util.Properties config)
glu.agent.hostname
config value to determine how to compute
hostname.
protected java.lang.String computeZKAgentFabricPath()
protected java.lang.String computeZooKeeperStoragePath()
@Override void configure(java.util.Map config)
protected CommandManager createCommandsManager(ShellImpl rootShell, ScriptManager scriptManager, AbstractScriptFactoryFactory scriptFactoryFactory)
protected ShellImpl createRootShell()
protected Shell createShell(ShellImpl rootShell, java.lang.String root)
protected Sigar createSigar()
protected Storage createStorage()
protected IZKClient createZooKeeperClient(java.lang.Object config)
protected ZooKeeperStorage createZooKeeperStorage()
protected java.io.File fetchFile(java.lang.Object fileLocation, java.lang.Object checksum)
java.lang.String getAgentName()
protected long getAgentPid()
java.lang.String getFabric()
protected java.lang.Object getOneWayCodec()
protected java.lang.String getPassword(java.lang.Object config, java.lang.String name)
java.lang.String getPrefix()
protected java.lang.Object getRemoteConfigCodec()
protected java.lang.Object getTwoWayCodec()
java.lang.Object getUrlFactory()
java.lang.String getZookeeperRoot()
void init(java.lang.Object args)
java.io.File loadPersistentProperties(java.util.Properties config, java.util.Properties persistentProperties)
config
- to determine if/where to load the persistent properties from (this object will
*not* be modified by this method)persistentProperties
- will be populated with the persistent propertiesnull
if we should
not store any persistent properties
static void main(java.lang.Object args)
protected java.util.Properties mergeConfig(java.util.Properties higherPriorityConfig, java.util.Properties lowerPriorityConfig)
higherPriority
bucket will override any that are
in the other bucket
void onConnected()
void onDisconnected()
protected java.lang.Object readConfig(java.lang.Object url, java.util.Properties properties)
java.lang.Object registerTerminationHandler()
java.io.File savePersistentProperties(java.lang.Object config, AgentProperties agentProperties)
void setUrlFactory(java.lang.Object urlFactory)
java.lang.Object start()
java.lang.Object start(boolean withTerminationHandler)
java.lang.Object startAndWait()
java.lang.Object startRestServer()
protected void startZooKeeperMonitor()
static java.lang.Object staticReadConfig(java.lang.Object url, java.util.Properties properties)
protected void toCanonicalPath(java.lang.Object config, java.lang.Object name)
protected void toCanonicalPath(java.util.Properties config)
Groovy Documentation