public abstract class InboundCompression<T>
extends java.lang.Object
Access to this class must be externally synchronised (e.g. by accessing it from only Actors or a GraphStage etc).
Modifier and Type | Class and Description |
---|---|
static class |
InboundCompression.State<T> |
static class |
InboundCompression.State$ |
Constructor and Description |
---|
InboundCompression(LoggingAdapter log,
ArterySettings.Compression settings,
long originUid,
InboundContext inboundContext,
TopHeavyHitters<T> heavyHitters) |
Modifier and Type | Method and Description |
---|---|
protected abstract void |
advertiseCompressionTable(OutboundContext association,
CompressionTable<T> table)
Must be implemented by extending classes in order to send a
ControlMessage
of appropriate type to the remote system in order to advertise the compression table to it. |
void |
confirmAdvertisement(byte tableVersion) |
abstract OptionVal<T> |
decompress(byte incomingTableVersion,
int idx)
Override and specialize if needed, for default compression logic delegate to 3-param overload
|
OptionVal<T> |
decompressInternal(byte incomingTableVersion,
int idx,
int attemptCounter)
Decompress given identifier into its original representation.
|
TopHeavyHitters<T> |
heavyHitters() |
void |
increment(Address remoteAddress,
T value,
long n)
Add
n occurrence for the given key and call heavyHittedDetected if element has become a heavy hitter. |
LoggingAdapter |
log() |
void |
runNextTableAdvertisement()
Entry point to advertising a new compression table.
|
ArterySettings.Compression |
settings() |
java.lang.String |
toString() |
public InboundCompression(LoggingAdapter log, ArterySettings.Compression settings, long originUid, InboundContext inboundContext, TopHeavyHitters<T> heavyHitters)
public LoggingAdapter log()
public ArterySettings.Compression settings()
public TopHeavyHitters<T> heavyHitters()
public abstract OptionVal<T> decompress(byte incomingTableVersion, int idx)
public final OptionVal<T> decompressInternal(byte incomingTableVersion, int idx, int attemptCounter)
incomingTableVersion
- (undocumented)idx
- (undocumented)attemptCounter
- (undocumented)UnknownCompressedIdException
- if given id is not known, this may indicate a bug – such situation should not happen.public final void confirmAdvertisement(byte tableVersion)
public void increment(Address remoteAddress, T value, long n)
n
occurrence for the given key and call heavyHittedDetected
if element has become a heavy hitter.
Empty keys are omitted.remoteAddress
- (undocumented)value
- (undocumented)n
- (undocumented)public void runNextTableAdvertisement()
[1] First we must *hand the new table over to the Incoming compression side on this system*, so it will not be used by someone else before "we" know about it in the Decoder. [2] Then the table must be *advertised to the remote system*, and MAY start using it immediately
It must be advertised to the other side so it can start using it in its outgoing compression. Triggers compression table advertisement. May be triggered by schedule or manually, i.e. for testing.
protected abstract void advertiseCompressionTable(OutboundContext association, CompressionTable<T> table)
ControlMessage
of appropriate type to the remote system in order to advertise the compression table to it.association
- (undocumented)table
- (undocumented)public java.lang.String toString()
toString
in class java.lang.Object