Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[CELEBORN-1679] Estimated ApplicationDiskUsage in cluster should be multiplied by worker count. #2865

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -106,8 +106,8 @@ class AppDiskUsageSnapShot(val topItemCount: Int) extends Logging with Serializa
val zoneId = ZoneId.systemDefault()
s"Snapshot " +
s"start ${LocalDateTime.ofInstant(Instant.ofEpochMilli(startSnapShotTime), zoneId)} " +
s"end ${LocalDateTime.ofInstant(Instant.ofEpochMilli(endSnapShotTime), zoneId)}" +
s" ${topNItems.filter(_ != null).mkString(", ")}"
s"end ${LocalDateTime.ofInstant(Instant.ofEpochMilli(endSnapShotTime), zoneId)}\n" +
s"${topNItems.filter(_ != null).mkString("\n")}"
}
}

Expand All @@ -124,12 +124,12 @@ class AppDiskUsageMetric(conf: CelebornConf) extends Logging {
var currentSnapShot: AtomicReference[AppDiskUsageSnapShot] =
new AtomicReference[AppDiskUsageSnapShot]()

def update(appDiskUsage: java.util.Map[String, java.lang.Long]): Unit = {
def update(appDiskUsage: java.util.Map[String, java.lang.Long], workerCount: Int = 1): Unit = {
updateExecutor.submit(new Runnable {
override def run(): Unit = {
if (currentSnapShot.get() != null) {
appDiskUsage.asScala.foreach { case (key, usage) =>
currentSnapShot.get().updateAppDiskUsage(key, usage)
currentSnapShot.get().updateAppDiskUsage(key, usage * workerCount)
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ public void updateWorkerHeartbeatMeta(
}
}

appDiskUsageMetric.update(estimatedAppDiskUsage);
appDiskUsageMetric.update(estimatedAppDiskUsage, workers.size());
// If using HDFSONLY mode, workers with empty disks should not be put into excluded worker list.
long unhealthyDiskNum =
disks.values().stream().filter(s -> !s.status().equals(DiskStatus.HEALTHY)).count();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -221,10 +221,10 @@ public void testObjSerde() throws IOException, InterruptedException {
Map<String, Long> appDiskUsage = JavaUtils.newConcurrentHashMap();
appDiskUsage.put("app-1", 100L);
appDiskUsage.put("app-2", 200L);
masterStatusSystem.appDiskUsageMetric.update(appDiskUsage);
masterStatusSystem.appDiskUsageMetric.update(appDiskUsage, masterStatusSystem.workers.size());
appDiskUsage.put("app-3", 300L);
appDiskUsage.put("app-1", 200L);
masterStatusSystem.appDiskUsageMetric.update(appDiskUsage);
masterStatusSystem.appDiskUsageMetric.update(appDiskUsage, masterStatusSystem.workers.size());
// wait for snapshot updated
Thread.sleep(3000);

Expand Down
Loading