-
Notifications
You must be signed in to change notification settings - Fork 3.8k
Use the official aws-sdk instead of jet3t #5382
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
d2fdc39
19f5021
dbc945c
1e28b1a
3dc2ec9
efb7cad
26b7562
cc63964
2b51ea7
c9db6f5
1062a92
55750da
60419aa
b151371
97e2db0
5f2c465
a8602f3
d144482
97c6b03
adf3cbb
421d15e
e8847a1
8774211
b73d61e
1c0b07c
66dae38
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 |
|---|---|---|
| @@ -0,0 +1,52 @@ | ||
| /* | ||
| * Licensed to Metamarkets Group Inc. (Metamarkets) under one | ||
| * or more contributor license agreements. See the NOTICE file | ||
| * distributed with this work for additional information | ||
| * regarding copyright ownership. Metamarkets 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. | ||
| */ | ||
|
|
||
| package io.druid.common.aws; | ||
|
|
||
| import com.fasterxml.jackson.annotation.JsonProperty; | ||
|
|
||
| public class AWSEndpointConfig | ||
| { | ||
| @JsonProperty | ||
| private String url; | ||
|
|
||
| @JsonProperty | ||
| private String serviceName; | ||
|
|
||
| @JsonProperty | ||
| private String signingRegion; | ||
|
|
||
| @JsonProperty | ||
| public String getUrl() | ||
| { | ||
| return url; | ||
| } | ||
|
|
||
| @JsonProperty | ||
| public String getServiceName() | ||
| { | ||
| return serviceName; | ||
| } | ||
|
|
||
| @JsonProperty | ||
| public String getSigningRegion() | ||
| { | ||
| return signingRegion; | ||
| } | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,61 @@ | ||
| /* | ||
| * Licensed to Metamarkets Group Inc. (Metamarkets) under one | ||
| * or more contributor license agreements. See the NOTICE file | ||
| * distributed with this work for additional information | ||
| * regarding copyright ownership. Metamarkets 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. | ||
| */ | ||
|
|
||
| package io.druid.common.aws; | ||
|
|
||
| import com.fasterxml.jackson.annotation.JsonProperty; | ||
|
|
||
| public class AWSProxyConfig | ||
| { | ||
| @JsonProperty | ||
| private String host; | ||
|
|
||
| @JsonProperty | ||
| private int port = -1; // AWS's default proxy port is -1 | ||
|
|
||
| @JsonProperty | ||
| private String username; | ||
|
|
||
| @JsonProperty | ||
| private String password; | ||
|
|
||
| @JsonProperty | ||
| public String getHost() | ||
| { | ||
| return host; | ||
| } | ||
|
|
||
| @JsonProperty | ||
| public int getPort() | ||
| { | ||
| return port; | ||
| } | ||
|
|
||
| @JsonProperty | ||
| public String getUsername() | ||
| { | ||
| return username; | ||
| } | ||
|
|
||
| @JsonProperty | ||
| public String getPassword() | ||
|
Contributor
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. can this be a
Contributor
Author
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. What do you mean? If you mean
Contributor
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. |
||
| { | ||
| return password; | ||
| } | ||
| } | ||
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.
Why do we need to have this class instead of relying on https://github.com/aws/aws-sdk-java/blob/1.11.291/aws-java-sdk-core/src/main/java/com/amazonaws/SDKGlobalConfiguration.java ?
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.
Sorry, I'm not sure how to use that. Does
SDKGlobalConfigurationprovide an endpoint configuration?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.
They are system properties the sdk picks up as per: https://github.com/aws/aws-sdk-java/blob/4734de6fb0f80fe5768a6587aad3b9d0eaec388f/aws-java-sdk-core/src/main/java/com/amazonaws/auth/SystemPropertiesCredentialsProvider.java#L35
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.
Basically if there's functionality in this config that is not available in the SDK supported system properties and env vars, then that is fine. But if all the config stuff can be done in SDK idiomatic ways, then I suggest we simply document where to find info on the SDK.
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.
@drcrallen the linked doc is for credentials and we're already using it for credentials.
AFAIK, aws-java-sdk doesn't provide such a configuration chain for the endpoint configuration. Instead, it's recommended to use
AwsClientBuilder.EndpointConfiguration(https://docs.aws.amazon.com/AWSJavaSDK/latest/javadoc/com/amazonaws/client/builder/AwsClientBuilder.EndpointConfiguration.html) orAmazonS3Client.setEndpoint()(https://docs.aws.amazon.com/AWSJavaSDK/latest/javadoc/com/amazonaws/AmazonWebServiceClient.html#setEndpoint-java.lang.String-java.lang.String-java.lang.String-). I used the later one even though it's deprecated because usingAwsClientBuildercauses some injection problem. I didn't dig that problem and not sure how to fix it.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.
As another example: https://github.com/aws/aws-sdk-java/blob/1.11.293/aws-java-sdk-core/src/main/java/com/amazonaws/regions/LegacyRegionXmlMetadataBuilder.java allows specifying region endpoints. But those might be such an esoteric way of specifying things then it could be better to just handle it on our own until more obvious ways arise.