public final class DiagnosticProcessors extends Object
package-level
documentation
.Modifier and Type | Field and Description |
---|---|
static FunctionEx<Object,String> |
PEEK_DEFAULT_TO_STRING
A function that uses `Object.toString()` for non-arrays,
`Arrays.toString()` for arrays of primitive types and
`Arrays.deepToString()` for `Object[]`.
|
Modifier and Type | Method and Description |
---|---|
static <T> ProcessorMetaSupplier |
peekInputP(FunctionEx<T,? extends CharSequence> toStringFn,
PredicateEx<T> shouldLogFn,
ProcessorMetaSupplier wrapped)
Returns a meta-supplier that wraps the provided one and adds a logging
layer to each processor it creates.
|
static <T> ProcessorSupplier |
peekInputP(FunctionEx<T,? extends CharSequence> toStringFn,
PredicateEx<T> shouldLogFn,
ProcessorSupplier wrapped)
Same as
peekInput(toStringFn, shouldLogFn, metaSupplier) ,
but accepts a ProcessorSupplier instead of a meta-supplier. |
static <T> SupplierEx<Processor> |
peekInputP(FunctionEx<T,? extends CharSequence> toStringFn,
PredicateEx<T> shouldLogFn,
SupplierEx<Processor> wrapped)
Same as
peekInput(toStringFn, shouldLogFn, metaSupplier) ,
but accepts a SupplierEx of processors instead of a
meta-supplier. |
static ProcessorMetaSupplier |
peekInputP(ProcessorMetaSupplier wrapped)
Convenience for
peekInput(toStringFn,
shouldLogFn, metaSupplier) with a pass-through filter and Object#toString as the formatting function. |
static ProcessorSupplier |
peekInputP(ProcessorSupplier wrapped)
Convenience for
peekInput(toStringFn,
shouldLogFn, metaSupplier) with a pass-through filter and Object#toString as the formatting function. |
static SupplierEx<Processor> |
peekInputP(SupplierEx<Processor> wrapped)
Convenience for
peekInput(toStringFn,
shouldLogFn, metaSupplier) with a pass-through filter and Object#toString as the formatting function. |
static <T> ProcessorMetaSupplier |
peekOutputP(FunctionEx<? super T,? extends CharSequence> toStringFn,
PredicateEx<? super T> shouldLogFn,
ProcessorMetaSupplier wrapped)
Returns a meta-supplier that wraps the provided one and adds a logging
layer to each processor it creates.
|
static <T> ProcessorSupplier |
peekOutputP(FunctionEx<? super T,? extends CharSequence> toStringFn,
PredicateEx<? super T> shouldLogFn,
ProcessorSupplier wrapped)
Same as
peekOutput(toStringFn, shouldLogFn, metaSupplier) ,
but accepts a ProcessorSupplier instead of a meta-supplier. |
static <T> SupplierEx<Processor> |
peekOutputP(FunctionEx<? super T,? extends CharSequence> toStringFn,
PredicateEx<? super T> shouldLogFn,
SupplierEx<Processor> wrapped)
Same as
peekOutput(toStringFn, shouldLogFn, metaSupplier) ,
but accepts a SupplierEx of processors instead of a
meta-supplier. |
static ProcessorMetaSupplier |
peekOutputP(ProcessorMetaSupplier wrapped)
Convenience for
peekOutput(toStringFn,
shouldLogFn, metaSupplier with a pass-through filter and Object#toString as the formatting function. |
static ProcessorSupplier |
peekOutputP(ProcessorSupplier wrapped)
Convenience for
peekOutput(toStringFn,
shouldLogFn, metaSupplier with a pass-through filter and Object#toString as the formatting function. |
static SupplierEx<Processor> |
peekOutputP(SupplierEx<Processor> wrapped)
Convenience for
peekOutput(toStringFn,
shouldLogFn, metaSupplier with a pass-through filter and Object#toString as the formatting function. |
static <K,V> ProcessorMetaSupplier |
peekSnapshotP(FunctionEx<? super Map.Entry<K,V>,? extends CharSequence> toStringFn,
PredicateEx<? super Map.Entry<K,V>> shouldLogFn,
ProcessorMetaSupplier wrapped)
Returns a meta-supplier that wraps the provided one and adds a logging
layer to each processor it creates.
|
static <K,V> ProcessorSupplier |
peekSnapshotP(FunctionEx<? super Map.Entry<K,V>,? extends CharSequence> toStringFn,
PredicateEx<? super Map.Entry<K,V>> shouldLogFn,
ProcessorSupplier wrapped)
Same as
peekSnapshot(toStringFn, shouldLogFn, metaSupplier) ,
but accepts a ProcessorSupplier instead of a meta-supplier. |
static <K,V> SupplierEx<Processor> |
peekSnapshotP(FunctionEx<? super Map.Entry<K,V>,? extends CharSequence> toStringFn,
PredicateEx<? super Map.Entry<K,V>> shouldLogFn,
SupplierEx<Processor> wrapped)
Same as
peekSnapshot(toStringFn, shouldLogFn, metaSupplier) ,
but accepts a SupplierEx of processors instead of a
meta-supplier. |
static ProcessorMetaSupplier |
peekSnapshotP(ProcessorMetaSupplier wrapped)
Convenience for
peekSnapshot(toStringFn,
shouldLogFn, metaSupplier with a pass-through filter and Object#toString as the formatting function. |
static ProcessorSupplier |
peekSnapshotP(ProcessorSupplier wrapped)
Convenience for
peekSnapshot(toStringFn,
shouldLogFn, metaSupplier with a pass-through filter and Object#toString as the formatting function. |
static SupplierEx<Processor> |
peekSnapshotP(SupplierEx<Processor> wrapped)
Convenience for
peekSnapshot(toStringFn,
shouldLogFn, metaSupplier with a pass-through filter and Object#toString as the formatting function. |
static ProcessorMetaSupplier |
writeLoggerP()
|
static <T> ProcessorMetaSupplier |
writeLoggerP(FunctionEx<T,? extends CharSequence> toStringFn)
Returns a meta-supplier of processors for a sink vertex that logs all
the data items it receives.
|
public static final FunctionEx<Object,String> PEEK_DEFAULT_TO_STRING
@Nonnull public static <T> ProcessorMetaSupplier writeLoggerP(@Nonnull FunctionEx<T,? extends CharSequence> toStringFn)
com.hazelcast.jet.impl.processor.PeekWrappedP.<vertexName>#<processorIndex>
and the level is INFO. Watermark
items are always logged, but at
FINE level; they are not passed to toStringFn
.
The vertex logs each item on whichever cluster member it happens to receive it. Its primary purpose is for development, when running Jet on a local machine.
T
- stream item typetoStringFn
- a function that returns a string representation of a stream item@Nonnull public static ProcessorMetaSupplier writeLoggerP()
@Nonnull public static <T> ProcessorMetaSupplier peekInputP(@Nonnull FunctionEx<T,? extends CharSequence> toStringFn, @Nonnull PredicateEx<T> shouldLogFn, @Nonnull ProcessorMetaSupplier wrapped)
shouldLogFn
predicate to see whether to log the item
toStringFn
to get a string
representation of the item
com.hazelcast.jet.impl.processor.PeekWrappedP.<vertexName>#<processorIndex>
.
The text is prefixed with "Input from X: ", where X is the edge
ordinal the item is received from. Received watermarks are prefixed
with just "Input: ".
Note: Watermarks are always logged. Watermark
objects are not
passed to shouldLogFn
and toStringFn
.
T
- input item typetoStringFn
- a function that returns the string representation of the item.
You can use PEEK_DEFAULT_TO_STRING
.shouldLogFn
- a function to filter the logged items. You can use alwaysTrue()
as a pass-through filter when you don't need any
filtering.wrapped
- The wrapped meta-supplier.peekOutputP(FunctionEx, PredicateEx, ProcessorMetaSupplier)
,
peekSnapshotP(FunctionEx, PredicateEx, ProcessorMetaSupplier)
@Nonnull public static <T> ProcessorSupplier peekInputP(@Nonnull FunctionEx<T,? extends CharSequence> toStringFn, @Nonnull PredicateEx<T> shouldLogFn, @Nonnull ProcessorSupplier wrapped)
peekInput(toStringFn, shouldLogFn, metaSupplier)
,
but accepts a ProcessorSupplier
instead of a meta-supplier.@Nonnull public static <T> SupplierEx<Processor> peekInputP(@Nonnull FunctionEx<T,? extends CharSequence> toStringFn, @Nonnull PredicateEx<T> shouldLogFn, @Nonnull SupplierEx<Processor> wrapped)
peekInput(toStringFn, shouldLogFn, metaSupplier)
,
but accepts a SupplierEx
of processors instead of a
meta-supplier.@Nonnull public static ProcessorMetaSupplier peekInputP(@Nonnull ProcessorMetaSupplier wrapped)
peekInput(toStringFn,
shouldLogFn, metaSupplier)
with a pass-through filter and Object#toString
as the formatting function.@Nonnull public static ProcessorSupplier peekInputP(@Nonnull ProcessorSupplier wrapped)
peekInput(toStringFn,
shouldLogFn, metaSupplier)
with a pass-through filter and Object#toString
as the formatting function. This variant accepts a
ProcessorSupplier
instead of a meta-supplier.@Nonnull public static SupplierEx<Processor> peekInputP(@Nonnull SupplierEx<Processor> wrapped)
peekInput(toStringFn,
shouldLogFn, metaSupplier)
with a pass-through filter and Object#toString
as the formatting function. This variant accepts a
SupplierEx
of processors instead of a meta-supplier.@Nonnull public static <T> ProcessorMetaSupplier peekOutputP(@Nonnull FunctionEx<? super T,? extends CharSequence> toStringFn, @Nonnull PredicateEx<? super T> shouldLogFn, @Nonnull ProcessorMetaSupplier wrapped)
shouldLogFn
predicate to see whether to log the item
toStringFn
to get a string
representation of the item
com.hazelcast.jet.impl.processor.PeekWrappedP.<vertexName>#<processorIndex>
.
The logged text is prefixed with "Output to X: ", where X is the edge
ordinal the item is sent to
Technically speaking, snapshot data is emitted to the same outbox as regular
data, but this wrapper only logs the regular data. See peekSnapshot()
.
"Output to N: "
"Output forwarded: "
Watermark
objects are not passed to
shouldLogFn
or toStringFn
.T
- output item typetoStringFn
- a function that returns the string representation of the item.
You can use PEEK_DEFAULT_TO_STRING
.shouldLogFn
- a function to filter the logged items. You can use alwaysTrue()
as a pass-through filter when you don't need any
filtering.wrapped
- The wrapped meta-supplier.peekInputP(FunctionEx, PredicateEx, ProcessorMetaSupplier)
,
peekSnapshotP(FunctionEx, PredicateEx, ProcessorMetaSupplier)
@Nonnull public static <T> ProcessorSupplier peekOutputP(@Nonnull FunctionEx<? super T,? extends CharSequence> toStringFn, @Nonnull PredicateEx<? super T> shouldLogFn, @Nonnull ProcessorSupplier wrapped)
peekOutput(toStringFn, shouldLogFn, metaSupplier)
,
but accepts a ProcessorSupplier
instead of a meta-supplier.@Nonnull public static <T> SupplierEx<Processor> peekOutputP(@Nonnull FunctionEx<? super T,? extends CharSequence> toStringFn, @Nonnull PredicateEx<? super T> shouldLogFn, @Nonnull SupplierEx<Processor> wrapped)
peekOutput(toStringFn, shouldLogFn, metaSupplier)
,
but accepts a SupplierEx
of processors instead of a
meta-supplier.@Nonnull public static ProcessorMetaSupplier peekOutputP(@Nonnull ProcessorMetaSupplier wrapped)
peekOutput(toStringFn,
shouldLogFn, metaSupplier
with a pass-through filter and Object#toString
as the formatting function.@Nonnull public static ProcessorSupplier peekOutputP(@Nonnull ProcessorSupplier wrapped)
peekOutput(toStringFn,
shouldLogFn, metaSupplier
with a pass-through filter and Object#toString
as the formatting function. This variant accepts a
ProcessorSupplier
instead of a meta-supplier.@Nonnull public static SupplierEx<Processor> peekOutputP(@Nonnull SupplierEx<Processor> wrapped)
peekOutput(toStringFn,
shouldLogFn, metaSupplier
with a pass-through filter and Object#toString
as the formatting function. This variant accepts a
SupplierEx
of processors instead of a meta-supplier.@Nonnull public static <K,V> ProcessorMetaSupplier peekSnapshotP(@Nonnull FunctionEx<? super Map.Entry<K,V>,? extends CharSequence> toStringFn, @Nonnull PredicateEx<? super Map.Entry<K,V>> shouldLogFn, @Nonnull ProcessorMetaSupplier wrapped)
shouldLogFn
predicate to see whether to log the item
toStringFn
to get a string
representation of the item
com.hazelcast.jet.impl.processor.PeekWrappedP.<vertexName>#<processorIndex>
K
- type of the key emitted to the snapshotV
- type of the value emitted to the snapshottoStringFn
- a function that returns the string representation of the item.
You can use DEFAULT_TO_STRING
shouldLogFn
- a function to filter the logged items. You can use alwaysTrue()
as a pass-through filter when you don't need any
filtering.wrapped
- The wrapped meta-supplier.peekInputP(FunctionEx, PredicateEx, ProcessorMetaSupplier)
,
peekOutputP(FunctionEx, PredicateEx, ProcessorMetaSupplier)
@Nonnull public static <K,V> ProcessorSupplier peekSnapshotP(@Nonnull FunctionEx<? super Map.Entry<K,V>,? extends CharSequence> toStringFn, @Nonnull PredicateEx<? super Map.Entry<K,V>> shouldLogFn, @Nonnull ProcessorSupplier wrapped)
peekSnapshot(toStringFn, shouldLogFn, metaSupplier)
,
but accepts a ProcessorSupplier
instead of a meta-supplier.@Nonnull public static <K,V> SupplierEx<Processor> peekSnapshotP(@Nonnull FunctionEx<? super Map.Entry<K,V>,? extends CharSequence> toStringFn, @Nonnull PredicateEx<? super Map.Entry<K,V>> shouldLogFn, @Nonnull SupplierEx<Processor> wrapped)
peekSnapshot(toStringFn, shouldLogFn, metaSupplier)
,
but accepts a SupplierEx
of processors instead of a
meta-supplier.@Nonnull public static SupplierEx<Processor> peekSnapshotP(@Nonnull SupplierEx<Processor> wrapped)
peekSnapshot(toStringFn,
shouldLogFn, metaSupplier
with a pass-through filter and Object#toString
as the formatting function. This variant accepts a
SupplierEx
of processors instead of a meta-supplier.@Nonnull public static ProcessorMetaSupplier peekSnapshotP(@Nonnull ProcessorMetaSupplier wrapped)
peekSnapshot(toStringFn,
shouldLogFn, metaSupplier
with a pass-through filter and Object#toString
as the formatting function.@Nonnull public static ProcessorSupplier peekSnapshotP(@Nonnull ProcessorSupplier wrapped)
peekSnapshot(toStringFn,
shouldLogFn, metaSupplier
with a pass-through filter and Object#toString
as the formatting function. This variant accepts a
ProcessorSupplier
instead of a meta-supplier.Copyright © 2024 Hazelcast, Inc.. All rights reserved.