Class LocalityDomain


  • public class LocalityDomain
    extends java.lang.Object
    A representation of the Locality Groups for a single Solaris instance.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static int LGRP_VIEW_CALLER
      Obtain a Locality Group snapshot based on the view available to the caller.
      static int LGRP_VIEW_OS
      Obtain a Locality Group snapshot based on the view of the Operating System.
    • Constructor Summary

      Constructors 
      Constructor Description
      LocalityDomain​(int view)
      Constructor.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void close()
      Close this LocalityDomain.
      protected void finalize()
      Reclaim the resource allocated by the C proxy.
      java.util.Set foreignGroups​(java.util.Set exclude, java.util.List cpus)
      Return the groups in this domain to which the supplied cpus belong, excluding the supplied set of groups.
      LocalityGroup getGroup​(int cpuid)
      Return the LocalityGroup containing the supplied CPU id.
      java.util.Set getGroups()
      Return the set of all LocalityGroups for this LocalityDomain.
      int getMaxLatency()
      Return the maximum possible latency between all locality groups in this domain.
      LocalityGroup getRepresentativeGroup​(java.util.List cpus)
      Return the locality group which contains the majority of the cpus in the supplied list.
      LocalityGroup getRoot()
      Return the "root" LocalityGroup.
      java.lang.String toString()
      Return a string representation of this instance.
      • Methods inherited from class java.lang.Object

        clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Field Detail

      • LGRP_VIEW_CALLER

        public static final int LGRP_VIEW_CALLER
        Obtain a Locality Group snapshot based on the view available to the caller.
        See Also:
        Constant Field Values
      • LGRP_VIEW_OS

        public static final int LGRP_VIEW_OS
        Obtain a Locality Group snapshot based on the view of the Operating System.
        See Also:
        Constant Field Values
    • Constructor Detail

      • LocalityDomain

        public LocalityDomain​(int view)
                       throws java.lang.Exception
        Constructor.
        Parameters:
        view - to use when creating the LocalityDomain.
        Throws:
        java.lang.Exception - if there is a problem initializing the lgrp snapshot.
    • Method Detail

      • finalize

        protected void finalize()
                         throws java.lang.Throwable
        Reclaim the resource allocated by the C proxy.
        Overrides:
        finalize in class java.lang.Object
        Throws:
        java.lang.Throwable - if there is a problem reclaiming the reosurces.
      • getRoot

        public LocalityGroup getRoot()
        Return the "root" LocalityGroup.
      • close

        public void close()
        Close this LocalityDomain. Resources are reclaimed in the C proxy and this LocalityDomain should never be used again. None of the LocalityGroups which are referenced from this LocalityDomain should be used after this method is invoked. NB: jl_fini returns a success indicator which is ignored as we are closing this domain.
      • toString

        public java.lang.String toString()
        Return a string representation of this instance.
        Overrides:
        toString in class java.lang.Object
      • foreignGroups

        public java.util.Set foreignGroups​(java.util.Set exclude,
                                           java.util.List cpus)
                                    throws PoolsException
        Return the groups in this domain to which the supplied cpus belong, excluding the supplied set of groups.
        Parameters:
        exclude - Set of groups to be excluded.
        cpus - List of cpus
        Throws:
        PoolsException - if there is an error accessing the cpu details.
      • getRepresentativeGroup

        public LocalityGroup getRepresentativeGroup​(java.util.List cpus)
                                             throws PoolsException
        Return the locality group which contains the majority of the cpus in the supplied list. If more than one group satisfies this criteria, then the choice of group is deterministic but unspecified.
        Parameters:
        cpus - List of cpus to be examined.
        Throws:
        PoolsException - if there is an error accessing the cpu details.
      • getMaxLatency

        public int getMaxLatency()
        Return the maximum possible latency between all locality groups in this domain.
      • getGroups

        public java.util.Set getGroups()
        Return the set of all LocalityGroups for this LocalityDomain.
      • getGroup

        public LocalityGroup getGroup​(int cpuid)
        Return the LocalityGroup containing the supplied CPU id. Search all LocalityGroups starting at the root group.
        Parameters:
        cpuid - is the sys-id of the CPU to search for.