MCPcopy Create free account
hub / github.com/apache/cassandra-python-driver / SegmentHeader

Class SegmentHeader

cassandra/segment.py:61–79  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

59
60
61class SegmentHeader(object):
62
63 payload_length = None
64 uncompressed_payload_length = None
65 is_self_contained = None
66
67 def __init__(self, payload_length, uncompressed_payload_length, is_self_contained):
68 self.payload_length = payload_length
69 self.uncompressed_payload_length = uncompressed_payload_length
70 self.is_self_contained = is_self_contained
71
72 @property
73 def segment_length(self):
74 """
75 Return the total length of the segment, including the CRC.
76 """
77 hl = SegmentCodec.UNCOMPRESSED_HEADER_LENGTH if self.uncompressed_payload_length < 1 \
78 else SegmentCodec.COMPRESSED_HEADER_LENGTH
79 return hl + CRC24_LENGTH + self.payload_length + CRC32_LENGTH
80
81
82class Segment(object):

Callers 1

decode_headerMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected