Skip to content

Commit

Permalink
Rename classname and method name
Browse files Browse the repository at this point in the history
  • Loading branch information
maobaolong committed Nov 22, 2024
1 parent 817a5d4 commit 2588c02
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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.");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -38,7 +38,7 @@ public class MultiPartLocalStorageManager extends LocalStorageManager {
// id -> storage
private final Map<Integer, LocalStorage> idToStorages;

private final CompositeStorage compositeStorage;
private final CompositeReadingViewStorage compositeStorage;

public MultiPartLocalStorageManager(ShuffleServerConf conf) {
super(conf);
Expand All @@ -47,7 +47,7 @@ public MultiPartLocalStorageManager(ShuffleServerConf conf) {
idToStorages.put(storage.getId(), storage);
}

compositeStorage = new CompositeStorage(getStorages());
compositeStorage = new CompositeReadingViewStorage(getStorages());
}

@Override
Expand Down Expand Up @@ -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;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public interface StorageManager {

Storage selectStorage(ShuffleDataReadEvent event);

default Storage selectStorageForIndex(ShuffleDataReadEvent event) {
default Storage selectStorageById(ShuffleDataReadEvent event) {
return selectStorage(event);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<LocalStorage> localStorages;

public CompositeStorage(List<LocalStorage> localStorages) {
public CompositeReadingViewStorage(List<LocalStorage> localStorages) {
super();
this.localStorages = localStorages;
}
Expand Down

0 comments on commit 2588c02

Please sign in to comment.