abstract class Cassandra::Compression::Compressor
- Abstract
- Compressors given to
Cassandra.cluster
as the:compressor
option don’t need to be subclasses of this class, but need to implement the same methods. This class exists only for documentation purposes.
Inherits
Object
Direct Known Subclasses
Methods
algorithm
Returns the name of the algorithm this compressor supports, e.g. “snappy” or “lz4”.
compress?
(frame)Before compressing a frame the compressor will be asked if it wants to compress it or not. One reason it could say no is if the frame is small enough that compression would be unlikely to decrease its size.
If your operations consist mostly of small prepared statement executions it might not be useful to compress the frames being sent to Cassandra, but enabling compression can still be useful on the frames coming from Cassandra. Making this method always return false disables request compression, but will still make the client tell Cassandra that it supports compressed frames.
The bytes given to #compress?
are the same as to #compress
compress
(frame)Compresses the raw bytes of a frame.
decompress
(compressed_frame)Decompresses the raw bytes of a compressed frame.