Package org.nuxeo.ecm.core.work
Class BaseOverflowRecordFilter
- java.lang.Object
-
- org.nuxeo.ecm.core.work.BaseOverflowRecordFilter
-
- All Implemented Interfaces:
RecordFilter
- Direct Known Subclasses:
KeyValueStoreOverflowRecordFilter
,TransientStoreOverflowRecordFilter
public abstract class BaseOverflowRecordFilter extends Object implements RecordFilter
Base for filter that saves long record's value in an alternate storage. The record is then marked with an internal flag and contains an empty value.- Since:
- 11.1
-
-
Field Summary
Fields Modifier and Type Field Description static String
DEFAULT_PREFIX
static String
DEFAULT_STORE_NAME
static String
DEFAULT_STORE_TTL
static int
DEFAULT_THRESHOLD_SIZE
protected String
prefix
static String
PREFIX_OPTION
static String
STORE_NAME_OPTION
static String
STORE_TTL_OPTION
protected String
storeName
protected Duration
storeTTL
static String
THRESHOLD_SIZE_OPTION
protected int
thresholdSize
-
Constructor Summary
Constructors Constructor Description BaseOverflowRecordFilter()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description Record
afterRead(Record record, LogOffset offset)
Called after reading a record.Record
beforeAppend(Record record)
Called before appending a record to a stream.protected abstract byte[]
fetchValue(String key)
Fetches a value previously stored bystoreValue(String, byte[])
String
getPrefix()
protected String
getPrefixedKey(String recordKey)
String
getStoreName()
Duration
getStoreTTL()
int
getThresholdSize()
protected String
getUniqRecordKey(Record record)
void
init(Map<String,String> options)
Initialiaze the filter.protected int
parseIntOrDefault(String valueAsString, int defaultValue)
void
setPrefix(String prefix)
void
setStoreName(String storeName)
void
setStoreTTL(Duration storeTTL)
void
setThresholdSize(int thresholdSize)
protected abstract void
storeValue(String key, byte[] data)
Sets the value associated to the key.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.nuxeo.lib.stream.computation.RecordFilter
afterAppend
-
-
-
-
Field Detail
-
STORE_NAME_OPTION
public static final String STORE_NAME_OPTION
- See Also:
- Constant Field Values
-
DEFAULT_STORE_NAME
public static final String DEFAULT_STORE_NAME
- See Also:
- Constant Field Values
-
STORE_TTL_OPTION
public static final String STORE_TTL_OPTION
- See Also:
- Constant Field Values
-
DEFAULT_STORE_TTL
public static final String DEFAULT_STORE_TTL
- See Also:
- Constant Field Values
-
THRESHOLD_SIZE_OPTION
public static final String THRESHOLD_SIZE_OPTION
- See Also:
- Constant Field Values
-
DEFAULT_THRESHOLD_SIZE
public static final int DEFAULT_THRESHOLD_SIZE
- See Also:
- Constant Field Values
-
PREFIX_OPTION
public static final String PREFIX_OPTION
- See Also:
- Constant Field Values
-
DEFAULT_PREFIX
public static final String DEFAULT_PREFIX
- See Also:
- Constant Field Values
-
prefix
protected String prefix
-
thresholdSize
protected int thresholdSize
-
storeTTL
protected Duration storeTTL
-
storeName
protected String storeName
-
-
Method Detail
-
storeValue
protected abstract void storeValue(String key, byte[] data)
Sets the value associated to the key.
-
fetchValue
protected abstract byte[] fetchValue(String key)
Fetches a value previously stored bystoreValue(String, byte[])
- Returns:
- the value, or
null
if there is no value
-
init
public void init(Map<String,String> options)
Description copied from interface:RecordFilter
Initialiaze the filter.- Specified by:
init
in interfaceRecordFilter
-
parseIntOrDefault
protected int parseIntOrDefault(String valueAsString, int defaultValue)
-
beforeAppend
public Record beforeAppend(Record record)
Description copied from interface:RecordFilter
Called before appending a record to a stream. This hook enables to change the record or to skip it when returning null.- Specified by:
beforeAppend
in interfaceRecordFilter
- Parameters:
record
- the record that will be appended to a stream
-
afterRead
public Record afterRead(Record record, LogOffset offset)
Description copied from interface:RecordFilter
Called after reading a record. This hook enables to change the record or to skip it when returning null.- Specified by:
afterRead
in interfaceRecordFilter
- Parameters:
record
- the recordoffset
- the offset of the record
-
getThresholdSize
public int getThresholdSize()
-
setThresholdSize
public void setThresholdSize(int thresholdSize)
-
getStoreName
public String getStoreName()
-
setStoreName
public void setStoreName(String storeName)
-
getStoreTTL
public Duration getStoreTTL()
-
setStoreTTL
public void setStoreTTL(Duration storeTTL)
-
getPrefix
public String getPrefix()
-
setPrefix
public void setPrefix(String prefix)
-
-