Şu satırı dahil ederiz
import com.hazelcast.jet.pipeline.Pipeline;
Gerçekleştirim için PipelineImpl sınıfına bakınız
readFrom metodu
Bu metodun eski ismi drawFrom. Açıklaması şöyle
Renamed Pipeline.drawFrom to Pipeline.readFrom and GeneralStage.drainToto GeneralStage.writeTo:pipeline.readFrom(TestSources.items(1, 2, 3)).writeTo(Sinks.logger());//pipeline.drawFrom(TestSources.items(1, 2, 3)).drainTo(Sinks.logger());
Örnek
Şöyle yaparız
class JetJob3 {private String instanceVar = ...;Pipeline buildPipeline() {Pipeline p = Pipeline.create();// Declare a local variable that loads the value of the instance field.String findMe = instanceVar;p.readFrom(Sources.list("input"))// By referring to the local variable `findMe` we avoid// capturing `this` and the job runs fine..filter(item -> item.equals(findMe));return p;}}
writeTo metodu
Örnek
Şöyle yaparız
IList<WindowResult<Long>> result = instance.getList("result");Pipeline p = Pipeline.create(); p.readFrom(...) .withIngestionTimestamps() .window(WindowDefinition.tumbling(50)) .aggregate(AggregateOperations.counting()) .writeTo(Sinks.list(result));
Hiç yorum yok:
Yorum Gönder