Community Articles
Find and share helpful community-sourced technical articles.
Labels (1)

while running the sqoop command from the java program with -verbose option can result into race condition during obtaining lock on the console appender.we can workaround this with the help of SSHXCUTE framework which will create java program and sqoop command context separately.

ENV: HDP 2.4

Java Version : JDK-8

Step 1: download sshxcute jar from

Step 2: Create

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);          
    CustomTask sqoopCommand = new ExecCommand("sqoop import -Dorg.apache.sqoop.splitter.allow_text_splitter=true  
                                     --connect jdbc:oracle:thin:@ 
                                              --table TEST_INCREMENTAL -m 1 --username system 
                                              --password oracle --target-dir 

Step 3: compile program

javac -cp sshxcute-1.0.jar

Step 4: Run program

java -cp sshxcute-1.0.jar RunSqoopCommand

Take a Tour of the Community
Don't have an account?
Your experience may be limited. Sign in to explore more.
Version history
Last update:
‎12-20-2016 02:19 PM
Updated by:
Top Kudoed Authors
; ;