File tree 3 files changed +19
-6
lines changed
src/main/java/org/apache/hadoop/fs
3 files changed +19
-6
lines changed Original file line number Diff line number Diff line change 6
6
7
7
<groupId >com.qcloud.cos</groupId >
8
8
<artifactId >hadoop-cos</artifactId >
9
- <version >8.0.1 </version >
9
+ <version >8.0.2 </version >
10
10
<packaging >jar</packaging >
11
11
12
12
<name >Apache Hadoop Tencent Qcloud COS Support</name >
41
41
<maven .compiler.source>1.7</maven .compiler.source>
42
42
<maven .compiler.target>1.7</maven .compiler.target>
43
43
<hadoop .version>3.3.0</hadoop .version>
44
- <cos_api .version>5.6.62 </cos_api .version>
44
+ <cos_api .version>5.6.65 </cos_api .version>
45
45
<google .guava.version>24.1.1-jre</google .guava.version>
46
46
<commons_lang3 .version>3.1</commons_lang3 .version>
47
47
<junit .version>4.8</junit .version>
Original file line number Diff line number Diff line change 12
12
@ InterfaceStability .Unstable
13
13
public class CosNConfigKeys extends CommonConfigurationKeys {
14
14
public static final String USER_AGENT = "fs.cosn.user.agent" ;
15
- public static final String DEFAULT_USER_AGENT = "cos-hadoop-plugin-v8.0.1 " ;
15
+ public static final String DEFAULT_USER_AGENT = "cos-hadoop-plugin-v8.0.2 " ;
16
16
17
17
public static final String TENCENT_EMR_VERSION_KEY = "fs.emr.version" ;
18
18
@@ -125,4 +125,8 @@ public class CosNConfigKeys extends CommonConfigurationKeys {
125
125
"org.apache.hadoop.fs.cosn.ranger.client.RangerQcloudObjectStorageClientImpl" ;
126
126
public static final String COSN_CLIENT_SOCKET_TIMEOUTSEC = "fs.cosn.client.socket.timeoutsec" ;
127
127
public static final int DEFAULT_CLIENT_SOCKET_TIMEOUTSEC = 30 ;
128
+
129
+ // default disable emr v2 instance url.
130
+ public static final String COSN_EMRV2_INSTANCE_PROVIDER_ENABLED = "fs.cosn.emrv2.instance.provider.enabled" ;
131
+ public static final boolean DEFAULT_COSN_EMRV2_INSTANCE_PROVIDER_ENABLED = false ;
128
132
}
Original file line number Diff line number Diff line change @@ -18,15 +18,24 @@ public class EMRInstanceCredentialsProvider extends AbstractCOSCredentialProvide
18
18
19
19
private String appId ;
20
20
private final COSCredentialsProvider cosCredentialsProvider ;
21
+ private boolean emrV2InstanceEnabled ;
21
22
22
23
public EMRInstanceCredentialsProvider (@ Nullable URI uri , Configuration conf ) {
23
24
super (uri , conf );
24
25
if (null != conf ) {
25
26
this .appId = conf .get (CosNConfigKeys .COSN_APPID_KEY );
27
+ this .emrV2InstanceEnabled = conf .getBoolean (CosNConfigKeys .COSN_EMRV2_INSTANCE_PROVIDER_ENABLED ,
28
+ CosNConfigKeys .DEFAULT_COSN_EMRV2_INSTANCE_PROVIDER_ENABLED );
29
+ }
30
+
31
+ InstanceMetadataCredentialsEndpointProvider endpointProvider ;
32
+ if (emrV2InstanceEnabled ) {
33
+ endpointProvider = new InstanceMetadataCredentialsEndpointProvider (
34
+ InstanceMetadataCredentialsEndpointProvider .Instance .EMRV2 );
35
+ } else {
36
+ endpointProvider = new InstanceMetadataCredentialsEndpointProvider (
37
+ InstanceMetadataCredentialsEndpointProvider .Instance .EMR );
26
38
}
27
- InstanceMetadataCredentialsEndpointProvider endpointProvider =
28
- new InstanceMetadataCredentialsEndpointProvider (
29
- InstanceMetadataCredentialsEndpointProvider .Instance .EMR );
30
39
InstanceCredentialsFetcher instanceCredentialsFetcher = new InstanceCredentialsFetcher (endpointProvider );
31
40
this .cosCredentialsProvider = new InstanceCredentialsProvider (instanceCredentialsFetcher );
32
41
}
You can’t perform that action at this time.
0 commit comments