RTI Connext Java API  Version 6.1.1
CompressionSettings_t Class Reference

<<extension>> Settings related to compressing user data. More...

Inherits Struct.

Public Member Functions

 CompressionSettings_t ()
 Constructor with default values of com.rti.dds.infrastructure.CompressionSettings_t.compression_ids, com.rti.dds.infrastructure.CompressionSettings_t.writer_compression_level and com.rti.dds.infrastructure.CompressionSettings_t.writer_compression_threshold. More...
 
 CompressionSettings_t (int compression_ids, int writer_compression_level, int writer_compression_threshold)
 Constructor with the given values for the com.rti.dds.infrastructure.CompressionSettings_t.compression_ids, com.rti.dds.infrastructure.CompressionSettings_t.writer_compression_level and com.rti.dds.infrastructure.CompressionSettings_t.writer_compression_threshold. More...
 

Public Attributes

int compression_ids
 <<extension>> Mask that represents the compression algorithms enabled. More...
 
int writer_compression_level
 <<extension>> The level of compression to use when compressing data. More...
 
int writer_compression_threshold
 <<extension>> The threshold, in bytes, above which a serialized sample will be eligible to be compressed. More...
 

Static Public Attributes

static final int COMPRESSION_LEVEL_BEST_COMPRESSION = 10
 <<extension>> The best compression ratio possible for a compression algorithm. More...
 
static final int COMPRESSION_LEVEL_BEST_SPEED = 0
 <<extension>> The best compression speed possible for a compression algorithm. More...
 
static final int COMPRESSION_LEVEL_DEFAULT = COMPRESSION_LEVEL_BEST_COMPRESSION
 <<extension>> Default level of compression. More...
 

Detailed Description

<<extension>> Settings related to compressing user data.

QoS:
com.rti.dds.infrastructure.DataRepresentationQosPolicy

Constructor & Destructor Documentation

◆ CompressionSettings_t() [1/2]

◆ CompressionSettings_t() [2/2]

Member Data Documentation

◆ COMPRESSION_LEVEL_BEST_COMPRESSION

final int COMPRESSION_LEVEL_BEST_COMPRESSION = 10
static

<<extension>> The best compression ratio possible for a compression algorithm.

See also
com.rti.dds.infrastructure.CompressionSettings_t.writer_compression_level

◆ COMPRESSION_LEVEL_BEST_SPEED

final int COMPRESSION_LEVEL_BEST_SPEED = 0
static

<<extension>> The best compression speed possible for a compression algorithm.

See also
com.rti.dds.infrastructure.CompressionSettings_t.writer_compression_level

◆ COMPRESSION_LEVEL_DEFAULT

◆ compression_ids

int compression_ids

<<extension>> Mask that represents the compression algorithms enabled.

A bitmap that represents the compression algorithm IDs (com.rti.dds.infrastructure.CompressionIdMask) that are supported by the endpoint. The com.rti.dds.publication.DataWriter creation will fail if more than one algorithm is provided.

If a com.rti.dds.publication.DataWriter inherits multiple compression IDs from a com.rti.dds.topic.Topic, only the least significant bit enabled will be inherited. This forces the following order of preference: com.rti.dds.infrastructure.DDS_COMPRESSION_ID_ZLIB, com.rti.dds.infrastructure.DDS_COMPRESSION_ID_BZIP2, com.rti.dds.infrastructure.DDS_COMPRESSION_ID_LZ4.

Interactions with Security and Batching: Currently, the only algorithm that is supported when compression and batching are enabled on the same com.rti.dds.publication.DataWriter is com.rti.dds.infrastructure.DDS_COMPRESSION_ID_ZLIB.

The combination of compression, batching and data protection is not supported. Please consider using RTPS protection instead of data protection if compression and batching are required. The reason behind this restriction is that when using batching, compression is applied to the entire batch, while data protection is applied to each of the batch samples individually. Compressing already encrypted data results in an expansion of the data instead of a reduction of it because encrypted data does not lend itself to compression. Therefore this combination is not supported and will result in a DataWriter creation error.

Note: When com.rti.dds.infrastructure.DataWriterProtocolQosPolicy.serialize_key_with_dispose is enabled and a dispose message is sent, the serialized key is not compressed.

[default] For com.rti.dds.topic.Topic, com.rti.dds.publication.DataWriter a com.rti.dds.infrastructure.CompressionIdMask mask set to com.rti.dds.infrastructure.CompressionIdMaskBits.MASK_NONE

[default] For com.rti.dds.subscription.DataReader a com.rti.dds.infrastructure.CompressionIdMask mask set to com.rti.dds.infrastructure.CompressionIdMaskBits.MASK_ALL.

Referenced by CompressionSettings_t.CompressionSettings_t().

◆ writer_compression_level

int writer_compression_level

<<extension>> The level of compression to use when compressing data.

Compression algorithms typically allow you to choose a level with which to compress the data. Each level has trade-offs between the resulting compression ratio and the speed of compression.

[range] [0, 10]

The value 1 represents the fastest compression time and the lowest compression ratio. The value 10 represents the slowest compression time but the highest compression ratio.

A value of 0 disables compression.

[default] com.rti.dds.infrastructure.COMPRESSION_LEVEL_BEST_COMPRESSION

Note
Only available for a com.rti.dds.publication.DataWriter and com.rti.dds.topic.Topic.

Referenced by CompressionSettings_t.CompressionSettings_t().

◆ writer_compression_threshold

int writer_compression_threshold

<<extension>> The threshold, in bytes, above which a serialized sample will be eligible to be compressed.

Any sample with a serialized size greater than or equal to the threshold will be eligible to be compressed. All samples with an eligible serialized size will be compressed. Only if the compressed size is smaller than the serialized size will the sample be stored and sent compressed on the wire.

For batching we check the maximum serialized size of the batch, calculated as serialized_sample_max_size * com.rti.dds.infrastructure.BatchQosPolicy.max_samples

[range] [0, 2147483647] or com.rti.dds.infrastructure.ResourceLimitsQosPolicy.LENGTH_UNLIMITED

Setting the threshold to com.rti.dds.infrastructure.ResourceLimitsQosPolicy.LENGTH_UNLIMITED disables the compression.

[default] com.rti.dds.infrastructure.COMPRESSION_THRESHOLD_DEFAULT (8192)

Note
Only available for a com.rti.dds.publication.DataWriter and com.rti.dds.topic.Topic.

Referenced by CompressionSettings_t.CompressionSettings_t().