smallzhongfeng commented on code in PR #680:
URL: https://github.com/apache/incubator-uniffle/pull/680#discussion_r1125847240
##########
coordinator/src/main/java/org/apache/uniffle/coordinator/strategy/storage/AbstractSelectStorageStrategy.java:
##########
@@ -18,36 +18,62 @@
package org.apache.uniffle.coordinator.strategy.storage;
import java.io.IOException;
+import java.util.Comparator;
+import java.util.List;
import java.util.Map;
+import java.util.Objects;
import java.util.UUID;
+import java.util.concurrent.CountDownLatch;
+import java.util.concurrent.atomic.AtomicBoolean;
+import java.util.concurrent.atomic.AtomicLong;
+import java.util.stream.Collectors;
+import com.google.common.annotations.VisibleForTesting;
+import com.google.common.collect.Lists;
import org.apache.commons.lang3.RandomUtils;
+import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.fs.FSDataInputStream;
import org.apache.hadoop.fs.FSDataOutputStream;
import org.apache.hadoop.fs.FileSystem;
import org.apache.hadoop.fs.Path;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import org.apache.uniffle.common.exception.RssException;
+import org.apache.uniffle.common.filesystem.HadoopFilesystemProvider;
+import org.apache.uniffle.coordinator.ApplicationManager;
import org.apache.uniffle.coordinator.CoordinatorConf;
import org.apache.uniffle.coordinator.util.CoordinatorUtils;
/**
* This is a simple implementation class, which provides some methods to check
whether the path is normal
*/
public abstract class AbstractSelectStorageStrategy implements
SelectStorageStrategy {
+
+ private static final Logger LOG =
LoggerFactory.getLogger(AbstractSelectStorageStrategy.class);
/**
* store remote path -> application count for assignment strategy
*/
protected final Map<String, RankValue> remoteStoragePathRankValue;
protected final int fileSize;
private final String coordinatorId;
+ private final Configuration hdfsConf;
+ protected List<Map.Entry<String, RankValue>> uris;
+ private int readAndWriteTimes = 1;
public AbstractSelectStorageStrategy(
Map<String, RankValue> remoteStoragePathRankValue,
CoordinatorConf conf) {
this.remoteStoragePathRankValue = remoteStoragePathRankValue;
- fileSize =
conf.getInteger(CoordinatorConf.COORDINATOR_REMOTE_STORAGE_SCHEDULE_FILE_SIZE);
+ this.hdfsConf = new Configuration();
+ this.fileSize =
conf.getInteger(CoordinatorConf.COORDINATOR_REMOTE_STORAGE_SCHEDULE_FILE_SIZE);
this.coordinatorId = conf.getString(CoordinatorUtils.COORDINATOR_ID,
UUID.randomUUID().toString());
+ ApplicationManager.StrategyName strategyName = conf.get(
+ CoordinatorConf.COORDINATOR_REMOTE_STORAGE_SELECT_STRATEGY);
+ if (strategyName == ApplicationManager.StrategyName.IO_SAMPLE) {
Review Comment:
Good idea! Updated.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]