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 Details

  • Constructor Details

    • BaseOverflowRecordFilter

      public BaseOverflowRecordFilter()
  • Method Details

    • 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 by storeValue(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 interface RecordFilter
    • 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 interface RecordFilter
      Parameters:
      record - the record that will be appended to a stream
    • getUniqRecordKey

      protected String getUniqRecordKey(Record record)
    • 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 interface RecordFilter
      Parameters:
      record - the record
      offset - 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)
    • getPrefixedKey

      protected String getPrefixedKey(String recordKey)