@@ -168,7 +168,7 @@ class ApiClient private (conf: APIConfigurations) {
168
168
val storageNamespace = key.storageClientType match {
169
169
case StorageClientType .HadoopFS =>
170
170
ApiClient
171
- .translateURI(URI .create(repo.getStorageNamespace), getBlockstoreType)
171
+ .translateURI(URI .create(repo.getStorageNamespace), getBlockstoreType(repo.getStorageId) )
172
172
.normalize()
173
173
.toString
174
174
case StorageClientType .SDKClient => repo.getStorageNamespace
@@ -210,19 +210,27 @@ class ApiClient private (conf: APIConfigurations) {
210
210
retryWrapper.wrapWithRetry(prepareGcCommits)
211
211
}
212
212
213
- def getGarbageCollectionRules (repoName : String ): String = {
214
- val getGcRules = new dev.failsafe.function.CheckedSupplier [GarbageCollectionRules ]() {
215
- def get (): GarbageCollectionRules = repositoriesApi.getGCRules (repoName).execute()
213
+ def getRepository (repoName : String ): Repository = {
214
+ val getRepo = new dev.failsafe.function.CheckedSupplier [Repository ]() {
215
+ def get (): Repository = repositoriesApi.getRepository (repoName).execute()
216
216
}
217
- val gcRules = retryWrapper.wrapWithRetry(getGcRules)
218
- gcRules.toString()
217
+ retryWrapper.wrapWithRetry(getRepo)
219
218
}
220
219
221
- def getBlockstoreType : String = {
220
+ def getBlockstoreType ( storageID : String ) : String = {
222
221
val getStorageConfig = new dev.failsafe.function.CheckedSupplier [StorageConfig ]() {
223
222
def get (): StorageConfig = {
224
223
val cfg = configApi.getConfig.execute()
225
- cfg.getStorageConfig
224
+ val storageConfigList = cfg.getStorageConfigList
225
+ if (storageConfigList.isEmpty || storageConfigList.size() == 1 ) {
226
+ cfg.getStorageConfig
227
+ } else {
228
+ storageConfigList.asScala
229
+ .find(_.getBlockstoreId == storageID)
230
+ .getOrElse(
231
+ throw new IllegalArgumentException (s " Storage config not found for ID: $storageID" )
232
+ )
233
+ }
226
234
}
227
235
}
228
236
val storageConfig = retryWrapper.wrapWithRetry(getStorageConfig)
0 commit comments