-
Notifications
You must be signed in to change notification settings - Fork 31
Upgrades for Presto Java 17 support #295
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -28,45 +28,48 @@ java { | |
} | ||
|
||
ext.versions = [ | ||
assertj : '2.0.0', | ||
guava : '21.0', | ||
guice : '4.0', | ||
log4j : '1.2.17', | ||
testng : '7.5', | ||
junit : '4.12', | ||
spock : '2.3-groovy-4.0', | ||
slf4j : '1.7.12', | ||
hsqldb : '2.3.2', | ||
dbutils : '1.6', | ||
snakeyaml : '1.15', | ||
cglib : '3.1', | ||
httpclient : '4.4', | ||
ioutils : '2.4', | ||
tpchgen : '0.6', | ||
tpcdsgen : '1.2', | ||
commons_lang3: '3.3.2', | ||
commons_dbcp2: '2.1', | ||
hive_jdbc : '0.13.1-5', | ||
hive : '3.0.0-2', | ||
presto : '0.181', | ||
reflections : '0.9.9', | ||
bytebuddy : '1.15.4', | ||
jsch : '0.1.55', | ||
mina_sshd : '0.14.0', | ||
freemarker : '2.3.22', | ||
objenesis : '1.4', | ||
jackson : '2.4.4', | ||
cassandra : '3.4.0', | ||
commons_cli : '1.3.1', | ||
thrift : '0.9.3', | ||
kafka : '3.9.0', | ||
jakarta_inject : '2.0.1', | ||
jakarta_annotation: '2.1.1', | ||
assertj : '2.0.0', | ||
guava : '21.0', | ||
guice : '7.0.0', | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. guice updated |
||
log4j : '1.2.17', | ||
testng : '7.5', | ||
junit : '4.12', | ||
spock : '2.3-groovy-4.0', | ||
slf4j : '1.7.12', | ||
hsqldb : '2.3.2', | ||
dbutils : '1.6', | ||
snakeyaml : '1.15', | ||
cglib : '3.1', | ||
httpclient : '4.4', | ||
ioutils : '2.4', | ||
tpchgen : '0.6', | ||
tpcdsgen : '1.2', | ||
commons_lang3 : '3.3.2', | ||
commons_dbcp2 : '2.1', | ||
hive_jdbc : '0.13.1-5', | ||
hive : '3.0.0-2', | ||
presto : '0.181', | ||
reflections : '0.9.9', | ||
bytebuddy : '1.15.4', | ||
jsch : '0.2.25', | ||
mina_sshd : '2.15.0', | ||
Comment on lines
+56
to
+57
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Both updated |
||
freemarker : '2.3.22', | ||
objenesis : '1.4', | ||
jackson : '2.4.4', | ||
cassandra : '3.4.0', | ||
commons_cli : '1.3.1', | ||
thrift : '0.9.3', | ||
kafka : '3.9.0', | ||
] | ||
|
||
ext.libraries = [ | ||
jakarta_inject : "jakarta.inject:jakarta.inject-api:${versions.jakarta_inject}", | ||
jakarta_annotation : "jakarta.annotation:jakarta.annotation-api:${versions.jakarta_annotation}", | ||
assertj : "org.assertj:assertj-core:${versions.assertj}", | ||
guava : "com.google.guava:guava:${versions.guava}", | ||
guice : ["com.google.inject:guice:${versions.guice}", | ||
"com.google.inject.extensions:guice-multibindings:${versions.guice}"], | ||
guice : ["com.google.inject:guice:${versions.guice}"], | ||
log4j : "log4j:log4j:${versions.log4j}", | ||
testng : "org.testng:testng:${versions.testng}", | ||
junit : "junit:junit:${versions.junit}", /* TODO: remove junit dependencies */ | ||
|
@@ -90,7 +93,7 @@ ext.libraries = [ | |
presto_jdbc : "com.facebook.presto:presto-jdbc:${versions.presto}", | ||
reflections : "org.reflections:reflections:${versions.reflections}", | ||
bytebuddy : "net.bytebuddy:byte-buddy:${versions.bytebuddy}", | ||
jsch : "com.jcraft:jsch:${versions.jsch}", | ||
jsch : "com.github.mwiede:jsch:${versions.jsch}", | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The old jsch was left unmaintained. This fork is maintained and has recent updates |
||
mina_sshd : "org.apache.sshd:apache-sshd:${versions.mina_sshd}", | ||
postgresql_jdbc : "org.postgresql:postgresql:9.4-1201-jdbc41", | ||
commons_cli : "commons-cli:commons-cli:1.2", | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,14 +15,17 @@ package io.prestodb.tempto.internal.ssh | |
|
||
import com.google.common.io.Files | ||
import io.prestodb.tempto.process.CliProcess | ||
import org.apache.sshd.SshServer | ||
import org.apache.sshd.server.Command | ||
import org.apache.sshd.server.CommandFactory | ||
import org.apache.sshd.server.PasswordAuthenticator | ||
import org.apache.sshd.server.PublickeyAuthenticator | ||
import org.apache.sshd.server.auth.UserAuthPassword | ||
import org.apache.sshd.server.auth.UserAuthPublicKey | ||
import org.apache.sshd.server.command.ScpCommandFactory | ||
import org.apache.sshd.common.io.nio2.Nio2ServiceFactoryFactory | ||
import org.apache.sshd.scp.server.ScpCommandFactory | ||
import org.apache.sshd.server.SshServer | ||
import org.apache.sshd.server.auth.UserAuthFactory | ||
import org.apache.sshd.server.auth.password.PasswordAuthenticator | ||
import org.apache.sshd.server.auth.password.UserAuthPasswordFactory | ||
import org.apache.sshd.server.auth.pubkey.PublickeyAuthenticator | ||
import org.apache.sshd.server.auth.pubkey.UserAuthPublicKeyFactory | ||
import org.apache.sshd.server.channel.ChannelSession | ||
import org.apache.sshd.server.command.Command | ||
import org.apache.sshd.server.command.CommandFactory | ||
import org.apache.sshd.server.keyprovider.SimpleGeneratorHostKeyProvider | ||
import org.apache.sshd.server.session.ServerSession | ||
import spock.lang.Shared | ||
|
@@ -31,7 +34,6 @@ import spock.lang.Specification | |
import java.security.PublicKey | ||
import java.time.Duration | ||
|
||
import static Thread.sleep | ||
import static java.nio.charset.StandardCharsets.UTF_8 | ||
|
||
class JSchSshClientTest | ||
|
@@ -141,12 +143,15 @@ class JSchSshClientTest | |
|
||
private void setupAuthentication() | ||
{ | ||
sshd.setUserAuthFactories([new UserAuthPassword.Factory(), new UserAuthPublicKey.Factory()]) | ||
List<UserAuthFactory> userAuthFactories = new ArrayList<>(); | ||
userAuthFactories.add(new UserAuthPasswordFactory()) | ||
userAuthFactories.add(new UserAuthPublicKeyFactory()) | ||
sshd.setUserAuthFactories(userAuthFactories) | ||
|
||
sshd.setPasswordAuthenticator(new PasswordAuthenticator() { | ||
boolean authenticate(String username, String password, ServerSession session) | ||
{ | ||
return USER.equals(username) && PASSWORD.equals(password); | ||
return USER == username && PASSWORD == password; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should use There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think in groovy it is different than Java. IntelliJ suggested the change. I can revert it though There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
} | ||
}); | ||
|
||
|
@@ -163,7 +168,8 @@ class JSchSshClientTest | |
{ | ||
CommandFactory delegateFactory = new CommandFactory() { | ||
@Override | ||
Command createCommand(String command) | ||
Command createCommand(ChannelSession channelSession, String command) | ||
throws IOException | ||
{ | ||
if (command == '"echo" "hello world"') { | ||
return new TestCommand('hello world\n', 0) | ||
|
@@ -177,7 +183,10 @@ class JSchSshClientTest | |
} | ||
} | ||
} | ||
sshd.setCommandFactory(new ScpCommandFactory(delegateFactory)) | ||
sshd.setIoServiceFactoryFactory(new Nio2ServiceFactoryFactory()) | ||
sshd.setCommandFactory(new ScpCommandFactory.Builder() | ||
.withDelegate(delegateFactory) | ||
.build()) | ||
} | ||
|
||
def cleanupSpec() | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These two were added