<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>question Re: How to create/update Sqoop Jobs in Java? in Archives of Support Questions (Read Only)</title>
    <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/How-to-create-update-Sqoop-Jobs-in-Java/m-p/126907#M22879</link>
    <description>&lt;P&gt;This should do it:&lt;/P&gt;&lt;PRE&gt;/** 
 * If this is an incremental import then we save the user's state back to the metastore
*/

private void saveIncrementalState(SqoopOptions options) throws IOException {
  if (!isIncremental(options)) {
    return;
  }
  Map&amp;lt;String,String&amp;gt; descriptor=options.getStorageDescriptor();
  String jobName=options.getJobName();
  if (null != jobName &amp;amp;&amp;amp; null != descriptor) {
    LOG.info("Saving incremental import state to the metastore");
    JobStorageFactory ssf=new JobStorageFactory(options.getConf());
    JobStorage storage=ssf.getJobStorage(descriptor);
    storage.open(descriptor);
    try {
      JobData data=new JobData(options.getParent(),this);
      storage.update(jobName,data);
      LOG.info("Updated data for job: " + jobName);
    }
  finally {
      storage.close();
    }
  }

}&lt;/PRE&gt;</description>
    <pubDate>Fri, 25 Mar 2016 13:42:06 GMT</pubDate>
    <dc:creator>egarelnabi</dc:creator>
    <dc:date>2016-03-25T13:42:06Z</dc:date>
    <item>
      <title>How to create/update Sqoop Jobs in Java?</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/How-to-create-update-Sqoop-Jobs-in-Java/m-p/126906#M22878</link>
      <description>&lt;P&gt;I am developing a Java program that uses the Apache Sqoop Metastore API to complete full and incremental loads.  I would like to store job details such as the check column in the job.  Is there an example leveraging this API to illustrate?&lt;/P&gt;</description>
      <pubDate>Tue, 15 Mar 2016 04:03:20 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/How-to-create-update-Sqoop-Jobs-in-Java/m-p/126906#M22878</guid>
      <dc:creator>ltsimps1</dc:creator>
      <dc:date>2016-03-15T04:03:20Z</dc:date>
    </item>
    <item>
      <title>Re: How to create/update Sqoop Jobs in Java?</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/How-to-create-update-Sqoop-Jobs-in-Java/m-p/126907#M22879</link>
      <description>&lt;P&gt;This should do it:&lt;/P&gt;&lt;PRE&gt;/** 
 * If this is an incremental import then we save the user's state back to the metastore
*/

private void saveIncrementalState(SqoopOptions options) throws IOException {
  if (!isIncremental(options)) {
    return;
  }
  Map&amp;lt;String,String&amp;gt; descriptor=options.getStorageDescriptor();
  String jobName=options.getJobName();
  if (null != jobName &amp;amp;&amp;amp; null != descriptor) {
    LOG.info("Saving incremental import state to the metastore");
    JobStorageFactory ssf=new JobStorageFactory(options.getConf());
    JobStorage storage=ssf.getJobStorage(descriptor);
    storage.open(descriptor);
    try {
      JobData data=new JobData(options.getParent(),this);
      storage.update(jobName,data);
      LOG.info("Updated data for job: " + jobName);
    }
  finally {
      storage.close();
    }
  }

}&lt;/PRE&gt;</description>
      <pubDate>Fri, 25 Mar 2016 13:42:06 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/How-to-create-update-Sqoop-Jobs-in-Java/m-p/126907#M22879</guid>
      <dc:creator>egarelnabi</dc:creator>
      <dc:date>2016-03-25T13:42:06Z</dc:date>
    </item>
  </channel>
</rss>

