How to get the work counter with sqoop 1.4.4 java api?

I use Sqoop 1.4.4 and its java api to start import work, and I have Unable to figure out how to access job counters after import is completed. I see suitable methods in the ConfigurationHelper class, for example getNumMapOutputRecords, but I'm not sure how to pass the work to them.

Is there a way to get a job from SqoopTool or Sqoop objects?

My code looks something like this:

SqoopTool sqoopTool = new ImportTool(); SqoopOptions options = new SqoopOptions(); options.setConnectString(connectString); options.setUsername(username); options.setPassword(password); options.setTableName(table); options.setColumns(columns); options.setWhereClause(whereClause); options.setTargetDir(targetDir); options.setNumMappers(1); options.setFileLayout(FileLayout.TextFile); options.setFieldsTerminatedBy(delimiter); Configuration config = new Configuration(); config.set("oracle.sessionTimeZone", timezone.getID()); System.setProperty(Sqoop.SQOOP_RETHROW_PROPERTY, "1"); Sqoop sqoop = new Sqoop(sqoopTool, config, options); String[] nullArgs = new String[0]; Sqoop.runSqoop(sqoop, nullArgs); 
+4
source share

Source: https://habr.com/ru/post/1495791/


All Articles