updated ChunkStatus, ConfigReader, DownloadConfig.
This commit is contained in:
@@ -107,6 +107,6 @@ public class ChunkStatus {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void setStartTime(long startTime) {
|
public void setStartTime(long startTime) {
|
||||||
|
this.startTimeMs = startTime;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -20,6 +20,8 @@ public class ConfigReader {
|
|||||||
int maxStepDelayMs = 0;
|
int maxStepDelayMs = 0;
|
||||||
double minStepDownloadMB = 0;
|
double minStepDownloadMB = 0;
|
||||||
double maxStepDownloadMB = 0;
|
double maxStepDownloadMB = 0;
|
||||||
|
int minDelayMs = 0;
|
||||||
|
int maxDelayMs = 0;
|
||||||
|
|
||||||
try (BufferedReader reader = new BufferedReader(
|
try (BufferedReader reader = new BufferedReader(
|
||||||
new InputStreamReader(inputStream, StandardCharsets.UTF_8))) {
|
new InputStreamReader(inputStream, StandardCharsets.UTF_8))) {
|
||||||
@@ -62,6 +64,12 @@ public class ConfigReader {
|
|||||||
case "maxStepDownloadMB":
|
case "maxStepDownloadMB":
|
||||||
maxStepDownloadMB = Double.parseDouble(value);
|
maxStepDownloadMB = Double.parseDouble(value);
|
||||||
break;
|
break;
|
||||||
|
case "minDelayMs":
|
||||||
|
minDelayMs = Integer.parseInt(value);
|
||||||
|
break;
|
||||||
|
case "maxDelayMs":
|
||||||
|
maxDelayMs = Integer.parseInt(value);
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
// Ignore unknown keys to keep parsing simple
|
// Ignore unknown keys to keep parsing simple
|
||||||
break;
|
break;
|
||||||
@@ -79,7 +87,9 @@ public class ConfigReader {
|
|||||||
minStepDelayMs,
|
minStepDelayMs,
|
||||||
maxStepDelayMs,
|
maxStepDelayMs,
|
||||||
minStepDownloadMB,
|
minStepDownloadMB,
|
||||||
maxStepDownloadMB
|
maxStepDownloadMB,
|
||||||
|
minDelayMs,
|
||||||
|
maxDelayMs
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -10,13 +10,15 @@ public class DownloadConfig {
|
|||||||
private final int maxStepDelayMs;
|
private final int maxStepDelayMs;
|
||||||
private final double minStepDownloadMB;
|
private final double minStepDownloadMB;
|
||||||
private final double maxStepDownloadMB;
|
private final double maxStepDownloadMB;
|
||||||
|
private final int maxDelayMs;
|
||||||
|
private final int minDelayMs;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructs a new DownloadConfig with specified simulation parameters.
|
* Constructs a new DownloadConfig with specified simulation parameters.
|
||||||
*/
|
*/
|
||||||
public DownloadConfig(String fileName, int totalSizeMB, int chunkCount,
|
public DownloadConfig(String fileName, int totalSizeMB, int chunkCount,
|
||||||
int minStepDelayMs, int maxStepDelayMs,
|
int minStepDelayMs, int maxStepDelayMs,
|
||||||
double minStepDownloadMB, double maxStepDownloadMB) {
|
double minStepDownloadMB, double maxStepDownloadMB, int maxDelayMs, int minDelayMs) {
|
||||||
this.fileName = fileName;
|
this.fileName = fileName;
|
||||||
this.totalSizeMB = totalSizeMB;
|
this.totalSizeMB = totalSizeMB;
|
||||||
this.chunkCount = chunkCount;
|
this.chunkCount = chunkCount;
|
||||||
@@ -24,6 +26,8 @@ public class DownloadConfig {
|
|||||||
this.maxStepDelayMs = maxStepDelayMs;
|
this.maxStepDelayMs = maxStepDelayMs;
|
||||||
this.minStepDownloadMB = minStepDownloadMB;
|
this.minStepDownloadMB = minStepDownloadMB;
|
||||||
this.maxStepDownloadMB = maxStepDownloadMB;
|
this.maxStepDownloadMB = maxStepDownloadMB;
|
||||||
|
this.maxDelayMs = maxDelayMs;
|
||||||
|
this.minDelayMs = minDelayMs;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Getters
|
// Getters
|
||||||
@@ -69,8 +73,10 @@ public class DownloadConfig {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public int getMinDelayMs() {
|
public int getMinDelayMs() {
|
||||||
|
return minDelayMs;
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getMaxDelayMs() {
|
public int getMaxDelayMs() {
|
||||||
|
return maxDelayMs;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user