org.apache.solr.store.hdfs

## Class HdfsLocalityReporter

- java.lang.Object
- - org.apache.solr.store.hdfs.HdfsLocalityReporter

- All Implemented Interfaces:
    SolrInfoMBean

      public class HdfsLocalityReporter
      extends Object
      implements SolrInfoMBean

- - ### Nested Class Summary

    - ### Nested classes/interfaces inherited from interface org.apache.solr.core.SolrInfoMBean

      `SolrInfoMBean.Category`

  - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static String` | `LOCALITY_BLOCKS_LOCAL`
    `static String` | `LOCALITY_BLOCKS_RATIO`
    `static String` | `LOCALITY_BLOCKS_TOTAL`
    `static String` | `LOCALITY_BYTES_LOCAL`
    `static String` | `LOCALITY_BYTES_RATIO`
    `static String` | `LOCALITY_BYTES_TOTAL`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `HdfsLocalityReporter()`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `SolrInfoMBean.Category` | `getCategory()` Purpose of this Class
    `String` | `getDescription()` Simple one or two line description
    `URL[]` | `getDocs()` Documentation URL list.
    `String` | `getName()` Simple common usage name, e.g.
    `String` | `getSource()` CVS Source, SVN Source, etc
    `NamedList` | `getStatistics()` Provide statistics on HDFS block locality, both in terms of bytes and block counts.
    `String` | `getVersion()` Simple common usage version, e.g.
    `void` | `registerDirectory(HdfsDirectory dir)` Add a directory for block locality reporting.
    `void` | `setHost(String hostname)` Set the host name to use when determining locality

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### LOCALITY_BYTES_TOTAL

          public static final String LOCALITY_BYTES_TOTAL

      See Also:
        Constant Field Values

    - #### LOCALITY_BYTES_LOCAL

          public static final String LOCALITY_BYTES_LOCAL

      See Also:
        Constant Field Values

    - #### LOCALITY_BYTES_RATIO

          public static final String LOCALITY_BYTES_RATIO

      See Also:
        Constant Field Values

    - #### LOCALITY_BLOCKS_TOTAL

          public static final String LOCALITY_BLOCKS_TOTAL

      See Also:
        Constant Field Values

    - #### LOCALITY_BLOCKS_LOCAL

          public static final String LOCALITY_BLOCKS_LOCAL

      See Also:
        Constant Field Values

    - #### LOCALITY_BLOCKS_RATIO

          public static final String LOCALITY_BLOCKS_RATIO

      See Also:
        Constant Field Values

  - ### Constructor Detail

    - #### HdfsLocalityReporter

          public HdfsLocalityReporter()

  - ### Method Detail

    - #### setHost

          public void setHost(String hostname)

      Set the host name to use when determining locality
      Parameters:
        `hostname` - The name of this host; should correspond to what HDFS Data Nodes think this is.

    - #### getName

          public String getName()

      Description copied from interface: `SolrInfoMBean`
      Simple common usage name, e.g. BasicQueryHandler, or fully qualified clas name.
      Specified by:
        `getName` in interface `SolrInfoMBean`

    - #### getVersion

          public String getVersion()

      Description copied from interface: `SolrInfoMBean`
      Simple common usage version, e.g. 2.0
      Specified by:
        `getVersion` in interface `SolrInfoMBean`

    - #### getDescription

          public String getDescription()

      Description copied from interface: `SolrInfoMBean`
      Simple one or two line description
      Specified by:
        `getDescription` in interface `SolrInfoMBean`

    - #### getCategory

          public SolrInfoMBean.Category getCategory()

      Description copied from interface: `SolrInfoMBean`
      Purpose of this Class
      Specified by:
        `getCategory` in interface `SolrInfoMBean`

    - #### getSource

          public String getSource()

      Description copied from interface: `SolrInfoMBean`
      CVS Source, SVN Source, etc
      Specified by:
        `getSource` in interface `SolrInfoMBean`

    - #### getDocs

          public URL[] getDocs()

      Description copied from interface: `SolrInfoMBean`
      Documentation URL list.

      Suggested documentation URLs: Homepage for sponsoring project, FAQ on class usage, Design doc for class, Wiki, bug reporting URL, etc...

      Specified by:
        `getDocs` in interface `SolrInfoMBean`

    - #### getStatistics

          public NamedList getStatistics()

      Provide statistics on HDFS block locality, both in terms of bytes and block counts.
      Specified by:
        `getStatistics` in interface `SolrInfoMBean`

    - #### registerDirectory

          public void registerDirectory(HdfsDirectory dir)

      Add a directory for block locality reporting. This directory will continue to be checked until its close method has been called.
      Parameters:
        `dir` - The directory to keep metrics on.

Copyright © 2000-2016 Apache Software Foundation. All Rights Reserved.