Skip to content

Commit

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

Change-Id: I882ba7ffe6a2975adf0147139f96db6df7766ea5
  • Loading branch information
yongyanw committed Nov 17, 2020
1 parent ac7f0ad commit ed4d6b6
Show file tree
Hide file tree
Showing 428 changed files with 8,053 additions and 2,882 deletions.
2 changes: 1 addition & 1 deletion client/base/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
<parent>
<groupId>com.dremio.client</groupId>
<artifactId>dremio-client-parent</artifactId>
<version>4.9.1-202010230218060541-2e764ed0</version>
<version>11.0.0-202011171636110752-16ab953d</version>
</parent>

<artifactId>dremio-client-base</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion 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>4.9.1-202010230218060541-2e764ed0</version>
<version>11.0.0-202011171636110752-16ab953d</version>
</parent>
<artifactId>dremio-client-jdbc</artifactId>
<name>Client - JDBC Driver</name>
Expand Down
2 changes: 1 addition & 1 deletion client/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
<parent>
<groupId>com.dremio</groupId>
<artifactId>dremio-parent</artifactId>
<version>4.9.1-202010230218060541-2e764ed0</version>
<version>11.0.0-202011171636110752-16ab953d</version>
</parent>

<groupId>com.dremio.client</groupId>
Expand Down
2 changes: 1 addition & 1 deletion common/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
<parent>
<groupId>com.dremio</groupId>
<artifactId>dremio-parent</artifactId>
<version>4.9.1-202010230218060541-2e764ed0</version>
<version>11.0.0-202011171636110752-16ab953d</version>
</parent>

<artifactId>dremio-common</artifactId>
Expand Down
13 changes: 13 additions & 0 deletions common/src/main/java/com/dremio/common/AutoCloseables.java
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,19 @@ public static void close(AutoCloseable... autoCloseables) throws Exception {
* @throws E
*/
public static <E extends Throwable> void close(Class<E> exceptionClazz, AutoCloseable... autoCloseables) throws E {
close(exceptionClazz, Arrays.asList(autoCloseables));
}

/**
* Close with an expected exception class. This method wraps any checked exception to an expected type.
* The exception class should have a constructor that takes Exception object as a parameter.
*
* @param exceptionClazz
* @param autoCloseables
* @param <E>
* @throws E
*/
public static <E extends Throwable> void close(Class<E> exceptionClazz, Iterable<? extends AutoCloseable> autoCloseables) throws E {
try {
close(autoCloseables);
} catch (RuntimeException e) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,4 +70,16 @@ public static Schema fromMetaData(Map<String, String> properties) throws IOExcep
}
return null;
}

/**
*
* @param properties
* @return true if parquet file footer properties contain arrow schema
*/
public static boolean isArrowSchemaPresent(Map<String, String> properties) {
Preconditions.checkNotNull(properties);
String jsonArrowSchema = properties.get(DREMIO_ARROW_SCHEMA);
String jsonArrowSchema2_1 = properties.get(DREMIO_ARROW_SCHEMA_2_1);
return jsonArrowSchema != null || jsonArrowSchema2_1 != null;
}
}
28 changes: 28 additions & 0 deletions common/src/main/java/com/dremio/common/util/DremioCollectors.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@

/*
* Copyright (C) 2017-2019 Dremio Corporation
*
* 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.
*/
package com.dremio.common.util;

import java.util.function.Function;
import java.util.stream.Collectors;
import com.google.common.collect.MoreCollectors;
public class DremioCollectors {
public static <VALUE, KEY> java.util.stream.Collector<VALUE, ?, java.util.Map<KEY, VALUE>> uniqueGrouping(
Function<VALUE, KEY> function
){
return Collectors.groupingBy(function, MoreCollectors.<VALUE>onlyElement());
}
}
36 changes: 36 additions & 0 deletions common/src/main/java/com/dremio/io/AsyncByteReader.java
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,12 @@
*/
package com.dremio.io;

import java.io.FileNotFoundException;
import java.util.Collections;
import java.util.List;
import java.util.Objects;
import java.util.concurrent.CompletableFuture;
import java.util.concurrent.CompletionException;

import com.dremio.io.file.Path;
import com.google.common.collect.ImmutableList;
Expand All @@ -30,6 +32,8 @@
* A simplified asynchronous data reading interface.
*/
public interface AsyncByteReader extends AutoCloseable {
CompletableFuture<Void> completedFuture = CompletableFuture.completedFuture(null);

/**
* Read data into the provided dst buffer. Attempts to do so offheap.
* @param offset The offset in the underlying data.
Expand All @@ -40,6 +44,38 @@ public interface AsyncByteReader extends AutoCloseable {
*/
CompletableFuture<Void> readFully(long offset, ByteBuf dst, int dstOffset, int len);

/**
* Checks if the version of the file being read has changed. Note that
* this should create a singleton instance of the Future to checkVersion. This API
* is called repeatedly as part of {@link #versionedReadFully} and would cause a
* performance degradation if the version check is done multiple times.
*
* @param version The expected version of the file
*
* @return A CompletableFuture that will be informed when the check is complete
*/
default CompletableFuture<Void> checkVersion(String version) {
return completedFuture;
}

/**
* Verifies that the object's version has not changed and reads the object
* @return
*/
default CompletableFuture<Void> versionedReadFully(String version, long offset, ByteBuf dst, int dstOffset, int len) {
return CompletableFuture
.allOf(checkVersion(version), readFully(offset, dst, dstOffset, len))
.whenComplete((v, e) -> {
if (e != null) {
Throwable cause = e.getCause();
if (cause instanceof FileNotFoundException) {
throw new CompletionException(cause);
}
throw new CompletionException(e);
}
});
}

/**
* Read data and return as a byte array.
* @param offset File offset to read from
Expand Down
8 changes: 6 additions & 2 deletions common/src/main/java/com/dremio/ssl/SSLEngineFactoryImpl.java
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,11 @@
import java.io.InputStream;
import java.security.GeneralSecurityException;
import java.security.KeyStore;
import java.util.Collections;
import java.util.Optional;

import javax.net.ssl.KeyManagerFactory;
import javax.net.ssl.SNIHostName;
import javax.net.ssl.SSLEngine;
import javax.net.ssl.SSLException;
import javax.net.ssl.SSLParameters;
Expand Down Expand Up @@ -171,14 +173,16 @@ public SSLEngine newClientEngine(ByteBufAllocator allocator, String peerHost, in
final SslContext sslContext = newClientContextBuilder().build();

final SSLEngine engine = sslContext.newEngine(allocator, peerHost, peerPort);
final SSLParameters sslParameters = engine.getSSLParameters();
sslParameters.setServerNames(Collections.singletonList(new SNIHostName(peerHost)));

if (!sslConfig.disableHostVerification()) {
final SSLParameters sslParameters = engine.getSSLParameters();
// only available since Java 7
sslParameters.setEndpointIdentificationAlgorithm("HTTPS");
engine.setSSLParameters(sslParameters);
}

engine.setSSLParameters(sslParameters);

try {
engine.setEnableSessionCreation(true);
} catch (UnsupportedOperationException ignored) {
Expand Down
Loading

0 comments on commit ed4d6b6

Please sign in to comment.