Package akka.remote.artery.compress
Class InboundCompression<T>
- java.lang.Object
-
- akka.remote.artery.compress.InboundCompression<T>
-
- Direct Known Subclasses:
InboundActorRefCompression
,InboundManifestCompression
public abstract class InboundCompression<T> extends java.lang.Object
Override and specialize if needed, for default compression logic delegate to 3-param overload
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
InboundCompression.Tables<T>
static class
InboundCompression.Tables$
-
Constructor Summary
Constructors Constructor Description InboundCompression(LoggingAdapter log, ArterySettings.Compression settings, long originUid, InboundContext inboundContext, TopHeavyHitters<T> heavyHitters)
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected abstract void
advertiseCompressionTable(OutboundContext association, CompressionTable<T> table)
Must be implemented by extending classes in order to send aControlMessage
of appropriate type to the remote system in order to advertise the compression table to it.void
confirmAdvertisement(byte tableVersion, boolean gaveUp)
abstract OptionVal<T>
decompress(byte incomingTableVersion, int idx)
Override and specialize if needed, for default compression logic delegate to 3-param overloadOptionVal<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)
Addn
occurrence for the given key and callheavyHittedDetected
if element has become a heavy hitter.static int
KeepOldTablesNumber()
LoggingAdapter
log()
long
originUid()
void
runNextTableAdvertisement()
Entry point to advertising a new compression table.ArterySettings.Compression
settings()
java.lang.String
toString()
-
-
-
Constructor Detail
-
InboundCompression
public InboundCompression(LoggingAdapter log, ArterySettings.Compression settings, long originUid, InboundContext inboundContext, TopHeavyHitters<T> heavyHitters)
-
-
Method Detail
-
KeepOldTablesNumber
public static final int KeepOldTablesNumber()
-
log
public LoggingAdapter log()
-
settings
public ArterySettings.Compression settings()
-
originUid
public long originUid()
-
heavyHitters
public TopHeavyHitters<T> heavyHitters()
-
decompress
public abstract OptionVal<T> decompress(byte incomingTableVersion, int idx)
Override and specialize if needed, for default compression logic delegate to 3-param overload
-
decompressInternal
public final OptionVal<T> decompressInternal(byte incomingTableVersion, int idx, int attemptCounter)
Decompress given identifier into its original representation. Passed in tableIds must only ever be in not-decreasing order (as old tables are dropped), tableIds must not have gaps. If an "old" tableId is received the value will fail to be decompressed.- Parameters:
incomingTableVersion
- (undocumented)idx
- (undocumented)attemptCounter
- (undocumented)- Returns:
- (undocumented)
- Throws:
UnknownCompressedIdException
- if given id is not known, this may indicate a bug – such situation should not happen.
-
confirmAdvertisement
public final void confirmAdvertisement(byte tableVersion, boolean gaveUp)
-
increment
public void increment(Address remoteAddress, T value, long n)
Addn
occurrence for the given key and callheavyHittedDetected
if element has become a heavy hitter. Empty keys are omitted.- Parameters:
remoteAddress
- (undocumented)value
- (undocumented)n
- (undocumented)
-
runNextTableAdvertisement
public void runNextTableAdvertisement()
Entry point to advertising a new compression table.[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.
-
advertiseCompressionTable
protected abstract void advertiseCompressionTable(OutboundContext association, CompressionTable<T> table)
Must be implemented by extending classes in order to send aControlMessage
of appropriate type to the remote system in order to advertise the compression table to it.- Parameters:
association
- (undocumented)table
- (undocumented)
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-