@@ -75,9 +75,11 @@ public class HdfsConfigurationUpdater
75
75
private final File s3StagingDirectory ;
76
76
private final boolean pinS3ClientToCurrentRegion ;
77
77
private final String s3UserAgentPrefix ;
78
+ private final String wasbAccessKey ;
79
+ private final String wasbStorageAccount ;
78
80
79
81
@ Inject
80
- public HdfsConfigurationUpdater (HiveClientConfig hiveClientConfig , HiveS3Config s3Config )
82
+ public HdfsConfigurationUpdater (HiveClientConfig hiveClientConfig , HiveS3Config s3Config , HiveWasbConfig wasbConfig )
81
83
{
82
84
requireNonNull (hiveClientConfig , "hiveClientConfig is null" );
83
85
checkArgument (hiveClientConfig .getDfsTimeout ().toMillis () >= 1 , "dfsTimeout must be at least 1 ms" );
@@ -115,6 +117,9 @@ public HdfsConfigurationUpdater(HiveClientConfig hiveClientConfig, HiveS3Config
115
117
this .s3StagingDirectory = s3Config .getS3StagingDirectory ();
116
118
this .pinS3ClientToCurrentRegion = s3Config .isPinS3ClientToCurrentRegion ();
117
119
this .s3UserAgentPrefix = s3Config .getS3UserAgentPrefix ();
120
+
121
+ this .wasbAccessKey = wasbConfig .getWasbAccessKey ();
122
+ this .wasbStorageAccount = wasbConfig .getWasbStorageAccount ();
118
123
}
119
124
120
125
private static Configuration readConfiguration (List <String > resourcePaths )
@@ -208,6 +213,11 @@ public void updateConfiguration(PrestoHadoopConfiguration config)
208
213
config .setLong (PrestoS3FileSystem .S3_MULTIPART_MIN_PART_SIZE , s3MultipartMinPartSize .toBytes ());
209
214
config .setBoolean (PrestoS3FileSystem .S3_PIN_CLIENT_TO_CURRENT_REGION , pinS3ClientToCurrentRegion );
210
215
config .set (PrestoS3FileSystem .S3_USER_AGENT_PREFIX , s3UserAgentPrefix );
216
+
217
+ // set config for Azure Blob
218
+ if (wasbAccessKey != null && wasbStorageAccount != null ) {
219
+ config .set (String .format ("fs.azure.account.key.%s.blob.core.windows.net" , wasbStorageAccount ), wasbAccessKey );
220
+ }
211
221
}
212
222
213
223
public static void configureCompression (Configuration config , HiveCompressionCodec compressionCodec )
0 commit comments