Groovy Documentation

org.linkedin.glu.orchestration.engine.fabric
[Groovy] Class FabricServiceImpl

java.lang.Object
  org.linkedin.glu.orchestration.engine.fabric.FabricServiceImpl
All Implemented Interfaces:
Destroyable, FabricService

class FabricServiceImpl

This service will manage fabrics

Authors:
ypujante@linkedin.com


Field Summary
static java.lang.String MODULE

static Logger log

 
Property Summary
ConfigurableFactory configurableFactory

FabricStorage fabricStorage

java.lang.String prefix

Timespan zkClientWaitForStartTimeout

java.lang.String zookeeperAgentsFabricRoot

 
Method Summary
boolean clearAgentFabric(java.lang.String agentName, java.lang.String fabricName)

Clears the fabric for the given agent (from ZooKeeper)

protected java.lang.String computeZKAgentsFabricPath(java.lang.String agentName)

protected java.lang.String computeZKAgentsPath(java.lang.String agentName)

void configureAgent(java.net.InetAddress host, java.lang.String fabricName)

Configures the agent on the given host (builds a default config url)

void configureAgent(java.net.URI agentConfigURI, java.lang.String fabricName)

Configures the agent given its configuration URI

void destroy()

Fabric findFabric(java.lang.String fabricName)

@return the fabric or null

java.util.Map getAgents()

@return a map where the key is the agent name and the value is the fabric name the agent belongs (as defined in ZooKeeper)

java.util.Collection getFabrics()

@return a collection of all the fabrics known by the service (cached list)

boolean isConnected(java.lang.String fabricName)

java.util.Collection listFabricNames()

@return the list of fabric names

void resetCache()

resets the fabrics cache which will force the connection to ZooKeeper to be dropped.

void setAgentFabric(java.lang.String agentName, java.lang.String fabricName)

Sets the fabric for the given agent: write it in ZooKeeper

java.lang.Object withZkClient(java.lang.String fabricName, groovy.lang.Closure closure)

Executes the closure with the ZooKeeper connection (instance of IZKClient) associated to the fabric

 
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

MODULE

public static final java.lang.String MODULE


log

public static final Logger log


 
Property Detail

configurableFactory

@Initializable
ConfigurableFactory configurableFactory


fabricStorage

@Initializable(required = true)
FabricStorage fabricStorage


prefix

@Initializable
java.lang.String prefix


zkClientWaitForStartTimeout

@Initializable
Timespan zkClientWaitForStartTimeout


zookeeperAgentsFabricRoot

@Initializable
java.lang.String zookeeperAgentsFabricRoot


 
Method Detail

clearAgentFabric

boolean clearAgentFabric(java.lang.String agentName, java.lang.String fabricName)
Clears the fabric for the given agent (from ZooKeeper)


computeZKAgentsFabricPath

protected java.lang.String computeZKAgentsFabricPath(java.lang.String agentName)


computeZKAgentsPath

protected java.lang.String computeZKAgentsPath(java.lang.String agentName)


configureAgent

void configureAgent(java.net.InetAddress host, java.lang.String fabricName)
Configures the agent on the given host (builds a default config url)


configureAgent

void configureAgent(java.net.URI agentConfigURI, java.lang.String fabricName)
Configures the agent given its configuration URI


destroy

void destroy()


findFabric

Fabric findFabric(java.lang.String fabricName)
Returns:
the fabric or null


getAgents

java.util.Map getAgents()
Returns:
a map where the key is the agent name and the value is the fabric name the agent belongs (as defined in ZooKeeper)


getFabrics

java.util.Collection getFabrics()
Returns:
a collection of all the fabrics known by the service (cached list)


isConnected

@Override
boolean isConnected(java.lang.String fabricName)


listFabricNames

java.util.Collection listFabricNames()
Returns:
the list of fabric names


resetCache

void resetCache()
resets the fabrics cache which will force the connection to ZooKeeper to be dropped.


setAgentFabric

void setAgentFabric(java.lang.String agentName, java.lang.String fabricName)
Sets the fabric for the given agent: write it in ZooKeeper


withZkClient

java.lang.Object withZkClient(java.lang.String fabricName, groovy.lang.Closure closure)
Executes the closure with the ZooKeeper connection (instance of IZKClient) associated to the fabric
Returns:
whatever the closure returns


 

Groovy Documentation