20 Eylül 2023 Çarşamba

HazelcastAPI ExecutionService Arayüzü

Giriş
Şu satırı dahil ederiz
import com.hazelcast.spi.impl.ExecutionService;
Kalıtım şöyle
ExecutionService
  ExecutionServiceImpl

ExecutionServiceImpl Sınıfı
createExecutor metodu
İmzası şöyle
private ManagedExecutorService createExecutor(String name, int poolSize, int queueCapacity,
                                          ExecutorType type, ThreadFactory threadFactory)
Kod şöyle.  CachedExecutorServiceDelegate veya NamedThreadPoolExecutor yaratır
private ManagedExecutorService createExecutor(String name, int poolSize, int queueCapacity,
                                           ExecutorType type, ThreadFactory threadFactory) {
  ManagedExecutorService executor;
  if (type == ExecutorType.CACHED) {
    if (threadFactory != null) {
      throw new IllegalArgumentException("...");
    }
    executor = new CachedExecutorServiceDelegate(name, cachedExecutorService, poolSize, 
      queueCapacity);
  } else if (type == ExecutorType.CONCRETE) {
    ...
  } else {
    throw new IllegalArgumentException("Unknown executor type: " + type);
  }
  return executor;
}
CachedExecutorServiceDelegate 
Bu sınıf Runnable işleri cachedExecutorService nesnesine verir. Yani aslında bir sürü sınıf altta paylaşılan bir ExecutorService kullanıyor

Hiç yorum yok:

Yorum Gönder

HazelcastAPI CP SubSystem vs Transaciton Yapılar

Giriş Bu yazının yazılma sebebi bu soru 1. Transactional Yapılar Hazelcast TransactionalMap, birden fazla veri değişikliğinin tek bir işlem ...