Uploaded image for project: 'Sqoop'
  1. Sqoop
  2. SQOOP-3218

Make sure the original ClassLoader is restored when running HCatalog tests

    XMLWordPrintableJSON

    Details

    • Type: Improvement
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 1.5.0
    • Component/s: None
    • Labels:
      None

      Description

      When Sqoop runs in test mode it creates another ClassLoader that loads from the generated JAR file in addition to everything else currently on the classpath (see: com.cloudera.sqoop.util.ClassLoaderStack#addJarFile) so it is dependent of Thread.currentThread().getContextClassLoader() value.
      However in HCatalog test cases Sqoop invokes org.apache.hive.hcatalog.cli.HCatCli#main method directly in process (org.apache.sqoop.mapreduce.hcat.SqoopHCatUtilities#executeHCatProgramInProcess) which can override the contextClassLoader in the current thread and cause the tests to fail.

      The task is to improve org.apache.sqoop.mapreduce.hcat.SqoopHCatUtilities#executeHCatProgramInProcess to make sure that the class loader used before invoking HCatCli is restored after the main method of the CLI is finished.

        Attachments

        1. SQOOP-3218.patch
          4 kB
          Vasas Szabolcs

          Issue Links

            Activity

              People

              • Assignee:
                vasas Vasas Szabolcs
                Reporter:
                vasas Vasas Szabolcs
              • Votes:
                0 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: