Giriş
Şu satırı dahil ederiz
import org.apache.ignite.IgniteDataStreamer;
addData metodu
Örnek
Şöyle yaparız
Path path = Paths.get(IgniteStream.class.getResource("employees.txt") .toURI()); Gson gson = new Gson(); Files.lines(path) .forEach(l -> streamer.addData( employee.getId(), gson.fromJson(l, Employee.class)));
Örnek
Şöyle yaparız
IgniteCache<Employee, Integer> cache = ignite.getOrCreateCache("fooCache"); IgniteDataStreamer<Integer, Employee> streamer = ignite.dataStreamer(cache.getName()); streamer.receiver(StreamTransformer.from((e, arg) -> { Employee employee = e.getValue(); employee.setEmployed(true); e.setValue(employee); return employee; }));
Hiç yorum yok:
Yorum Gönder