Skip to content

Commit 8f94898

Browse files
committed
Reapply "Use Virtual Thread"
This reverts commit 769e571.
1 parent bc8a10b commit 8f94898

File tree

4 files changed

+7
-6
lines changed

4 files changed

+7
-6
lines changed

openmetadata-service/src/main/java/org/openmetadata/service/apps/bundles/searchIndex/SearchIndexExecutor.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -455,16 +455,16 @@ private int initializeQueueAndExecutors(ThreadConfiguration threadConfig, int en
455455
producersDone.set(false);
456456

457457
jobExecutor =
458-
Executors.newFixedThreadPool(entityCount, Thread.ofPlatform().name("job-", 0).factory());
458+
Executors.newFixedThreadPool(entityCount, Thread.ofVirtual().name("job-", 0).factory());
459459

460460
int finalNumConsumers = Math.min(threadConfig.numConsumers(), MAX_CONSUMER_THREADS);
461461
consumerExecutor =
462462
Executors.newFixedThreadPool(
463-
finalNumConsumers, Thread.ofPlatform().name("consumer-", 0).factory());
463+
finalNumConsumers, Thread.ofVirtual().name("consumer-", 0).factory());
464464

465465
producerExecutor =
466466
Executors.newFixedThreadPool(
467-
threadConfig.numProducers(), Thread.ofPlatform().name("producer-", 0).factory());
467+
threadConfig.numProducers(), Thread.ofVirtual().name("producer-", 0).factory());
468468

469469
return effectiveQueueSize;
470470
}

openmetadata-service/src/main/java/org/openmetadata/service/apps/bundles/searchIndex/distributed/DistributedJobStatsAggregator.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ public void start() {
114114
if (running.compareAndSet(false, true)) {
115115
scheduler =
116116
Executors.newSingleThreadScheduledExecutor(
117-
Thread.ofPlatform()
117+
Thread.ofVirtual()
118118
.name("stats-aggregator-" + jobId.toString().substring(0, 8))
119119
.factory());
120120

openmetadata-service/src/main/java/org/openmetadata/service/apps/bundles/searchIndex/distributed/PartitionWorker.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,8 @@ public PartitionResult processPartition(SearchIndexPartition partition) {
158158
successCount.addAndGet(batchResult.successCount());
159159
failedCount.addAndGet(batchResult.failedCount());
160160
warningsCount.addAndGet(batchResult.warningsCount());
161-
processedCount.addAndGet(batchResult.successCount() + batchResult.failedCount());
161+
processedCount.addAndGet(
162+
batchResult.successCount() + batchResult.failedCount() + batchResult.warningsCount());
162163

163164
currentOffset += currentBatchSize;
164165

openmetadata-service/src/main/java/org/openmetadata/service/apps/bundles/searchIndex/distributed/PollingJobNotifier.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ public void start() {
7070

7171
scheduler =
7272
Executors.newSingleThreadScheduledExecutor(
73-
Thread.ofPlatform().name("job-notifier-poll").factory());
73+
Thread.ofVirtual().name("job-notifier-poll").factory());
7474

7575
// Schedule with fixed delay of 1 second, but actual polling is controlled by interval logic
7676
scheduler.scheduleWithFixedDelay(

0 commit comments

Comments
 (0)