Skip to content

Commit

Permalink
print debug info
Browse files Browse the repository at this point in the history
  • Loading branch information
cfmcgrady committed Jul 31, 2023
1 parent e5ae5e9 commit 68da052
Showing 1 changed file with 10 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -124,11 +124,15 @@ public void testDataPushQueue() throws Exception {
}

AtomicBoolean running = new AtomicBoolean(true);
System.out.println(System.currentTimeMillis() + " before thread start....");
new Thread(
() -> {
while (running.get()) {
long startTs = System.currentTimeMillis();
System.out.println(startTs + " thread running....");
try {
ArrayList<PushTask> tasks = dataPushQueue.takePushTasks();
System.out.println("task size: " + tasks.size());
for (int i = 0; i < tasks.size(); i++) {
PushTask task = tasks.get(i);
byte[] buffer = task.getBuffer();
Expand All @@ -139,13 +143,19 @@ public void testDataPushQueue() throws Exception {
reducePartitionMap.get(partitionId).hostAndPushPort());
}
} catch (IOException | InterruptedException e) {
e.printStackTrace();
throw new RuntimeException(e);
} finally {
System.out.println("took: " + (System.currentTimeMillis() - startTs));
}
}
System.out.println("running is false.....");
})
.start();

System.out.println(System.currentTimeMillis() + " before sleep....");
Thread.sleep(15 * 1000);
System.out.println(System.currentTimeMillis() + " finish sleep....");
running.set(false);

System.out.println("=====result======");
Expand Down

0 comments on commit 68da052

Please sign in to comment.