java program to run Sqoop Command using google SSHXCUTE framework
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import net.neoremind.sshxcute.core.SSHExec; | |
import net.neoremind.sshxcute.core.ConnBean; | |
import net.neoremind.sshxcute.task.CustomTask; | |
import net.neoremind.sshxcute.task.impl.ExecCommand; | |
public class RunSqoopCommand { | |
public static void main(String args[]) throws Exception{ | |
ConnBean cb = new ConnBean("localhost", "root","hadoop"); | |
SSHExec ssh = SSHExec.getInstance(cb); | |
ssh.connect(); | |
CustomTask sqoopCommand = new ExecCommand("sqoop import -Dorg.apache.sqoop.splitter.allow_text_splitter=true | |
-Dmapred.job.name=test --connect jdbc:oracle:thin:@10.0.2.12:1521:XE | |
--table TEST_INCREMENTAL -m 1 --username system | |
--password oracle --target-dir | |
/tmp/test26 | |
--verbose"); | |
ssh.exec(sqoopCommand); | |
ssh.disconnect(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment