diff --git a/server/src/main/java/org/apache/uniffle/server/ShuffleTaskManager.java b/server/src/main/java/org/apache/uniffle/server/ShuffleTaskManager.java index 55b83c9290..d9a06da1e2 100644 --- a/server/src/main/java/org/apache/uniffle/server/ShuffleTaskManager.java +++ b/server/src/main/java/org/apache/uniffle/server/ShuffleTaskManager.java @@ -844,7 +844,7 @@ public ShuffleIndexResult getShuffleIndex( int[] range = ShuffleStorageUtils.getPartitionRange(partitionId, partitionNumPerRange, partitionNum); Storage storage = - storageManager.selectStorageForIndex( + storageManager.selectStorageById( new ShuffleDataReadEvent(appId, shuffleId, partitionId, range[0])); if (storage == null) { throw new FileNotFoundException("No such data in current storage manager."); diff --git a/server/src/main/java/org/apache/uniffle/server/storage/HybridStorageManager.java b/server/src/main/java/org/apache/uniffle/server/storage/HybridStorageManager.java index f913a56c71..29693ad18c 100644 --- a/server/src/main/java/org/apache/uniffle/server/storage/HybridStorageManager.java +++ b/server/src/main/java/org/apache/uniffle/server/storage/HybridStorageManager.java @@ -116,8 +116,8 @@ public Storage selectStorage(ShuffleDataReadEvent event) { } @Override - public Storage selectStorageForIndex(ShuffleDataReadEvent event) { - return warmStorageManager.selectStorageForIndex(event); + public Storage selectStorageById(ShuffleDataReadEvent event) { + return warmStorageManager.selectStorageById(event); } @Override diff --git a/server/src/main/java/org/apache/uniffle/server/storage/MultiPartLocalStorageManager.java b/server/src/main/java/org/apache/uniffle/server/storage/MultiPartLocalStorageManager.java index 1516afa43b..5bca9a9e1f 100644 --- a/server/src/main/java/org/apache/uniffle/server/storage/MultiPartLocalStorageManager.java +++ b/server/src/main/java/org/apache/uniffle/server/storage/MultiPartLocalStorageManager.java @@ -28,7 +28,7 @@ import org.apache.uniffle.server.ShuffleDataFlushEvent; import org.apache.uniffle.server.ShuffleDataReadEvent; import org.apache.uniffle.server.ShuffleServerConf; -import org.apache.uniffle.storage.common.CompositeStorage; +import org.apache.uniffle.storage.common.CompositeReadingViewStorage; import org.apache.uniffle.storage.common.LocalStorage; import org.apache.uniffle.storage.common.Storage; import org.apache.uniffle.storage.util.ShuffleStorageUtils; @@ -38,7 +38,7 @@ public class MultiPartLocalStorageManager extends LocalStorageManager { // id -> storage private final Map idToStorages; - private final CompositeStorage compositeStorage; + private final CompositeReadingViewStorage compositeStorage; public MultiPartLocalStorageManager(ShuffleServerConf conf) { super(conf); @@ -47,7 +47,7 @@ public MultiPartLocalStorageManager(ShuffleServerConf conf) { idToStorages.put(storage.getId(), storage); } - compositeStorage = new CompositeStorage(getStorages()); + compositeStorage = new CompositeReadingViewStorage(getStorages()); } @Override @@ -106,14 +106,13 @@ public Storage selectStorage(ShuffleDataReadEvent event) { return getStorages().get(0); } - // Use higher 8 bit to storage the storage id, and use lower 56 bit to storage the offset. int storageId = event.getStorageId(); // TODO(baoloongmao): check AOOB exception return idToStorages.get(storageId); } @Override - public Storage selectStorageForIndex(ShuffleDataReadEvent event) { + public Storage selectStorageById(ShuffleDataReadEvent event) { return compositeStorage; } } diff --git a/server/src/main/java/org/apache/uniffle/server/storage/StorageManager.java b/server/src/main/java/org/apache/uniffle/server/storage/StorageManager.java index af172ee0c1..4d8ca68226 100644 --- a/server/src/main/java/org/apache/uniffle/server/storage/StorageManager.java +++ b/server/src/main/java/org/apache/uniffle/server/storage/StorageManager.java @@ -36,7 +36,7 @@ public interface StorageManager { Storage selectStorage(ShuffleDataReadEvent event); - default Storage selectStorageForIndex(ShuffleDataReadEvent event) { + default Storage selectStorageById(ShuffleDataReadEvent event) { return selectStorage(event); } diff --git a/storage/src/main/java/org/apache/uniffle/storage/common/CompositeStorage.java b/storage/src/main/java/org/apache/uniffle/storage/common/CompositeReadingViewStorage.java similarity index 91% rename from storage/src/main/java/org/apache/uniffle/storage/common/CompositeStorage.java rename to storage/src/main/java/org/apache/uniffle/storage/common/CompositeReadingViewStorage.java index 855627c849..b090b94cca 100644 --- a/storage/src/main/java/org/apache/uniffle/storage/common/CompositeStorage.java +++ b/storage/src/main/java/org/apache/uniffle/storage/common/CompositeReadingViewStorage.java @@ -30,12 +30,13 @@ import org.apache.uniffle.storage.request.CreateShuffleReadHandlerRequest; import org.apache.uniffle.storage.request.CreateShuffleWriteHandlerRequest; -public class CompositeStorage extends AbstractStorage { +public class CompositeReadingViewStorage extends AbstractStorage { - private static final Logger LOG = LoggerFactory.getLogger(CompositeStorage.class); + private static final Logger LOG = LoggerFactory.getLogger( + CompositeReadingViewStorage.class); private final List localStorages; - public CompositeStorage(List localStorages) { + public CompositeReadingViewStorage(List localStorages) { super(); this.localStorages = localStorages; }