From 74e47930f07d30242878266f1be3e55881ccf2b3 Mon Sep 17 00:00:00 2001 From: David Phillips Date: Sat, 29 Dec 2018 23:45:07 -0800 Subject: [PATCH 1/6] Fix undeclared dependency used for HTTP constants --- .../plugin/hive/S3SelectLineRecordReader.java | 12 +++---- .../plugin/hive/s3/PrestoS3FileSystem.java | 22 ++++++------- .../plugin/hive/s3/MockAmazonS3.java | 10 +++--- .../hive/s3/TestPrestoS3FileSystem.java | 33 ++++++++++--------- 4 files changed, 39 insertions(+), 38 deletions(-) diff --git a/presto-hive/src/main/java/io/prestosql/plugin/hive/S3SelectLineRecordReader.java b/presto-hive/src/main/java/io/prestosql/plugin/hive/S3SelectLineRecordReader.java index b87756698df7..7d2c8051f303 100644 --- a/presto-hive/src/main/java/io/prestosql/plugin/hive/S3SelectLineRecordReader.java +++ b/presto-hive/src/main/java/io/prestosql/plugin/hive/S3SelectLineRecordReader.java @@ -43,14 +43,14 @@ import static io.prestosql.plugin.hive.s3.S3ConfigurationUpdater.S3_MAX_CLIENT_RETRIES; import static io.prestosql.plugin.hive.s3.S3ConfigurationUpdater.S3_MAX_RETRY_TIME; import static java.lang.String.format; +import static java.net.HttpURLConnection.HTTP_BAD_REQUEST; +import static java.net.HttpURLConnection.HTTP_FORBIDDEN; +import static java.net.HttpURLConnection.HTTP_NOT_FOUND; import static java.util.Objects.requireNonNull; import static java.util.concurrent.TimeUnit.SECONDS; import static org.apache.hadoop.hive.serde.serdeConstants.FIELD_DELIM; import static org.apache.hadoop.hive.serde.serdeConstants.LINE_DELIM; import static org.apache.hadoop.hive.serde.serdeConstants.SERIALIZATION_FORMAT; -import static org.apache.http.HttpStatus.SC_BAD_REQUEST; -import static org.apache.http.HttpStatus.SC_FORBIDDEN; -import static org.apache.http.HttpStatus.SC_NOT_FOUND; @ThreadSafe public abstract class S3SelectLineRecordReader @@ -137,9 +137,9 @@ private int readLine(Text value) recordsFromS3 = 0; if (e instanceof AmazonS3Exception) { switch (((AmazonS3Exception) e).getStatusCode()) { - case SC_FORBIDDEN: - case SC_NOT_FOUND: - case SC_BAD_REQUEST: + case HTTP_FORBIDDEN: + case HTTP_NOT_FOUND: + case HTTP_BAD_REQUEST: throw new UnrecoverableS3OperationException(selectClient.getBucketName(), selectClient.getKeyName(), e); } } diff --git a/presto-hive/src/main/java/io/prestosql/plugin/hive/s3/PrestoS3FileSystem.java b/presto-hive/src/main/java/io/prestosql/plugin/hive/s3/PrestoS3FileSystem.java index 0775f7ef9af6..6fa886a60e3e 100644 --- a/presto-hive/src/main/java/io/prestosql/plugin/hive/s3/PrestoS3FileSystem.java +++ b/presto-hive/src/main/java/io/prestosql/plugin/hive/s3/PrestoS3FileSystem.java @@ -132,14 +132,13 @@ import static java.lang.Math.max; import static java.lang.Math.toIntExact; import static java.lang.String.format; +import static java.net.HttpURLConnection.HTTP_BAD_REQUEST; +import static java.net.HttpURLConnection.HTTP_FORBIDDEN; +import static java.net.HttpURLConnection.HTTP_NOT_FOUND; import static java.nio.file.Files.createDirectories; import static java.nio.file.Files.createTempFile; import static java.util.Objects.requireNonNull; import static java.util.concurrent.TimeUnit.SECONDS; -import static org.apache.http.HttpStatus.SC_BAD_REQUEST; -import static org.apache.http.HttpStatus.SC_FORBIDDEN; -import static org.apache.http.HttpStatus.SC_NOT_FOUND; -import static org.apache.http.HttpStatus.SC_REQUESTED_RANGE_NOT_SATISFIABLE; public class PrestoS3FileSystem extends FileSystem @@ -152,6 +151,7 @@ public class PrestoS3FileSystem private static final DataSize MAX_SKIP_SIZE = new DataSize(1, MEGABYTE); private static final String PATH_SEPARATOR = "/"; private static final Duration BACKOFF_MIN_SLEEP = new Duration(1, SECONDS); + private static final int HTTP_RANGE_NOT_SATISFIABLE = 416; private URI uri; private Path workingDirectory; @@ -566,10 +566,10 @@ ObjectMetadata getS3ObjectMetadata(Path path) STATS.newGetMetadataError(); if (e instanceof AmazonS3Exception) { switch (((AmazonS3Exception) e).getStatusCode()) { - case SC_NOT_FOUND: + case HTTP_NOT_FOUND: return null; - case SC_FORBIDDEN: - case SC_BAD_REQUEST: + case HTTP_FORBIDDEN: + case HTTP_BAD_REQUEST: throw new UnrecoverableS3OperationException(path, e); } } @@ -926,12 +926,12 @@ private InputStream openStream(Path path, long start) STATS.newGetObjectError(); if (e instanceof AmazonS3Exception) { switch (((AmazonS3Exception) e).getStatusCode()) { - case SC_REQUESTED_RANGE_NOT_SATISFIABLE: + case HTTP_RANGE_NOT_SATISFIABLE: // ignore request for start past end of object return new ByteArrayInputStream(new byte[0]); - case SC_FORBIDDEN: - case SC_NOT_FOUND: - case SC_BAD_REQUEST: + case HTTP_FORBIDDEN: + case HTTP_NOT_FOUND: + case HTTP_BAD_REQUEST: throw new UnrecoverableS3OperationException(path, e); } } diff --git a/presto-hive/src/test/java/io/prestosql/plugin/hive/s3/MockAmazonS3.java b/presto-hive/src/test/java/io/prestosql/plugin/hive/s3/MockAmazonS3.java index 9853184ddb67..13833bb72f32 100644 --- a/presto-hive/src/test/java/io/prestosql/plugin/hive/s3/MockAmazonS3.java +++ b/presto-hive/src/test/java/io/prestosql/plugin/hive/s3/MockAmazonS3.java @@ -23,13 +23,13 @@ import com.amazonaws.services.s3.model.PutObjectResult; import com.amazonaws.services.s3.model.S3Object; -import static org.apache.http.HttpStatus.SC_OK; +import static java.net.HttpURLConnection.HTTP_OK; public class MockAmazonS3 extends AbstractAmazonS3 { - private int getObjectHttpCode = SC_OK; - private int getObjectMetadataHttpCode = SC_OK; + private int getObjectHttpCode = HTTP_OK; + private int getObjectMetadataHttpCode = HTTP_OK; private GetObjectMetadataRequest getObjectMetadataRequest; private CannedAccessControlList acl; @@ -57,7 +57,7 @@ public GetObjectMetadataRequest getGetObjectMetadataRequest() public ObjectMetadata getObjectMetadata(GetObjectMetadataRequest getObjectMetadataRequest) { this.getObjectMetadataRequest = getObjectMetadataRequest; - if (getObjectMetadataHttpCode != SC_OK) { + if (getObjectMetadataHttpCode != HTTP_OK) { AmazonS3Exception exception = new AmazonS3Exception("Failing getObjectMetadata call with " + getObjectMetadataHttpCode); exception.setStatusCode(getObjectMetadataHttpCode); throw exception; @@ -68,7 +68,7 @@ public ObjectMetadata getObjectMetadata(GetObjectMetadataRequest getObjectMetada @Override public S3Object getObject(GetObjectRequest getObjectRequest) { - if (getObjectHttpCode != SC_OK) { + if (getObjectHttpCode != HTTP_OK) { AmazonS3Exception exception = new AmazonS3Exception("Failing getObject call with " + getObjectHttpCode); exception.setStatusCode(getObjectHttpCode); throw exception; diff --git a/presto-hive/src/test/java/io/prestosql/plugin/hive/s3/TestPrestoS3FileSystem.java b/presto-hive/src/test/java/io/prestosql/plugin/hive/s3/TestPrestoS3FileSystem.java index 33b8b7d2e0eb..a5092715cb7a 100644 --- a/presto-hive/src/test/java/io/prestosql/plugin/hive/s3/TestPrestoS3FileSystem.java +++ b/presto-hive/src/test/java/io/prestosql/plugin/hive/s3/TestPrestoS3FileSystem.java @@ -65,17 +65,18 @@ import static io.prestosql.plugin.hive.s3.S3ConfigurationUpdater.S3_USER_AGENT_PREFIX; import static io.prestosql.plugin.hive.s3.S3ConfigurationUpdater.S3_USER_AGENT_SUFFIX; import static io.prestosql.plugin.hive.s3.S3ConfigurationUpdater.S3_USE_INSTANCE_CREDENTIALS; +import static java.net.HttpURLConnection.HTTP_FORBIDDEN; +import static java.net.HttpURLConnection.HTTP_INTERNAL_ERROR; +import static java.net.HttpURLConnection.HTTP_NOT_FOUND; import static java.nio.file.Files.createTempDirectory; import static java.nio.file.Files.createTempFile; -import static org.apache.http.HttpStatus.SC_FORBIDDEN; -import static org.apache.http.HttpStatus.SC_INTERNAL_SERVER_ERROR; -import static org.apache.http.HttpStatus.SC_NOT_FOUND; -import static org.apache.http.HttpStatus.SC_REQUESTED_RANGE_NOT_SATISFIABLE; import static org.testng.Assert.assertEquals; import static org.testng.Assert.assertTrue; public class TestPrestoS3FileSystem { + private static final int HTTP_RANGE_NOT_SATISFIABLE = 416; + @Test public void testStaticCredentials() throws Exception @@ -184,7 +185,7 @@ public void testReadRetryCounters() try (PrestoS3FileSystem fs = new PrestoS3FileSystem()) { int maxRetries = 2; MockAmazonS3 s3 = new MockAmazonS3(); - s3.setGetObjectHttpErrorCode(SC_INTERNAL_SERVER_ERROR); + s3.setGetObjectHttpErrorCode(HTTP_INTERNAL_ERROR); Configuration configuration = new Configuration(); configuration.set(S3_MAX_BACKOFF_TIME, "1ms"); configuration.set(S3_MAX_RETRY_TIME, "5s"); @@ -196,7 +197,7 @@ public void testReadRetryCounters() } catch (Throwable expected) { assertInstanceOf(expected, AmazonS3Exception.class); - assertEquals(((AmazonS3Exception) expected).getStatusCode(), SC_INTERNAL_SERVER_ERROR); + assertEquals(((AmazonS3Exception) expected).getStatusCode(), HTTP_INTERNAL_ERROR); assertEquals(PrestoS3FileSystem.getFileSystemStats().getReadRetries().getTotalCount(), maxRetries); assertEquals(PrestoS3FileSystem.getFileSystemStats().getGetObjectRetries().getTotalCount(), (maxRetries + 1L) * maxRetries); } @@ -210,7 +211,7 @@ public void testGetMetadataRetryCounter() int maxRetries = 2; try (PrestoS3FileSystem fs = new PrestoS3FileSystem()) { MockAmazonS3 s3 = new MockAmazonS3(); - s3.setGetObjectMetadataHttpCode(SC_INTERNAL_SERVER_ERROR); + s3.setGetObjectMetadataHttpCode(HTTP_INTERNAL_ERROR); Configuration configuration = new Configuration(); configuration.set(S3_MAX_BACKOFF_TIME, "1ms"); configuration.set(S3_MAX_RETRY_TIME, "5s"); @@ -221,19 +222,19 @@ public void testGetMetadataRetryCounter() } catch (Throwable expected) { assertInstanceOf(expected, AmazonS3Exception.class); - assertEquals(((AmazonS3Exception) expected).getStatusCode(), SC_INTERNAL_SERVER_ERROR); + assertEquals(((AmazonS3Exception) expected).getStatusCode(), HTTP_INTERNAL_ERROR); assertEquals(PrestoS3FileSystem.getFileSystemStats().getGetMetadataRetries().getTotalCount(), maxRetries); } } @SuppressWarnings("ResultOfMethodCallIgnored") - @Test(expectedExceptions = RuntimeException.class, expectedExceptionsMessageRegExp = ".*Failing getObject call with " + SC_NOT_FOUND + ".*") + @Test(expectedExceptions = RuntimeException.class, expectedExceptionsMessageRegExp = ".*Failing getObject call with " + HTTP_NOT_FOUND + ".*") public void testReadNotFound() throws Exception { try (PrestoS3FileSystem fs = new PrestoS3FileSystem()) { MockAmazonS3 s3 = new MockAmazonS3(); - s3.setGetObjectHttpErrorCode(SC_NOT_FOUND); + s3.setGetObjectHttpErrorCode(HTTP_NOT_FOUND); fs.initialize(new URI("s3n://test-bucket/"), new Configuration()); fs.setS3Client(s3); try (FSDataInputStream inputStream = fs.open(new Path("s3n://test-bucket/test"))) { @@ -243,13 +244,13 @@ public void testReadNotFound() } @SuppressWarnings("ResultOfMethodCallIgnored") - @Test(expectedExceptions = RuntimeException.class, expectedExceptionsMessageRegExp = ".*Failing getObject call with " + SC_FORBIDDEN + ".*") + @Test(expectedExceptions = RuntimeException.class, expectedExceptionsMessageRegExp = ".*Failing getObject call with " + HTTP_FORBIDDEN + ".*") public void testReadForbidden() throws Exception { try (PrestoS3FileSystem fs = new PrestoS3FileSystem()) { MockAmazonS3 s3 = new MockAmazonS3(); - s3.setGetObjectHttpErrorCode(SC_FORBIDDEN); + s3.setGetObjectHttpErrorCode(HTTP_FORBIDDEN); fs.initialize(new URI("s3n://test-bucket/"), new Configuration()); fs.setS3Client(s3); try (FSDataInputStream inputStream = fs.open(new Path("s3n://test-bucket/test"))) { @@ -342,7 +343,7 @@ public void testReadRequestRangeNotSatisfiable() { try (PrestoS3FileSystem fs = new PrestoS3FileSystem()) { MockAmazonS3 s3 = new MockAmazonS3(); - s3.setGetObjectHttpErrorCode(SC_REQUESTED_RANGE_NOT_SATISFIABLE); + s3.setGetObjectHttpErrorCode(HTTP_RANGE_NOT_SATISFIABLE); fs.initialize(new URI("s3n://test-bucket/"), new Configuration()); fs.setS3Client(s3); try (FSDataInputStream inputStream = fs.open(new Path("s3n://test-bucket/test"))) { @@ -351,13 +352,13 @@ public void testReadRequestRangeNotSatisfiable() } } - @Test(expectedExceptions = RuntimeException.class, expectedExceptionsMessageRegExp = ".*Failing getObjectMetadata call with " + SC_FORBIDDEN + ".*") + @Test(expectedExceptions = RuntimeException.class, expectedExceptionsMessageRegExp = ".*Failing getObjectMetadata call with " + HTTP_FORBIDDEN + ".*") public void testGetMetadataForbidden() throws Exception { try (PrestoS3FileSystem fs = new PrestoS3FileSystem()) { MockAmazonS3 s3 = new MockAmazonS3(); - s3.setGetObjectMetadataHttpCode(SC_FORBIDDEN); + s3.setGetObjectMetadataHttpCode(HTTP_FORBIDDEN); fs.initialize(new URI("s3n://test-bucket/"), new Configuration()); fs.setS3Client(s3); fs.getS3ObjectMetadata(new Path("s3n://test-bucket/test")); @@ -370,7 +371,7 @@ public void testGetMetadataNotFound() { try (PrestoS3FileSystem fs = new PrestoS3FileSystem()) { MockAmazonS3 s3 = new MockAmazonS3(); - s3.setGetObjectMetadataHttpCode(SC_NOT_FOUND); + s3.setGetObjectMetadataHttpCode(HTTP_NOT_FOUND); fs.initialize(new URI("s3n://test-bucket/"), new Configuration()); fs.setS3Client(s3); assertEquals(fs.getS3ObjectMetadata(new Path("s3n://test-bucket/test")), null); From 1b551e6c577867e544327ae92bc7dc4e2aa4c092 Mon Sep 17 00:00:00 2001 From: David Phillips Date: Mon, 31 Dec 2018 02:43:47 -0800 Subject: [PATCH 2/6] Update Sphinx plugin to 2.1 This updates to Sphinx 1.6.5 and fixes warnings on Java 9. --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index bff3d6b2bb16..e508f3050830 100644 --- a/pom.xml +++ b/pom.xml @@ -1140,7 +1140,7 @@ io.airlift.maven.plugins sphinx-maven-plugin - 2.0 + 2.1 From 696cc914c7021554dce55e3e77381a733d833285 Mon Sep 17 00:00:00 2001 From: David Phillips Date: Tue, 1 Jan 2019 17:29:06 -0800 Subject: [PATCH 3/6] Remove old Maven extensions The Smart Builder was added as an experiment but we never used it. --- .mvn/README.md | 13 ------------- .mvn/extensions.xml | 13 ------------- .mvn/maven.config | 2 -- 3 files changed, 28 deletions(-) delete mode 100644 .mvn/README.md delete mode 100644 .mvn/extensions.xml delete mode 100644 .mvn/maven.config diff --git a/.mvn/README.md b/.mvn/README.md deleted file mode 100644 index 23ce31fc2194..000000000000 --- a/.mvn/README.md +++ /dev/null @@ -1,13 +0,0 @@ -# Parallel Build with Smart Builder - -Add this line if you want to use the Smart Builder with 8 threads: - -`-T 8 -b smart` - -Enabling this by default causes issues with tests as it usually consumes more resources than a normal laptop has, and it also causes issues with the maven-release-plugin. - -If you are working in a mode where you are not running the tests than turning on this option may be more convenient. - -Note that you can still use this option from the command line and it will override the default single threaded builder listed the `.mvn/maven.config`. - - diff --git a/.mvn/extensions.xml b/.mvn/extensions.xml deleted file mode 100644 index ce181fd59d12..000000000000 --- a/.mvn/extensions.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - io.takari.maven - takari-smart-builder - 0.4.0 - - - io.takari.aether - takari-concurrent-localrepo - 0.0.7 - - diff --git a/.mvn/maven.config b/.mvn/maven.config deleted file mode 100644 index 1da3b4e56a2d..000000000000 --- a/.mvn/maven.config +++ /dev/null @@ -1,2 +0,0 @@ --b multithreaded - From 84b274d3e8852164ab68e8bd2078121245411ce7 Mon Sep 17 00:00:00 2001 From: David Phillips Date: Fri, 4 Jan 2019 00:16:22 -0800 Subject: [PATCH 4/6] Use ValidationAssertions in TestPowerOfTwoValidator --- presto-main/pom.xml | 6 -- .../util/TestPowerOfTwoValidator.java | 93 +++++-------------- 2 files changed, 21 insertions(+), 78 deletions(-) diff --git a/presto-main/pom.xml b/presto-main/pom.xml index 48f0dd4da079..f58d3f561c99 100644 --- a/presto-main/pom.xml +++ b/presto-main/pom.xml @@ -307,12 +307,6 @@ jjwt - - - org.apache.bval - bval-jsr - - org.testng diff --git a/presto-main/src/test/java/io/prestosql/util/TestPowerOfTwoValidator.java b/presto-main/src/test/java/io/prestosql/util/TestPowerOfTwoValidator.java index b3070cd7f91f..3fbbc2bf59b7 100644 --- a/presto-main/src/test/java/io/prestosql/util/TestPowerOfTwoValidator.java +++ b/presto-main/src/test/java/io/prestosql/util/TestPowerOfTwoValidator.java @@ -13,94 +13,43 @@ */ package io.prestosql.util; -import org.apache.bval.jsr.ApacheValidationProvider; import org.testng.annotations.Test; -import javax.validation.ConstraintValidatorContext; -import javax.validation.ConstraintViolation; -import javax.validation.Validation; -import javax.validation.Validator; - -import java.util.Set; - -import static io.airlift.testing.Assertions.assertInstanceOf; -import static org.testng.Assert.assertEquals; -import static org.testng.Assert.assertFalse; -import static org.testng.Assert.assertTrue; +import static io.airlift.testing.ValidationAssertions.assertFailsValidation; +import static io.airlift.testing.ValidationAssertions.assertValidates; public class TestPowerOfTwoValidator { - private static final Validator VALIDATOR = Validation.byProvider(ApacheValidationProvider.class).configure().buildValidatorFactory().getValidator(); - @Test public void testValidator() { - PowerOfTwoValidator validator = new PowerOfTwoValidator(); - validator.initialize(new MockPowerOfTwo()); - - assertTrue(validator.isValid(1, new MockContext())); - assertTrue(validator.isValid(2, new MockContext())); - assertTrue(validator.isValid(64, new MockContext())); - assertFalse(validator.isValid(0, new MockContext())); - assertFalse(validator.isValid(3, new MockContext())); - assertFalse(validator.isValid(99, new MockContext())); - assertFalse(validator.isValid(-1, new MockContext())); - assertFalse(validator.isValid(-2, new MockContext())); - assertFalse(validator.isValid(-4, new MockContext())); + assertValid(1); + assertValid(2); + assertValid(64); + assertInvalid(0); + assertInvalid(3); + assertInvalid(99); + assertInvalid(-1); + assertInvalid(-2); + assertInvalid(-4); } @Test public void testAllowsNullPowerOfTwoAnnotation() { - VALIDATOR.validate(new NullPowerOfTwoAnnotation()); + assertValidates(new NullPowerOfTwoAnnotation()); } - @Test - public void testPassesValidation() + private static void assertValid(int value) { - ConstrainedPowerOfTwo object = new ConstrainedPowerOfTwo(128); - Set> violations = VALIDATOR.validate(object); - assertTrue(violations.isEmpty()); - } - - @Test - public void testFailsValidation() - { - ConstrainedPowerOfTwo object = new ConstrainedPowerOfTwo(11); - Set> violations = VALIDATOR.validate(object); - assertEquals(violations.size(), 2); - - for (ConstraintViolation violation : violations) { - assertInstanceOf(violation.getConstraintDescriptor().getAnnotation(), PowerOfTwo.class); - } + assertValidates(new ConstrainedPowerOfTwo(value)); } - private static class MockContext - implements ConstraintValidatorContext + private static void assertInvalid(int value) { - @Override - public void disableDefaultConstraintViolation() - { - throw new UnsupportedOperationException(); - } - - @Override - public String getDefaultConstraintMessageTemplate() - { - throw new UnsupportedOperationException(); - } - - @Override - public ConstraintViolationBuilder buildConstraintViolationWithTemplate(String s) - { - throw new UnsupportedOperationException(); - } - - @Override - public T unwrap(Class type) - { - throw new UnsupportedOperationException(); - } + Object object = new ConstrainedPowerOfTwo(value); + assertFailsValidation(object, "unboxed", "is not a power of two", PowerOfTwo.class); + assertFailsValidation(object, "boxed", "is not a power of two", PowerOfTwo.class); } @SuppressWarnings("UnusedDeclaration") @@ -114,13 +63,13 @@ public ConstrainedPowerOfTwo(int value) } @PowerOfTwo - public int getConstrainedByPowerOfTwoUnboxed() + public int getUnboxed() { return value; } @PowerOfTwo - public Integer getConstrainedByPowerOfTwoBoxed() + public Integer getBoxed() { return value; } @@ -130,7 +79,7 @@ public Integer getConstrainedByPowerOfTwoBoxed() public static class NullPowerOfTwoAnnotation { @PowerOfTwo - public static Integer getConstrainedByPowerOfTwo() + public Integer getNull() { return null; } From 7822a13ea4e0613f6904d98bb0f20e3c38d93770 Mon Sep 17 00:00:00 2001 From: David Phillips Date: Fri, 4 Jan 2019 00:57:30 -0800 Subject: [PATCH 5/6] Fix deprecated usage of catchingAsync --- .../java/io/prestosql/plugin/thrift/util/ThriftExceptions.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/presto-thrift/src/main/java/io/prestosql/plugin/thrift/util/ThriftExceptions.java b/presto-thrift/src/main/java/io/prestosql/plugin/thrift/util/ThriftExceptions.java index cd2f209af9c3..7dde703d9bb0 100644 --- a/presto-thrift/src/main/java/io/prestosql/plugin/thrift/util/ThriftExceptions.java +++ b/presto-thrift/src/main/java/io/prestosql/plugin/thrift/util/ThriftExceptions.java @@ -22,6 +22,7 @@ import static com.google.common.util.concurrent.Futures.catchingAsync; import static com.google.common.util.concurrent.Futures.immediateFailedFuture; +import static com.google.common.util.concurrent.MoreExecutors.directExecutor; import static io.prestosql.plugin.thrift.ThriftErrorCode.THRIFT_SERVICE_CONNECTION_ERROR; import static io.prestosql.plugin.thrift.ThriftErrorCode.THRIFT_SERVICE_GENERIC_REMOTE_ERROR; import static io.prestosql.plugin.thrift.ThriftErrorCode.THRIFT_SERVICE_NO_AVAILABLE_HOSTS; @@ -47,6 +48,6 @@ public static PrestoException toPrestoException(Exception e) public static ListenableFuture catchingThriftException(ListenableFuture future) { - return catchingAsync(future, Exception.class, e -> immediateFailedFuture(toPrestoException(e))); + return catchingAsync(future, Exception.class, e -> immediateFailedFuture(toPrestoException(e)), directExecutor()); } } From ad3b4ac94093e6f942bbc755da7c7703158859da Mon Sep 17 00:00:00 2001 From: David Phillips Date: Fri, 4 Jan 2019 00:57:48 -0800 Subject: [PATCH 6/6] Update to Airbase 90 Also update TPCH to be compatible with the new version of Guava. --- pom.xml | 4 ++-- presto-accumulo/pom.xml | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index e508f3050830..c3aad030fe69 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ io.airlift airbase - 88 + 90 io.prestosql @@ -638,7 +638,7 @@ io.airlift.tpch tpch - 0.9 + 0.10 diff --git a/presto-accumulo/pom.xml b/presto-accumulo/pom.xml index 91d34f41febb..444121e68c7a 100644 --- a/presto-accumulo/pom.xml +++ b/presto-accumulo/pom.xml @@ -232,6 +232,7 @@ org.apache.commons commons-lang3 + 3.4