Ticket #4916 (closed: fixed)

Opened 9 years ago

Last modified 5 years ago

FileFinder makeover

Reported by: Peter Peterson Owned by: Shelly Ren
Priority: major Milestone: Release 2.1
Component: Mantid Keywords:
Cc: Blocked By:
Blocking: Tester: Vickie Lynch

Description

FileFinder has various bugs and optimizations and this is the ticket describing them. The goal is to have the current system, working faster, squashing bugs, and easier to understand/debug. Generically the new version should implement a method FileFinder::findFullPath which uses the existing FileFinder::getFullPath and IArchiveSearch. This should also used to replace all usage of FileFinder::findRun once it is deemed working correctly. The new method will still take a "hint" and vector of extensions.

Behavior:

  • If the hint ends with one of the supplied extensions, call getFullPath and return the result if it is non-empty. If that fails call the IArchiveSearch and return the result whether it is empty or not.
  • Otherwise work harder
    1. Put together a list of possible filenames. This should try just adding the various extensions supplied to the hint as well as try different case mixtures (i.e. uppercase hint with uppercase extension, uppercase hint with lowercase extension, ...). Care should be taken to not repeat filenames that are already in the list of cases to try.
    2. Use getFullPath with all of these cases.
    3. Use IArchiveSearch with all of these cases.
    4. All else fails return an empty string.

Special note:

  • Currently IArchiveSearch is only used for extensions found in facilities.xml, but it desirable to always use it.
  • The extensions in the facilities.xml should not be added to expand the list of potential cases. The load algorithm, when it supplies extensions, knows what it understands better than facilities.xml.

Change History

comment:1 Changed 8 years ago by Shelly Ren

Refs #4916 -- added findFullPath() to optimize the fileFinder

Changeset: cb853c5ed956368782a2e41ac129dd81f4bb5e9b

comment:2 Changed 8 years ago by Shelly Ren

Refs #4916 -- added findFullPath() to optimize the fileFinder

Changeset: 0718789d57bbb09182aaa10c3d0e72a12565c43e

comment:3 Changed 8 years ago by Shelly Ren

Refs #4916 -- temporarily calls findRun inside findRuns

Changeset: 8e161ec5941f454fdd1d533129f2c5c8fea38747

comment:4 Changed 8 years ago by Shelly Ren

Refs #4916 -- fixed file extensions

Changeset: 3b35efd489459c0ca1cf3cb26c30c680158ec716

comment:5 Changed 8 years ago by Shelly Ren

Created a new method FileFinder::findFullPath() to optimize the file finding process. The new method will eventually replace the existing FileFinder::findRun() method.

The new method will first check to see if the user submitted search key looks like a full filename. If it does, it will attempt a full path search. If it's not found in the directory search, it will try an archive search (For SNS, it will try icat2, then orbiter).

If a file path is found from the search above, the new method will construct a list of extensions supplied by users or algorithms. It will loop through the list of possible constructed filenames, and will try directory search, then archive search.

If a file path still can't be found or the extensions are not supplied by users or algorithms, the new method will fetch a list of extensions from the Facility.xml file. Again, it will loop through the list of possible constructed filenames ,and try directory search, then archive search.

comment:6 Changed 8 years ago by Shelly Ren

Refs #4916 -- caught exception in FileFinder thrown by archive

Changeset: 6f2058da140e7f7980725fa49a67780dc7f3abba

comment:7 Changed 8 years ago by Shelly Ren

Refs #4916 -- Changed log from error to info in archive

If the run number doesn't exist, and therefore can not be found in the archive. Some systme (such as OS Ubuntu 10.04) would throw POCO::IOException. Users would see lots of errors in that case. Change the log level to info would ease the problem of overwhelming users.

Changeset: 81d8af8295b0d9436befd2a87d767e74306bd8c5

comment:8 Changed 8 years ago by Shelly Ren

Refs #4916 -- Changed log from error to info in archive

If the run number doesn't exist, and therefore can not be found in the archive. Some systme (such as OS Ubuntu 10.04) would throw POCO::IOException. Users would see lots of errors in that case. Change the log level to info would ease the problem of overwhelming users.

Changeset: 81d8af8295b0d9436befd2a87d767e74306bd8c5

comment:9 Changed 8 years ago by Shelly Ren

Refs #4916 -- back to the original method name findRun()

Changeset: 1fc6ffeba5a3063c60efc858294d3d38095503bd

comment:10 Changed 8 years ago by Shelly Ren

Refs #4916 -- Revised findRun(CSp78173.Raw) test case

Changeset: a1dfbccdf3fbad71e606277d79cd978d5d44033a

comment:11 Changed 8 years ago by Shelly Ren

Refs #4916 -- back to the original method name findRun()

Changeset: 1fc6ffeba5a3063c60efc858294d3d38095503bd

comment:12 Changed 8 years ago by Shelly Ren

Refs #4916 -- Revised findRun(CSp78173.Raw) test case

Changeset: a1dfbccdf3fbad71e606277d79cd978d5d44033a

comment:13 Changed 8 years ago by Shelly Ren

Refs #4916 -- add a new method getCaseSensitive()

Added new logics to not transfer filename to upper case or lower case if the caseSensive is set true.

Changeset: 3bc2eaab33ebf6f5bb61a7c6626c0274cc1afbfc

comment:14 Changed 8 years ago by Shelly Ren

Refs #4916 -- Added a new unit test case in FileFinderTest.h

Added a new unit test case to testFindFileCaseSensitive() in the FileFinderTest.h class; Changer the interator increment in the for loop from it++ to ++it.

Changeset: 3c330d70ae22b8f0aef09db81c1bc0b29b89e371

comment:15 Changed 8 years ago by Shelly Ren

Refs #4916 -- add a new method getCaseSensitive()

Added new logics to not transfer filename to upper case or lower case if the caseSensive is set true.

Changeset: 3bc2eaab33ebf6f5bb61a7c6626c0274cc1afbfc

comment:16 Changed 8 years ago by Shelly Ren

Refs #4916 -- Added a new unit test case in FileFinderTest.h

Added a new unit test case to testFindFileCaseSensitive() in the FileFinderTest.h class; Changer the interator increment in the for loop from it++ to ++it.

Changeset: 3c330d70ae22b8f0aef09db81c1bc0b29b89e371

comment:17 Changed 8 years ago by Shelly Ren

  • Status changed from new to accepted

comment:18 Changed 8 years ago by Shelly Ren

  • Status changed from accepted to verify
  • Resolution set to fixed

comment:19 Changed 8 years ago by Peter Parker

  • Status changed from verify to verifying
  • Tester set to Peter Parker

comment:20 Changed 8 years ago by Peter Parker

  • Status changed from verifying to verify
  • Tester Peter Parker deleted

comment:21 Changed 8 years ago by Vickie Lynch

  • Status changed from verify to verifying
  • Tester set to Vickie Lynch

comment:22 Changed 8 years ago by Vickie Lynch

  • Status changed from verifying to closed

Tested on analysis.sns.gov and all files loaded with hint

comment:23 Changed 5 years ago by Stuart Campbell

This ticket has been transferred to github issue 5762

Note: See TracTickets for help on using tickets.