Package com.cloudera.sqoop

Examples of com.cloudera.sqoop.SqoopOptions


    String[] args = {
      "--hcatalog-home",
      "/usr/lib/hcatalog",
    };

    SqoopOptions opts = parseExportArgs(args);
  }
View Full Code Here


    extraArgs.add("--password-file");
    extraArgs.add(passwordFilePath);
    String[] argv = getCommonArgs(false, extraArgs);

    Configuration conf = getConf();
    SqoopOptions in = getSqoopOptions(conf);
    ImportTool importTool = new ImportTool();
    SqoopOptions out = importTool.parseArguments(argv, conf, in, true);
    assertNotNull(out.getPassword());

    // Enable storing passwords in the metastore
    conf.set(SqoopOptions.METASTORE_PASSWORD_KEY, "true");

    // this is what is used to record password into the metastore
    Properties propertiesIntoMetastore = out.writeProperties();

    assertNull(propertiesIntoMetastore.getProperty("db.password"));
    // password-file should NOT be null as it'll be sued to retrieve password
    assertNotNull(propertiesIntoMetastore.getProperty("db.password.file"));

    // load the saved properties and verify
    SqoopOptions optionsFromMetastore = new SqoopOptions();
    optionsFromMetastore.loadProperties(propertiesIntoMetastore);
    assertNotNull(optionsFromMetastore.getPassword());
    assertNotNull(optionsFromMetastore.getPasswordFilePath());
    assertEquals(passwordFilePath, optionsFromMetastore.getPasswordFilePath());
  }
View Full Code Here

    String[] args = {
      "--hcatalog-table",
      "table",
    };

    SqoopOptions opts = parseImportArgs(args);
  }
View Full Code Here

    String[] args = {
      "--hcatalog-table",
      "table",
    };

    SqoopOptions opts = parseExportArgs(args);
  }
View Full Code Here

      "table",
      "--target-dir",
      "/target/dir",
    };
    try {
      SqoopOptions opts = parseImportArgs(args);
      importTool.validateOptions(opts);
      fail("Expected InvalidOptionsException");
    } catch (SqoopOptions.InvalidOptionsException ioe) {
      // expected.
    }
View Full Code Here

      "table",
      "--warehouse-dir",
      "/target/dir",
    };
    try {
      SqoopOptions opts = parseImportArgs(args);
      importTool.validateOptions(opts);
      fail("Expected InvalidOptionsException");
    } catch (SqoopOptions.InvalidOptionsException ioe) {
      // expected.
    }
View Full Code Here

    extraArgs.add("--password-file");
    extraArgs.add(passwordFilePath);
    String[] argv = getCommonArgs(false, extraArgs);

    Configuration conf = getConf();
    SqoopOptions in = getSqoopOptions(conf);
    ImportTool importTool = new ImportTool();
    SqoopOptions out = importTool.parseArguments(argv, conf, in, true);
    assertNotNull(out.getPassword());

    // Enable storing passwords in the metastore
    conf.set(SqoopOptions.METASTORE_PASSWORD_KEY, "false");

    // this is what is used to record password into the metastore
    Properties propertiesIntoMetastore = out.writeProperties();

    assertNull(propertiesIntoMetastore.getProperty("db.password"));
    assertNotNull(propertiesIntoMetastore.getProperty("db.password.file"));

    // load the saved properties and verify
    SqoopOptions optionsFromMetastore = new SqoopOptions();
    optionsFromMetastore.loadProperties(propertiesIntoMetastore);
    assertNotNull(optionsFromMetastore.getPassword());
    assertNotNull(optionsFromMetastore.getPasswordFilePath());
    assertEquals(passwordFilePath, optionsFromMetastore.getPasswordFilePath());
  }
View Full Code Here

      "--hcatalog-table",
      "table",
      "--hive-import",
    };
    try {
      SqoopOptions opts = parseImportArgs(args);
      importTool.validateOptions(opts);
      fail("Expected InvalidOptionsException");
    } catch (SqoopOptions.InvalidOptionsException ioe) {
      // expected.
    }
View Full Code Here

      "table",
      "--export-dir",
      "/export/dir",
    };
    try {
      SqoopOptions opts = parseExportArgs(args);
      exportTool.validateOptions(opts);
      fail("Expected InvalidOptionsException");
    } catch (SqoopOptions.InvalidOptionsException ioe) {
      // expected.
    }
View Full Code Here

      "--hcatalog-table",
      "table",
      "--direct",
    };
    try {
      SqoopOptions opts = parseImportArgs(args);
      importTool.validateOptions(opts);
      fail("Expected InvalidOptionsException");
    } catch (SqoopOptions.InvalidOptionsException ioe) {
      // expected.
    }
View Full Code Here

TOP

Related Classes of com.cloudera.sqoop.SqoopOptions

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.