Package com.github.ambry.clustermap
Class CompositeClusterAgentsFactory
- java.lang.Object
-
- com.github.ambry.clustermap.CompositeClusterAgentsFactory
-
- All Implemented Interfaces:
com.github.ambry.clustermap.ClusterAgentsFactory
public class CompositeClusterAgentsFactory extends java.lang.Object implements com.github.ambry.clustermap.ClusterAgentsFactory
A factory that creates aCompositeClusterManager
andClusterParticipant
. Only one instance of each type of objects will ever be created by this factory.
-
-
Constructor Summary
Constructors Constructor Description CompositeClusterAgentsFactory(com.github.ambry.config.ClusterMapConfig clusterMapConfig, java.lang.String hardwareLayoutFilePath, java.lang.String partitionLayoutFilePath)
Create an instance of this class.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description com.github.ambry.clustermap.CompositeClusterManager
getClusterMap()
Create and return aCompositeClusterManager
.java.util.List<com.github.ambry.clustermap.ClusterParticipant>
getClusterParticipants()
-
-
-
Constructor Detail
-
CompositeClusterAgentsFactory
public CompositeClusterAgentsFactory(com.github.ambry.config.ClusterMapConfig clusterMapConfig, java.lang.String hardwareLayoutFilePath, java.lang.String partitionLayoutFilePath) throws org.json.JSONException, java.io.IOException
Create an instance of this class.- Parameters:
clusterMapConfig
- theClusterMapConfig
to use.hardwareLayoutFilePath
- the path to the hardware layout file.partitionLayoutFilePath
- the path to the partition layout file.- Throws:
org.json.JSONException
- if there is an exception parsing the layout files.java.io.IOException
- if there is an IO error accessing or reading the layout files.
-
-
Method Detail
-
getClusterMap
public com.github.ambry.clustermap.CompositeClusterManager getClusterMap() throws java.io.IOException
Create and return aCompositeClusterManager
.- Specified by:
getClusterMap
in interfacecom.github.ambry.clustermap.ClusterAgentsFactory
- Returns:
- the constructed
CompositeClusterManager
. - Throws:
java.lang.Exception
- if constructing the underlyingStaticClusterManager
or theHelixClusterManager
throws an Exception.java.io.IOException
-
getClusterParticipants
public java.util.List<com.github.ambry.clustermap.ClusterParticipant> getClusterParticipants() throws java.io.IOException
- Specified by:
getClusterParticipants
in interfacecom.github.ambry.clustermap.ClusterAgentsFactory
- Throws:
java.io.IOException
-
-