sqoop-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From szvasas <...@git.apache.org>
Subject [GitHub] sqoop pull request #38: Metastore
Date Wed, 02 Aug 2017 08:24:24 GMT
Github user szvasas commented on a diff in the pull request:

    https://github.com/apache/sqoop/pull/38#discussion_r130812016
  
    --- Diff: src/java/org/apache/sqoop/tool/JobTool.java ---
    @@ -369,6 +366,61 @@ public void applyOptions(CommandLine in, SqoopOptions out)
         }
       }
     
    +  private void applyMetastoreOptions(CommandLine in, SqoopOptions out) throws InvalidOptionsException
{
    +    String metaConnectString;
    +    String metaUsernameString;
    +    String metaPasswordString;
    +    if (in.hasOption(STORAGE_METASTORE_ARG)) {
    +      metaConnectString = in.getOptionValue(STORAGE_METASTORE_ARG);
    +      this.storageDescriptor.put(GenericJobStorage.META_DRIVER_KEY, chooseDriverType(metaConnectString));
    +      this.storageDescriptor.put(GenericJobStorage.META_CONNECT_KEY, metaConnectString);
    +    } else {
    +      metaConnectString = out.getMetaConnectStr();
    +      this.storageDescriptor.put(GenericJobStorage.META_DRIVER_KEY, chooseDriverType(metaConnectString));
    +      this.storageDescriptor.put(GenericJobStorage.META_CONNECT_KEY, metaConnectString);
    +    }
    +    if (in.hasOption(METASTORE_USER_ARG)) {
    +      metaUsernameString = in.getOptionValue(METASTORE_USER_ARG);
    +      this.storageDescriptor.put(GenericJobStorage.META_USERNAME_KEY, metaUsernameString);
    +    } else {
    +      metaUsernameString = out.getMetaUsername();
    +      this.storageDescriptor.put(GenericJobStorage.META_USERNAME_KEY, metaUsernameString);
    +    }
    +    if (in.hasOption(METASTORE_PASS_ARG)) {
    +      metaPasswordString = in.getOptionValue(METASTORE_PASS_ARG);
    +      this.storageDescriptor.put(GenericJobStorage.META_PASSWORD_KEY, metaPasswordString);
    +    } else {
    +      metaPasswordString = out.getMetaPassword();
    +      this.storageDescriptor.put(GenericJobStorage.META_PASSWORD_KEY, metaPasswordString);
    +    }
    +  }
    +
    +  public static String chooseDriverType(String metaConnectString) throws InvalidOptionsException
{
    --- End diff --
    
    This method should be private and non-static since it is only used in this class.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

Mime
View raw message