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
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
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionCalled after reading a 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[])
protected String
getPrefixedKey
(String recordKey) int
protected String
getUniqRecordKey
(Record record) void
Initialiaze the filter.protected int
parseIntOrDefault
(String valueAsString, int defaultValue) void
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 Details
-
STORE_NAME_OPTION
- See Also:
-
DEFAULT_STORE_NAME
- See Also:
-
STORE_TTL_OPTION
- See Also:
-
DEFAULT_STORE_TTL
- See Also:
-
THRESHOLD_SIZE_OPTION
- See Also:
-
DEFAULT_THRESHOLD_SIZE
public static final int DEFAULT_THRESHOLD_SIZE- See Also:
-
PREFIX_OPTION
- See Also:
-
DEFAULT_PREFIX
- See Also:
-
prefix
-
thresholdSize
protected int thresholdSize -
storeTTL
-
storeName
-
-
Constructor Details
-
BaseOverflowRecordFilter
public BaseOverflowRecordFilter()
-
-
Method Details
-
storeValue
Sets the value associated to the key. -
fetchValue
Fetches a value previously stored bystoreValue(String, byte[])
- Returns:
- the value, or
null
if there is no value
-
init
Description copied from interface:RecordFilter
Initialiaze the filter.- Specified by:
init
in interfaceRecordFilter
-
parseIntOrDefault
-
beforeAppend
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
-
getUniqRecordKey
-
afterRead
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
-
setStoreName
-
getStoreTTL
-
setStoreTTL
-
getPrefix
-
setPrefix
-
getPrefixedKey
-