use of com.hazelcast.jet.impl.processor.TransformP in project hazelcast by hazelcast.
the class JoinByEquiJoinProcessorSupplier method get.
@Nonnull
@Override
public Collection<? extends Processor> get(int count) {
List<Processor> processors = new ArrayList<>(count);
for (int i = 0; i < count; i++) {
PartitionIdSet partitions = this.partitions == null ? null : new PartitionIdSet(partitionCount, this.partitions);
QueryPath[] rightPaths = rightRowProjectorSupplier.paths();
KvRowProjector rightProjector = rightRowProjectorSupplier.get(evalContext, extractors);
Processor processor = new TransformP<JetSqlRow, JetSqlRow>(joinFn(joinInfo, map, partitions, rightPaths, rightProjector, evalContext)) {
@Override
public boolean isCooperative() {
return false;
}
};
processors.add(processor);
}
return processors;
}
use of com.hazelcast.jet.impl.processor.TransformP in project hazelcast by hazelcast.
the class RowProjectorProcessorSupplier method get.
@Nonnull
@Override
public Collection<? extends Processor> get(int count) {
List<Processor> processors = new ArrayList<>(count);
for (int i = 0; i < count; i++) {
ResettableSingletonTraverser<JetSqlRow> traverser = new ResettableSingletonTraverser<>();
KvRowProjector projector = projectorSupplier.get(evalContext, extractors);
Processor processor = new TransformP<LazyMapEntry<Object, Object>, JetSqlRow>(entry -> {
traverser.accept(projector.project(entry.getKeyData(), entry.getValueData()));
return traverser;
});
processors.add(processor);
}
return processors;
}
use of com.hazelcast.jet.impl.processor.TransformP in project hazelcast by hazelcast.
the class MetricsTest method availableViaJmx.
@Test
public void availableViaJmx() throws Exception {
int generatedItems = 1000;
pipeline.readFrom(TestSources.itemStream(1_000)).withIngestionTimestamps().filter(l -> l.sequence() < generatedItems).map(t -> {
Metrics.metric("total").increment();
return t;
}).writeTo(Sinks.noop());
Job job = instance.getJet().newJob(pipeline, JOB_CONFIG_WITH_METRICS);
JobMetricsChecker jobMetricsChecker = new JobMetricsChecker(job);
assertTrueEventually(() -> jobMetricsChecker.assertSummedMetricValue("total", generatedItems));
String instanceName = instance.getName();
long sum = 0;
int availableProcessors = config.getJetConfig().getCooperativeThreadCount();
for (int i = 0; i < availableProcessors; i++) {
JmxMetricsChecker jmxMetricsChecker = new JmxMetricsChecker(instanceName, job, "vertex=fused(filter, map)", "procType=TransformP", "proc=" + i, "user=true");
long attributeValue = jmxMetricsChecker.getMetricValue("total");
sum += attributeValue;
}
assertEquals(generatedItems, sum);
}
Aggregations