source: proiecte/HadoopJUnit/hadoop-0.20.1/src/mapred/org/apache/hadoop/mapred/lib/db/package.html @ 120

Last change on this file since 120 was 120, checked in by (none), 14 years ago

Added the mail files for the Hadoop JUNit Project

  • Property svn:executable set to *
File size: 1.8 KB
Line 
1<html>
2<!--
3   Licensed to the Apache Software Foundation (ASF) under one or more
4   contributor license agreements.  See the NOTICE file distributed with
5   this work for additional information regarding copyright ownership.
6   The ASF licenses this file to You under the Apache License, Version 2.0
7   (the "License"); you may not use this file except in compliance with
8   the License.  You may obtain a copy of the License at
9
10       http://www.apache.org/licenses/LICENSE-2.0
11
12   Unless required by applicable law or agreed to in writing, software
13   distributed under the License is distributed on an "AS IS" BASIS,
14   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15   See the License for the specific language governing permissions and
16   limitations under the License.
17-->
18
19<body>
20<h2>org.apache.hadoop.mapred.lib.db Package</h2>
21<p>
22This package contains a library to read records from a database as an
23input to a mapreduce job, and write the output records to the database.   
24</p>
25<p>
26The Database to access can be configured using the static methods in the
27DBConfiguration class. Jobs reading input from a database should use
28DBInputFormat#setInput() to set the configuration. And jobs writing
29its output to the database should use DBOutputFormat#setOutput().
30</p>
31<p> 
32Tuples from/to the database are converted to/from Java objects using
33DBWritable methods. Typically, for each table in the db, a class extending
34DBWritable is defined, which holds the fields of the tuple. The fields
35of a record are read from the database using DBWritable#readFields(ResultSet),
36and written to the database using DBWritable#write(PreparedStatament
37statement).
38</p>
39<p>
40An example program using both DBInputFormat and DBOutputFormat can be found
41at src/examples/org/apache/hadoop/examples/DBCountPageview.java.
42</p>
43</body>
44</html>
Note: See TracBrowser for help on using the repository browser.