@@ -127,6 +127,7 @@ public class TableMetaStore implements Serializable {
127127 private final boolean disableAuth ;
128128 private final String accessKey ;
129129 private final String secretKey ;
130+ private final String storageType ;
130131
131132 private transient RuntimeContext runtimeContext ;
132133 private transient String authInformation ;
@@ -146,6 +147,7 @@ private TableMetaStore(
146147 String krbPrincipal ,
147148 String accessKey ,
148149 String secretKey ,
150+ String storageType ,
149151 boolean disableAuth ) {
150152 Preconditions .checkArgument (
151153 authMethod == null
@@ -165,6 +167,7 @@ private TableMetaStore(
165167 this .disableAuth = disableAuth ;
166168 this .accessKey = accessKey ;
167169 this .secretKey = secretKey ;
170+ this .storageType = storageType ;
168171 }
169172
170173 private TableMetaStore (Configuration configuration ) {
@@ -179,6 +182,7 @@ private TableMetaStore(Configuration configuration) {
179182 this .krbPrincipal = null ;
180183 this .accessKey = null ;
181184 this .secretKey = null ;
185+ this .storageType = null ;
182186 this .runtimeContext = new RuntimeContext ();
183187 runtimeContext .setConfiguration (configuration );
184188 }
@@ -219,6 +223,10 @@ public String getSecretKey() {
219223 return secretKey ;
220224 }
221225
226+ public String getStorageType () {
227+ return storageType ;
228+ }
229+
222230 public boolean isKerberosAuthMethod () {
223231 return AUTH_METHOD_KERBEROS .equalsIgnoreCase (authMethod );
224232 }
@@ -586,6 +594,7 @@ public static class Builder {
586594 private String krbPrincipal ;
587595 private String accessKey ;
588596 private String secretKey ;
597+ private String storageType ;
589598 private boolean disableAuth = true ;
590599 private final Map <String , String > properties = Maps .newHashMap ();
591600 private Configuration configuration ;
@@ -640,11 +649,12 @@ public Builder withBase64CoreSite(String encodedCoreSite) {
640649 return this ;
641650 }
642651
643- public Builder withAkSkAuth (String accessKey , String secretKey ) {
652+ public Builder withAkSkAuth (String accessKey , String secretKey , String storageType ) {
644653 this .disableAuth = false ;
645654 this .authMethod = AUTH_METHOD_AK_SK ;
646655 this .accessKey = accessKey ;
647656 this .secretKey = secretKey ;
657+ this .storageType = storageType ;
648658 return this ;
649659 }
650660
@@ -785,6 +795,7 @@ public TableMetaStore build() {
785795 } else if (AUTH_METHOD_AK_SK .equals (authMethod )) {
786796 Preconditions .checkNotNull (accessKey );
787797 Preconditions .checkNotNull (secretKey );
798+ Preconditions .checkNotNull (storageType );
788799 } else if (authMethod != null ) {
789800 throw new IllegalArgumentException ("Unsupported auth method:" + authMethod );
790801 }
@@ -805,6 +816,7 @@ public TableMetaStore build() {
805816 krbPrincipal ,
806817 accessKey ,
807818 secretKey ,
819+ storageType ,
808820 disableAuth );
809821 }
810822 }
0 commit comments