Interface ProcessorWrapper
- All Superinterfaces:
Configurable
Wrapper class that can be used to inject custom wrappers around the processors of their application topology.
The returned instance should wrap the supplied
ProcessorSupplier and the Processor it supplies
to avoid disrupting the regular processing of the application, although this is not required and any processor
implementation can be substituted in to replace the original processor entirely (which may be useful for example
while testing or debugging an application topology).
NOTE: in order to use this feature, you must set the StreamsConfig.PROCESSOR_WRAPPER_CLASS_CONFIG config and pass it
in as a TopologyConfig when creating the StreamsBuilder or Topology by using the
appropriate constructor (ie StreamsBuilder(TopologyConfig) or Topology(TopologyConfig))
Can be configured, if desired, by implementing the configure(Map) method. This will be invoked when
the ProcessorWrapper is instantiated, and will provide it with the TopologyConfigs that were passed in
to the StreamsBuilder or Topology constructor.
-
Method Summary
Modifier and TypeMethodDescriptionstatic <KIn,VIn, KOut, VOut>
WrappedProcessorSupplier<KIn, VIn, KOut, VOut> asWrapped(ProcessorSupplier<KIn, VIn, KOut, VOut> processorSupplier) Use to convert aProcessorSupplierinstance into aWrappedProcessorSupplierstatic <KIn,VIn, VOut>
WrappedFixedKeyProcessorSupplier<KIn, VIn, VOut> asWrappedFixedKey(FixedKeyProcessorSupplier<KIn, VIn, VOut> processorSupplier) Use to convert aFixedKeyProcessorSupplierinstance into aWrappedFixedKeyProcessorSupplierdefault voidConfigure this class with the given key-value pairs<KIn,VIn, VOut>
WrappedFixedKeyProcessorSupplier<KIn, VIn, VOut> wrapFixedKeyProcessorSupplier(String processorName, FixedKeyProcessorSupplier<KIn, VIn, VOut> processorSupplier) Wrap or replace the providedFixedKeyProcessorSupplierand return aWrappedFixedKeyProcessorSupplierTo convert aFixedKeyProcessorSupplierinstance into aWrappedFixedKeyProcessorSupplier, use theasWrappedFixedKey(FixedKeyProcessorSupplier)method<KIn,VIn, KOut, VOut>
WrappedProcessorSupplier<KIn, VIn, KOut, VOut> wrapProcessorSupplier(String processorName, ProcessorSupplier<KIn, VIn, KOut, VOut> processorSupplier) Wrap or replace the providedProcessorSupplierand return aWrappedProcessorSupplierTo convert aProcessorSupplierinstance into aWrappedProcessorSupplier, use theasWrapped(ProcessorSupplier)method
-
Method Details
-
configure
Description copied from interface:ConfigurableConfigure this class with the given key-value pairs- Specified by:
configurein interfaceConfigurable
-
wrapProcessorSupplier
<KIn,VIn, WrappedProcessorSupplier<KIn,KOut, VOut> VIn, wrapProcessorSupplierKOut, VOut> (String processorName, ProcessorSupplier<KIn, VIn, KOut, VOut> processorSupplier) Wrap or replace the providedProcessorSupplierand return aWrappedProcessorSupplierTo convert aProcessorSupplierinstance into aWrappedProcessorSupplier, use theasWrapped(ProcessorSupplier)method -
wrapFixedKeyProcessorSupplier
<KIn,VIn, WrappedFixedKeyProcessorSupplier<KIn,VOut> VIn, wrapFixedKeyProcessorSupplierVOut> (String processorName, FixedKeyProcessorSupplier<KIn, VIn, VOut> processorSupplier) Wrap or replace the providedFixedKeyProcessorSupplierand return aWrappedFixedKeyProcessorSupplierTo convert aFixedKeyProcessorSupplierinstance into aWrappedFixedKeyProcessorSupplier, use theasWrappedFixedKey(FixedKeyProcessorSupplier)method -
asWrapped
static <KIn,VIn, WrappedProcessorSupplier<KIn,KOut, VOut> VIn, asWrappedKOut, VOut> (ProcessorSupplier<KIn, VIn, KOut, VOut> processorSupplier) Use to convert aProcessorSupplierinstance into aWrappedProcessorSupplier -
asWrappedFixedKey
static <KIn,VIn, WrappedFixedKeyProcessorSupplier<KIn,VOut> VIn, asWrappedFixedKeyVOut> (FixedKeyProcessorSupplier<KIn, VIn, VOut> processorSupplier) Use to convert aFixedKeyProcessorSupplierinstance into aWrappedFixedKeyProcessorSupplier
-