Solr
  1. Solr
  2. SOLR-8351

Improve HdfsDirectory and HdfsLock toString representation

    Details

    • Type: Improvement Improvement
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 5.5, 6.0
    • Component/s: None
    • Labels:
      None

      Description

      HdfsDirectory's toString is used in logging by the DeletionPolicy and SnapPuller (and probably others). It would be useful to match what FSDirectory does, and print the directory it refers to.

      1. SOLR-8351.patch
        1 kB
        Gregory Chanan
      2. SOLR-8351.patch
        1 kB
        Mike Drob

        Activity

        Hide
        Mike Drob added a comment -

        Patch that adds directory to HdfsDirectory. Also changes LockFactory to use simple name instead of full class name.

        Show
        Mike Drob added a comment - Patch that adds directory to HdfsDirectory. Also changes LockFactory to use simple name instead of full class name.
        Hide
        Mike Drob added a comment -

        It occurs to me that there might be some value in providing another abstract directory that both FSDirectory and HdfsDirectory could inherit from that would take care of any common functionality that they have. That's a more invasive fix and I'm not sure if that would impact usage of either one of them significantly.

        Show
        Mike Drob added a comment - It occurs to me that there might be some value in providing another abstract directory that both FSDirectory and HdfsDirectory could inherit from that would take care of any common functionality that they have. That's a more invasive fix and I'm not sure if that would impact usage of either one of them significantly.
        Hide
        Gregory Chanan added a comment -

        I added a toString to HdfsLock to match what's in NativeFsLock, since that seems in spirit with what this patch is doing.

        I also removed the change to LockFactory – it feels weird to clutter a simple interface declaration with toString implementation details. I'm not against the log message changing, though. Perhaps the correct place to do that is in a derivation on the LockFactories/Locks similar to what you are suggesting with the Directories. That should probably be done in a separate jira though.

        Let me know what you think Mike Drob.

        Show
        Gregory Chanan added a comment - I added a toString to HdfsLock to match what's in NativeFsLock, since that seems in spirit with what this patch is doing. I also removed the change to LockFactory – it feels weird to clutter a simple interface declaration with toString implementation details. I'm not against the log message changing, though. Perhaps the correct place to do that is in a derivation on the LockFactories/Locks similar to what you are suggesting with the Directories. That should probably be done in a separate jira though. Let me know what you think Mike Drob .
        Hide
        Mike Drob added a comment -

        LGTM. Updated issue summary to better capture what we're doing.

        Show
        Mike Drob added a comment - LGTM. Updated issue summary to better capture what we're doing.
        Hide
        ASF subversion and git services added a comment -

        Commit 1717344 from gchanan@apache.org in branch 'dev/trunk'
        [ https://svn.apache.org/r1717344 ]

        SOLR-8351: Improve HdfsDirectory toString representation

        Show
        ASF subversion and git services added a comment - Commit 1717344 from gchanan@apache.org in branch 'dev/trunk' [ https://svn.apache.org/r1717344 ] SOLR-8351 : Improve HdfsDirectory toString representation
        Hide
        ASF subversion and git services added a comment -

        Commit 1717345 from gchanan@apache.org in branch 'dev/branches/branch_5x'
        [ https://svn.apache.org/r1717345 ]

        SOLR-8351: Improve HdfsDirectory toString representation

        Show
        ASF subversion and git services added a comment - Commit 1717345 from gchanan@apache.org in branch 'dev/branches/branch_5x' [ https://svn.apache.org/r1717345 ] SOLR-8351 : Improve HdfsDirectory toString representation

          People

          • Assignee:
            Gregory Chanan
            Reporter:
            Mike Drob
          • Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development