Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1468,7 +1468,7 @@
<dependency>
<groupId>org.apache.thrift</groupId>
<artifactId>libthrift</artifactId>
<version>0.9.3-1</version>
<version>0.14.1</version>
<exclusions>
<exclusion>
<groupId>org.apache.httpcomponents</groupId>
Expand All @@ -1478,6 +1478,10 @@
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpclient</artifactId>
</exclusion>
<exclusion>
<groupId>org.apache.tomcat.embed</groupId>
<artifactId>tomcat-embed-core</artifactId>
</exclusion>
</exclusions>
</dependency>

Expand Down
11 changes: 11 additions & 0 deletions presto-accumulo/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,17 @@
<dep.reload4j.version>1.2.18.3</dep.reload4j.version>
</properties>

<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.apache.thrift</groupId>
<artifactId>libthrift</artifactId>
<!-- libthrift >= 0.14.1 not compatible with accumulo-minicluster 1.x -->
<version>0.9.3-1</version>
</dependency>
</dependencies>
</dependencyManagement>

<dependencies>
<dependency>
<groupId>org.apache.accumulo</groupId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@

import com.facebook.presto.hive.authentication.HiveMetastoreAuthentication;
import com.google.common.net.HostAndPort;
import org.apache.thrift.TConfiguration;
import org.apache.thrift.transport.TSocket;
import org.apache.thrift.transport.TTransport;
import org.apache.thrift.transport.TTransportException;
Expand Down Expand Up @@ -217,5 +218,26 @@ public void flush()
throw rewriteException(e, address);
}
}

// Methods added in libthrift 0.14.0 and not present in Hive Metastore <= 3.1.2
@Override
public TConfiguration getConfiguration()
{
return TConfiguration.DEFAULT;
}

@Override
public void updateKnownMessageSize(long size)
throws TTransportException
{
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

throw new UnsupportedOperationException("Not implemented");

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does transport not have these methods? (transport.updateKnownMessageSize)?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

or just leave a noop comment if its noop

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

// noop: method added in libthrift 0.14.0 and not present in Hive Metastore <= 3.1.2
}

@Override
public void checkReadBytesAvailable(long numBytes)
throws TTransportException
{
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

throw new UnsupportedOperationException("Not implemented");

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

added noop comment

// noop: method added in libthrift 0.14.0 and not present in Hive Metastore <= 3.1.2
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@

import com.facebook.presto.hive.ForHiveMetastore;
import com.facebook.presto.hive.HiveClientConfig;
import com.facebook.presto.spi.PrestoException;
import com.google.common.collect.ImmutableMap;
import org.apache.hadoop.hive.metastore.security.DelegationTokenIdentifier;
import org.apache.hadoop.hive.thrift.client.TUGIAssumingTransport;
Expand All @@ -24,6 +25,7 @@
import org.apache.hadoop.security.token.TokenIdentifier;
import org.apache.thrift.transport.TSaslClientTransport;
import org.apache.thrift.transport.TTransport;
import org.apache.thrift.transport.TTransportException;

import javax.inject.Inject;
import javax.security.auth.callback.Callback;
Expand All @@ -40,6 +42,7 @@
import java.util.Map;
import java.util.Optional;

import static com.facebook.presto.hive.HiveErrorCode.HIVE_METASTORE_ERROR;
import static com.google.common.base.Preconditions.checkState;
import static java.util.Objects.requireNonNull;
import static javax.security.sasl.Sasl.QOP;
Expand Down Expand Up @@ -98,6 +101,9 @@ private TTransport authenticateWithToken(TTransport rawTransport, String tokenSt
catch (IOException ex) {
throw new UncheckedIOException(ex);
}
catch (TTransportException e) {
throw new PrestoException(HIVE_METASTORE_ERROR, e);
}
}

private static class SaslClientCallbackHandler
Expand Down Expand Up @@ -175,5 +181,8 @@ private TTransport authenticateWithHost(TTransport rawTransport, String hiveMeta
catch (IOException e) {
throw new UncheckedIOException(e);
}
catch (TTransportException e) {
throw new PrestoException(HIVE_METASTORE_ERROR, e);
}
}
}
Loading