use of com.ibm.streams.operator.state.ConsistentRegionContext in project streamsx.kafka by IBMStreams.
the class AbstractKafkaProducerOperator method checkConsistentRegion.
@ContextCheck(compile = true)
public static void checkConsistentRegion(OperatorContextChecker checker) {
// check that the operator is not the start of the consistent region
OperatorContext opContext = checker.getOperatorContext();
ConsistentRegionContext crContext = opContext.getOptionalContext(ConsistentRegionContext.class);
if (crContext != null) {
if (crContext.isStartOfRegion()) {
// //$NON-NLS-1$
checker.setInvalidContext(Messages.getString("PRODUCER_NOT_START_OF_CONSISTENT_REGION"), new Object[0]);
}
}
}
use of com.ibm.streams.operator.state.ConsistentRegionContext in project streamsx.topology by IBMStreams.
the class FunctionalOpUtils method checkNotConsistentRegionSource.
/**
* Verify a functional operator is not the start of a consistent region.
* @param checker Context checker.
*/
static void checkNotConsistentRegionSource(OperatorContextChecker checker) {
OperatorContext context = checker.getOperatorContext();
ConsistentRegionContext crc = context.getOptionalContext(ConsistentRegionContext.class);
if (crc == null)
return;
if (crc.isStartOfRegion() || crc.isTriggerOperator())
checker.setInvalidContext(Messages.getString("CONSISTENT_CHECK_1"), new String[] { context.getKind() });
}
Aggregations