jerqi commented on code in PR #167:
URL: https://github.com/apache/incubator-uniffle/pull/167#discussion_r949905016
##########
server/src/main/java/org/apache/uniffle/server/ShuffleFlushManager.java:
##########
@@ -111,26 +114,28 @@ public ShuffleFlushManager(ShuffleServerConf
shuffleServerConf, String shuffleSe
processEventThread.setName("ProcessEventThread");
processEventThread.setDaemon(true);
processEventThread.start();
- // todo: extract a class named Service, and support stop method
- Thread thread = new Thread("PendingEventProcessThread") {
- @Override
- public void run() {
- for (; ; ) {
- try {
- processPendingEvents();
- processPendingEventIndex = (processPendingEventIndex + 1) % 1000;
- if (processPendingEventIndex == 0) {
- // todo: get sleep interval from configuration
- Uninterruptibles.sleepUninterruptibly(1, TimeUnit.SECONDS);
- }
- } catch (Exception e) {
- LOG.error(getName() + " happened exception: ", e);
+ pendingEventProcesser = Executors.newSingleThreadScheduledExecutor(
+ ThreadUtils.getThreadFactory("PendingEventProcesser-%d"));
+ long sleepInterval =
shuffleServerConf.get(ShuffleServerConf.PENDING_EVENT_CHECK_INTERVAL);
+ long memoryCapacity =
shuffleServerConf.getSizeAsBytes(ShuffleServerConf.SERVER_BUFFER_CAPACITY);;
+ long memoryThreshold = Math.max(memoryCapacity / 10, 1024L * 1024 * 1024);
Review Comment:
Why do we divide by 10?
--
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]