use of org.apache.ignite.internal.cdc.CdcConsumerState in project ignite by apache.
the class AbstractCdcTest method createCdc.
/**
*/
protected CdcMain createCdc(CdcConsumer cnsmr, IgniteConfiguration cfg, CountDownLatch latch, GridAbsPredicate... conditions) {
CdcConfiguration cdcCfg = new CdcConfiguration();
cdcCfg.setConsumer(cnsmr);
cdcCfg.setKeepBinary(keepBinary());
cdcCfg.setMetricExporterSpi(metricExporters());
return new CdcMain(cfg, null, cdcCfg) {
@Override
protected CdcConsumerState createState(Path stateDir) {
return new CdcConsumerState(stateDir) {
@Override
public void save(WALPointer ptr) throws IOException {
super.save(ptr);
if (!F.isEmpty(conditions)) {
for (GridAbsPredicate p : conditions) {
if (!p.apply())
return;
}
latch.countDown();
}
}
};
}
};
}
Aggregations