Commit ee63c939 authored by tammam.alsoleman's avatar tammam.alsoleman

edit to show the execution time

parent eb5ae0d6
......@@ -50,7 +50,7 @@ public class SearchClient {
if (stubs.isEmpty()) {
return Collections.emptyList();
}
long startTime = System.currentTimeMillis();
// Phase 1: Aggregate Global Counts
Map<String, Integer> globalTermCounts = new HashMap<>();
int filesPerWorker = (int) Math.ceil((double) allFiles.size() / stubs.size());
......@@ -101,7 +101,8 @@ public class SearchClient {
} catch (Exception e) { System.err.println("Worker " + address + " Phase 2 error"); }
currentFileIndex += count;
}
long endTime = System.currentTimeMillis();
System.out.println(">>> Distributed Search took: " + (endTime - startTime) + " ms");
// --- return the sorted list ---
finalResults.sort((a, b) -> Double.compare(b.getScore(), a.getScore()));
return finalResults;
......
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment