Added: 
websites/staging/sqoop/trunk/content/docs/1.99.5/ConnectorDevelopment.html
==============================================================================
--- websites/staging/sqoop/trunk/content/docs/1.99.5/ConnectorDevelopment.html 
(added)
+++ websites/staging/sqoop/trunk/content/docs/1.99.5/ConnectorDevelopment.html 
Fri Feb 27 00:59:26 2015
@@ -0,0 +1,612 @@
+
+
+<!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 2 Connector Development &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 2 Connector Development</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-2-connector-development">
+<h1><a class="toc-backref" href="#id2">Sqoop 2 Connector Development</a><a 
class="headerlink" href="#sqoop-2-connector-development" title="Permalink to 
this headline">¶</a></h1>
+<p>This document describes how to implement a connector in the Sqoop 2 using 
the code sample from one of the built-in connectors ( <tt class="docutils 
literal"><span class="pre">GenericJdbcConnector</span></tt> ) as a reference. 
Sqoop 2 jobs support extraction from and/or loading to different data sources. 
Sqoop 2 connectors encapsulate the job lifecyle operations for extracting 
and/or loading data from and/or to
+different data sources. Each connector will primarily focus on a particular 
data source and its custom implementation for optimally reading and/or writing 
data in a distributed environment.</p>
+<div class="contents topic" id="contents">
+<p class="topic-title first">Contents</p>
+<ul class="simple">
+<li><a class="reference internal" href="#sqoop-2-connector-development" 
id="id2">Sqoop 2 Connector Development</a><ul>
+<li><a class="reference internal" href="#what-is-a-sqoop-connector" 
id="id3">What is a Sqoop Connector?</a><ul>
+<li><a class="reference internal" href="#when-do-we-add-a-new-connector" 
id="id4">When do we add a new connector?</a></li>
+</ul>
+</li>
+<li><a class="reference internal" href="#connector-implementation" 
id="id5">Connector Implementation</a><ul>
+<li><a class="reference internal" href="#from" id="id6">From</a><ul>
+<li><a class="reference internal" href="#initializer-and-destroyer" 
id="id7">Initializer and Destroyer</a></li>
+<li><a class="reference internal" href="#partitioner" 
id="id8">Partitioner</a></li>
+<li><a class="reference internal" href="#extractor" id="id9">Extractor</a></li>
+</ul>
+</li>
+<li><a class="reference internal" href="#to" id="id10">To</a><ul>
+<li><a class="reference internal" href="#id1" id="id11">Initializer and 
Destroyer</a></li>
+<li><a class="reference internal" href="#loader" id="id12">Loader</a></li>
+</ul>
+</li>
+<li><a class="reference internal" 
href="#sqoop-connector-identifier-sqoopconnector-properties" id="id13">Sqoop 
Connector Identifier : sqoopconnector.properties</a></li>
+<li><a class="reference internal" 
href="#sqoop-connector-build-time-dependencies" id="id14">Sqoop Connector 
Build-time Dependencies</a></li>
+</ul>
+</li>
+<li><a class="reference internal" href="#configurables" 
id="id15">Configurables</a><ul>
+<li><a class="reference internal" href="#configurable-registration" 
id="id16">Configurable registration</a></li>
+<li><a class="reference internal" href="#configurations" 
id="id17">Configurations</a></li>
+<li><a class="reference internal" href="#configs-and-inputs" id="id18">Configs 
and Inputs</a><ul>
+<li><a class="reference internal" href="#empty-configuration" id="id19">Empty 
Configuration</a></li>
+</ul>
+</li>
+<li><a class="reference internal" href="#configuration-resourcebundle" 
id="id20">Configuration ResourceBundle</a></li>
+<li><a class="reference internal" href="#validations-for-configs-and-inputs" 
id="id21">Validations for Configs and Inputs</a></li>
+</ul>
+</li>
+<li><a class="reference internal" href="#loading-external-connectors" 
id="id22">Loading External Connectors</a></li>
+<li><a class="reference internal" 
href="#sqoop-2-mapreduce-job-execution-lifecycle-with-connector-api" 
id="id23">Sqoop 2 MapReduce Job Execution Lifecycle with Connector API</a></li>
+</ul>
+</li>
+</ul>
+</div>
+<div class="section" id="what-is-a-sqoop-connector">
+<h2><a class="toc-backref" href="#id3">What is a Sqoop Connector?</a><a 
class="headerlink" href="#what-is-a-sqoop-connector" title="Permalink to this 
headline">¶</a></h2>
+<p>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 connector 
implementation will provide logic to read from and/or write to a data source 
that it represents. For instance the ( <tt class="docutils literal"><span 
class="pre">GenericJdbcConnector</span></tt> ) encapsulates the logic to read 
from and/or write to jdbc enabled relational data sources. The connector part 
that enables reading from a data source and transferring this data to internal 
Sqoop format is called the FROM and the part that enables writng data to a data 
source by transferring data from Sqoop format is called TO. In order to 
interact with these data sources, the connector will provide one or many config 
classes and input fields within it.</p>
+<p>Broadly we support two main config types for connectors, link type 
represented by the enum <tt class="docutils literal"><span 
class="pre">ConfigType.LINK</span></tt> and job type represented by the enum 
<tt class="docutils literal"><span class="pre">ConfigType.JOB</span></tt>. Link 
config represents the properties to physically connect to the data source. Job 
config represent the properties that are required to invoke reading from and/or 
writing to particular dataset in the data source it connects to. If a connector 
supports both reading from and writing to, it will provide the <tt 
class="docutils literal"><span class="pre">FromJobConfig</span></tt> and <tt 
class="docutils literal"><span class="pre">ToJobConfig</span></tt> objects. 
Each of these config objects are custom to each connector and can have one or 
more inputs associated with each of the Link, FromJob and ToJob config types. 
Hence we call the connectors as configurables i.e an entity that can provide 
configs for interac
 ting with the data source it represents. As the connectors evolve over time to 
support new features in their data sources, the configs and inputs will change 
as well. Thus the connector API also provides methods for upgrading the config 
and input names and data related to these data sources across different 
versions.</p>
+<p>The connectors implement logic for various stages of the extract/load 
process using the connector API described below. While extracting/reading data 
from the data-source the main stages are <tt class="docutils literal"><span 
class="pre">Initializer</span></tt>, <tt class="docutils literal"><span 
class="pre">Partitioner</span></tt>, <tt class="docutils literal"><span 
class="pre">Extractor</span></tt> and <tt class="docutils literal"><span 
class="pre">Destroyer</span></tt>. While loading/writitng data to the data 
source the main stages currently supported are <tt class="docutils 
literal"><span class="pre">Initializer</span></tt>, <tt class="docutils 
literal"><span class="pre">Loader</span></tt> and <tt class="docutils 
literal"><span class="pre">Destroyer</span></tt>. Each stage has its unique set 
of responsibilities that are explained in detail below. Since connectors 
understand the internals of the data source they represent, they work in tandem 
with the sqoop supported execution 
 engines such as MapReduce or Spark (in future) to accomplish this process in a 
most optimal way.</p>
+<div class="section" id="when-do-we-add-a-new-connector">
+<h3><a class="toc-backref" href="#id4">When do we add a new connector?</a><a 
class="headerlink" href="#when-do-we-add-a-new-connector" title="Permalink to 
this headline">¶</a></h3>
+<p>You add a new connector when you need to extract/read data from a new data 
source, or load/write
+data into a new data source that is not supported yet in Sqoop 2.
+In addition to the connector API, Sqoop 2 also has an submission and execution 
engine interface.
+At the moment the only supported engine is MapReduce, but we may support 
additional engines in the future such as Spark. Since many parallel execution 
engines are capable of reading/writing data, there may be a question of whether 
adding support for a new data source should be done through the connector or 
the execution engine API.</p>
+<p><strong>Our guideline are as follows:</strong> Connectors should manage all 
data extract(reading) from and/or load(writing) into a data source. Submission 
and execution engine together manage the job submission and execution life 
cycle to read/write data from/to data sources in the most optimal way possible. 
If you need to support a new data store and details of linking to it and 
don&#8217;t care how the process of reading/writing from/to happens then you 
are looking to add a connector and you should continue reading the below 
Connector API details to contribute new connectors to Sqoop 2.</p>
+</div>
+</div>
+<div class="section" id="connector-implementation">
+<h2><a class="toc-backref" href="#id5">Connector Implementation</a><a 
class="headerlink" href="#connector-implementation" title="Permalink to this 
headline">¶</a></h2>
+<p>The <tt class="docutils literal"><span 
class="pre">SqoopConnector</span></tt> class defines an API for the connectors 
that must be implemented by the connector developers. Each Connector must 
extend <tt class="docutils literal"><span 
class="pre">SqoopConnector</span></tt> and override the methods shown below.</p>
+<div class="highlight-none"><div class="highlight"><pre>public abstract String 
getVersion();
+public abstract ResourceBundle getBundle(Locale locale);
+public abstract Class getLinkConfigurationClass();
+public abstract Class getJobConfigurationClass(Direction direction);
+public abstract From getFrom();
+public abstract To getTo();
+public abstract ConnectorConfigurableUpgrader getConfigurableUpgrader()
+</pre></div>
+</div>
+<p>Connectors can optionally override the following methods:</p>
+<div class="highlight-none"><div class="highlight"><pre>public 
List&lt;Direction&gt; getSupportedDirections();
+public Class&lt;? extends IntermediateDataFormat&lt;?&gt;&gt; 
getIntermediateDataFormat()
+</pre></div>
+</div>
+<p>The <tt class="docutils literal"><span class="pre">getVersion</span></tt> 
method returns the current version of the connector
+It is important to provide a unique identifier every time a connector jar is 
released externally.
+In case of the Sqoop built-in connectors, the version refers to the Sqoop 
build/release version. External
+connectors can also use the same or similar mechanism to set this version. The 
version number is critical for
+the connector upgrade logic used in Sqoop</p>
+<div class="highlight-none"><div class="highlight"><pre>@Override
+ public String getVersion() {
+  return VersionInfo.getBuildVersion();
+ }
+</pre></div>
+</div>
+<p>The <tt class="docutils literal"><span class="pre">getFrom</span></tt> 
method returns <a class="reference internal" href="#from">From</a> instance
+which is a <tt class="docutils literal"><span 
class="pre">Transferable</span></tt> entity that encapsulates the operations
+needed to read from the data source that the connector represents.</p>
+<p>The <tt class="docutils literal"><span class="pre">getTo</span></tt> method 
returns <a class="reference internal" href="#to">To</a> instance
+which is a <tt class="docutils literal"><span 
class="pre">Transferable</span></tt> entity that encapsulates the operations
+needed to write to the data source that the connector represents.</p>
+<p>Methods such as <tt class="docutils literal"><span 
class="pre">getBundle</span></tt> , <tt class="docutils literal"><span 
class="pre">getLinkConfigurationClass</span></tt> , <tt class="docutils 
literal"><span class="pre">getJobConfigurationClass</span></tt>
+are related to <a class="reference internal" 
href="#configurations">Configurations</a></p>
+<p>Since a connector represents a data source and it can support one of the 
two directions, either reading FROM its data source or writing to its data 
souurce or both, the <tt class="docutils literal"><span 
class="pre">getSupportedDirections</span></tt> method returns a list of 
directions that a connector will implement. This should be a subset of the 
values in the <tt class="docutils literal"><span 
class="pre">Direction</span></tt> enum we provide:</p>
+<div class="highlight-none"><div class="highlight"><pre>public 
List&lt;Direction&gt; getSupportedDirections() {
+    return Arrays.asList(new Direction[]{
+        Direction.FROM,
+        Direction.TO
+    });
+}
+</pre></div>
+</div>
+<div class="section" id="from">
+<h3><a class="toc-backref" href="#id6">From</a><a class="headerlink" 
href="#from" title="Permalink to this headline">¶</a></h3>
+<p>The <tt class="docutils literal"><span class="pre">getFrom</span></tt> 
method returns <a class="reference internal" href="#from">From</a> instance 
which is a <tt class="docutils literal"><span 
class="pre">Transferable</span></tt> entity that encapsulates the operations 
needed to read from the data source the connector represents. The built-in <tt 
class="docutils literal"><span class="pre">GenericJdbcConnector</span></tt> 
defines <tt class="docutils literal"><span class="pre">From</span></tt> like 
this.</p>
+<div class="highlight-none"><div class="highlight"><pre>private static final 
From FROM = new From(
+      GenericJdbcFromInitializer.class,
+      GenericJdbcPartitioner.class,
+      GenericJdbcExtractor.class,
+      GenericJdbcFromDestroyer.class);
+...
+
+@Override
+public From getFrom() {
+  return FROM;
+}
+</pre></div>
+</div>
+<div class="section" id="initializer-and-destroyer">
+<h4><a class="toc-backref" href="#id7">Initializer and Destroyer</a><a 
class="headerlink" href="#initializer-and-destroyer" title="Permalink to this 
headline">¶</a></h4>
+<p>Initializer is instantiated before the submission of sqoop job to the 
execution engine and doing preparations such as connecting to the data source, 
creating temporary tables or adding dependent jar files. Initializers are 
executed as the first step in the sqoop job lifecyle. Here is the <tt 
class="docutils literal"><span class="pre">Initializer</span></tt> API.</p>
+<div class="highlight-none"><div class="highlight"><pre>public abstract void 
initialize(InitializerContext context, LinkConfiguration linkConfiguration,
+    JobConfiguration jobConfiguration);
+
+public List&lt;String&gt; getJars(InitializerContext context, 
LinkConfiguration linkConfiguration,
+    JobConfiguration jobConfiguration){
+     return new LinkedList&lt;String&gt;();
+    }
+
+public abstract Schema getSchema(InitializerContext context, LinkConfiguration 
linkConfiguration,
+    JobConfiguration jobConfiguration) {
+       return new NullSchema();
+    }
+</pre></div>
+</div>
+<p>In addition to the initialize() method where the job execution preparation 
activities occur, the <tt class="docutils literal"><span 
class="pre">Initializer</span></tt> can also implement the getSchema() method 
for the directions <tt class="docutils literal"><span 
class="pre">FROM</span></tt> and <tt class="docutils literal"><span 
class="pre">TO</span></tt> that it supports.</p>
+<p>The getSchema() method is used by the sqoop system to match the data 
extracted/read by the <tt class="docutils literal"><span 
class="pre">From</span></tt> instance of connector data source with the data 
loaded/written to the <tt class="docutils literal"><span 
class="pre">To</span></tt> instance of the connector data source. In case of a 
relational database or columnar database, the returned Schema object will 
include collection of columns with their data types. If the data source is 
schema-less, such as a file, a default <tt class="docutils literal"><span 
class="pre">NullSchema</span></tt> will be used (i.e a Schema object without 
any columns).</p>
+<p>NOTE: Sqoop 2 currently does not support extract and load between two 
connectors that represent schema-less data sources. We expect that atleast the 
<tt class="docutils literal"><span class="pre">From</span></tt> instance of the 
connector or the <tt class="docutils literal"><span class="pre">To</span></tt> 
instance of the connector in the sqoop job will have a schema. If both <tt 
class="docutils literal"><span class="pre">From</span></tt> and <tt 
class="docutils literal"><span class="pre">To</span></tt> have a associated non 
empty schema, Sqoop 2 will load data by column name, i.e, data in column 
&#8220;A&#8221; in <tt class="docutils literal"><span 
class="pre">From</span></tt> instance of the connector for the job will be 
loaded to column &#8220;A&#8221; in the <tt class="docutils literal"><span 
class="pre">To</span></tt> instance of the connector for that job.</p>
+<p><tt class="docutils literal"><span class="pre">Destroyer</span></tt> is 
instantiated after the execution engine finishes its processing. It is the last 
step in the sqoop job lifecyle, so pending clean up tasks such as dropping 
temporary tables and closing connections. The term destroyer is a little 
misleading. It represents the phase where the final output commits to the data 
source can also happen in case of the <tt class="docutils literal"><span 
class="pre">TO</span></tt> instance of the connector code.</p>
+</div>
+<div class="section" id="partitioner">
+<h4><a class="toc-backref" href="#id8">Partitioner</a><a class="headerlink" 
href="#partitioner" title="Permalink to this headline">¶</a></h4>
+<p>The <tt class="docutils literal"><span class="pre">Partitioner</span></tt> 
creates <tt class="docutils literal"><span class="pre">Partition</span></tt> 
instances ranging from 1..N. The N is driven by a configuration as well. The 
default set of partitions created is set to 10 in the sqoop code. Here is the 
<tt class="docutils literal"><span class="pre">Partitioner</span></tt> API</p>
+<p><tt class="docutils literal"><span class="pre">Partitioner</span></tt> must 
implement the <tt class="docutils literal"><span 
class="pre">getPartitions</span></tt> method in the <tt class="docutils 
literal"><span class="pre">Partitioner</span></tt> API.</p>
+<div class="highlight-none"><div class="highlight"><pre>public abstract 
List&lt;Partition&gt; getPartitions(PartitionerContext context,
+    LinkConfiguration linkConfiguration, FromJobConfiguration 
jobConfiguration);
+</pre></div>
+</div>
+<p><tt class="docutils literal"><span class="pre">Partition</span></tt> 
instances are passed to <a class="reference internal" 
href="#extractor">Extractor</a> as the argument of <tt class="docutils 
literal"><span class="pre">extract</span></tt> method.
+<a class="reference internal" href="#extractor">Extractor</a> determines which 
portion of the data to extract by a given partition.</p>
+<p>There is no actual convention for Partition classes other than being 
actually <tt class="docutils literal"><span class="pre">Writable</span></tt> 
and <tt class="docutils literal"><span class="pre">toString()</span></tt> 
-able. Here is the <tt class="docutils literal"><span 
class="pre">Partition</span></tt> API</p>
+<div class="highlight-none"><div class="highlight"><pre>public abstract class 
Partition {
+  public abstract void readFields(DataInput in) throws IOException;
+  public abstract void write(DataOutput out) throws IOException;
+  public abstract String toString();
+}
+</pre></div>
+</div>
+<p>Connectors can implement custom <tt class="docutils literal"><span 
class="pre">Partition</span></tt> classes. <tt class="docutils literal"><span 
class="pre">GenericJdbcPartitioner</span></tt> is one such example. It returns 
the <tt class="docutils literal"><span 
class="pre">GenericJdbcPartition</span></tt> objects.</p>
+</div>
+<div class="section" id="extractor">
+<h4><a class="toc-backref" href="#id9">Extractor</a><a class="headerlink" 
href="#extractor" title="Permalink to this headline">¶</a></h4>
+<p>Extractor (E for ETL) extracts data from a given data source
+<tt class="docutils literal"><span class="pre">Extractor</span></tt> must 
implement the <tt class="docutils literal"><span 
class="pre">extract</span></tt> method in the <tt class="docutils 
literal"><span class="pre">Extractor</span></tt> API.</p>
+<div class="highlight-none"><div class="highlight"><pre>public abstract void 
extract(ExtractorContext context,
+                             LinkConfiguration linkConfiguration,
+                             JobConfiguration jobConfiguration,
+                             SqoopPartition partition);
+</pre></div>
+</div>
+<p>The <tt class="docutils literal"><span class="pre">extract</span></tt> 
method extracts data from the data source using the link and job configuration 
properties and writes it to the <tt class="docutils literal"><span 
class="pre">SqoopMapDataWriter</span></tt> (provided in the extractor context 
given to the extract method).
+The <tt class="docutils literal"><span 
class="pre">SqoopMapDataWriter</span></tt> has the <tt class="docutils 
literal"><span class="pre">SqoopWritable</span></tt> thats holds the data read 
from the data source in the <a class="reference external" 
href="https://cwiki.apache.org/confluence/display/SQOOP/Sqoop2+Intermediate+representation";>Intermediate
 Data Format representation</a></p>
+<p>Extractors use Writer&#8217;s provided by the ExtractorContext to send a 
record through the sqoop system.</p>
+<div class="highlight-none"><div 
class="highlight"><pre>context.getDataWriter().writeArrayRecord(array);
+</pre></div>
+</div>
+<p>The extractor must iterate through the given partition in the <tt 
class="docutils literal"><span class="pre">extract</span></tt> method.</p>
+<div class="highlight-none"><div class="highlight"><pre>while 
(resultSet.next()) {
+  ...
+  context.getDataWriter().writeArrayRecord(array);
+  ...
+}
+</pre></div>
+</div>
+</div>
+</div>
+<div class="section" id="to">
+<h3><a class="toc-backref" href="#id10">To</a><a class="headerlink" href="#to" 
title="Permalink to this headline">¶</a></h3>
+<p>The <tt class="docutils literal"><span class="pre">getTo</span></tt> method 
returns <tt class="docutils literal"><span class="pre">TO</span></tt> instance 
which is a <tt class="docutils literal"><span 
class="pre">Transferable</span></tt> entity that encapsulates the operations 
needed to wtite data to the data source the connector represents. The built-in 
<tt class="docutils literal"><span class="pre">GenericJdbcConnector</span></tt> 
defines <tt class="docutils literal"><span class="pre">To</span></tt> like 
this.</p>
+<div class="highlight-none"><div class="highlight"><pre>private static final 
To TO = new To(
+      GenericJdbcToInitializer.class,
+      GenericJdbcLoader.class,
+      GenericJdbcToDestroyer.class);
+...
+
+@Override
+public To getTo() {
+  return TO;
+}
+</pre></div>
+</div>
+<div class="section" id="id1">
+<h4><a class="toc-backref" href="#id11">Initializer and Destroyer</a><a 
class="headerlink" href="#id1" title="Permalink to this headline">¶</a></h4>
+<p><a class="reference internal" href="#initializer">Initializer</a> and <a 
class="reference internal" href="#destroyer">Destroyer</a> of a <tt 
class="docutils literal"><span class="pre">To</span></tt> instance are used in 
a similar way to those of a <tt class="docutils literal"><span 
class="pre">From</span></tt> instance.
+Refer to the previous section for more details.</p>
+</div>
+<div class="section" id="loader">
+<h4><a class="toc-backref" href="#id12">Loader</a><a class="headerlink" 
href="#loader" title="Permalink to this headline">¶</a></h4>
+<p>A loader (L for ETL) receives data from the <tt class="docutils 
literal"><span class="pre">From</span></tt> instance of the sqoop connector 
associated with the sqoop job and then loads it to an <tt class="docutils 
literal"><span class="pre">TO</span></tt> instance of the connector associated 
with the same sqoop job</p>
+<p><tt class="docutils literal"><span class="pre">Loader</span></tt> must 
implement <tt class="docutils literal"><span class="pre">load</span></tt> 
method of the <tt class="docutils literal"><span class="pre">Loader</span></tt> 
API</p>
+<div class="highlight-none"><div class="highlight"><pre>public abstract void 
load(LoaderContext context,
+                          ConnectionConfiguration connectionConfiguration,
+                          JobConfiguration jobConfiguration) throws Exception;
+</pre></div>
+</div>
+<p>The <tt class="docutils literal"><span class="pre">load</span></tt> method 
reads data from <tt class="docutils literal"><span 
class="pre">SqoopOutputFormatDataReader</span></tt> (provided in the loader 
context of the load methods). It reads the data in the <a class="reference 
external" 
href="https://cwiki.apache.org/confluence/display/SQOOP/Sqoop2+Intermediate+representation";>Intermediate
 Data Format representation</a> and loads it to the data source.</p>
+<p>Loader must iterate in the <tt class="docutils literal"><span 
class="pre">load</span></tt> method until the data from <tt class="docutils 
literal"><span class="pre">DataReader</span></tt> is exhausted.</p>
+<div class="highlight-none"><div class="highlight"><pre>while ((array = 
context.getDataReader().readArrayRecord()) != null) {
+  ...
+}
+</pre></div>
+</div>
+<p>NOTE: we do not yet support a stage for connector developers to control how 
to balance the loading/writitng of data across the mutiple loaders. In future 
we may be adding this to the connector API to have custom logic to balance the 
loading across multiple reducers.</p>
+</div>
+</div>
+<div class="section" id="sqoop-connector-identifier-sqoopconnector-properties">
+<h3><a class="toc-backref" href="#id13">Sqoop Connector Identifier : 
sqoopconnector.properties</a><a class="headerlink" 
href="#sqoop-connector-identifier-sqoopconnector-properties" title="Permalink 
to this headline">¶</a></h3>
+<p>Every Sqoop 2 connector needs to have a sqoopconnector.properties in the 
packaged jar to be identified by Sqoop.
+A typical <tt class="docutils literal"><span 
class="pre">sqoopconnector.properties</span></tt> for a sqoop2 connector looks 
like below</p>
+<div class="highlight-none"><div class="highlight"><pre># Sqoop Foo Connector 
Properties
+org.apache.sqoop.connector.class = org.apache.sqoop.connector.foo.FooConnector
+org.apache.sqoop.connector.name = sqoop-foo-connector
+</pre></div>
+</div>
+<p>If the above file does not exist, then Sqoop will not load this jar and 
thus cannot be registered into Sqoop repository for creating Sqoop jobs</p>
+</div>
+<div class="section" id="sqoop-connector-build-time-dependencies">
+<h3><a class="toc-backref" href="#id14">Sqoop Connector Build-time 
Dependencies</a><a class="headerlink" 
href="#sqoop-connector-build-time-dependencies" title="Permalink to this 
headline">¶</a></h3>
+<p>Sqoop provides the connector-sdk module identified by the package:<tt 
class="docutils literal"><span 
class="pre">org.apache.sqoop.connector</span></tt> It provides the public 
facing apis for the external connectors
+to extend from. It also provides common utilities that the connectors can 
utilize for converting data to and from the sqoop intermediate data format</p>
+<p>The common-test module identified by the package  <tt class="docutils 
literal"><span class="pre">org.apache.sqoop.common.test</span></tt> provides 
utilities used related to the built-in connectors such as the JDBC, HDFS,
+and Kafka connectors that can be used by the external connectors for creating 
the end-end integration test for sqoop jobs</p>
+<dl class="docutils">
+<dt>The test module identified by the package <tt class="docutils 
literal"><span class="pre">org.apache.sqoop.test</span></tt> provides various 
minicluster utilites the integration tests can extend from to run</dt>
+<dd>a sqoop job with the given sqoop connector either using it as a <tt 
class="docutils literal"><span class="pre">FROM</span></tt> or <tt 
class="docutils literal"><span class="pre">TO</span></tt> data-source</dd>
+</dl>
+<p>Hence the pom.xml for the sqoop kite connector built using the kite-sdk  
might look something like below</p>
+<div class="highlight-none"><div class="highlight"><pre> &lt;dependencies&gt;
+  &lt;!-- Sqoop modules --&gt;
+  &lt;dependency&gt;
+    &lt;groupId&gt;org.apache.sqoop&lt;/groupId&gt;
+    &lt;artifactId&gt;connector-sdk&lt;/artifactId&gt;
+  &lt;/dependency&gt;
+
+  &lt;!-- Testing specified modules --&gt;
+  &lt;dependency&gt;
+    &lt;groupId&gt;org.testng&lt;/groupId&gt;
+    &lt;artifactId&gt;testng&lt;/artifactId&gt;
+    &lt;scope&gt;test&lt;/scope&gt;
+  &lt;/dependency&gt;
+  &lt;dependency&gt;
+    &lt;groupId&gt;org.mockito&lt;/groupId&gt;
+    &lt;artifactId&gt;mockito-all&lt;/artifactId&gt;
+    &lt;scope&gt;test&lt;/scope&gt;
+  &lt;/dependency&gt;
+   &lt;dependency&gt;
+     &lt;groupId&gt;org.apache.sqoop&lt;/groupId&gt;
+     &lt;artifactId&gt;sqoop-common-test&lt;/artifactId&gt;
+   &lt;/dependency&gt;
+
+   &lt;dependency&gt;
+     &lt;groupId&gt;org.apache.sqoop&lt;/groupId&gt;
+     &lt;artifactId&gt;test&lt;/artifactId&gt;
+   &lt;/dependency&gt;
+  &lt;!-- Connector required modules --&gt;
+  &lt;dependency&gt;
+    &lt;groupId&gt;org.kitesdk&lt;/groupId&gt;
+    &lt;artifactId&gt;kite-data-core&lt;/artifactId&gt;
+  &lt;/dependency&gt;
+  ....
+&lt;/dependencies&gt;
+</pre></div>
+</div>
+</div>
+</div>
+<div class="section" id="configurables">
+<h2><a class="toc-backref" href="#id15">Configurables</a><a class="headerlink" 
href="#configurables" title="Permalink to this headline">¶</a></h2>
+<div class="section" id="configurable-registration">
+<h3><a class="toc-backref" href="#id16">Configurable registration</a><a 
class="headerlink" href="#configurable-registration" title="Permalink to this 
headline">¶</a></h3>
+<p>One of the currently supported configurable in Sqoop are the connectors. 
Sqoop 2 registers definitions of connectors from the file named <tt 
class="docutils literal"><span 
class="pre">sqoopconnector.properties</span></tt> which each connector 
implementation should provide to become available in Sqoop.</p>
+<div class="highlight-none"><div class="highlight"><pre># Generic JDBC 
Connector Properties
+org.apache.sqoop.connector.class = 
org.apache.sqoop.connector.jdbc.GenericJdbcConnector
+org.apache.sqoop.connector.name = generic-jdbc-connector
+</pre></div>
+</div>
+</div>
+<div class="section" id="configurations">
+<h3><a class="toc-backref" href="#id17">Configurations</a><a 
class="headerlink" href="#configurations" title="Permalink to this 
headline">¶</a></h3>
+<p>Implementations of <tt class="docutils literal"><span 
class="pre">SqoopConnector</span></tt> overrides methods such as <tt 
class="docutils literal"><span 
class="pre">getLinkConfigurationClass</span></tt> and <tt class="docutils 
literal"><span class="pre">getJobConfigurationClass</span></tt> returning 
configuration class.</p>
+<div class="highlight-none"><div class="highlight"><pre>@Override
+public Class getLinkConfigurationClass() {
+  return LinkConfiguration.class;
+}
+
+@Override
+public Class getJobConfigurationClass(Direction direction) {
+  switch (direction) {
+    case FROM:
+      return FromJobConfiguration.class;
+    case TO:
+      return ToJobConfiguration.class;
+    default:
+      return null;
+  }
+}
+</pre></div>
+</div>
+<p>Configurations are represented by annotations defined in <tt 
class="docutils literal"><span class="pre">org.apache.sqoop.model</span></tt> 
package.
+Annotations such as <tt class="docutils literal"><span 
class="pre">ConfigurationClass</span></tt> , <tt class="docutils literal"><span 
class="pre">ConfigClass</span></tt> , <tt class="docutils literal"><span 
class="pre">Config</span></tt> and <tt class="docutils literal"><span 
class="pre">Input</span></tt>
+are provided for defining configuration objects for each connector.</p>
+<p><tt class="docutils literal"><span 
class="pre">&#64;ConfigurationClass</span></tt> is a marker annotation for <tt 
class="docutils literal"><span class="pre">ConfigurationClasses</span></tt>  
that hold a group or lis of <tt class="docutils literal"><span 
class="pre">ConfigClasses</span></tt> annotated with the marker <tt 
class="docutils literal"><span class="pre">&#64;ConfigClass</span></tt></p>
+<div class="highlight-none"><div class="highlight"><pre>@ConfigurationClass
+public class LinkConfiguration {
+
+  @Config public LinkConfig linkConfig;
+
+  public LinkConfiguration() {
+    linkConfig = new LinkConfig();
+  }
+}
+</pre></div>
+</div>
+<p>Each <tt class="docutils literal"><span class="pre">ConfigClass</span></tt> 
defines the different inputs it exposes for the link and job configs. These 
inputs are annotated with <tt class="docutils literal"><span 
class="pre">&#64;Input</span></tt> and the user will be asked to fill in when 
they create a sqoop job and choose to use this instance of the connector for 
either the <tt class="docutils literal"><span class="pre">From</span></tt> or 
<tt class="docutils literal"><span class="pre">To</span></tt> part of the 
job.</p>
+<div class="highlight-none"><div 
class="highlight"><pre>@ConfigClass(validators = 
{@Validator(LinkConfig.ConfigValidator.class)})
+public class LinkConfig {
+  @Input(size = 128, validators = {@Validator(NotEmpty.class), 
@Validator(ClassAvailable.class)} )
+  @Input(size = 128) public String jdbcDriver;
+  @Input(size = 128) public String connectionString;
+  @Input(size = 40)  public String username;
+  @Input(size = 40, sensitive = true) public String password;
+  @Input public Map&lt;String, String&gt; jdbcProperties;
+}
+</pre></div>
+</div>
+<p>Each <tt class="docutils literal"><span class="pre">ConfigClass</span></tt> 
and the  inputs within the configs annotated with <tt class="docutils 
literal"><span class="pre">Input</span></tt> can specifiy validators via the 
<tt class="docutils literal"><span class="pre">&#64;Validator</span></tt> 
annotation described below.</p>
+</div>
+<div class="section" id="configs-and-inputs">
+<h3><a class="toc-backref" href="#id18">Configs and Inputs</a><a 
class="headerlink" href="#configs-and-inputs" title="Permalink to this 
headline">¶</a></h3>
+<p>As discussed above, <tt class="docutils literal"><span 
class="pre">Input</span></tt> provides a way to express the type of config 
parameter exposed. In addition it allows connector developer to add attributes
+that describe how the input will be used in the sqoop job. Here are the list 
of the supported attributes</p>
+<p>Inputs associated with the link configuration include:</p>
+<table border="1" class="docutils">
+<colgroup>
+<col width="18%" />
+<col width="6%" />
+<col width="45%" />
+<col width="31%" />
+</colgroup>
+<thead valign="bottom">
+<tr class="row-odd"><th class="head">Attribute</th>
+<th class="head">Type</th>
+<th class="head">Description</th>
+<th class="head">Example</th>
+</tr>
+</thead>
+<tbody valign="top">
+<tr class="row-even"><td>size</td>
+<td>Integer</td>
+<td>Describes the maximum size of the attribute value .</td>
+<td>&#64;Input(size = 128) public String driver</td>
+</tr>
+<tr class="row-odd"><td>sensitive</td>
+<td>Boolean</td>
+<td>Describes if the input value should be hidden from display</td>
+<td>&#64;Input(sensitive = true) public String password</td>
+</tr>
+<tr class="row-even"><td>editable</td>
+<td>Enum</td>
+<td>Describes the roles that can edit the value of this input</td>
+<td>&#64;Input(editable = ANY) public String value</td>
+</tr>
+<tr class="row-odd"><td>overrides</td>
+<td>String</td>
+<td>Describes a list of other inputs this input can override in this 
config</td>
+<td>&#64;Input(overrides =&#8221;value&#8221;) public String lvalue</td>
+</tr>
+</tbody>
+</table>
+<p><tt class="docutils literal"><span class="pre">Editable</span></tt> 
Attribute: Possible values for the Enum InputEditable are USER_ONLY, 
CONNECTOR_ONLY, ANY. If an input says editable by USER_ONLY, then the connector 
code during the
+job run or upgrade cannot update the config input value. Similarly for a 
CONNECTOR_ONLY, user cannot update its value via the rest api or shell command 
line.</p>
+<p><tt class="docutils literal"><span class="pre">Overrides</span></tt> 
Attribute: USER_ONLY input attribute values cannot be overriden by other 
inputs.</p>
+<div class="section" id="empty-configuration">
+<h4><a class="toc-backref" href="#id19">Empty Configuration</a><a 
class="headerlink" href="#empty-configuration" title="Permalink to this 
headline">¶</a></h4>
+<p>If a connector does not have any configuration inputs to specify for the 
<tt class="docutils literal"><span class="pre">ConfigType.LINK</span></tt> or 
<tt class="docutils literal"><span class="pre">ConfigType.JOB</span></tt> it is 
recommended to return the <tt class="docutils literal"><span 
class="pre">EmptyConfiguration</span></tt> class in the <tt class="docutils 
literal"><span class="pre">getLinkConfigurationClass()</span></tt> or <tt 
class="docutils literal"><span 
class="pre">getJobConfigurationClass(..)</span></tt> methods.</p>
+<div class="highlight-none"><div class="highlight"><pre>@ConfigurationClass
+public class EmptyConfiguration { }
+</pre></div>
+</div>
+</div>
+</div>
+<div class="section" id="configuration-resourcebundle">
+<h3><a class="toc-backref" href="#id20">Configuration ResourceBundle</a><a 
class="headerlink" href="#configuration-resourcebundle" title="Permalink to 
this headline">¶</a></h3>
+<p>The config and its corresponding input names, the input field description 
are represented in the config resource bundle defined per connector.</p>
+<div class="highlight-none"><div class="highlight"><pre># jdbc driver
+connection.jdbcDriver.label = JDBC Driver Class
+connection.jdbcDriver.help = Enter the fully qualified class name of the JDBC \
+                   driver that will be used for establishing this connection.
+
+# connect string
+connection.connectionString.label = JDBC Connection String
+connection.connectionString.help = Enter the value of JDBC connection string 
to be \
+                   used by this connector for creating connections.
+
+...
+</pre></div>
+</div>
+<p>Those resources are loaded by <tt class="docutils literal"><span 
class="pre">getBundle</span></tt> method of the <tt class="docutils 
literal"><span class="pre">SqoopConnector.</span></tt></p>
+<div class="highlight-none"><div class="highlight"><pre>@Override
+public ResourceBundle getBundle(Locale locale) {
+  return ResourceBundle.getBundle(
+  GenericJdbcConnectorConstants.RESOURCE_BUNDLE_NAME, locale);
+}
+</pre></div>
+</div>
+</div>
+<div class="section" id="validations-for-configs-and-inputs">
+<h3><a class="toc-backref" href="#id21">Validations for Configs and 
Inputs</a><a class="headerlink" href="#validations-for-configs-and-inputs" 
title="Permalink to this headline">¶</a></h3>
+<p>Validators validate the config objects and the inputs associated with the 
config objects. For config objects themselves we encourage developers to write 
custom valdiators for both the link and job config types.</p>
+<div class="highlight-none"><div class="highlight"><pre>@Input(size = 128, 
validators = {@Validator(value = StartsWith.class, strArg = &quot;jdbc:&quot;)} 
)
+
+@Input(size = 255, validators = { @Validator(NotEmpty.class) })
+</pre></div>
+</div>
+<p>Sqoop 2 provides a list of standard input validators that can be used by 
different connectors for the link and job type configuration inputs.</p>
+<div class="highlight-none"><div class="highlight"><pre>public class NotEmpty 
extends AbstractValidator&lt;String&gt; {
+@Override
+public void validate(String instance) {
+  if (instance == null || instance.isEmpty()) {
+   addMessage(Status.ERROR, &quot;Can&#39;t be null nor empty&quot;);
+  }
+ }
+}
+</pre></div>
+</div>
+<p>The validation logic is executed when users creating the sqoop jobs input 
values for the link and job configs associated with the <tt class="docutils 
literal"><span class="pre">From</span></tt> and <tt class="docutils 
literal"><span class="pre">To</span></tt> instances of the connectors 
associated with the job.</p>
+</div>
+</div>
+<div class="section" id="loading-external-connectors">
+<h2><a class="toc-backref" href="#id22">Loading External Connectors</a><a 
class="headerlink" href="#loading-external-connectors" title="Permalink to this 
headline">¶</a></h2>
+<p>Loading new connector say sqoop-foo-connector to the sqoop2, here are the 
steps to follow</p>
+<ol class="arabic simple">
+<li>Create a <tt class="docutils literal"><span 
class="pre">sqoop-foo-connector.jar</span></tt>. Make sure the jar contains the 
<tt class="docutils literal"><span 
class="pre">sqoopconnector.properties</span></tt> for it to be picked up by 
Sqoop</li>
+<li>Add this jar to the a folder on your installation machine and update the 
path to this folder in the sqoop.properties located under the <tt 
class="docutils literal"><span class="pre">server/conf</span></tt> directory 
under the Sqoop2  for the key <tt class="docutils literal"><span 
class="pre">org.apache.sqoop.connector.external.loadpath</span></tt></li>
+</ol>
+<div class="highlight-none"><div class="highlight"><pre>#
+# External connectors load path
+# &quot;/path/to/external/connectors/&quot;: Add all the connector JARs in the 
specified folder
+#
+org.apache.sqoop.connector.external.loadpath=/path/to/connector
+</pre></div>
+</div>
+<ol class="arabic simple" start="3">
+<li>Start the Sqoop 2 server and while initializing the server this jar should 
be loaded into the Sqoop 2&#8217;s class path and registered into the Sqoop 2 
repository</li>
+</ol>
+</div>
+<div class="section" 
id="sqoop-2-mapreduce-job-execution-lifecycle-with-connector-api">
+<h2><a class="toc-backref" href="#id23">Sqoop 2 MapReduce Job Execution 
Lifecycle with Connector API</a><a class="headerlink" 
href="#sqoop-2-mapreduce-job-execution-lifecycle-with-connector-api" 
title="Permalink to this headline">¶</a></h2>
+<p>Sqoop 2 provides MapReduce utilities such as <tt class="docutils 
literal"><span class="pre">SqoopMapper</span></tt> and <tt class="docutils 
literal"><span class="pre">SqoopReducer</span></tt> that aid sqoop job 
execution.</p>
+<p>Note: Any class prefixed with Sqoop is a internal sqoop class provided for 
MapReduce and is not part of the conenector API. These internal classes work 
with the custom implementations of <tt class="docutils literal"><span 
class="pre">Extractor</span></tt>, <tt class="docutils literal"><span 
class="pre">Partitioner</span></tt> in the <tt class="docutils literal"><span 
class="pre">From</span></tt> instance and <tt class="docutils literal"><span 
class="pre">Loader</span></tt> in the <tt class="docutils literal"><span 
class="pre">To</span></tt> instance of the connector.</p>
+<p>When reading from a data source, the <tt class="docutils literal"><span 
class="pre">Extractor</span></tt> provided by the <tt class="docutils 
literal"><span class="pre">From</span></tt> instance of the connector extracts 
data from a corresponding data source it represents and the <tt class="docutils 
literal"><span class="pre">Loader</span></tt>, provided by the TO instance of 
the connector, loads data into the data source it represents.</p>
+<p>The diagram below describes the initialization phase of a job.
+<tt class="docutils literal"><span class="pre">SqoopInputFormat</span></tt> 
create splits using <tt class="docutils literal"><span 
class="pre">Partitioner</span></tt>.</p>
+<div class="highlight-none"><div class="highlight"><pre>    ,----------------. 
         ,-----------.
+    |SqoopInputFormat|          |Partitioner|
+    `-------+--------&#39;          `-----+-----&#39;
+ getSplits  |                         |
+-----------&gt;|                         |
+            |      getPartitions      |
+            |------------------------&gt;|
+            |                         |         ,---------.
+            |                         |-------&gt; |Partition|
+            |                         |         `----+----&#39;
+            |&lt;- - - - - - - - - - - - |              |
+            |                         |              |          ,----------.
+            |--------------------------------------------------&gt;|SqoopSplit|
+            |                         |              |          
`----+-----&#39;
+</pre></div>
+</div>
+<p>The diagram below describes the map phase of a job.
+<tt class="docutils literal"><span class="pre">SqoopMapper</span></tt> invokes 
<tt class="docutils literal"><span class="pre">From</span></tt> 
connector&#8217;s extractor&#8217;s <tt class="docutils literal"><span 
class="pre">extract</span></tt> method.</p>
+<div class="highlight-none"><div class="highlight"><pre>    ,-----------.
+    |SqoopMapper|
+    `-----+-----&#39;
+   run    |
+---------&gt;|                                   ,------------------.
+          |----------------------------------&gt;|SqoopMapDataWriter|
+          |                                   `------+-----------&#39;
+          |                ,---------.               |
+          |--------------&gt; |Extractor|               |
+          |                `----+----&#39;               |
+          |      extract        |                    |
+          |--------------------&gt;|                    |
+          |                     |                    |
+         read from Data Source  |                    |
+&lt;-------------------------------|      write*        |
+          |                     |-------------------&gt;|
+          |                     |                    |           
,-------------.
+          |                     |                    
|----------&gt;|SqoopWritable|
+          |                     |                    |           
`----+--------&#39;
+          |                     |                    |                |
+          |                     |                    |                |  
context.write(writable, ..)
+          |                     |                    |                
|----------------------------&gt;
+</pre></div>
+</div>
+<p>The diagram below decribes the reduce phase of a job.
+<tt class="docutils literal"><span class="pre">OutputFormat</span></tt> 
invokes <tt class="docutils literal"><span class="pre">To</span></tt> 
connector&#8217;s loader&#8217;s <tt class="docutils literal"><span 
class="pre">load</span></tt> method (via <tt class="docutils literal"><span 
class="pre">SqoopOutputFormatLoadExecutor</span></tt> ).</p>
+<div class="highlight-none"><div class="highlight"><pre>  ,------------.  
,---------------------.
+  |SqoopReducer|  |SqoopNullOutputFormat|
+  `---+--------&#39;  `----------+----------&#39;
+      |                 |   ,-----------------------------.
+      |                 |-&gt; |SqoopOutputFormatLoadExecutor|
+      |                 |   `--------------+--------------&#39;              |
+      |                 |                  |                             |
+      |                 |                  |   ,-----------------.   
,-------------.
+      |                 |                  |-&gt; 
|SqoopRecordWriter|--&gt;|SqoopWritable|
+    getRecordWriter     |                  |   `--------+--------&#39;   
`---+---------&#39;
+-----------------------&gt;| getRecordWriter  |            |                |
+      |                 |-----------------&gt;|            |                |  
   ,--------------.
+      |                 |                  
|----------------------------------&gt;|ConsumerThread|
+      |                 |                  |            |                |     
`------+-------&#39;
+      |                 |&lt;- - - - - - - - -|            |                |  
          |    ,------.
+&lt;- - - - - - - - - - - -|                  |            |                |  
          |---&gt;|Loader|
+      |                 |                  |            |                |     
       |    `--+---&#39;
+      |                 |                  |            |                |     
       |       |
+      |                 |                  |            |                |     
       | load  |
+ run  |                 |                  |            |                |     
       |------&gt;|
+-----&gt;|                 |     write        |            |                |  
          |       |
+      |------------------------------------------------&gt;| setContent     |  
          | read* |
+      |                 |                  |            |---------------&gt;| 
getContent |&lt;------|
+      |                 |                  |            |                
|&lt;-----------|       |
+      |                 |                  |            |                |     
       | - - -&gt;|
+      |                 |                  |            |                |     
       |       | write into Data Source
+      |                 |                  |            |                |     
       |       |-----------------------&gt;
+</pre></div>
+</div>
+<p>More details can be found in <a class="reference external" 
href="https://cwiki.apache.org/confluence/display/SQOOP/Sqoop+MR+Execution+Engine";>Sqoop
 MR Execution Engine</a></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: websites/staging/sqoop/trunk/content/docs/1.99.5/Connectors.html
==============================================================================
--- websites/staging/sqoop/trunk/content/docs/1.99.5/Connectors.html (added)
+++ websites/staging/sqoop/trunk/content/docs/1.99.5/Connectors.html Fri Feb 27 
00:59:26 2015
@@ -0,0 +1,352 @@
+
+
+<!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 2 Connectors &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 2 Connectors</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-2-connectors">
+<h1><a class="toc-backref" href="#id2">Sqoop 2 Connectors</a><a 
class="headerlink" href="#sqoop-2-connectors" title="Permalink to this 
headline">¶</a></h1>
+<p>This document describes how to use the built-in connectors. This includes a 
detailed description of how connectors partition, format their output, extract 
data, and load data.</p>
+<div class="contents topic" id="contents">
+<p class="topic-title first">Contents</p>
+<ul class="simple">
+<li><a class="reference internal" href="#sqoop-2-connectors" id="id2">Sqoop 2 
Connectors</a><ul>
+<li><a class="reference internal" href="#generic-jdbc-connector" 
id="id3">Generic JDBC Connector</a><ul>
+<li><a class="reference internal" href="#usage" id="id4">Usage</a></li>
+<li><a class="reference internal" href="#partitioner" 
id="id5">Partitioner</a></li>
+<li><a class="reference internal" href="#extractor" id="id6">Extractor</a></li>
+<li><a class="reference internal" href="#loader" id="id7">Loader</a></li>
+<li><a class="reference internal" href="#destroyers" 
id="id8">Destroyers</a></li>
+</ul>
+</li>
+</ul>
+</li>
+</ul>
+</div>
+<div class="section" id="generic-jdbc-connector">
+<h2><a class="toc-backref" href="#id3">Generic JDBC Connector</a><a 
class="headerlink" href="#generic-jdbc-connector" title="Permalink to this 
headline">¶</a></h2>
+<p>The Generic JDBC Connector can connect to any data source that adheres to 
the <strong>JDBC 4</strong> specification.</p>
+<div class="section" id="usage">
+<h3><a class="toc-backref" href="#id4">Usage</a><a class="headerlink" 
href="#usage" title="Permalink to this headline">¶</a></h3>
+<p>To use the Generic JDBC Connector, create a link for the connector and a 
job that uses the link.</p>
+<div class="section" id="link-configuration">
+<h4><strong>Link Configuration</strong><a class="headerlink" 
href="#link-configuration" title="Permalink to this headline">¶</a></h4>
+<p>Inputs associated with the link configuration include:</p>
+<table border="1" class="docutils">
+<colgroup>
+<col width="19%" />
+<col width="6%" />
+<col width="47%" />
+<col width="28%" />
+</colgroup>
+<thead valign="bottom">
+<tr class="row-odd"><th class="head">Input</th>
+<th class="head">Type</th>
+<th class="head">Description</th>
+<th class="head">Example</th>
+</tr>
+</thead>
+<tbody valign="top">
+<tr class="row-even"><td>JDBC Driver Class</td>
+<td>String</td>
+<td>The full class name of the JDBC driver.
+<em>Required</em> and accessible by the Sqoop server.</td>
+<td>com.mysql.jdbc.Driver</td>
+</tr>
+<tr class="row-odd"><td>JDBC Connection String</td>
+<td>String</td>
+<td>The JDBC connection string to use when connecting to the data source.
+<em>Required</em>. Connectivity upon creation is optional.</td>
+<td><a class="reference external" 
href="jdbc:mysql://localhost/test">jdbc:mysql://localhost/test</a></td>
+</tr>
+<tr class="row-even"><td>Username</td>
+<td>String</td>
+<td>The username to provide when connecting to the data source.
+<em>Optional</em>. Connectivity upon creation is optional.</td>
+<td>sqoop</td>
+</tr>
+<tr class="row-odd"><td>Password</td>
+<td>String</td>
+<td>The password to provide when connecting to the data source.
+<em>Optional</em>. Connectivity upon creation is optional.</td>
+<td>sqoop</td>
+</tr>
+<tr class="row-even"><td>JDBC Connection Properties</td>
+<td colspan="2"><dl class="first last docutils">
+<dt>Map     | A map of JDBC connection properties to pass to the JDBC 
driver</dt>
+<dd><div class="first last line-block">
+<div class="line"><em>Optional</em>.</div>
+</div>
+</dd>
+</dl>
+</td>
+<td>profileSQL=true&amp;useFastDateParsing=false</td>
+</tr>
+</tbody>
+</table>
+</div>
+<div class="section" id="from-job-configuration">
+<h4><strong>FROM Job Configuration</strong><a class="headerlink" 
href="#from-job-configuration" title="Permalink to this headline">¶</a></h4>
+<p>Inputs associated with the Job configuration for the FROM direction 
include:</p>
+<table border="1" class="docutils">
+<colgroup>
+<col width="19%" />
+<col width="6%" />
+<col width="47%" />
+<col width="29%" />
+</colgroup>
+<thead valign="bottom">
+<tr class="row-odd"><th class="head">Input</th>
+<th class="head">Type</th>
+<th class="head">Description</th>
+<th class="head">Example</th>
+</tr>
+</thead>
+<tbody valign="top">
+<tr class="row-even"><td>Schema name</td>
+<td>String</td>
+<td>The schema name the table is part of.
+<em>Optional</em></td>
+<td>sqoop</td>
+</tr>
+<tr class="row-odd"><td>Table name</td>
+<td>String</td>
+<td>The table name to import data from.
+<em>Optional</em>. See note below.</td>
+<td>test</td>
+</tr>
+<tr class="row-even"><td>Table SQL statement</td>
+<td>String</td>
+<td>The SQL statement used to perform a <strong>free form query</strong>.
+<em>Optional</em>. See notes below.</td>
+<td><tt class="docutils literal"><span class="pre">SELECT</span> <span 
class="pre">COUNT(*)</span> <span class="pre">FROM</span> <span 
class="pre">test</span> <span class="pre">${CONDITIONS}</span></tt></td>
+</tr>
+<tr class="row-odd"><td>Table column names</td>
+<td>String</td>
+<td>Columns to extract from the JDBC data source.
+<em>Optional</em> Comma separated list of columns.</td>
+<td>col1,col2</td>
+</tr>
+<tr class="row-even"><td>Partition column name</td>
+<td>Map</td>
+<td>The column name used to partition the data transfer process.
+<em>Optional</em>.  Defaults to primary key of table.</td>
+<td>col1</td>
+</tr>
+<tr class="row-odd"><td>Null value allowed for
+the partition column</td>
+<td>Boolean</td>
+<td>True or false depending on whether NULL values are allowed in data
+of the Partition column. <em>Optional</em>.</td>
+<td>true</td>
+</tr>
+<tr class="row-even"><td>Boundary query</td>
+<td colspan="2"><dl class="first last docutils">
+<dt>String  | The query used to define an upper and lower boundary when 
partitioning.</dt>
+<dd><div class="first last line-block">
+<div class="line"><em>Optional</em>.</div>
+</div>
+</dd>
+</dl>
+</td>
+<td>&nbsp;</td>
+</tr>
+</tbody>
+</table>
+<div class="section" id="notes">
+<h5><strong>Notes</strong><a class="headerlink" href="#notes" title="Permalink 
to this headline">¶</a></h5>
+<ol class="arabic simple">
+<li><em>Table name</em> and <em>Table SQL statement</em> are mutually 
exclusive. If <em>Table name</em> is provided, the <em>Table SQL statement</em> 
should not be provided. If <em>Table SQL statement</em> is provided then 
<em>Table name</em> should not be provided.</li>
+<li><em>Table column names</em> should be provided only if <em>Table name</em> 
is provided.</li>
+<li>If there are columns with similar names, column aliases are required. For 
example: <tt class="docutils literal"><span class="pre">SELECT</span> <span 
class="pre">table1.id</span> <span class="pre">as</span> <span 
class="pre">&quot;i&quot;,</span> <span class="pre">table2.id</span> <span 
class="pre">as</span> <span class="pre">&quot;j&quot;</span> <span 
class="pre">FROM</span> <span class="pre">table1</span> <span 
class="pre">INNER</span> <span class="pre">JOIN</span> <span 
class="pre">table2</span> <span class="pre">ON</span> <span 
class="pre">table1.id</span> <span class="pre">=</span> <span 
class="pre">table2.id</span></tt>.</li>
+</ol>
+</div>
+</div>
+<div class="section" id="to-job-configuration">
+<h4><strong>TO Job Configuration</strong><a class="headerlink" 
href="#to-job-configuration" title="Permalink to this headline">¶</a></h4>
+<p>Inputs associated with the Job configuration for the TO direction 
include:</p>
+<table border="1" class="docutils">
+<colgroup>
+<col width="18%" />
+<col width="6%" />
+<col width="46%" />
+<col width="31%" />
+</colgroup>
+<thead valign="bottom">
+<tr class="row-odd"><th class="head">Input</th>
+<th class="head">Type</th>
+<th class="head">Description</th>
+<th class="head">Example</th>
+</tr>
+</thead>
+<tbody valign="top">
+<tr class="row-even"><td>Schema name</td>
+<td>String</td>
+<td>The schema name the table is part of.
+<em>Optional</em></td>
+<td>sqoop</td>
+</tr>
+<tr class="row-odd"><td>Table name</td>
+<td>String</td>
+<td>The table name to import data from.
+<em>Optional</em>. See note below.</td>
+<td>test</td>
+</tr>
+<tr class="row-even"><td>Table SQL statement</td>
+<td>String</td>
+<td>The SQL statement used to perform a <strong>free form query</strong>.
+<em>Optional</em>. See note below.</td>
+<td><tt class="docutils literal"><span class="pre">INSERT</span> <span 
class="pre">INTO</span> <span class="pre">test</span> <span 
class="pre">(col1,</span> <span class="pre">col2)</span> <span 
class="pre">VALUES</span> <span class="pre">(?,</span> <span 
class="pre">?)</span></tt></td>
+</tr>
+<tr class="row-odd"><td>Table column names</td>
+<td>String</td>
+<td>Columns to insert into the JDBC data source.
+<em>Optional</em> Comma separated list of columns.</td>
+<td>col1,col2</td>
+</tr>
+<tr class="row-even"><td>Stage table name</td>
+<td>String</td>
+<td>The name of the table used as a <em>staging table</em>.
+<em>Optional</em>.</td>
+<td>staging</td>
+</tr>
+<tr class="row-odd"><td>Should clear stage table</td>
+<td colspan="2"><dl class="first last docutils">
+<dt>Boolean | True or false depending on whether the staging table should be 
cleared</dt>
+<dd><div class="first last line-block">
+<div class="line">after the data transfer has finished. 
<em>Optional</em>.</div>
+</div>
+</dd>
+</dl>
+</td>
+<td>true</td>
+</tr>
+</tbody>
+</table>
+<div class="section" id="id1">
+<h5><strong>Notes</strong><a class="headerlink" href="#id1" title="Permalink 
to this headline">¶</a></h5>
+<ol class="arabic simple">
+<li><em>Table name</em> and <em>Table SQL statement</em> are mutually 
exclusive. If <em>Table name</em> is provided, the <em>Table SQL statement</em> 
should not be provided. If <em>Table SQL statement</em> is provided then 
<em>Table name</em> should not be provided.</li>
+<li><em>Table column names</em> should be provided only if <em>Table name</em> 
is provided.</li>
+</ol>
+</div>
+</div>
+</div>
+<div class="section" id="partitioner">
+<h3><a class="toc-backref" href="#id5">Partitioner</a><a class="headerlink" 
href="#partitioner" title="Permalink to this headline">¶</a></h3>
+<p>The Generic JDBC Connector partitioner generates conditions to be used by 
the extractor.
+It varies in how it partitions data transfer based on the partition column 
data type.
+Though, each strategy roughly takes on the following form:</p>
+<div class="highlight-none"><div class="highlight"><pre>(upper boundary - 
lower boundary) / (max partitions)
+</pre></div>
+</div>
+<p>By default, the <em>primary key</em> will be used to partition the data 
unless otherwise specified.</p>
+<p>The following data types are currently supported:</p>
+<ol class="arabic simple">
+<li>TINYINT</li>
+<li>SMALLINT</li>
+<li>INTEGER</li>
+<li>BIGINT</li>
+<li>REAL</li>
+<li>FLOAT</li>
+<li>DOUBLE</li>
+<li>NUMERIC</li>
+<li>DECIMAL</li>
+<li>BIT</li>
+<li>BOOLEAN</li>
+<li>DATE</li>
+<li>TIME</li>
+<li>TIMESTAMP</li>
+<li>CHAR</li>
+<li>VARCHAR</li>
+<li>LONGVARCHAR</li>
+</ol>
+</div>
+<div class="section" id="extractor">
+<h3><a class="toc-backref" href="#id6">Extractor</a><a class="headerlink" 
href="#extractor" title="Permalink to this headline">¶</a></h3>
+<p>During the <em>extraction</em> phase, the JDBC data source is queried using 
SQL. This SQL will vary based on your configuration.</p>
+<ul class="simple">
+<li>If <em>Table name</em> is provided, then the SQL statement generated will 
take on the form <tt class="docutils literal"><span class="pre">SELECT</span> 
<span class="pre">*</span> <span class="pre">FROM</span> <span 
class="pre">&lt;table</span> <span class="pre">name&gt;</span></tt>.</li>
+<li>If <em>Table name</em> and <em>Columns</em> are provided, then the SQL 
statement generated will take on the form <tt class="docutils literal"><span 
class="pre">SELECT</span> <span class="pre">&lt;columns&gt;</span> <span 
class="pre">FROM</span> <span class="pre">&lt;table</span> <span 
class="pre">name&gt;</span></tt>.</li>
+<li>If <em>Table SQL statement</em> is provided, then the provided SQL 
statement will be used.</li>
+</ul>
+<p>The conditions generated by the <em>partitioner</em> are appended to the 
end of the SQL query to query a section of data.</p>
+<p>The Generic JDBC connector extracts CSV data usable by the <em>CSV 
Intermediate Data Format</em>.</p>
+</div>
+<div class="section" id="loader">
+<h3><a class="toc-backref" href="#id7">Loader</a><a class="headerlink" 
href="#loader" title="Permalink to this headline">¶</a></h3>
+<p>During the <em>loading</em> phase, the JDBC data source is queried using 
SQL. This SQL will vary based on your configuration.</p>
+<ul class="simple">
+<li>If <em>Table name</em> is provided, then the SQL statement generated will 
take on the form <tt class="docutils literal"><span class="pre">INSERT</span> 
<span class="pre">INTO</span> <span class="pre">&lt;table</span> <span 
class="pre">name&gt;</span> <span class="pre">(col1,</span> <span 
class="pre">col2,</span> <span class="pre">...)</span> <span 
class="pre">VALUES</span> <span class="pre">(?,?,..)</span></tt>.</li>
+<li>If <em>Table name</em> and <em>Columns</em> are provided, then the SQL 
statement generated will take on the form <tt class="docutils literal"><span 
class="pre">INSERT</span> <span class="pre">INTO</span> <span 
class="pre">&lt;table</span> <span class="pre">name&gt;</span> <span 
class="pre">(&lt;columns&gt;)</span> <span class="pre">VALUES</span> <span 
class="pre">(?,?,..)</span></tt>.</li>
+<li>If <em>Table SQL statement</em> is provided, then the provided SQL 
statement will be used.</li>
+</ul>
+<p>This connector expects to receive CSV data consumable by the <em>CSV 
Intermediate Data Format</em>.</p>
+</div>
+<div class="section" id="destroyers">
+<h3><a class="toc-backref" href="#id8">Destroyers</a><a class="headerlink" 
href="#destroyers" title="Permalink to this headline">¶</a></h3>
+<p>The Generic JDBC Connector performs two operations in the destroyer in the 
TO direction:</p>
+<ol class="arabic simple">
+<li>Copy the contents of the staging table to the desired table.</li>
+<li>Clear the staging table.</li>
+</ol>
+<p>No operations are performed in the FROM direction.</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: websites/staging/sqoop/trunk/content/docs/1.99.5/DevEnv.html
==============================================================================
--- websites/staging/sqoop/trunk/content/docs/1.99.5/DevEnv.html (added)
+++ websites/staging/sqoop/trunk/content/docs/1.99.5/DevEnv.html Fri Feb 27 
00:59:26 2015
@@ -0,0 +1,94 @@
+
+
+<!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 2 Development Environment Setup &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 2 Development Environment 
Setup</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-2-development-environment-setup">
+<h1>Sqoop 2 Development Environment Setup<a class="headerlink" 
href="#sqoop-2-development-environment-setup" title="Permalink to this 
headline">¶</a></h1>
+<p>This document describes you how to setup development environment for Sqoop 
2.</p>
+<div class="section" id="system-requirement">
+<h2>System Requirement<a class="headerlink" href="#system-requirement" 
title="Permalink to this headline">¶</a></h2>
+<div class="section" id="java">
+<h3>Java<a class="headerlink" href="#java" title="Permalink to this 
headline">¶</a></h3>
+<p>Sqoop written in Java and using version 1.6. You can <a class="reference 
external" 
href="http://www.oracle.com/technetwork/java/javase/downloads/index.html";>download
 java</a> and install. Locate JAVA_HOME to installed directroy, e.g. export 
JAVA_HOME=/usr/lib/jvm/jdk1.6.0_32.</p>
+</div>
+<div class="section" id="maven">
+<h3>Maven<a class="headerlink" href="#maven" title="Permalink to this 
headline">¶</a></h3>
+<p>Sqoop uses Maven 3 for building the project. Download <a class="reference 
external" href="http://maven.apache.org/download.cgi";>Maven</a> and its 
Installation instructions given in <a class="reference external" 
href="http://maven.apache.org/download.cgi#Maven_Documentation";>link</a>.</p>
+</div>
+</div>
+<div class="section" id="eclipse-setup">
+<h2>Eclipse Setup<a class="headerlink" href="#eclipse-setup" title="Permalink 
to this headline">¶</a></h2>
+<p>Steps for downloading source code is given in <a class="reference external" 
href="BuildingSqoop2.html">Building Sqoop2</a></p>
+<p>Sqoop 2 project has multiple modules where one module is depend on another 
module for e.g. sqoop 2 client module has sqoop 2 common module dependency. 
Follow below step for creating eclipse&#8217;s project and classpath for each 
module.</p>
+<div class="highlight-none"><div class="highlight"><pre>//Install all package 
into local maven repository
+mvn clean install -DskipTests
+
+//Adding M2_REPO variable to eclipse workspace
+mvn eclipse:configure-workspace 
-Declipse.workspace=&lt;path-to-eclipse-workspace-dir-for-sqoop-2&gt;
+
+//Eclipse project creation with optional parameters
+mvn eclipse:eclipse -DdownloadSources=true -DdownloadJavadocs=true
+</pre></div>
+</div>
+<p>Alternatively, for manually adding M2_REPO classpath variable as maven 
repository path in eclipse-&gt; window-&gt; Java -&gt;Classpath Variables 
-&gt;Click &#8220;New&#8221; -&gt;In new dialog box, input Name as M2_REPO and 
Path as $HOME/.m2/repository -&gt;click Ok.</p>
+<p>On successful execution of above maven commands, Then import the sqoop 
project modules into eclipse-&gt; File -&gt; Import -&gt;General -&gt;Existing 
Projects into Workspace-&gt; Click Next-&gt; Browse Sqoop 2 directory 
($HOME/git/sqoop2) -&gt;Click Ok -&gt;Import dialog shows multiple projects 
(sqoop-client, sqoop-common, etc.) -&gt; Select all modules -&gt; click 
Finish.</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: websites/staging/sqoop/trunk/content/docs/1.99.5/Installation.html
==============================================================================
--- websites/staging/sqoop/trunk/content/docs/1.99.5/Installation.html (added)
+++ websites/staging/sqoop/trunk/content/docs/1.99.5/Installation.html Fri Feb 
27 00:59:26 2015
@@ -0,0 +1,134 @@
+
+
+<!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>Installation &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>Installation</span></h2>
+      </div>
+      <div class="topnav">
+      
+        <p>
+        <a class="uplink" href="index.html">Contents</a>
+        </p>
+
+      </div>
+      <div class="content">
+        
+        
+  <div class="section" id="installation">
+<h1>Installation<a class="headerlink" href="#installation" title="Permalink to 
this headline">¶</a></h1>
+<p>Sqoop ships as one binary package however it&#8217;s compound from two 
separate parts - client and server. You need to install server on single node 
in your cluster. This node will then serve as an entry point for all connecting 
Sqoop clients. Server acts as a mapreduce client and therefore Hadoop must be 
installed and configured on machine hosting Sqoop server. Clients can be 
installed on any arbitrary number of machines. Client is not acting as a 
mapreduce client and thus you do not need to install Hadoop on nodes that will 
act only as a Sqoop client.</p>
+<div class="section" id="server-installation">
+<h2>Server installation<a class="headerlink" href="#server-installation" 
title="Permalink to this headline">¶</a></h2>
+<p>Copy Sqoop artifact on machine where you want to run Sqoop server. This 
machine must have installed and configured Hadoop. You don&#8217;t need to run 
any Hadoop related services there, however the machine must be able to act as 
an Hadoop client. You should be able to list a HDFS for example:</p>
+<div class="highlight-none"><div class="highlight"><pre>hadoop dfs -ls
+</pre></div>
+</div>
+<p>Sqoop server supports multiple Hadoop versions. However as Hadoop major 
versions are not compatible with each other, Sqoop have multiple binary 
artefacts - one for each supported major version of Hadoop. You need to make 
sure that you&#8217;re using appropriated binary artifact for your specific 
Hadoop version. To install Sqoop server decompress appropriate distribution 
artifact in location at your convenience and change your working directory to 
this folder.</p>
+<div class="highlight-none"><div class="highlight"><pre># Decompress Sqoop 
distribution tarball
+tar -xvf sqoop-&lt;version&gt;-bin-hadoop&lt;hadoop-version&gt;.tar.gz
+
+# Move decompressed content to any location
+mv sqoop-&lt;version&gt;-bin-hadoop&lt;hadoop version&gt;.tar.gz /usr/lib/sqoop
+
+# Change working directory
+cd /usr/lib/sqoop
+</pre></div>
+</div>
+<div class="section" id="installing-dependencies">
+<h3>Installing Dependencies<a class="headerlink" 
href="#installing-dependencies" title="Permalink to this headline">¶</a></h3>
+<p>Hadoop libraries must be available on node where you are planning to run 
Sqoop server with proper configuration for major services - <tt class="docutils 
literal"><span class="pre">NameNode</span></tt> and either <tt class="docutils 
literal"><span class="pre">JobTracker</span></tt> or <tt class="docutils 
literal"><span class="pre">ResourceManager</span></tt> depending whether you 
are running Hadoop 1 or 2. There is no need to run any Hadoop service on the 
same node as Sqoop server, just the libraries and configuration files must be 
available.</p>
+<p>Path to Hadoop libraries is stored in file <tt class="docutils 
literal"><span class="pre">catalina.properties</span></tt> inside directory <tt 
class="docutils literal"><span class="pre">server/conf</span></tt>. You need to 
change property called <tt class="docutils literal"><span 
class="pre">common.loader</span></tt> to contain all directories with your 
Hadoop libraries. The default expected locations are <tt class="docutils 
literal"><span class="pre">/usr/lib/hadoop</span></tt> and <tt class="docutils 
literal"><span class="pre">/usr/lib/hadoop/lib/</span></tt>. Please check out 
the comments in the file for further description how to configure different 
locations.</p>
+<p>Lastly you might need to install JDBC drivers that are not bundled with 
Sqoop because of incompatible licenses. You can add any arbitrary Java jar file 
to Sqoop server by copying it into <tt class="docutils literal"><span 
class="pre">lib/</span></tt> directory. You can create this directory if it do 
not exists already.</p>
+</div>
+<div class="section" id="configuring-path">
+<h3>Configuring PATH<a class="headerlink" href="#configuring-path" 
title="Permalink to this headline">¶</a></h3>
+<p>All user and administrator facing shell commands are stored in <tt 
class="docutils literal"><span class="pre">bin/</span></tt> directory. 
It&#8217;s recommended to add this directory to your <tt class="docutils 
literal"><span class="pre">$PATH</span></tt> for their easier execution, for 
example:</p>
+<div class="highlight-none"><div class="highlight"><pre>PATH=$PATH:`pwd`/bin/
+</pre></div>
+</div>
+<p>Further documentation pages will assume that you have the binaries on your 
<tt class="docutils literal"><span class="pre">$PATH</span></tt>. You will need 
to call them specifying full path if you decide to skip this step.</p>
+</div>
+<div class="section" id="configuring-server">
+<h3>Configuring Server<a class="headerlink" href="#configuring-server" 
title="Permalink to this headline">¶</a></h3>
+<p>Before starting server you should revise configuration to match your 
specific environment. Server configuration files are stored in <tt 
class="docutils literal"><span class="pre">server/config</span></tt> directory 
of distributed artifact along side with other configuration files of Tomcat.</p>
+<p>File <tt class="docutils literal"><span 
class="pre">sqoop_bootstrap.properties</span></tt> specifies which 
configuration provider should be used for loading configuration for rest of 
Sqoop server. Default value <tt class="docutils literal"><span 
class="pre">PropertiesConfigurationProvider</span></tt> should be 
sufficient.</p>
+<p>Second configuration file <tt class="docutils literal"><span 
class="pre">sqoop.properties</span></tt> contains remaining configuration 
properties that can affect Sqoop server. File is very well documented, so check 
if all configuration properties fits your environment. Default or very little 
tweaking should be sufficient most common cases.</p>
+<p>You can verify the Sqoop server configuration using <a class="reference 
external" href="Tools.html#verify">Verify Tool</a>, for example:</p>
+<div class="highlight-none"><div class="highlight"><pre>sqoop2-tool verify
+</pre></div>
+</div>
+<p>Upon running the <tt class="docutils literal"><span 
class="pre">verify</span></tt> tool, you should see messages similar to the 
following:</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>Consult <a class="reference external" href="Tools.html#upgrade">Verify 
Tool</a> documentation page in case of any failure.</p>
+</div>
+<div class="section" id="server-life-cycle">
+<h3>Server Life Cycle<a class="headerlink" href="#server-life-cycle" 
title="Permalink to this headline">¶</a></h3>
+<p>After installation and configuration you can start Sqoop server with 
following command:</p>
+<div class="highlight-none"><div class="highlight"><pre>sqoop2-server start
+</pre></div>
+</div>
+<p>Similarly you can stop server using following command:</p>
+<div class="highlight-none"><div class="highlight"><pre>sqoop2-server stop
+</pre></div>
+</div>
+<p>By default Sqoop server daemons use ports 12000 and 12001. You can set <tt 
class="docutils literal"><span class="pre">SQOOP_HTTP_PORT</span></tt> and <tt 
class="docutils literal"><span class="pre">SQOOP_ADMIN_PORT</span></tt> in 
configuration file <tt class="docutils literal"><span 
class="pre">server/bin/setenv.sh</span></tt> to use different ports.</p>
+</div>
+</div>
+<div class="section" id="client-installation">
+<h2>Client installation<a class="headerlink" href="#client-installation" 
title="Permalink to this headline">¶</a></h2>
+<p>Client do not need extra installation and configuration steps. Just copy 
Sqoop distribution artifact on target machine and unzip it in desired location. 
You can start client with following command:</p>
+<div class="highlight-none"><div class="highlight"><pre>sqoop2-shell
+</pre></div>
+</div>
+<p>You can find more documentation to Sqoop client in <a class="reference 
external" href="CommandLineClient.html">Command Line Client</a> section.</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


Reply via email to