Skip to content
This repository has been archived by the owner on May 12, 2021. It is now read-only.

Commit

Permalink
TAJO-1883: Keep tajo-client and its dependent modules to be 1.7 target.
Browse files Browse the repository at this point in the history
Closes #778
  • Loading branch information
hyunsik committed Oct 7, 2015
1 parent 4bed490 commit 513aff4
Show file tree
Hide file tree
Showing 19 changed files with 95 additions and 50 deletions.
30 changes: 18 additions & 12 deletions BUILDING
Expand Up @@ -4,7 +4,7 @@ Build instructions for Tajo
Requirements:

* Unix System
* JDK 1.7 or higher
* JDK 1.8 or higher
* Maven 3.0 or higher
* Protocol Buffers 2.5.0
* Internet connection for first build (to fetch all Maven and Tajo dependencies)
Expand All @@ -15,18 +15,23 @@ Maven main modules:
tajo (Main Tajo project)
- tajo-project (Parent POM for all Tajo Maven modules. )
(All plugins & dependencies versions are defined here.)
- tajo-algebra
- tajo-common
- tajo-rpc
- tajo-catalog
- tajo-storage
- tajo-pullserver
- tajo-core
- tajo-client
- tajo-jdbc
- tajo-maven-plugin
- tajo-docs
- tajo-algebra (Algebraic expressions)
- tajo-catalog (Catalog and its plugins)
- tajo-common (Common modules)
- tajo-core (Core module)
- tajo-core-tests (Tests for core module and query execution)
- tajo-client (Client API and its implementation)
- tajo-client-example (Client API examples)
- tajo-dist (Tajo distribution assembler)
- tajo-docs (User documentation)
- tajo-jdbc (Tajo JDBC Driver)
- tajo-maven-plugin (Maven Plugin)
- tajo-metrics (Metrics)
- tajo-plan (Plan representation)
- tajo-pullserver (Pullserver for intermediate)
- tajo-rpc (Rpc)
- tajo-sql-parser (SQL parser)
- tajo-storage (Storage and its plugins)

--------------------------------------------------------------------------------
Maven build goals:
Expand All @@ -53,6 +58,7 @@ Maven build goals:
* -Dtest=<TESTCLASSNAME>,<TESTCLASSNAME#METHODNAME>,....
* -Dtest.exclude=<TESTCLASSNAME>
* -Dtest.exclude.pattern=**/<TESTCLASSNAME1>.java,**/<TESTCLASSNAME2>.java
* For more information, refer to https://cwiki.apache.org/confluence/display/TAJO/Unit+Tests.

--------------------------------------------------------------------------------
Building distributions:
Expand Down
3 changes: 3 additions & 0 deletions CHANGES
Expand Up @@ -6,6 +6,9 @@ Release 0.12.0 - unreleased

IMPROVEMENT

TAJO-1883: Keep tajo-client and its dependent modules to be 1.7 target.
(hyunsik)

TAJO-1899: Calling 'Arrays.asList()' with too few arguments cause memory
extravagance. (Contributed by Dongkyu Hwangbo, committed by jihoon)

Expand Down
2 changes: 1 addition & 1 deletion README
Expand Up @@ -31,7 +31,7 @@ Documents

Requirements
============
* Java 1.7 or higher
* Java 1.8 or higher
* Hadoop 2.3.0 or higher

Mailing lists
Expand Down
5 changes: 5 additions & 0 deletions tajo-catalog/tajo-catalog-common/pom.xml
Expand Up @@ -38,6 +38,11 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.7</source> <!-- for keeping tajo-client and tajo-jdbc available in 1.7-->
<target>1.7</target> <!-- for keeping tajo-client and tajo-jdbc available in 1.7-->
<encoding>${project.build.sourceEncoding}</encoding>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.rat</groupId>
Expand Down
Expand Up @@ -18,15 +18,17 @@

package org.apache.tajo.catalog;

import com.google.common.base.Function;
import org.apache.tajo.catalog.partition.PartitionMethodDesc;
import org.apache.tajo.catalog.proto.CatalogProtos.PartitionDescProto;
import org.apache.tajo.util.KeyValueSet;
import org.apache.tajo.util.StringUtils;

import java.util.Comparator;
import java.io.File;
import java.util.Arrays;
import java.util.Comparator;
import java.util.List;
import java.util.Map.Entry;
import java.util.function.Consumer;

public class DDLBuilder {

Expand Down Expand Up @@ -123,21 +125,24 @@ private static void buildWithClause(final StringBuilder sb, TableMeta meta) {

sb.append(" WITH (");

meta.getOptions().getAllKeyValus().entrySet().stream()
.sorted(Comparator.comparing(e -> e.getKey())) // sort them for a determined table property string.
.forEach(new Consumer<Entry<String, String>>() {
boolean first = true;

@Override
public void accept(Entry<String, String> e) {
if (first) {
first = false;
} else {
sb.append(", ");
}
sb.append("'").append(e.getKey()).append("'='").append(e.getValue()).append("'");
}
});
// sort table properties in an lexicographic order of the property keys.
Entry<String, String> [] entries = meta.getOptions().getAllKeyValus().entrySet().toArray(
new Entry[meta.getOptions().size()]);

Arrays.sort(entries, new Comparator<Entry<String, String>>() {
@Override
public int compare(Entry<String, String> o1, Entry<String, String> o2) {
return o1.getKey().compareTo(o2.getKey());
}
});

// Join all properties by comma (',')
sb.append(StringUtils.join(entries, ", ", new Function<Entry<String, String>, String>() {
@Override
public String apply(Entry<String, String> e) {
return "'" + e.getKey() + "'='" + e.getValue() + "'";
}
}));

sb.append(")");
}
Expand Down
4 changes: 4 additions & 0 deletions tajo-client-example/pom.xml
Expand Up @@ -50,6 +50,10 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.7</source>
<target>1.7</target>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.rat</groupId>
Expand Down
5 changes: 5 additions & 0 deletions tajo-client/pom.xml
Expand Up @@ -50,6 +50,11 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.7</source> <!-- for keeping tajo-client and tajo-jdbc available in 1.7-->
<target>1.7</target> <!-- for keeping tajo-client and tajo-jdbc available in 1.7-->
<encoding>${project.build.sourceEncoding}</encoding>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.rat</groupId>
Expand Down
Expand Up @@ -569,15 +569,13 @@ public Object getObject(String name, Map<String, Class<?>> x)
throw new SQLFeatureNotSupportedException("getObject not supported");
}

public <T> T getObject(String name, Class<T> x)
throws SQLException {
//JDK 1.7
@Override
public <T> T getObject(String name, Class<T> x) throws SQLException {
throw new SQLFeatureNotSupportedException("getObject not supported");
}

public <T> T getObject(int index, Class<T> x)
throws SQLException {
//JDK 1.7
@Override
public <T> T getObject(int index, Class<T> x) throws SQLException {
throw new SQLFeatureNotSupportedException("getObject not supported");
}

Expand Down
5 changes: 5 additions & 0 deletions tajo-common/pom.xml
Expand Up @@ -91,6 +91,11 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.7</source> <!-- for keeping tajo-client and tajo-jdbc available in 1.7-->
<target>1.7</target> <!-- for keeping tajo-client and tajo-jdbc available in 1.7-->
<encoding>${project.build.sourceEncoding}</encoding>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.rat</groupId>
Expand Down
2 changes: 1 addition & 1 deletion tajo-docs/src/main/sphinx/getting_started.rst
Expand Up @@ -9,7 +9,7 @@ Prerequisites
======================

* Hadoop 2.3.0 or higher (up to 2.6.0)
* Java 1.7 or higher
* Java 1.8 or higher
* Protocol buffer 2.5.0

===================================
Expand Down
5 changes: 5 additions & 0 deletions tajo-jdbc/pom.xml
Expand Up @@ -49,6 +49,11 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.7</source> <!-- for keeping tajo-client and tajo-jdbc available in 1.7-->
<target>1.7</target> <!-- for keeping tajo-client and tajo-jdbc available in 1.7-->
<encoding>${project.build.sourceEncoding}</encoding>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.rat</groupId>
Expand Down
Expand Up @@ -433,24 +433,25 @@ public boolean isWrapperFor(Class<?> tClass) throws SQLException {
}

public void abort(Executor executor) throws SQLException {
// JDK 1.7
throw new SQLFeatureNotSupportedException("abort is not supported");
}

@Override
public int getNetworkTimeout() throws SQLException {
// JDK 1.7
throw new SQLFeatureNotSupportedException("getNetworkTimeout is not supported");
}

@Override
public void setNetworkTimeout(Executor executor, int milliseconds) throws SQLException {
// JDK 1.7
throw new SQLFeatureNotSupportedException("setNetworkTimeout not supported");
}

@Override
public String getSchema() throws SQLException {
return TajoConstants.DEFAULT_SCHEMA_NAME;
}

@Override
public void setSchema(String schema) throws SQLException {
throw new SQLFeatureNotSupportedException("setSchema() is not supported yet");
}
Expand Down
Expand Up @@ -1256,14 +1256,14 @@ public boolean isWrapperFor(Class<?> iface) throws SQLException {
return iface.isInstance(this);
}

@Override
public boolean generatedKeyAlwaysReturned() throws SQLException {
// JDK 1.7
return false;
}

@Override
public ResultSet getPseudoColumns(String catalog, String schemaPattern,
String tableNamePattern, String columnNamePattern) throws SQLException {
// JDK 1.7
throw new SQLFeatureNotSupportedException("getPseudoColumns not supported");
}
}
Expand Down
Expand Up @@ -76,8 +76,8 @@ public boolean jdbcCompliant() {
return false;
}

@Override
public Logger getParentLogger() throws SQLFeatureNotSupportedException {
// JDK 1.7
throw new SQLFeatureNotSupportedException("getParentLogger not supported");
}
}
Expand Up @@ -109,8 +109,8 @@ public void close() throws SQLException {
isClosed = true;
}

@Override
public void closeOnCompletion() throws SQLException {
// JDK 1.7
throw new SQLFeatureNotSupportedException("closeOnCompletion() is not supported yet.");
}

Expand Down Expand Up @@ -292,8 +292,8 @@ public boolean isClosed() throws SQLException {
return isClosed;
}

@Override
public boolean isCloseOnCompletion() throws SQLException {
// JDK 1.7
throw new SQLFeatureNotSupportedException("isCloseOnCompletion() is not supported yet.");
}

Expand Down
4 changes: 4 additions & 0 deletions tajo-rpc/tajo-rpc-common/pom.xml
Expand Up @@ -34,6 +34,10 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.7</source>
<target>1.7</target>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.rat</groupId>
Expand Down
5 changes: 5 additions & 0 deletions tajo-rpc/tajo-rpc-protobuf/pom.xml
Expand Up @@ -34,6 +34,11 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.7</source> <!-- for keeping tajo-client and tajo-jdbc available in 1.7-->
<target>1.7</target> <!-- for keeping tajo-client and tajo-jdbc available in 1.7-->
<encoding>${project.build.sourceEncoding}</encoding>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.rat</groupId>
Expand Down
5 changes: 0 additions & 5 deletions tajo-storage/tajo-storage-jdbc/pom.xml
Expand Up @@ -52,11 +52,6 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.7</source>
<target>1.7</target>
<encoding>${project.build.sourceEncoding}</encoding>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.rat</groupId>
Expand Down
4 changes: 4 additions & 0 deletions tajo-thirdparty/asm/pom.xml
Expand Up @@ -46,6 +46,10 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.7</source>
<target>1.7</target>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.rat</groupId>
Expand Down

0 comments on commit 513aff4

Please sign in to comment.