Return-Path: X-Original-To: apmail-tajo-commits-archive@minotaur.apache.org Delivered-To: apmail-tajo-commits-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 045BA18AE5 for ; Thu, 4 Feb 2016 00:29:47 +0000 (UTC) Received: (qmail 48654 invoked by uid 500); 4 Feb 2016 00:29:47 -0000 Delivered-To: apmail-tajo-commits-archive@tajo.apache.org Received: (qmail 48617 invoked by uid 500); 4 Feb 2016 00:29:46 -0000 Mailing-List: contact commits-help@tajo.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@tajo.apache.org Delivered-To: mailing list commits@tajo.apache.org Received: (qmail 48602 invoked by uid 99); 4 Feb 2016 00:29:46 -0000 Received: from Unknown (HELO spamd2-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 04 Feb 2016 00:29:46 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd2-us-west.apache.org (ASF Mail Server at spamd2-us-west.apache.org) with ESMTP id 4975A1A04F1 for ; Thu, 4 Feb 2016 00:29:46 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd2-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 1.371 X-Spam-Level: * X-Spam-Status: No, score=1.371 tagged_above=-999 required=6.31 tests=[KAM_ASCII_DIVIDERS=0.8, KAM_LAZY_DOMAIN_SECURITY=1, RP_MATCHES_RCVD=-0.429] autolearn=disabled Received: from mx1-us-east.apache.org ([10.40.0.8]) by localhost (spamd2-us-west.apache.org [10.40.0.9]) (amavisd-new, port 10024) with ESMTP id Cax-FeIO7KQN for ; Thu, 4 Feb 2016 00:29:25 +0000 (UTC) Received: from mailrelay1-us-west.apache.org (mailrelay1-us-west.apache.org [209.188.14.139]) by mx1-us-east.apache.org (ASF Mail Server at mx1-us-east.apache.org) with ESMTP id 7FBEA43F75 for ; Thu, 4 Feb 2016 00:29:21 +0000 (UTC) Received: from svn01-us-west.apache.org (svn.apache.org [10.41.0.6]) by mailrelay1-us-west.apache.org (ASF Mail Server at mailrelay1-us-west.apache.org) with ESMTP id 0A911E4895 for ; Thu, 4 Feb 2016 00:29:20 +0000 (UTC) Received: from svn01-us-west.apache.org (localhost [127.0.0.1]) by svn01-us-west.apache.org (ASF Mail Server at svn01-us-west.apache.org) with ESMTP id 0B0323A022E for ; Thu, 4 Feb 2016 00:29:20 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: svn commit: r1728394 [22/42] - in /tajo/site/docs: 0.11.1/ 0.11.1/_sources/ 0.11.1/_sources/backup_and_restore/ 0.11.1/_sources/configuration/ 0.11.1/_sources/functions/ 0.11.1/_sources/index/ 0.11.1/_sources/partitioning/ 0.11.1/_sources/sql_language/... Date: Thu, 04 Feb 2016 00:29:12 -0000 To: commits@tajo.apache.org From: jihoonson@apache.org X-Mailer: svnmailer-1.0.9 Message-Id: <20160204002920.0B0323A022E@svn01-us-west.apache.org> Added: tajo/site/docs/0.11.1/index/types.html URL: http://svn.apache.org/viewvc/tajo/site/docs/0.11.1/index/types.html?rev=1728394&view=auto ============================================================================== --- tajo/site/docs/0.11.1/index/types.html (added) +++ tajo/site/docs/0.11.1/index/types.html Thu Feb 4 00:29:05 2016 @@ -0,0 +1,283 @@ + + + + + + + + + + Index Types — Apache Tajo 0.11.0 documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + +
+ + + + + + +
+
+
+ +
+
+
+ +
+

Index Types¶

+

Currently, Tajo supports only one type of index, TWO_LEVEL_BIN_TREE, shortly BST. The BST index is a kind of binary search tree which is extended to be permanently stored on disk. It consists of two levels of nodes; a leaf node indexes the keys with the offsets to data stored on HDFS, and a root node indexes the keys with the offsets to the leaf nodes.

+

When an index scan is started, the query engine first reads the root node and finds the search key. If it successfully finds a leaf node corresponding to the search key, it subsequently finds the search key in that leaf node. Finally, it directly reads a tuple corresponding to the search key from HDFS.

+
+ + +
+ +
+
+ +
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file Added: tajo/site/docs/0.11.1/index_overview.html URL: http://svn.apache.org/viewvc/tajo/site/docs/0.11.1/index_overview.html?rev=1728394&view=auto ============================================================================== --- tajo/site/docs/0.11.1/index_overview.html (added) +++ tajo/site/docs/0.11.1/index_overview.html Thu Feb 4 00:29:05 2016 @@ -0,0 +1,287 @@ + + + + + + + + + + Index (Experimental Feature) — Apache Tajo 0.11.0 documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + +
+ + + + + + +
+
+
+ +
+
+
+ +
+

Index (Experimental Feature)¶

+

An index is a data structure that is used for efficient query processing. Using an index, the Tajo query engine can directly retrieve search values.

+

The following sections describe the supported index types, the query execution with an index, and the future works.

+ +
+ + +
+ +
+
+ +
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file Added: tajo/site/docs/0.11.1/introduction.html URL: http://svn.apache.org/viewvc/tajo/site/docs/0.11.1/introduction.html?rev=1728394&view=auto ============================================================================== --- tajo/site/docs/0.11.1/introduction.html (added) +++ tajo/site/docs/0.11.1/introduction.html Thu Feb 4 00:29:05 2016 @@ -0,0 +1,287 @@ + + + + + + + + + + Introduction — Apache Tajo 0.11.0 documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + +
+ + + + + + +
+
+
+ +
+
+
+ +
+

Introduction¶

+

The main goal of Apache Tajo project is to build an advanced open source +data warehouse system in Hadoop for processing web-scale data sets. +Basically, Tajo provides SQL standard as a query language. +Tajo is designed for both interactive and batch queries on data sets +stored on HDFS and other data sources. Without hurting query response +times, Tajo provides fault-tolerance and dynamic load balancing which +are necessary for long-running queries. Tajo employs a cost-based and +progressive query optimization techniques for reoptimizing running +queries in order to avoid the worst query plans.

+
+ + +
+ +
+
+ +
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file Added: tajo/site/docs/0.11.1/jdbc_driver.html URL: http://svn.apache.org/viewvc/tajo/site/docs/0.11.1/jdbc_driver.html?rev=1728394&view=auto ============================================================================== --- tajo/site/docs/0.11.1/jdbc_driver.html (added) +++ tajo/site/docs/0.11.1/jdbc_driver.html Thu Feb 4 00:29:05 2016 @@ -0,0 +1,403 @@ + + + + + + + + + + Tajo JDBC Driver — Apache Tajo 0.11.0 documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + +
+ + + + + + +
+
+
+ +
+
+
+ +
+

Tajo JDBC Driver¶

+

Apache Tajo™ provides JDBC driver +which enables Java applciations to easily access Apache Tajo in a RDBMS-like manner. +In this section, we explain how to get JDBC driver and an example code.

+
+

How to get JDBC driver¶

+
+

Direct Download¶

+

You can directly download a JDBC driver jar file (tajo-jdbc-x.y.z.jar) from Downloads.

+
+
+

From Binary Distribution¶

+

Tajo binary distribution provides JDBC jar file located in ${TAJO_HOME}/share/jdbc-dist/tajo-jdbc-x.y.z.jar.

+
+
+

From Building Source Code¶

+

You can build Tajo from the source code and then get JAR files as follows:

+
$ tar xzvf tajo-x.y.z-src.tar.gz
+$ mvn clean package -DskipTests -Pdist -Dtar
+$ ls -l tajo-dist/target/tajo-x.y.z/share/jdbc-dist/tajo-jdbc-x.y.z.jar
+
+
+
+
+
+

Setting the CLASSPATH¶

+

In order to use the JDBC driver, you should add tajo-jdbc-x.y.z.jar in your CLASSPATH.

+
CLASSPATH=path/to/tajo-jdbc-x.y.z.jar:$CLASSPATH
+
+
+
+
+

Connecting to the Tajo cluster instance¶

+

A Tajo cluster is represented by a URL. Tajo JDBC driver can take the following URL forms:

+
+
    +
  • jdbc:tajo://host/
  • +
  • jdbc:tajo://host/database
  • +
  • jdbc:tajo://host:port/
  • +
  • jdbc:tajo://host:port/database
  • +
+
+

Each part of URL has the following meanings:

+
+
    +
  • host - The hostname of the TajoMaster. You can put hostname or ip address here.
  • +
  • port - The port number that server is listening. Default port number is 26002.
  • +
  • database - The database name. The default database name is default.
  • +
+

To connect, you need to get Connection instance from Java JDBC Driver Manager as follows:

+
+
Connection db = DriverManager.getConnection(url);
+
+
+
+
+

Connection Parameters¶

+

Connection parameters lets the JDBC Copnnection to enable or disable additional features. You should use java.util.Properties to pass your connection parameters into Connection. The following example means that the transmission of ResultSet uses compression and its connection timeout is 15 seconds.

+
String url = "jdbc:tajo://localhost/test";
+Properties props = new Properties();
+props.setProperty("useCompression","true");  // use compression for ResultSet
+props.setProperty("connectTimeout","15000"); // 15 seconds
+Connection conn = DriverManager.getConnection(url, props);
+
+
+

The connection parameters that Tajo currently supports are as follows:

+
+
    +
  • useCompression = bool - Enable compressed transfer for ResultSet.
  • +
  • defaultRowFetchSize = int - Determine the number of rows fetched in ResultSet by one fetch with trip to the Server.
  • +
  • connectTimeout = int (seconds) - The timeout value used for socket connect operations. If connecting to the server takes longer than this value, the connection is broken. The timeout is specified in seconds and a value of zero means that it is disabled.
  • +
  • socketTimeout = int (seconds) - The timeout value used for socket read operations. If reading from the server takes longer than this value, the connection is closed. This can be used as both a brute force global query timeout and a method of detecting network problems. The timeout is specified in seconds and a value of zero means that it is disabled.
  • +
  • retry = int - Number of retry operation. Tajo JDBC driver is resilient against some network or connection problems. It determines how many times the connection will retry.
  • +
+
+
+
+

An Example JDBC Client¶

+

The JDBC driver class name is org.apache.tajo.jdbc.TajoDriver. +You can get the driver Class.forName("org.apache.tajo.jdbc.TajoDriver"). +The connection url should be jdbc:tajo://<TajoMaster hostname>:<TajoMaster client rpc port>/<database name>. +The default TajoMaster client rpc port is 26002. +If you want to change the listening port, please refer Cluster Setup.

+
+

Note

+

Currently, Tajo does not support the concept of database and namespace. +All tables are contained in default database. So, you don’t need to specify any database name.

+
+

The following shows an example of JDBC Client.

+
import java.sql.Connection;
+import java.sql.ResultSet;
+import java.sql.Statement;
+import java.sql.DriverManager;
+
+public class TajoJDBCClient {
+
+  ....
+
+  public static void main(String[] args) throws Exception {
+
+    try {
+      Class.forName("org.apache.tajo.jdbc.TajoDriver");
+    } catch (ClassNotFoundException e) {
+      // fill your handling code
+    }
+
+    Connection conn = DriverManager.getConnection("jdbc:tajo://127.0.0.1:26002/default");
+
+    Statement stmt = null;
+    ResultSet rs = null;
+    try {
+      stmt = conn.createStatement();
+      rs = stmt.executeQuery("select * from table1");
+      while (rs.next()) {
+        System.out.println(rs.getString(1) + "," + rs.getString(3));
+      }
+    } finally {
+      if (rs != null) rs.close();
+      if (stmt != null) stmt.close();
+      if (conn != null) conn.close();
+    }
+  }
+}
+
+
+
+
+ + +
+ +
+
+ +
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file Added: tajo/site/docs/0.11.1/objects.inv URL: http://svn.apache.org/viewvc/tajo/site/docs/0.11.1/objects.inv?rev=1728394&view=auto ============================================================================== Binary file - no diff available. Propchange: tajo/site/docs/0.11.1/objects.inv ------------------------------------------------------------------------------ svn:mime-type = application/octet-stream