MCPcopy Index your code
hub / github.com/saltstack/salt / _read_slot_pointer

Method _read_slot_pointer

salt/utils/mmap_cache.py:955–963  ·  view source on GitHub ↗

Return (heap_offset, length, mtime_ns) from a data slot.

(self, offset)

Source from the content-addressed store, hash-verified

953 return raw[:null_pos] if null_pos != -1 else raw
954
955 def _read_slot_pointer(self, offset):
956 """Return (heap_offset, length, mtime_ns) from a data slot."""
957 base = offset + self._offset_off
958 heap_offset = struct.unpack_from(_OFFSET_FMT, self._mm, base)[0]
959 length = struct.unpack_from(_LENGTH_FMT, self._mm, base + _OFFSET_SIZE)[0]
960 mtime_ns = struct.unpack_from(
961 _MTIME_FMT, self._mm, base + _OFFSET_SIZE + _LENGTH_SIZE
962 )[0]
963 return heap_offset, length, mtime_ns
964
965 def _write_slot(self, offset, key_bytes, heap_offset, length, mtime_ns):
966 """Write key + pointer fields into a data slot (does NOT set STATUS)."""

Callers 5

putMethod · 0.95
getMethod · 0.95
get_mtimeMethod · 0.95
list_itemsMethod · 0.95
get_statsMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected