Package com.linkedin.venice.hadoop
Class FilterChain<INPUT_VALUE>
- java.lang.Object
-
- com.linkedin.venice.hadoop.FilterChain<INPUT_VALUE>
-
- All Implemented Interfaces:
java.io.Closeable
,java.lang.AutoCloseable
public class FilterChain<INPUT_VALUE> extends java.lang.Object implements java.io.Closeable
The FilterChain class takes a list ofAbstractVeniceFilter
to assemble a filter chain to manage the life cycles' of filters and perform filtering based on the order of filters. If a record has been filtered by a predecessor, then it won't be passed to latter part of the filter chain.
-
-
Constructor Summary
Constructors Constructor Description FilterChain()
FilterChain(AbstractVeniceFilter<INPUT_VALUE>... filters)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
add(AbstractVeniceFilter<INPUT_VALUE> filter)
boolean
apply(INPUT_VALUE value)
This function passes the value through the filter chain to determine if the value can be filtered out or not.void
close()
boolean
isEmpty()
-
-
-
Constructor Detail
-
FilterChain
public FilterChain()
-
FilterChain
public FilterChain(AbstractVeniceFilter<INPUT_VALUE>... filters)
-
-
Method Detail
-
isEmpty
public boolean isEmpty()
-
add
public void add(AbstractVeniceFilter<INPUT_VALUE> filter)
-
apply
public boolean apply(INPUT_VALUE value)
This function passes the value through the filter chain to determine if the value can be filtered out or not.- Parameters:
value
-- Returns:
- true if the value should be filtered out by this filter or its successor, otherwise false.
-
close
public void close() throws java.io.IOException
- Specified by:
close
in interfacejava.lang.AutoCloseable
- Specified by:
close
in interfacejava.io.Closeable
- Throws:
java.io.IOException
-
-