11 Ekim 2021 Pazartesi

TcpDiscoveryMulticastIpFinder Sınıfı

Giriş
Şu satırı dahil ederiz
import org.apache.ignite.spi.discovery.tcp.ipfinder.multicast.
  TcpDiscoveryMulticastIpFinder;
setAddresses metodu
Örnek
Şöyle yaparız
import org.apache.ignite.Ignition; import org.apache.ignite.configuration.IgniteConfiguration; import org.apache.ignite.internal.IgniteEx; import org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi; @Order(Ordered.HIGHEST_PRECEDENCE) @Configuration public class GridConfig { @Bean("ignite") public IgniteEx ignite() { IgniteConfiguration cfg = new IgniteConfiguration() .setClientMode(true) .setDiscoverySpi(new TcpDiscoverySpi() .setIpFinder(new TcpDiscoveryMulticastIpFinder() .setAddresses(Arrays.asList("127.0.0.1:47500", "127.0.0.1:47501", "127.0.0.1:47502")))); return (IgniteEx)Ignition.start(cfg); } }
Örnek
Şöyle yaparız
public IgniteConfiguration build() {
  IgniteConfiguration config = new IgniteConfiguration();
  config.setPeerClassLoadingEnabled(true);
  config.setClientMode(false);
  
  TcpDiscoverySpi discoSpi = new TcpDiscoverySpi();
  TcpDiscoveryMulticastIpFinder ipFinder = new TcpDiscoveryMulticastIpFinder();
  ArrayList addrs = new ArrayList<>();
  addrs.add("127.0.0.1:47500..47509");
  ipFinder.setAddresses(addrs);
  discoSpi.setIpFinder(ipFinder);
  config.setDiscoverySpi(discoSpi);
  ...
  return config;
}
Örnek
Şöyle yaparız
TcpDiscoverySpi discoSpi = new TcpDiscoverySpi();
TcpDiscoveryMulticastIpFinder ipFinder = new TcpDiscoveryMulticastIpFinder();
ArrayList addrs = new ArrayList<>();
addrs.add("127.0.0.1:47500..47509");
ipFinder.setAddresses(addrs);
discoSpi.setIpFinder(ipFinder);

Hiç yorum yok:

Yorum Gönder

Ignite Transaction Kullanımı

Giriş Bir tablo 3 tane atomicity değerinden birisine sahip olabilir. 1. ATOMIC 2. TRANSACTIONAL 3. TRANSACTIONAL_SNAPSHOT ATOMIC Açıklaması ...