Skip to content

Commit

Permalink
Release 3.2.0
Browse files Browse the repository at this point in the history
Release notes are available at:
https://docs.dremio.com/release-notes/32-release-notes.html

Change-Id: I73748c037481d6076ef86e6fea041f8ed299b5a8
  • Loading branch information
yongyanw committed May 10, 2019
1 parent 11c17e2 commit b8f0e26
Show file tree
Hide file tree
Showing 1,665 changed files with 64,895 additions and 31,322 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
.checkstyle
.classpath
.idea/
.vscode/
.project
.mvn/wrapper/maven-wrapper.jar
.profiler
Expand Down
Empty file removed .gitmodules
Empty file.
51 changes: 29 additions & 22 deletions .mvn/wrapper/MavenWrapperDownloader.java
100755 → 100644
Original file line number Diff line number Diff line change
@@ -1,34 +1,31 @@
/*
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
*/

* Copyright 2007-present the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import java.net.*;
import java.io.*;
import java.nio.channels.*;
import java.util.Properties;

public class MavenWrapperDownloader {

private static final String WRAPPER_VERSION = "0.5.4";
/**
* Default URL to download the maven-wrapper.jar from, if no 'downloadUrl' is provided.
*/
private static final String DEFAULT_DOWNLOAD_URL =
"https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.4.0/maven-wrapper-0.4.0.jar";
private static final String DEFAULT_DOWNLOAD_URL = "https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/"
+ WRAPPER_VERSION + "/maven-wrapper-" + WRAPPER_VERSION + " .jar";

/**
* Path to the maven-wrapper.properties file, which might contain a downloadUrl property to
Expand Down Expand Up @@ -76,13 +73,13 @@ public static void main(String args[]) {
}
}
}
System.out.println("- Downloading from: : " + url);
System.out.println("- Downloading from: " + url);

File outputFile = new File(baseDirectory.getAbsolutePath(), MAVEN_WRAPPER_JAR_PATH);
if(!outputFile.getParentFile().exists()) {
if(!outputFile.getParentFile().mkdirs()) {
System.out.println(
"- ERROR creating output direcrory '" + outputFile.getParentFile().getAbsolutePath() + "'");
"- ERROR creating output directory '" + outputFile.getParentFile().getAbsolutePath() + "'");
}
}
System.out.println("- Downloading to: " + outputFile.getAbsolutePath());
Expand All @@ -98,6 +95,16 @@ public static void main(String args[]) {
}

private static void downloadFileFromURL(String urlString, File destination) throws Exception {
if (System.getenv("MVNW_USERNAME") != null && System.getenv("MVNW_PASSWORD") != null) {
String username = System.getenv("MVNW_USERNAME");
char[] password = System.getenv("MVNW_PASSWORD").toCharArray();
Authenticator.setDefault(new Authenticator() {
@Override
protected PasswordAuthentication getPasswordAuthentication() {
return new PasswordAuthentication(username, password);
}
});
}
URL website = new URL(urlString);
ReadableByteChannel rbc;
rbc = Channels.newChannel(website.openStream());
Expand Down
3 changes: 2 additions & 1 deletion .mvn/wrapper/maven-wrapper.properties
100755 → 100644
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.5.2/apache-maven-3.5.2-bin.zip
distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.6.0/apache-maven-3.6.0-bin.zip
wrapperUrl=https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.4/maven-wrapper-0.5.4.jar
5 changes: 1 addition & 4 deletions client/jdbc/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<parent>
<groupId>com.dremio.client</groupId>
<artifactId>dremio-client-parent</artifactId>
<version>3.1.11-201904261857420193-c674472</version>
<version>3.2.0-201905102005330382-0598733</version>
</parent>
<artifactId>dremio-client-jdbc</artifactId>
<name>Client - JDBC Driver</name>
Expand Down Expand Up @@ -73,17 +73,14 @@
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-core</artifactId>
<version>${jackson.version}</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-annotations</artifactId>
<version>${jackson.version}</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
<version>${jackson.version}</version>
</dependency>
<dependency>
<groupId>net.hydromatic</groupId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -600,13 +600,13 @@ public BigDecimal getBigDecimal( int rowOffset ) throws InvalidAccessException {
result = new BigDecimal( innerAccessor.getInt( rowOffset ) );
break;
case BIGINT:
result = new BigDecimal( innerAccessor.getLong( rowOffset ) );
result = BigDecimal.valueOf( innerAccessor.getLong( rowOffset ) );
break;
case FLOAT4:
result = new BigDecimal( innerAccessor.getFloat( rowOffset ) );
result = BigDecimal.valueOf( innerAccessor.getFloat( rowOffset ) );
break;
case FLOAT8:
result = new BigDecimal( innerAccessor.getDouble( rowOffset ) );
result = BigDecimal.valueOf( innerAccessor.getDouble( rowOffset ) );
break;

// 3. Not-yet-converted and unconvertible types:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -458,17 +458,17 @@ public void test_getBigDecimal_handles_BIGINT() throws SQLException {
@Ignore( "TODO(DRILL-2683): unignore when REAL is implemented" )
@Test
public void test_getBigDecimal_handles_REAL() throws SQLException {
assertThat( testDataRow.getBigDecimal( "C_REAL_5.5" ), equalTo( new BigDecimal( 5.5f ) ) );
assertThat( testDataRow.getBigDecimal( "C_REAL_5.5" ), equalTo( BigDecimal.valueOf( 5.5f ) ) );
}

@Test
public void test_getBigDecimal_handles_DOUBLE() throws SQLException {
assertThat( testDataRow.getBigDecimal( "C_DOUBLE_PREC._6.6" ), equalTo( new BigDecimal( 6.6d ) ) );
assertThat( testDataRow.getBigDecimal( "C_DOUBLE_PREC._6.6" ), equalTo( BigDecimal.valueOf( 6.6d ) ) );
}

@Test
public void test_getBigDecimal_handles_FLOAT() throws SQLException {
assertThat( testDataRow.getBigDecimal( "C_FLOAT_7.7" ), equalTo( new BigDecimal( 7.7f ) ) );
assertThat( testDataRow.getBigDecimal( "C_FLOAT_7.7" ), equalTo( BigDecimal.valueOf( 7.7f ) ) );
}

@Test
Expand All @@ -479,7 +479,7 @@ public void test_getBigDecimal_handles_DECIMAL_1() throws SQLException {
@Ignore( "TODO(DRILL-3367): unignore when DECIMAL is no longer DOUBLE" )
@Test
public void test_getBigDecimal_handles_DECIMAL_2() throws SQLException {
assertThat( testDataRow.getBigDecimal( "C_DECIMAL_10.10" ), equalTo( new BigDecimal( "10.10") ) );
assertThat( testDataRow.getBigDecimal( "C_DECIMAL_10.10" ), equalTo( new BigDecimal("10.10") ) );
}


Expand Down
4 changes: 2 additions & 2 deletions client/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@

<parent>
<groupId>com.dremio</groupId>
<artifactId>dremio-root</artifactId>
<version>3.1.11-201904261857420193-c674472</version>
<artifactId>dremio-parent</artifactId>
<version>3.2.0-201905102005330382-0598733</version>
</parent>

<groupId>com.dremio.client</groupId>
Expand Down
8 changes: 6 additions & 2 deletions common/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@

<parent>
<groupId>com.dremio</groupId>
<artifactId>dremio-root</artifactId>
<version>3.1.11-201904261857420193-c674472</version>
<artifactId>dremio-parent</artifactId>
<version>3.2.0-201905102005330382-0598733</version>
</parent>

<artifactId>dremio-common</artifactId>
Expand Down Expand Up @@ -192,6 +192,10 @@
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
</dependency>
<dependency>
<groupId>com.hubspot.jackson</groupId>
<artifactId>jackson-datatype-protobuf</artifactId>
</dependency>
<dependency>
<groupId>com.github.slugify</groupId>
<artifactId>slugify</artifactId>
Expand Down
21 changes: 10 additions & 11 deletions common/src/main/java/com/dremio/common/ProcessExit.java
Original file line number Diff line number Diff line change
Expand Up @@ -33,20 +33,17 @@ private ProcessExit() {
* @param code an error code to exit the JVM with.
*/
public static void exit(String message, int code) {
try {
exit(null, message, code);
} finally {
// We tried to exit with a nice error message, but that failed for some reason. Can't let this thread simply exit
Runtime.getRuntime().halt(code);
}
exit(null, message, code);
}

public static void exitHeap(Throwable t, int code) {
public static void exitHeap(Throwable t) {
final int heapExitCode = 1;
try {
exit(t, "There was insufficient heap memory to continue operating.", code);
exit(t, "There was insufficient heap memory to continue operating.", heapExitCode);
} finally {
// We tried to exit with a nice error message, but that failed for some reason. Can't let this thread simply exit
Runtime.getRuntime().halt(code);
// We tried to exit with a nice error message, but that failed, likely when we tried to create a String for the
// error message. Can't let this thread simply exit
Runtime.getRuntime().halt(heapExitCode);
}
}

Expand All @@ -72,7 +69,9 @@ public static void exit(Throwable t, String message, int code) {
out.flush();
try {
Thread.sleep(5000);
} catch (InterruptedException e) {}
} catch (InterruptedException e) {
// Exception ignored
}
} finally {
// We tried to exit with a nice error message, but that failed for some reason. Can't let this thread simply exit
Runtime.getRuntime().halt(code);
Expand Down
12 changes: 8 additions & 4 deletions common/src/main/java/com/dremio/common/WakeupHandler.java
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,14 @@
*/
package com.dremio.common;

import java.util.concurrent.CompletableFuture;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Future;
import java.util.concurrent.FutureTask;
import java.util.concurrent.atomic.AtomicBoolean;

import com.google.common.base.Preconditions;
import com.google.common.util.concurrent.AbstractFuture;

/**
* Handles wakeup events for the various managers.
Expand All @@ -39,17 +43,17 @@ public WakeupHandler(ExecutorService executor, Runnable manager) {
this.manager = Preconditions.checkNotNull(manager, "runnable manager required");
}

public void handle(String reason) {
public Future<?> handle(String reason) {
logger.trace("waking up manager, reason: {}", reason);
if (!wakeup.compareAndSet(false, true)) {
return; // wakeup event already queued for handling, nothing more to do
return CompletableFuture.completedFuture(null);
}
// following check if not necessary. It helps not submitting a thread if the manager is already running
if (running.get()) {
return;
return CompletableFuture.completedFuture(null);
}

executor.submit(new Runnable() {
return executor.submit(new Runnable() {

@Override
public void run() {
Expand Down
6 changes: 3 additions & 3 deletions common/src/main/java/com/dremio/common/collections/Tuple.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@
/**
* An immutable ordered sequence of two elements
*
* @param <F> first element
* @param <S> second element
* @param <F> first element
* @param <S> second element
*/
public class Tuple<F, S> {
public final F first;
Expand All @@ -31,7 +31,7 @@ protected Tuple(final F first, final S second) {
}

public static <F, S> Tuple<F, S> of(final F first, final S second) {
return new Tuple(first, second);
return new Tuple<>(first, second);
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
* Converts newly added error types to types compatible with the existing C or ODBC clients.
* <p>
* <ul>
* <li>{@link ErrorType#JSON_FIELD_CHANGE} to {@link ErrorType#DATA_READ}</li>
* <li>{@link ErrorType#SCHEMA_CHANGE} to {@link ErrorType#DATA_READ}</li>
* <li>{@link ErrorType#OUT_OF_MEMORY} to {@link ErrorType#RESOURCE}</li>
* <li>{@link ErrorType#IO_EXCEPTION} to {@link ErrorType#RESOURCE}</li>
Expand All @@ -43,7 +44,8 @@ public class ErrorCompatibility {
ErrorType.CONCURRENT_MODIFICATION,
ErrorType.INVALID_DATASET_METADATA,
ErrorType.REFLECTION_ERROR,
ErrorType.SOURCE_BAD_STATE);
ErrorType.SOURCE_BAD_STATE,
ErrorType.JSON_FIELD_CHANGE);

private static boolean needsConversion(final DremioPBError error) {
return incompatibleErrorTypes.contains(error.getErrorType());
Expand All @@ -55,6 +57,7 @@ public static DremioPBError convertIfNecessary(final DremioPBError error) {
}

switch (error.getErrorType()) {
case JSON_FIELD_CHANGE:
case SCHEMA_CHANGE:
case SOURCE_BAD_STATE:
return DremioPBError.newBuilder(error).setErrorType(ErrorType.DATA_READ).build();
Expand Down
Loading

0 comments on commit b8f0e26

Please sign in to comment.