Uploaded image for project: 'Geode'
  1. Geode
  2. GEODE-6825

Specify workingDirectory when creating GMSLocator

    XMLWordPrintableJSON

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 1.10.0
    • Component/s: locator
    • Labels:
      None

      Description

      I want to be able to specify the workingDirectory when constructing a GMSLocator which will then be used for the location of the locator view files (locator<pid>view.dat). Tests would use the TemporaryFolder JUnit Rule to specify a workingDirectory for the location of the locator view files. This will eliminate the potential for file system pollution of locator view files and guarantee better cleanup especially when running tests from an IDE.

      Default value for workingDirectory is System.getProperty("user.dir").

      At first, I intend to use this from tests that use LocatorLauncher. The full path from LocatorLauncher to GMSLocator is:

      LocatorLauncher.start()
      -> InternalLocator.startLocator(int, File, InternalLogWriter, InternalLogWriter, InetAddress, boolean, Properties, String)
      -> InternalLocator.startPeerLocation()
      -> MemberFactory.newLocatorHandler(InetAddress, String, boolean, boolean, LocatorStats, String)
      -> GMSMemberFactory.newLocatorHandler(InetAddress, String, boolean, boolean, LocatorStats, String)
      -> GMSLocator.GMSLocator(InetAddress, String, boolean, boolean, LocatorStats, String)

      Proposed implementation is to add a String field and constructor parameter for the absolute workingDirectory path to these classes:

      • InternalLocator
      • GMSLocator

      And, finally the following methods would have a new String parameter for workingDirectory added to them:

      • InternalLocator.startLocator(int, File, InternalLogWriter, InternalLogWriter, InetAddress, boolean, Properties, String, String)
      • MemberFactory.newLocatorHandler(InetAddress, String, boolean, boolean, LocatorStats, String, String)
      • GMSMemberFactory.newLocatorHandler(InetAddress, String, boolean, boolean, LocatorStats, String, String)

        Attachments

          Activity

            People

            • Assignee:
              klund Kirk Lund
              Reporter:
              klund Kirk Lund
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Time Tracking

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0h
                0h
                Logged:
                Time Spent - 2h
                2h