Class 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 a CompositeClusterManager and ClusterParticipant. 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 a CompositeClusterManager.
      java.util.List<com.github.ambry.clustermap.ClusterParticipant> getClusterParticipants()  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • 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 - the ClusterMapConfig 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 a CompositeClusterManager.
        Specified by:
        getClusterMap in interface com.github.ambry.clustermap.ClusterAgentsFactory
        Returns:
        the constructed CompositeClusterManager.
        Throws:
        java.lang.Exception - if constructing the underlying StaticClusterManager or the HelixClusterManager 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 interface com.github.ambry.clustermap.ClusterAgentsFactory
        Throws:
        java.io.IOException