Giriş
Şu satırı dahil ederiz
import org.apache.ignite.Ignite;
Kullanım
Örnek
Ben şöyle yaptım
// Preparing IgniteConfiguration using Java APIs
IgniteConfiguration cfg = new IgniteConfiguration();
// The node will be started as a client node.
cfg.setClientMode(true);
// Classes of custom Java logic will be transferred over the wire from this app.
//cfg.setPeerClassLoadingEnabled(true);
// Setting up an IP Finder to ensure the client can locate the servers.
TcpDiscoveryMulticastIpFinder ipFinder = new TcpDiscoveryMulticastIpFinder();
ipFinder.setAddresses(Collections.singletonList("127.0.0.1:47500..47509"));
cfg.setDiscoverySpi(new TcpDiscoverySpi().setIpFinder(ipFinder));
// Starting the node
Ignite ignite = Ignition.start(cfg);
constructor
Şöyle yaparız
try (Ignite ignite = Ignition.start("examples/config/example-ignite.xml")) {
...
}
cluster metodu
IgniteCluster nesnesi döndürür
createCache metodu
IgniteCache nesnesi yaratır
getEvents metodu
Örnek
Şöyle yaparız
var cfg = new IgniteConfiguration{IncludedEventTypes = new[]{EventType.CacheObjectPut,EventType.CacheObjectRemoved,}};var ignite = Ignition.Start(cfg);var events = ignite.GetEvents();events.LocalListen(new LocalListener(), EventType.CacheObjectPut,EventType.CacheObjectRemoved);
queue metodu
IgniteQueue nesnesi döner
set metodu
IgniteSet nesnesi döner
Hiç yorum yok:
Yorum Gönder