sqoop-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jar...@apache.org
Subject svn commit: r1662605 [4/10] - in /sqoop/site/trunk/content/resources/docs/1.99.5: ./ _sources/ _static/ css/ images/ images/logos/
Date Fri, 27 Feb 2015 00:59:17 GMT
Added: sqoop/site/trunk/content/resources/docs/1.99.5/Sqoop5MinutesDemo.html
URL: http://svn.apache.org/viewvc/sqoop/site/trunk/content/resources/docs/1.99.5/Sqoop5MinutesDemo.html?rev=1662605&view=auto
==============================================================================
--- sqoop/site/trunk/content/resources/docs/1.99.5/Sqoop5MinutesDemo.html (added)
+++ sqoop/site/trunk/content/resources/docs/1.99.5/Sqoop5MinutesDemo.html Fri Feb 27 00:59:16 2015
@@ -0,0 +1,267 @@
+
+
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+
+<html xmlns="http://www.w3.org/1999/xhtml">
+  <head>
+    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+    
+    <title>Sqoop 5 Minutes Demo &mdash; Apache Sqoop  documentation</title>
+    
+    <link rel="stylesheet" href="_static/haiku.css" type="text/css" />
+    <link rel="stylesheet" href="_static/pygments.css" type="text/css" />
+    <link rel="stylesheet" href="_static/print.css" type="text/css" />
+    
+    <script type="text/javascript">
+      var DOCUMENTATION_OPTIONS = {
+        URL_ROOT:    '',
+        VERSION:     '',
+        COLLAPSE_INDEX: false,
+        FILE_SUFFIX: '.html',
+        HAS_SOURCE:  true
+      };
+    </script>
+    <script type="text/javascript" src="_static/jquery.js"></script>
+    <script type="text/javascript" src="_static/underscore.js"></script>
+    <script type="text/javascript" src="_static/doctools.js"></script>
+    <script type="text/javascript" src="_static/theme_extras.js"></script>
+    <link rel="top" title="Apache Sqoop  documentation" href="index.html" /> 
+  </head>
+  <body>
+      <div class="header"><img class="rightlogo" src="_static/sqoop-logo.png" alt="Logo"/><h1 class="heading"><a href="index.html">
+          <span>Apache Sqoop  documentation</span></a></h1>
+        <h2 class="heading"><span>Sqoop 5 Minutes Demo</span></h2>
+      </div>
+      <div class="topnav">
+      
+        <p>
+        <a class="uplink" href="index.html">Contents</a>
+        </p>
+
+      </div>
+      <div class="content">
+        
+        
+  <div class="section" id="sqoop-5-minutes-demo">
+<h1>Sqoop 5 Minutes Demo<a class="headerlink" href="#sqoop-5-minutes-demo" title="Permalink to this headline">¶</a></h1>
+<p>This page will walk you through the basic usage of Sqoop. You need to have installed and configured Sqoop server and client in order to follow this guide. Installation procedure is described on <a class="reference external" href="Installation.html">Installation page</a>. Please note that exact output shown in this page might differ from yours as Sqoop evolves. All major information should however remain the same.</p>
+<p>Sqoop uses unique names or persistent ids to identify connectors, links, jobs and configs. We support querying a entity by its unique name or by its perisent database Id.</p>
+<div class="section" id="starting-client">
+<h2>Starting Client<a class="headerlink" href="#starting-client" title="Permalink to this headline">¶</a></h2>
+<p>Start client in interactive mode using following command:</p>
+<div class="highlight-none"><div class="highlight"><pre>sqoop2-shell
+</pre></div>
+</div>
+<p>Configure client to use your Sqoop server:</p>
+<div class="highlight-none"><div class="highlight"><pre>sqoop:000&gt; set server --host your.host.com --port 12000 --webapp sqoop
+</pre></div>
+</div>
+<p>Verify that connection is working by simple version checking:</p>
+<div class="highlight-none"><div class="highlight"><pre>sqoop:000&gt; show version --all
+client version:
+  Sqoop 2.0.0-SNAPSHOT source revision 418c5f637c3f09b94ea7fc3b0a4610831373a25f
+  Compiled by vbasavaraj on Mon Nov  3 08:18:21 PST 2014
+server version:
+  Sqoop 2.0.0-SNAPSHOT source revision 418c5f637c3f09b94ea7fc3b0a4610831373a25f
+  Compiled by vbasavaraj on Mon Nov  3 08:18:21 PST 2014
+API versions:
+  [v1]
+</pre></div>
+</div>
+<p>You should received similar output as shown above describing the sqoop client build version, the server build version and the supported versions for the rest API.</p>
+<p>You can use the help command to check all the supported commands in the sqoop shell.</p>
+<div class="highlight-none"><div class="highlight"><pre>sqoop:000&gt; help
+For information about Sqoop, visit: http://sqoop.apache.org/
+
+Available commands:
+  exit    (\x  ) Exit the shell
+  history (\H  ) Display, manage and recall edit-line history
+  help    (\h  ) Display this help message
+  set     (\st ) Configure various client options and settings
+  show    (\sh ) Display various objects and configuration options
+  create  (\cr ) Create new object in Sqoop repository
+  delete  (\d  ) Delete existing object in Sqoop repository
+  update  (\up ) Update objects in Sqoop repository
+  clone   (\cl ) Create new object based on existing one
+  start   (\sta) Start job
+  stop    (\stp) Stop job
+  status  (\stu) Display status of a job
+  enable  (\en ) Enable object in Sqoop repository
+  disable (\di ) Disable object in Sqoop repository
+</pre></div>
+</div>
+</div>
+<div class="section" id="creating-link-object">
+<h2>Creating Link Object<a class="headerlink" href="#creating-link-object" title="Permalink to this headline">¶</a></h2>
+<p>Check for the registered connectors on your Sqoop server:</p>
+<div class="highlight-none"><div class="highlight"><pre>sqoop:000&gt; show connector
++----+------------------------+----------------+------------------------------------------------------+----------------------+
+| Id |          Name          |    Version     |                        Class                         | Supported Directions |
++----+------------------------+----------------+------------------------------------------------------+----------------------+
+| 1  | hdfs-connector         | 2.0.0-SNAPSHOT | org.apache.sqoop.connector.hdfs.HdfsConnector        | FROM/TO              |
+| 2  | generic-jdbc-connector | 2.0.0-SNAPSHOT | org.apache.sqoop.connector.jdbc.GenericJdbcConnector | FROM/TO              |
++----+------------------------+----------------+------------------------------------------------------+----------------------+
+</pre></div>
+</div>
+<p>Our example contains two connectors. The one with connector Id 2 is called the <tt class="docutils literal"><span class="pre">generic-jdbc-connector</span></tt>. This is a basic connector relying on the Java JDBC interface for communicating with data sources. It should work with the most common databases that are providing JDBC drivers. Please note that you must install JDBC drivers separately. They are not bundled in Sqoop due to incompatible licenses.</p>
+<p>Generic JDBC Connector in our example has a persistence Id 2 and we will use this value to create new link object for this connector. Note that the link name should be unique.</p>
+<div class="highlight-none"><div class="highlight"><pre>sqoop:000&gt; create link -c 2
+Creating link for connector with id 2
+Please fill following values to create new link object
+Name: First Link
+
+Link configuration
+JDBC Driver Class: com.mysql.jdbc.Driver
+JDBC Connection String: jdbc:mysql://mysql.server/database
+Username: sqoop
+Password: *****
+JDBC Connection Properties:
+There are currently 0 values in the map:
+entry#protocol=tcp
+New link was successfully created with validation status OK and persistent id 1
+</pre></div>
+</div>
+<p>Our new link object was created with assigned id 1.</p>
+<p>In the <tt class="docutils literal"><span class="pre">show</span> <span class="pre">connector</span> <span class="pre">-all</span></tt> we see that there is a hdfs-connector registered in sqoop with the persistent id 1. Let us create another link object but this time for the  hdfs-connector instead.</p>
+<div class="highlight-none"><div class="highlight"><pre>sqoop:000&gt; create link -c 1
+Creating link for connector with id 1
+Please fill following values to create new link object
+Name: Second Link
+
+Link configuration
+HDFS URI: hdfs://nameservice1:8020/
+New link was successfully created with validation status OK and persistent id 2
+</pre></div>
+</div>
+</div>
+<div class="section" id="creating-job-object">
+<h2>Creating Job Object<a class="headerlink" href="#creating-job-object" title="Permalink to this headline">¶</a></h2>
+<p>Connectors implement the <tt class="docutils literal"><span class="pre">From</span></tt> for reading data from and/or <tt class="docutils literal"><span class="pre">To</span></tt> for writing data to. Generic JDBC Connector supports both of them List of supported directions for each connector might be seen in the output of <tt class="docutils literal"><span class="pre">show</span> <span class="pre">connector</span> <span class="pre">-all</span></tt> command above. In order to create a job we need to specifiy the <tt class="docutils literal"><span class="pre">From</span></tt> and <tt class="docutils literal"><span class="pre">To</span></tt> parts of the job uniquely identified by their link Ids. We already have 2 links created in the system, you can verify the same with the following command</p>
+<div class="highlight-none"><div class="highlight"><pre>sqoop:000&gt; show link --all
+2 link(s) to show:
+link with id 1 and name First Link (Enabled: true, Created by root at 11/4/14 4:27 PM, Updated by root at 11/4/14 4:27 PM)
+Using Connector id 2
+  Link configuration
+    JDBC Driver Class: com.mysql.jdbc.Driver
+    JDBC Connection String: jdbc:mysql://mysql.ent.cloudera.com/sqoop
+    Username: sqoop
+    Password:
+    JDBC Connection Properties:
+      protocol = tcp
+link with id 2 and name Second Link (Enabled: true, Created by root at 11/4/14 4:38 PM, Updated by root at 11/4/14 4:38 PM)
+Using Connector id 1
+  Link configuration
+    HDFS URI: hdfs://nameservice1:8020/
+</pre></div>
+</div>
+<p>Next, we can use the two link Ids to associate the <tt class="docutils literal"><span class="pre">From</span></tt> and <tt class="docutils literal"><span class="pre">To</span></tt> for the job.</p>
+<div class="highlight-none"><div class="highlight"><pre> sqoop:000&gt; create job -f 1 -t 2
+ Creating job for links with from id 1 and to id 2
+ Please fill following values to create new job object
+ Name: Sqoopy
+
+ FromJob configuration
+
+  Schema name:(Required)sqoop
+  Table name:(Required)sqoop
+  Table SQL statement:(Optional)
+  Table column names:(Optional)
+  Partition column name:(Optional) id
+  Null value allowed for the partition column:(Optional)
+  Boundary query:(Optional)
+
+ToJob configuration
+
+  Output format:
+   0 : TEXT_FILE
+   1 : SEQUENCE_FILE
+  Choose: 0
+  Compression format:
+   0 : NONE
+   1 : DEFAULT
+   2 : DEFLATE
+   3 : GZIP
+   4 : BZIP2
+   5 : LZO
+   6 : LZ4
+   7 : SNAPPY
+   8 : CUSTOM
+  Choose: 0
+  Custom compression format:(Optional)
+  Output directory:(Required)/root/projects/sqoop
+
+  Driver Config
+  Extractors:(Optional) 2
+  Loaders:(Optional) 2
+  New job was successfully created with validation status OK  and persistent id 1
+</pre></div>
+</div>
+<p>Our new job object was created with assigned id 1.</p>
+</div>
+<div class="section" id="start-job-a-k-a-data-transfer">
+<h2>Start Job ( a.k.a Data transfer )<a class="headerlink" href="#start-job-a-k-a-data-transfer" title="Permalink to this headline">¶</a></h2>
+<p>You can start a sqoop job with the following command:</p>
+<div class="highlight-none"><div class="highlight"><pre>sqoop:000&gt; start job -j 1
+Submission details
+Job ID: 1
+Server URL: http://localhost:12000/sqoop/
+Created by: root
+Creation date: 2014-11-04 19:43:29 PST
+Lastly updated by: root
+External ID: job_1412137947693_0001
+  http://vbsqoop-1.ent.cloudera.com:8088/proxy/application_1412137947693_0001/
+2014-11-04 19:43:29 PST: BOOTING  - Progress is not available
+</pre></div>
+</div>
+<p>You can iteratively check your running job status with <tt class="docutils literal"><span class="pre">status</span> <span class="pre">job</span></tt> command:</p>
+<div class="highlight-none"><div class="highlight"><pre>sqoop:000&gt; status job -j 1
+Submission details
+Job ID: 1
+Server URL: http://localhost:12000/sqoop/
+Created by: root
+Creation date: 2014-11-04 19:43:29 PST
+Lastly updated by: root
+External ID: job_1412137947693_0001
+  http://vbsqoop-1.ent.cloudera.com:8088/proxy/application_1412137947693_0001/
+2014-11-04 20:09:16 PST: RUNNING  - 0.00 %
+</pre></div>
+</div>
+<p>Alternatively you can start a sqoop job and observe job running status with the following command:</p>
+<div class="highlight-none"><div class="highlight"><pre>sqoop:000&gt; start job -j 1 -s
+Submission details
+Job ID: 1
+Server URL: http://localhost:12000/sqoop/
+Created by: root
+Creation date: 2014-11-04 19:43:29 PST
+Lastly updated by: root
+External ID: job_1412137947693_0001
+  http://vbsqoop-1.ent.cloudera.com:8088/proxy/application_1412137947693_0001/
+2014-11-04 19:43:29 PST: BOOTING  - Progress is not available
+2014-11-04 19:43:39 PST: RUNNING  - 0.00 %
+2014-11-04 19:43:49 PST: RUNNING  - 10.00 %
+</pre></div>
+</div>
+<p>And finally you can stop running the job at any time using <tt class="docutils literal"><span class="pre">stop</span> <span class="pre">job</span></tt> command:</p>
+<div class="highlight-none"><div class="highlight"><pre>sqoop:000&gt; stop job -j 1
+</pre></div>
+</div>
+</div>
+</div>
+
+
+      </div>
+      <div class="bottomnav">
+      
+        <p>
+        <a class="uplink" href="index.html">Contents</a>
+        </p>
+
+      </div>
+
+    <div class="footer">
+        &copy; Copyright 2009-2013 The Apache Software Foundation.
+    </div>
+  </body>
+</html>
\ No newline at end of file

Added: sqoop/site/trunk/content/resources/docs/1.99.5/Tools.html
URL: http://svn.apache.org/viewvc/sqoop/site/trunk/content/resources/docs/1.99.5/Tools.html?rev=1662605&view=auto
==============================================================================
--- sqoop/site/trunk/content/resources/docs/1.99.5/Tools.html (added)
+++ sqoop/site/trunk/content/resources/docs/1.99.5/Tools.html Fri Feb 27 00:59:16 2015
@@ -0,0 +1,167 @@
+
+
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+
+<html xmlns="http://www.w3.org/1999/xhtml">
+  <head>
+    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+    
+    <title>Tools &mdash; Apache Sqoop  documentation</title>
+    
+    <link rel="stylesheet" href="_static/haiku.css" type="text/css" />
+    <link rel="stylesheet" href="_static/pygments.css" type="text/css" />
+    <link rel="stylesheet" href="_static/print.css" type="text/css" />
+    
+    <script type="text/javascript">
+      var DOCUMENTATION_OPTIONS = {
+        URL_ROOT:    '',
+        VERSION:     '',
+        COLLAPSE_INDEX: false,
+        FILE_SUFFIX: '.html',
+        HAS_SOURCE:  true
+      };
+    </script>
+    <script type="text/javascript" src="_static/jquery.js"></script>
+    <script type="text/javascript" src="_static/underscore.js"></script>
+    <script type="text/javascript" src="_static/doctools.js"></script>
+    <script type="text/javascript" src="_static/theme_extras.js"></script>
+    <link rel="top" title="Apache Sqoop  documentation" href="index.html" /> 
+  </head>
+  <body>
+      <div class="header"><img class="rightlogo" src="_static/sqoop-logo.png" alt="Logo"/><h1 class="heading"><a href="index.html">
+          <span>Apache Sqoop  documentation</span></a></h1>
+        <h2 class="heading"><span>Tools</span></h2>
+      </div>
+      <div class="topnav">
+      
+        <p>
+        <a class="uplink" href="index.html">Contents</a>
+        </p>
+
+      </div>
+      <div class="content">
+        
+        
+  <div class="section" id="tools">
+<h1>Tools<a class="headerlink" href="#tools" title="Permalink to this headline">¶</a></h1>
+<p>Tools are server commands that administrators can execute on the Sqoop server machine in order to perform various maintenance tasks. The tool execution will always perform a given task and finish. There are no long running services implemented as tools.</p>
+<p>In order to perform the maintenance task each tool is suppose to do, they need to be executed in exactly the same environment as the main Sqoop server. The tool binary will take care of setting up the <tt class="docutils literal"><span class="pre">CLASSPATH</span></tt> and other environmental variables that might be required. However it&#8217;s up to the administrator himself to run the tool under the same user as is used for the server. This is usually configured automatically for various Hadoop distributions (such as Apache Bigtop).</p>
+<div class="admonition note">
+<p class="first admonition-title">Note</p>
+<p class="last">Running tools while the Sqoop Server is also running is not recommended as it might lead to a data corruption and service disruption.</p>
+</div>
+<p>List of available tools:</p>
+<ul class="simple">
+<li>verify</li>
+<li>upgrade</li>
+</ul>
+<p>To run the desired tool, execute binary <tt class="docutils literal"><span class="pre">sqoop2-tool</span></tt> with desired tool name. For example to run <tt class="docutils literal"><span class="pre">verify</span></tt> tool:</p>
+<div class="highlight-none"><div class="highlight"><pre>sqoop2-tool verify
+</pre></div>
+</div>
+<div class="admonition note">
+<p class="first admonition-title">Note</p>
+<p class="last">Stop the Sqoop Server before running Sqoop tools. Running tools while Sqoop Server is running can lead to a data corruption and service disruption.</p>
+</div>
+<div class="section" id="verify">
+<h2>Verify<a class="headerlink" href="#verify" title="Permalink to this headline">¶</a></h2>
+<p>The verify tool will verify Sqoop server configuration by starting all subsystems with the exception of servlets and tearing them down.</p>
+<p>To run the <tt class="docutils literal"><span class="pre">verify</span></tt> tool:</p>
+<div class="highlight-none"><div class="highlight"><pre>sqoop2-tool verify
+</pre></div>
+</div>
+<p>If the verification process succeeds, you should see messages like:</p>
+<div class="highlight-none"><div class="highlight"><pre>Verification was successful.
+Tool class org.apache.sqoop.tools.tool.VerifyTool has finished correctly
+</pre></div>
+</div>
+<p>If the verification process will find any inconsistencies, it will print out the following message instead:</p>
+<div class="highlight-none"><div class="highlight"><pre>Verification has failed, please check Server logs for further details.
+Tool class org.apache.sqoop.tools.tool.VerifyTool has failed.
+</pre></div>
+</div>
+<p>Further details why the verification has failed will be available in the Sqoop server log - same file as the Sqoop Server logs into.</p>
+</div>
+<div class="section" id="upgrade">
+<h2>Upgrade<a class="headerlink" href="#upgrade" title="Permalink to this headline">¶</a></h2>
+<p>Upgrades all versionable components inside Sqoop2. This includes structural changes inside the repository and stored metadata.
+Running this tool on Sqoop deployment that was already upgraded will have no effect.</p>
+<p>To run the <tt class="docutils literal"><span class="pre">upgrade</span></tt> tool:</p>
+<div class="highlight-none"><div class="highlight"><pre>sqoop2-tool upgrade
+</pre></div>
+</div>
+<p>Upon successful upgrade you should see following message:</p>
+<div class="highlight-none"><div class="highlight"><pre>Tool class org.apache.sqoop.tools.tool.UpgradeTool has finished correctly.
+</pre></div>
+</div>
+<p>Execution failure will show the following message instead:</p>
+<div class="highlight-none"><div class="highlight"><pre>Tool class org.apache.sqoop.tools.tool.UpgradeTool has failed.
+</pre></div>
+</div>
+<p>Further details why the upgrade process has failed will be available in the Sqoop server log - same file as the Sqoop Server logs into.</p>
+</div>
+<div class="section" id="repositorydump">
+<h2>RepositoryDump<a class="headerlink" href="#repositorydump" title="Permalink to this headline">¶</a></h2>
+<p>Writes the user-created contents of the Sqoop repository to a file in JSON format. This includes connections, jobs and submissions.</p>
+<p>To run the <tt class="docutils literal"><span class="pre">repositorydump</span></tt> tool:</p>
+<div class="highlight-none"><div class="highlight"><pre>sqoop2-tool repositorydump -o repository.json
+</pre></div>
+</div>
+<p>As an option, the administrator can choose to include sensitive information such as database connection passwords in the file:</p>
+<div class="highlight-none"><div class="highlight"><pre>sqoop2-tool repositorydump -o repository.json --include-sensitive
+</pre></div>
+</div>
+<p>Upon successful execution, you should see the following message:</p>
+<div class="highlight-none"><div class="highlight"><pre>Tool class org.apache.sqoop.tools.tool.RepositoryDumpTool has finished correctly.
+</pre></div>
+</div>
+<p>If repository dump has failed, you will see the following message instead:</p>
+<div class="highlight-none"><div class="highlight"><pre>Tool class org.apache.sqoop.tools.tool.RepositoryDumpTool has failed.
+</pre></div>
+</div>
+<p>Further details why the upgrade process has failed will be available in the Sqoop server log - same file as the Sqoop Server logs into.</p>
+</div>
+<div class="section" id="repositoryload">
+<h2>RepositoryLoad<a class="headerlink" href="#repositoryload" title="Permalink to this headline">¶</a></h2>
+<p>Reads a json formatted file created by RepositoryDump and loads to current Sqoop repository.</p>
+<p>To run the <tt class="docutils literal"><span class="pre">repositoryLoad</span></tt> tool:</p>
+<div class="highlight-none"><div class="highlight"><pre>sqoop2-tool repositoryload -i repository.json
+</pre></div>
+</div>
+<p>Upon successful execution, you should see the following message:</p>
+<div class="highlight-none"><div class="highlight"><pre>Tool class org.apache.sqoop.tools.tool.RepositoryLoadTool has finished correctly.
+</pre></div>
+</div>
+<p>If repository load failed you will see the following message instead:</p>
+<div class="highlight-none"><div class="highlight"><pre>Tool class org.apache.sqoop.tools.tool.RepositoryLoadTool has failed.
+</pre></div>
+</div>
+<p>Or an exception. Further details why the upgrade process has failed will be available in the Sqoop server log - same file as the Sqoop Server logs into.</p>
+<div class="admonition note">
+<p class="first admonition-title">Note</p>
+<p class="last">If the repository dump was created without passwords (default), the connections will not contain a password and the jobs will fail to execute. In that case you&#8217;ll need to manually update the connections and set the password.</p>
+</div>
+<div class="admonition note">
+<p class="first admonition-title">Note</p>
+<p class="last">RepositoryLoad tool will always generate new connections, jobs and submissions from the file. Even when an identical objects already exists in repository.</p>
+</div>
+</div>
+</div>
+
+
+      </div>
+      <div class="bottomnav">
+      
+        <p>
+        <a class="uplink" href="index.html">Contents</a>
+        </p>
+
+      </div>
+
+    <div class="footer">
+        &copy; Copyright 2009-2013 The Apache Software Foundation.
+    </div>
+  </body>
+</html>
\ No newline at end of file

Added: sqoop/site/trunk/content/resources/docs/1.99.5/Upgrade.html
URL: http://svn.apache.org/viewvc/sqoop/site/trunk/content/resources/docs/1.99.5/Upgrade.html?rev=1662605&view=auto
==============================================================================
--- sqoop/site/trunk/content/resources/docs/1.99.5/Upgrade.html (added)
+++ sqoop/site/trunk/content/resources/docs/1.99.5/Upgrade.html Fri Feb 27 00:59:16 2015
@@ -0,0 +1,121 @@
+
+
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+
+<html xmlns="http://www.w3.org/1999/xhtml">
+  <head>
+    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+    
+    <title>Upgrade &mdash; Apache Sqoop  documentation</title>
+    
+    <link rel="stylesheet" href="_static/haiku.css" type="text/css" />
+    <link rel="stylesheet" href="_static/pygments.css" type="text/css" />
+    <link rel="stylesheet" href="_static/print.css" type="text/css" />
+    
+    <script type="text/javascript">
+      var DOCUMENTATION_OPTIONS = {
+        URL_ROOT:    '',
+        VERSION:     '',
+        COLLAPSE_INDEX: false,
+        FILE_SUFFIX: '.html',
+        HAS_SOURCE:  true
+      };
+    </script>
+    <script type="text/javascript" src="_static/jquery.js"></script>
+    <script type="text/javascript" src="_static/underscore.js"></script>
+    <script type="text/javascript" src="_static/doctools.js"></script>
+    <script type="text/javascript" src="_static/theme_extras.js"></script>
+    <link rel="top" title="Apache Sqoop  documentation" href="index.html" /> 
+  </head>
+  <body>
+      <div class="header"><img class="rightlogo" src="_static/sqoop-logo.png" alt="Logo"/><h1 class="heading"><a href="index.html">
+          <span>Apache Sqoop  documentation</span></a></h1>
+        <h2 class="heading"><span>Upgrade</span></h2>
+      </div>
+      <div class="topnav">
+      
+        <p>
+        <a class="uplink" href="index.html">Contents</a>
+        </p>
+
+      </div>
+      <div class="content">
+        
+        
+  <div class="section" id="upgrade">
+<h1>Upgrade<a class="headerlink" href="#upgrade" title="Permalink to this headline">¶</a></h1>
+<p>This page describes procedure that you need to take in order to upgrade Sqoop from one release to a higher release. Upgrading both client and server component will be discussed separately.</p>
+<div class="admonition note">
+<p class="first admonition-title">Note</p>
+<p class="last">Only updates from one Sqoop 2 release to another are covered, starting with upgrades from version 1.99.2. This guide do not contain general information how to upgrade from Sqoop 1 to Sqoop 2.</p>
+</div>
+<div class="section" id="upgrading-server">
+<h2>Upgrading Server<a class="headerlink" href="#upgrading-server" title="Permalink to this headline">¶</a></h2>
+<p>As Sqoop server is using a database repository for persisting sqoop entities such as the connector, driver, links and jobs the repository schema might need to be updated as part of the server upgrade. In addition the configs and inputs described by the various connectors and the driver may also change with a new server version and might need a data upgrade.</p>
+<p>There are two ways how to upgrade Sqoop entities in the repository, you can either execute upgrade tool or configure the sqoop server to perform all necessary upgrades on start up.</p>
+<p>It&#8217;s strongly advised to back up the repository before moving on to next steps. Backup instructions will vary depending on the repository implementation. For example, using MySQL as a repository will require a different back procedure than Apache Derby. Please follow the repositories&#8217; backup procedure.</p>
+<div class="section" id="upgrading-server-using-upgrade-tool">
+<h3>Upgrading Server using upgrade tool<a class="headerlink" href="#upgrading-server-using-upgrade-tool" title="Permalink to this headline">¶</a></h3>
+<p>Preferred upgrade path is to explicitly run the <a class="reference external" href="Tools.html#upgrade">Upgrade Tool</a>. First step is to however shutdown the server as having both the server and upgrade utility accessing the same repository might corrupt it:</p>
+<div class="highlight-none"><div class="highlight"><pre>sqoop2-server stop
+</pre></div>
+</div>
+<p>When the server has been successfully stopped, you can update the server bits and simply run the upgrade tool:</p>
+<div class="highlight-none"><div class="highlight"><pre>sqoop2-tool upgrade
+</pre></div>
+</div>
+<p>You should see that the upgrade process has been successful:</p>
+<div class="highlight-none"><div class="highlight"><pre>Tool class org.apache.sqoop.tools.tool.UpgradeTool has finished correctly.
+</pre></div>
+</div>
+<p>In case of any failure, please take a look into <a class="reference external" href="Tools.html#upgrade">Upgrade Tool</a> documentation page.</p>
+</div>
+<div class="section" id="upgrading-server-on-start-up">
+<h3>Upgrading Server on start-up<a class="headerlink" href="#upgrading-server-on-start-up" title="Permalink to this headline">¶</a></h3>
+<p>The capability of performing the upgrade has been built-in to the server, however is disabled by default to avoid any unintentional changes to the repository. You can start the repository schema upgrade procedure by stopping the server:</p>
+<div class="highlight-none"><div class="highlight"><pre>sqoop2-server stop
+</pre></div>
+</div>
+<p>Before starting the server again you will need to enable the auto-upgrade feature that will perform all necessary changes during Sqoop Server start up.</p>
+<p>You need to set the following property in configuration file <tt class="docutils literal"><span class="pre">sqoop.properties</span></tt> for the repository schema upgrade.</p>
+<div class="highlight-none"><div class="highlight"><pre>org.apache.sqoop.repository.schema.immutable=false
+</pre></div>
+</div>
+<p>You need to set the following property in configuration file <tt class="docutils literal"><span class="pre">sqoop.properties</span></tt> for the connector config data upgrade.</p>
+<div class="highlight-none"><div class="highlight"><pre>org.apache.sqoop.connector.autoupgrade=true
+</pre></div>
+</div>
+<p>You need to set the following property in configuration file <tt class="docutils literal"><span class="pre">sqoop.properties</span></tt> for the driver config data upgrade.</p>
+<div class="highlight-none"><div class="highlight"><pre>org.apache.sqoop.driver.autoupgrade=true
+</pre></div>
+</div>
+<p>When all properties are set, start the sqoop server using the following command:</p>
+<div class="highlight-none"><div class="highlight"><pre>sqoop2-server start
+</pre></div>
+</div>
+<p>All required actions will be performed automatically during the server bootstrap. It&#8217;s strongly advised to set all three properties to their original values once the server has been successfully started and the upgrade has completed</p>
+</div>
+</div>
+<div class="section" id="upgrading-client">
+<h2>Upgrading Client<a class="headerlink" href="#upgrading-client" title="Permalink to this headline">¶</a></h2>
+<p>Client do not require any manual steps during upgrade. Replacing the binaries with updated version is sufficient.</p>
+</div>
+</div>
+
+
+      </div>
+      <div class="bottomnav">
+      
+        <p>
+        <a class="uplink" href="index.html">Contents</a>
+        </p>
+
+      </div>
+
+    <div class="footer">
+        &copy; Copyright 2009-2013 The Apache Software Foundation.
+    </div>
+  </body>
+</html>
\ No newline at end of file

Added: sqoop/site/trunk/content/resources/docs/1.99.5/_sources/BuildingSqoop2.txt
URL: http://svn.apache.org/viewvc/sqoop/site/trunk/content/resources/docs/1.99.5/_sources/BuildingSqoop2.txt?rev=1662605&view=auto
==============================================================================
--- sqoop/site/trunk/content/resources/docs/1.99.5/_sources/BuildingSqoop2.txt (added)
+++ sqoop/site/trunk/content/resources/docs/1.99.5/_sources/BuildingSqoop2.txt Fri Feb 27 00:59:16 2015
@@ -0,0 +1,76 @@
+.. Licensed to the Apache Software Foundation (ASF) under one or more
+   contributor license agreements.  See the NOTICE file distributed with
+   this work for additional information regarding copyright ownership.
+   The ASF licenses this file to You under the Apache License, Version 2.0
+   (the "License"); you may not use this file except in compliance with
+   the License.  You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+   Unless required by applicable law or agreed to in writing, software
+   distributed under the License is distributed on an "AS IS" BASIS,
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+   See the License for the specific language governing permissions and
+   limitations under the License.
+
+
+================================
+Building Sqoop2 from source code
+================================
+
+This guide will show you how to build Sqoop2 from source code. Sqoop is using `maven <http://maven.apache.org/>`_ as build system. You you will need to use at least version 3.0 as older versions will not work correctly. All other dependencies will be downloaded by maven automatically. With exception of special JDBC drivers that are needed only for advanced integration tests.
+
+Downloading source code
+-----------------------
+
+Sqoop project is using git as a revision control system hosted at Apache Software Foundation. You can clone entire repository using following command:
+
+::
+
+  git clone https://git-wip-us.apache.org/repos/asf/sqoop.git sqoop2
+
+Sqoop2 is currently developed in special branch ``sqoop2`` that you need to check out after clone:
+
+::
+
+  cd sqoop2
+  git checkout sqoop2
+
+Building project
+----------------
+
+You can use usual maven targets like ``compile`` or ``package`` to build the project. Sqoop supports one major Hadoop revision at the moment - 2.x. As compiled code for one Hadoop major version can't be used on another, you must compile Sqoop against appropriate Hadoop version.
+
+::
+
+  mvn compile
+
+Maven target ``package`` can be used to create Sqoop packages similar to the ones that are officially available for download. Sqoop will build only source tarball by default. You need to specify ``-Pbinary`` to build binary distribution.
+
+::
+
+  mvn package -Pbinary
+
+Running tests
+-------------
+
+Sqoop supports two different sets of tests. First smaller and much faster set is called **unit tests** and will be executed on maven target ``test``. Second larger set of **integration tests** will be executed on maven target ``integration-test``. Please note that integration tests might require manual steps for installing various JDBC drivers into your local maven cache.
+
+Example for running unit tests:
+
+::
+
+  mvn test
+
+Example for running integration tests:
+
+::
+
+  mvn integration-test
+
+For the **unit tests**, there are two helpful profiles: **fast** and **slow**. The **fast** unit tests do not start or use any services. The **slow** unit tests, may start services or use an external service (ie. MySQL).
+
+::
+
+  mvn test -Pfast,hadoop200
+  mvn test -Pslow,hadoop200
\ No newline at end of file

Added: sqoop/site/trunk/content/resources/docs/1.99.5/_sources/ClientAPI.txt
URL: http://svn.apache.org/viewvc/sqoop/site/trunk/content/resources/docs/1.99.5/_sources/ClientAPI.txt?rev=1662605&view=auto
==============================================================================
--- sqoop/site/trunk/content/resources/docs/1.99.5/_sources/ClientAPI.txt (added)
+++ sqoop/site/trunk/content/resources/docs/1.99.5/_sources/ClientAPI.txt Fri Feb 27 00:59:16 2015
@@ -0,0 +1,304 @@
+.. Licensed to the Apache Software Foundation (ASF) under one or more
+   contributor license agreements.  See the NOTICE file distributed with
+   this work for additional information regarding copyright ownership.
+   The ASF licenses this file to You under the Apache License, Version 2.0
+   (the "License"); you may not use this file except in compliance with
+   the License.  You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+   Unless required by applicable law or agreed to in writing, software
+   distributed under the License is distributed on an "AS IS" BASIS,
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+   See the License for the specific language governing permissions and
+   limitations under the License.
+
+
+===========================
+Sqoop Java Client API Guide
+===========================
+
+This document will explain how to use Sqoop Java Client API with external application. Client API allows you to execute the functions of sqoop commands. It requires Sqoop Client JAR and its dependencies.
+
+The main class that provides wrapper methods for all the supported operations is the
+::
+
+  public class SqoopClient {
+    ...
+  }
+
+Java Client API is explained using Generic JDBC Connector example. Before executing the application using the sqoop client API, check whether sqoop server is running.
+
+Workflow
+========
+
+Given workflow has to be followed for executing a sqoop job in Sqoop server.
+
+  1. Create LINK object for a given connectorId             - Creates Link object and returns linkId (lid)
+  2. Create a JOB for a given "from" and "to" linkId            - Create Job object and returns jobId (jid)
+  3. Start the JOB for a given jobId                        - Start Job on the server and creates a submission record
+
+Project Dependencies
+====================
+Here given maven dependency
+
+::
+
+  <dependency>
+    <groupId>org.apache.sqoop</groupId>
+      <artifactId>sqoop-client</artifactId>
+      <version>${requestedVersion}</version>
+  </dependency>
+
+Initialization
+==============
+
+First initialize the SqoopClient class with server URL as argument.
+
+::
+
+  String url = "http://localhost:12000/sqoop/";
+  SqoopClient client = new SqoopClient(url);
+
+Server URL value can be modfied by setting value to setServerUrl(String) method
+
+::
+
+  client.setServerUrl(newUrl);
+
+
+Link
+====
+Connectors provide the facility to interact with many data sources and thus can be used as a means to transfer data between them in Sqoop. The registered connector implementation will provide logic to read from and/or write to a data source that it represents. A connector can have one or more links associated with it. The java client API allows you to create, update and delete a link for any registered connector. Creating or updating a link requires you to populate the Link Config for that particular connector. Hence the first thing to do is get the list of registered connectors and select the connector for which you would like to create a link. Then
+you can get the list of all the config/inputs using `Display Config and Input Names For Connector`_ for that connector.
+
+
+Save Link
+---------
+
+First create a new link by invoking ``createLink(cid)`` method with connector Id and it returns a MLink object with dummy id and the unfilled link config inputs for that connector. Then fill the config inputs with relevant values. Invoke ``saveLink`` passing it the filled MLink object.
+
+::
+
+  // create a placeholder for link
+  long connectorId = 1;
+  MLink link = client.createLink(connectorId);
+  link.setName("Vampire");
+  link.setCreationUser("Buffy");
+  MLinkConfig linkConfig = link.getConnectorLinkConfig();
+  // fill in the link config values
+  linkConfig.getStringInput("linkConfig.connectionString").setValue("jdbc:mysql://localhost/my");
+  linkConfig.getStringInput("linkConfig.jdbcDriver").setValue("com.mysql.jdbc.Driver");
+  linkConfig.getStringInput("linkConfig.username").setValue("root");
+  linkConfig.getStringInput("linkConfig.password").setValue("root");
+  // save the link object that was filled
+  Status status = client.saveLink(link);
+  if(status.canProceed()) {
+   System.out.println("Created Link with Link Id : " + link.getPersistenceId());
+  } else {
+   System.out.println("Something went wrong creating the link");
+  }
+
+``status.canProceed()`` returns true if status is OK or a WARNING. Before sending the status, the link config values are validated using the corresponding validator associated with th link config inputs.
+
+On successful execution of the saveLink method, new link Id is assigned to the link object else an exception is thrown. ``link.getPersistenceId()`` method returns the unique Id for this object persisted in the sqoop repository.
+
+User can retrieve a link using the following methods
+
++----------------------------+--------------------------------------+
+|   Method                   | Description                          |
++============================+======================================+
+| ``getLink(lid)``           | Returns a link by id                 |
++----------------------------+--------------------------------------+
+| ``getLinks()``             | Returns list of links in the sqoop   |
++----------------------------+--------------------------------------+
+
+Job
+===
+
+A sqoop job holds the ``From`` and ``To`` parts for transferring data from the ``From`` data source to the ``To`` data source. Both the ``From`` and the ``To`` are uniquely identified by their corresponding connector Link Ids. i.e when creating a job we have to specifiy the ``FromLinkId`` and the ``ToLinkId``. Thus the pre-requisite for creating a job is to first create the links as described above.
+
+Once the linkIds for the ``From`` and ``To`` are given, then the job configs for the associated connector for the link object have to be filled. You can get the list of all the from and to job config/inputs using `Display Config and Input Names For Connector`_ for that connector. A connector can have one or more links. We then use the links in the ``From`` and ``To`` direction to populate the corresponding ``MFromConfig`` and ``MToConfig`` respectively.
+
+In addition to filling the job configs for the ``From`` and the ``To`` representing the link, we also need to fill the driver configs that control the job execution engine environment. For example, if the job execution engine happens to be the MapReduce we will specifiy the number of mappers to be used in reading data from the ``From`` data source.
+
+Save Job
+---------
+Here is the code to create and then save a job
+::
+
+  String url = "http://localhost:12000/sqoop/";
+  SqoopClient client = new SqoopClient(url);
+  //Creating dummy job object
+  long fromLinkId = 1;// for jdbc connector
+  long toLinkId = 2; // for HDFS connector
+  MJob job = client.createJob(fromLinkId, toLinkId);
+  job.setName("Vampire");
+  job.setCreationUser("Buffy");
+  // set the "FROM" link job config values
+  MFromConfig fromJobConfig = job.getFromJobConfig();
+  fromJobConfig.getStringInput("fromJobConfig.schemaName").setValue("sqoop");
+  fromJobConfig.getStringInput("fromJobConfig.tableName").setValue("sqoop");
+  fromJobConfig.getStringInput("fromJobConfig.partitionColumn").setValue("id");
+  // set the "TO" link job config values
+  MToConfig toJobConfig = job.getToJobConfig();
+  toJobConfig.getStringInput("toJobConfig.outputDirectory").setValue("/usr/tmp");
+  // set the driver config values
+  MDriverConfig driverConfig = job.getDriverConfig();
+  driverConfig.getStringInput("throttlingConfig.numExtractors").setValue("3");
+
+  Status status = client.saveJob(job);
+  if(status.canProceed()) {
+   System.out.println("Created Job with Job Id: "+ job.getPersistenceId());
+  } else {
+   System.out.println("Something went wrong creating the job");
+  }
+
+User can retrieve a job using the following methods
+
++----------------------------+--------------------------------------+
+|   Method                   | Description                          |
++============================+======================================+
+| ``getJob(jid)``            | Returns a job by id                  |
++----------------------------+--------------------------------------+
+| ``getJobs()``              | Returns list of jobs in the sqoop    |
++----------------------------+--------------------------------------+
+
+
+List of status codes
+--------------------
+
++------------------+------------------------------------------------------------------------------------------------------------+
+| Function         | Description                                                                                                |
++==================+============================================================================================================+
+| ``OK``           | There are no issues, no warnings.                                                                          |
++------------------+------------------------------------------------------------------------------------------------------------+
+| ``WARNING``      | Validated entity is correct enough to be proceed. Not a fatal error                                        |
++------------------+------------------------------------------------------------------------------------------------------------+
+| ``ERROR``        | There are serious issues with validated entity. We can't proceed until reported issues will be resolved.   |
++------------------+------------------------------------------------------------------------------------------------------------+
+
+View Error or Warning valdiation message
+----------------------------------------
+
+In case of any WARNING AND ERROR status, user has to iterate the list of validation messages.
+
+::
+
+ printMessage(link.getConnectorLinkConfig().getConfigs());
+
+ private static void printMessage(List<MConfig> configs) {
+   for(MConfig config : configs) {
+     List<MInput<?>> inputlist = config.getInputs();
+     if (config.getValidationMessages() != null) {
+      // print every validation message
+      for(Message message : config.getValidationMessages()) {
+       System.out.println("Config validation message: " + message.getMessage());
+      }
+     }
+     for (MInput minput : inputlist) {
+       if (minput.getValidationStatus() == Status.WARNING) {
+        for(Message message : config.getValidationMessages()) {
+         System.out.println("Config Input Validation Warning: " + message.getMessage());
+       }
+     }
+     else if (minput.getValidationStatus() == Status.ERROR) {
+       for(Message message : config.getValidationMessages()) {
+        System.out.println("Config Input Validation Error: " + message.getMessage());
+       }
+      }
+     }
+    }
+
+Updating link and job
+---------------------
+After creating link or job in the repository, you can update or delete a link or job using the following functions
+
++----------------------------------+------------------------------------------------------------------------------------+
+|   Method                         | Description                                                                        |
++==================================+====================================================================================+
+| ``updateLink(link)``             | Invoke update with link and check status for any errors or warnings                |
++----------------------------------+------------------------------------------------------------------------------------+
+| ``deleteLink(lid)``              | Delete link. Deletes only if specified link is not used by any job                 |
++----------------------------------+------------------------------------------------------------------------------------+
+| ``updateJob(job)``               | Invoke update with job and check status for any errors or warnings                 |
++----------------------------------+------------------------------------------------------------------------------------+
+| ``deleteJob(jid)``               | Delete job                                                                         |
++----------------------------------+------------------------------------------------------------------------------------+
+
+Job Start
+==============
+
+Starting a job requires a job id. On successful start, getStatus() method returns "BOOTING" or "RUNNING".
+
+::
+
+  //Job start
+  long jobId = 1;
+  MSubmission submission = client.startJob(jobId);
+  System.out.println("Job Submission Status : " + submission.getStatus());
+  if(submission.getStatus().isRunning() && submission.getProgress() != -1) {
+    System.out.println("Progress : " + String.format("%.2f %%", submission.getProgress() * 100));
+  }
+  System.out.println("Hadoop job id :" + submission.getExternalId());
+  System.out.println("Job link : " + submission.getExternalLink());
+  Counters counters = submission.getCounters();
+  if(counters != null) {
+    System.out.println("Counters:");
+    for(CounterGroup group : counters) {
+      System.out.print("\t");
+      System.out.println(group.getName());
+      for(Counter counter : group) {
+        System.out.print("\t\t");
+        System.out.print(counter.getName());
+        System.out.print(": ");
+        System.out.println(counter.getValue());
+      }
+    }
+  }
+  if(submission.getExceptionInfo() != null) {
+    System.out.println("Exception info : " +submission.getExceptionInfo());
+  }
+
+
+  //Check job status for a running job 
+  MSubmission submission = client.getJobStatus(jobId);
+  if(submission.getStatus().isRunning() && submission.getProgress() != -1) {
+    System.out.println("Progress : " + String.format("%.2f %%", submission.getProgress() * 100));
+  }
+
+  //Stop a running job
+  submission.stopJob(jobId);
+
+Above code block, job start is asynchronous. For synchronous job start, use ``startJob(jid, callback, pollTime)`` method. If you are not interested in getting the job status, then invoke the same method with "null" as the value for the callback parameter and this returns the final job status. ``pollTime`` is the request interval for getting the job status from sqoop server and the value should be greater than zero. We will frequently hit the sqoop server if a low value is given for the ``pollTime``. When a synchronous job is started with a non null callback, it first invokes the callback's ``submitted(MSubmission)`` method on successful start, after every poll time interval, it then invokes the ``updated(MSubmission)`` method on the callback API and finally on finishing the job executuon it invokes the ``finished(MSubmission)`` method on the callback API.
+
+Display Config and Input Names For Connector
+============================================
+
+You can view the config/input names for the link and job config types per connector
+
+::
+
+  String url = "http://localhost:12000/sqoop/";
+  SqoopClient client = new SqoopClient(url);
+  long connectorId = 1;
+  // link config for connector
+  describe(client.getConnector(connectorId).getLinkConfig().getConfigs(), client.getConnectorConfigBundle(connectorId));
+  // from job config for connector
+  describe(client.getConnector(connectorId).getFromConfig().getConfigs(), client.getConnectorConfigBundle(connectorId));
+  // to job config for the connector
+  describe(client.getConnector(connectorId).getToConfig().getConfigs(), client.getConnectorConfigBundle(connectorId));
+
+  void describe(List<MConfig> configs, ResourceBundle resource) {
+    for (MConfig config : configs) {
+      System.out.println(resource.getString(config.getLabelKey())+":");
+      List<MInput<?>> inputs = config.getInputs();
+      for (MInput input : inputs) {
+        System.out.println(resource.getString(input.getLabelKey()) + " : " + input.getValue());
+      }
+      System.out.println();
+    }
+  }
+
+
+Above Sqoop 2 Client API tutorial explained how to create a link, create job and and then start the job.

Added: sqoop/site/trunk/content/resources/docs/1.99.5/_sources/CommandLineClient.txt
URL: http://svn.apache.org/viewvc/sqoop/site/trunk/content/resources/docs/1.99.5/_sources/CommandLineClient.txt?rev=1662605&view=auto
==============================================================================
--- sqoop/site/trunk/content/resources/docs/1.99.5/_sources/CommandLineClient.txt (added)
+++ sqoop/site/trunk/content/resources/docs/1.99.5/_sources/CommandLineClient.txt Fri Feb 27 00:59:16 2015
@@ -0,0 +1,533 @@
+.. Licensed to the Apache Software Foundation (ASF) under one or more
+   contributor license agreements.  See the NOTICE file distributed with
+   this work for additional information regarding copyright ownership.
+   The ASF licenses this file to You under the Apache License, Version 2.0
+   (the "License"); you may not use this file except in compliance with
+   the License.  You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+   Unless required by applicable law or agreed to in writing, software
+   distributed under the License is distributed on an "AS IS" BASIS,
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+   See the License for the specific language governing permissions and
+   limitations under the License.
+
+
+===================
+Command Line Shell
+===================
+
+Sqoop 2 provides command line shell that is capable of communicating with Sqoop 2 server using REST interface. Client is able to run in two modes - interactive and batch mode. Commands ``create``, ``update`` and ``clone`` are not currently supported in batch mode. Interactive mode supports all available commands.
+
+You can start Sqoop 2 client in interactive mode using command ``sqoop2-shell``::
+
+  sqoop2-shell
+
+Batch mode can be started by adding additional argument representing path to your Sqoop client script: ::
+
+  sqoop2-shell /path/to/your/script.sqoop
+
+Sqoop client script is expected to contain valid Sqoop client commands, empty lines and lines starting with ``#`` that are denoting comment lines. Comments and empty lines are ignored, all other lines are interpreted. Example script: ::
+
+  # Specify company server
+  set server --host sqoop2.company.net
+
+  # Executing given job
+  start job  --jid 1
+
+
+.. contents:: Table of Contents
+
+Resource file
+=============
+
+Sqoop 2 client have ability to load resource files similarly as other command line tools. At the beginning of execution Sqoop client will check existence of file ``.sqoop2rc`` in home directory of currently logged user. If such file exists, it will be interpreted before any additional actions. This file is loaded in both interactive and batch mode. It can be used to execute any batch compatible commands.
+
+Example resource file: ::
+
+  # Configure our Sqoop 2 server automatically
+  set server --host sqoop2.company.net
+
+  # Run in verbose mode by default
+  set option --name verbose --value true
+
+Commands
+========
+
+Sqoop 2 contains several commands that will be documented in this section. Each command have one more functions that are accepting various arguments. Not all commands are supported in both interactive and batch mode.
+
+Auxiliary Commands
+------------------
+
+Auxiliary commands are commands that are improving user experience and are running purely on client side. Thus they do not need working connection to the server.
+
+* ``exit`` Exit client immediately. This command can be also executed by sending EOT (end of transmission) character. It's CTRL+D on most common Linux shells like Bash or Zsh.
+* ``history`` Print out command history. Please note that Sqoop client is saving history from previous executions and thus you might see commands that you've executed in previous runs.
+* ``help`` Show all available commands with short in-shell documentation.
+
+::
+
+ sqoop:000> help
+ For information about Sqoop, visit: http://sqoop.apache.org/
+
+ Available commands:
+   exit    (\x  ) Exit the shell
+   history (\H  ) Display, manage and recall edit-line history
+   help    (\h  ) Display this help message
+   set     (\st ) Configure various client options and settings
+   show    (\sh ) Display various objects and configuration options
+   create  (\cr ) Create new object in Sqoop repository
+   delete  (\d  ) Delete existing object in Sqoop repository
+   update  (\up ) Update objects in Sqoop repository
+   clone   (\cl ) Create new object based on existing one
+   start   (\sta) Start job
+   stop    (\stp) Stop job
+   status  (\stu) Display status of a job
+   enable  (\en ) Enable object in Sqoop repository
+   disable (\di ) Disable object in Sqoop repository
+
+Set Command
+-----------
+
+Set command allows to set various properties of the client. Similarly as auxiliary commands, set do not require connection to Sqoop server. Set commands is not used to reconfigure Sqoop server.
+
+Available functions:
+
++---------------+------------------------------------------+
+| Function      | Description                              |
++===============+==========================================+
+| ``server``    | Set connection configuration for server  |
++---------------+------------------------------------------+
+| ``option``    | Set various client side options          |
++---------------+------------------------------------------+
+
+Set Server Function
+~~~~~~~~~~~~~~~~~~~
+
+Configure connection to Sqoop server - host port and web application name. Available arguments:
+
++-----------------------+---------------+--------------------------------------------------+
+| Argument              | Default value | Description                                      |
++=======================+===============+==================================================+
+| ``-h``, ``--host``    | localhost     | Server name (FQDN) where Sqoop server is running |
++-----------------------+---------------+--------------------------------------------------+
+| ``-p``, ``--port``    | 12000         | TCP Port                                         |
++-----------------------+---------------+--------------------------------------------------+
+| ``-w``, ``--webapp``  | sqoop         | Tomcat's web application name                    |
++-----------------------+---------------+--------------------------------------------------+
+| ``-u``, ``--url``     |               | Sqoop Server in url format                       |
++-----------------------+---------------+--------------------------------------------------+
+
+Example: ::
+
+  set server --host sqoop2.company.net --port 80 --webapp sqoop
+
+or ::
+
+  set server --url http://sqoop2.company.net:80/sqoop
+
+Note: When ``--url`` option is given, ``--host``, ``--port`` or ``--webapp`` option will be ignored.
+
+Set Option Function
+~~~~~~~~~~~~~~~~~~~
+
+Configure Sqoop client related options. This function have two required arguments ``name`` and ``value``. Name represents internal property name and value holds new value that should be set. List of available option names follows:
+
++-------------------+---------------+---------------------------------------------------------------------+
+| Option name       | Default value | Description                                                         |
++===================+===============+=====================================================================+
+| ``verbose``       | false         | Client will print additional information if verbose mode is enabled |
++-------------------+---------------+---------------------------------------------------------------------+
+| ``poll-timeout``  | 10000         | Server poll timeout in milliseconds                                 |
++-------------------+---------------+---------------------------------------------------------------------+
+
+Example: ::
+
+  set option --name verbose --value true
+  set option --name poll-timeout --value 20000
+
+Show Command
+------------
+
+Show commands displays various information as described below.
+
+Available functions:
+
++----------------+--------------------------------------------------------------------------------------------------------+
+| Function       | Description                                                                                            |
++================+========================================================================================================+
+| ``server``     | Display connection information to the sqoop server (host, port, webapp)                                |
++----------------+--------------------------------------------------------------------------------------------------------+
+| ``option``     | Display various client side options                                                                    |
++----------------+--------------------------------------------------------------------------------------------------------+
+| ``version``    | Show client build version, with an option -all it shows server build version and supported api versions|
++----------------+--------------------------------------------------------------------------------------------------------+
+| ``connector``  | Show connector configurable and its related configs                                                    |
++----------------+--------------------------------------------------------------------------------------------------------+
+| ``driver``     | Show driver configurable and its related configs                                                       |
++----------------+--------------------------------------------------------------------------------------------------------+
+| ``link``       | Show links in sqoop                                                                                    |
++----------------+--------------------------------------------------------------------------------------------------------+
+| ``job``        | Show jobs in sqoop                                                                                     |
++----------------+--------------------------------------------------------------------------------------------------------+
+
+Show Server Function
+~~~~~~~~~~~~~~~~~~~~
+
+Show details about connection to Sqoop server.
+
++-----------------------+--------------------------------------------------------------+
+| Argument              |  Description                                                 |
++=======================+==============================================================+
+| ``-a``, ``--all``     | Show all connection related information (host, port, webapp) |
++-----------------------+--------------------------------------------------------------+
+| ``-h``, ``--host``    | Show host                                                    |
++-----------------------+--------------------------------------------------------------+
+| ``-p``, ``--port``    | Show port                                                    |
++-----------------------+--------------------------------------------------------------+
+| ``-w``, ``--webapp``  | Show web application name                                    |
++-----------------------+--------------------------------------------------------------+
+
+Example: ::
+
+  show server --all
+
+Show Option Function
+~~~~~~~~~~~~~~~~~~~~
+
+Show values of various client side options. This function will show all client options when called without arguments.
+
++-----------------------+--------------------------------------------------------------+
+| Argument              |  Description                                                 |
++=======================+==============================================================+
+| ``-n``, ``--name``    | Show client option value with given name                     |
++-----------------------+--------------------------------------------------------------+
+
+Please check table in `Set Option Function`_ section to get a list of all supported option names.
+
+Example: ::
+
+  show option --name verbose
+
+Show Version Function
+~~~~~~~~~~~~~~~~~~~~~
+
+Show build versions of both client and server as well as the supported rest api versions.
+
++------------------------+-----------------------------------------------+
+| Argument               |  Description                                  |
++========================+===============================================+
+| ``-a``, ``--all``      | Show all versions (server, client, api)       |
++------------------------+-----------------------------------------------+
+| ``-c``, ``--client``   | Show client build version                     |
++------------------------+-----------------------------------------------+
+| ``-s``, ``--server``   | Show server build version                     |
++------------------------+-----------------------------------------------+
+| ``-p``, ``--api``      | Show supported api versions                   |
++------------------------+-----------------------------------------------+
+
+Example: ::
+
+  show version --all
+
+Show Connector Function
+~~~~~~~~~~~~~~~~~~~~~~~
+
+Show persisted connector configurable and its related configs used in creating associated link and job objects
+
++-----------------------+------------------------------------------------+
+| Argument              |  Description                                   |
++=======================+================================================+
+| ``-a``, ``--all``     | Show information for all connectors            |
++-----------------------+------------------------------------------------+
+| ``-c``, ``--cid <x>`` | Show information for connector with id ``<x>`` |
++-----------------------+------------------------------------------------+
+
+Example: ::
+
+  show connector --all or show connector
+
+Show Driver Function
+~~~~~~~~~~~~~~~~~~~~
+
+Show persisted driver configurable and its related configs used in creating job objects
+
+This function do not have any extra arguments. There is only one registered driver in sqoop
+
+Example: ::
+
+  show driver
+
+Show Link Function
+~~~~~~~~~~~~~~~~~~
+
+Show persisted link objects.
+
++-----------------------+------------------------------------------------------+
+| Argument              |  Description                                         |
++=======================+======================================================+
+| ``-a``, ``--all``     | Show all available links                             |
++-----------------------+------------------------------------------------------+
+| ``-x``, ``--lid <x>`` | Show link with id ``<x>``                            |
++-----------------------+------------------------------------------------------+
+
+Example: ::
+
+  show link --all or show link
+
+Show Job Function
+~~~~~~~~~~~~~~~~~
+
+Show persisted job objects.
+
++-----------------------+----------------------------------------------+
+| Argument              |  Description                                 |
++=======================+==============================================+
+| ``-a``, ``--all``     | Show all available jobs                      |
++-----------------------+----------------------------------------------+
+| ``-j``, ``--jid <x>`` | Show job with id ``<x>``                     |
++-----------------------+----------------------------------------------+
+
+Example: ::
+
+  show job --all or show job
+
+Show Submission Function
+~~~~~~~~~~~~~~~~~~~~~~~~
+
+Show persisted job submission objects.
+
++-----------------------+---------------------------------------------+
+| Argument              |  Description                                |
++=======================+=============================================+
+| ``-j``, ``--jid <x>`` | Show available submissions for given job    |
++-----------------------+---------------------------------------------+
+| ``-d``, ``--detail``  | Show job submissions in full details        |
++-----------------------+---------------------------------------------+
+
+Example: ::
+
+  show submission
+  show submission --jid 1
+  show submission --jid 1 --detail
+
+Create Command
+--------------
+
+Creates new link and job objects. This command is supported only in interactive mode. It will ask user to enter the link config and job configs for from /to and driver when creating link and job objects respectively.
+
+Available functions:
+
++----------------+-------------------------------------------------+
+| Function       | Description                                     |
++================+=================================================+
+| ``link``       | Create new link object                          |
++----------------+-------------------------------------------------+
+| ``job``        | Create new job object                           |
++----------------+-------------------------------------------------+
+
+Create Link Function
+~~~~~~~~~~~~~~~~~~~~
+
+Create new link object.
+
++------------------------+-------------------------------------------------------------+
+| Argument               |  Description                                                |
++========================+=============================================================+
+| ``-c``, ``--cid <x>``  |  Create new link object for connector with id ``<x>``       |
++------------------------+-------------------------------------------------------------+
+
+
+Example: ::
+
+  create link --cid 1 or create link -c 1
+
+Create Job Function
+~~~~~~~~~~~~~~~~~~~
+
+Create new job object.
+
++------------------------+------------------------------------------------------------------+
+| Argument               |  Description                                                     |
++========================+==================================================================+
+| ``-f``, ``--from <x>`` | Create new job object with a FROM link with id ``<x>``           |
++------------------------+------------------------------------------------------------------+
+| ``-t``, ``--to <t>``   | Create new job object with a TO link with id ``<x>``             |
++------------------------+------------------------------------------------------------------+
+
+Example: ::
+
+  create job --from 1 --to 2 or create job --f 1 --t 2 
+
+Update Command
+--------------
+
+Update commands allows you to edit link and job objects. This command is supported only in interactive mode.
+
+Update Link Function
+~~~~~~~~~~~~~~~~~~~~
+
+Update existing link object.
+
++-----------------------+---------------------------------------------+
+| Argument              |  Description                                |
++=======================+=============================================+
+| ``-x``, ``--lid <x>`` |  Update existing link with id ``<x>``       |
++-----------------------+---------------------------------------------+
+
+Example: ::
+
+  update link --lid 1
+
+Update Job Function
+~~~~~~~~~~~~~~~~~~~
+
+Update existing job object.
+
++-----------------------+--------------------------------------------+
+| Argument              |  Description                               |
++=======================+============================================+
+| ``-j``, ``--jid <x>`` | Update existing job object with id ``<x>`` |
++-----------------------+--------------------------------------------+
+
+Example: ::
+
+  update job --jid 1
+
+
+Delete Command
+--------------
+
+Deletes link and job objects from Sqoop server.
+
+Delete Link Function
+~~~~~~~~~~~~~~~~~~~~
+
+Delete existing link object.
+
++-----------------------+-------------------------------------------+
+| Argument              |  Description                              |
++=======================+===========================================+
+| ``-x``, ``--lid <x>`` |  Delete link object with id ``<x>``       |
++-----------------------+-------------------------------------------+
+
+Example: ::
+
+  delete link --lid 1
+
+
+Delete Job Function
+~~~~~~~~~~~~~~~~~~~
+
+Delete existing job object.
+
++-----------------------+------------------------------------------+
+| Argument              |  Description                             |
++=======================+==========================================+
+| ``-j``, ``--jid <x>`` | Delete job object with id ``<x>``        |
++-----------------------+------------------------------------------+
+
+Example: ::
+
+  delete job --jid 1
+
+
+Clone Command
+-------------
+
+Clone command will load existing link or job object from Sqoop server and allow user in place updates that will result in creation of new link or job object. This command is not supported in batch mode.
+
+Clone Link Function
+~~~~~~~~~~~~~~~~~~~~~~~~~
+
+Clone existing link object.
+
++-----------------------+------------------------------------------+
+| Argument              |  Description                             |
++=======================+==========================================+
+| ``-x``, ``--lid <x>`` |  Clone link object with id ``<x>``       |
++-----------------------+------------------------------------------+
+
+Example: ::
+
+  clone link --lid 1
+
+
+Clone Job Function
+~~~~~~~~~~~~~~~~~~
+
+Clone existing job object.
+
++-----------------------+------------------------------------------+
+| Argument              |  Description                             |
++=======================+==========================================+
+| ``-j``, ``--jid <x>`` | Clone job object with id ``<x>``         |
++-----------------------+------------------------------------------+
+
+Example: ::
+
+  clone job --jid 1
+
+Start Command
+-------------
+
+Start command will begin execution of an existing Sqoop job.
+
+Start Job Function
+~~~~~~~~~~~~~~~~~~
+
+Start job (submit new submission). Starting already running job is considered as invalid operation.
+
++----------------------------+----------------------------+
+| Argument                   |  Description               |
++============================+============================+
+| ``-j``, ``--jid <x>``      | Start job with id ``<x>``  |
++----------------------------+----------------------------+
+| ``-s``, ``--synchronous``  | Synchoronous job execution |
++----------------------------+----------------------------+
+
+Example: ::
+
+  start job --jid 1
+  start job --jid 1 --synchronous
+
+Stop Command
+------------
+
+Stop command will interrupt an job execution.
+
+Stop Job Function
+~~~~~~~~~~~~~~~~~
+
+Interrupt running job.
+
++-----------------------+------------------------------------------+
+| Argument              |  Description                             |
++=======================+==========================================+
+| ``-j``, ``--jid <x>`` | Interrupt running job with id ``<x>``    |
++-----------------------+------------------------------------------+
+
+Example: ::
+
+  stop job --jid 1
+
+Status Command
+--------------
+
+Status command will retrieve the last status of a job.
+
+Status Job Function
+~~~~~~~~~~~~~~~~~~~
+
+Retrieve last status for given job.
+
++-----------------------+------------------------------------------+
+| Argument              |  Description                             |
++=======================+==========================================+
+| ``-j``, ``--jid <x>`` | Retrieve status for job with id ``<x>``  |
++-----------------------+------------------------------------------+
+
+Example: ::
+
+  status job --jid 1
\ No newline at end of file



Mime
View raw message