Viewing File: /opt/cloudlinux/venv/lib/python3.11/site-packages/lvestats/lib/__pycache__/snapshot.cpython-311.pyc
�
5J�i� � � � d dl Z d dlZd dlZd dlZd dlZd dlZd dlZd dlmZ d dl m
Z
d dlmZ dZ
dZ ee� � Z G d� d� � Ze
d efd
�� � ZdS )� N)�Iterator)�contextmanager)�BinaryIOz/var/lve/snapshotsz .snapshotc � � e Zd ZdZd dededdfd�Zdedefd �Ze d
� � � Z
deddfd�Zdee fd�Z
d
edz dedz dee fd�Zd
edz dedz dee fd�Zdedefd�Zdefd�Zdefd�Zdedefd�Zdedefd�Zdeddfd�Ze dededz fd�� � Ze d!dee d
edz dedz dee fd�� � Ze dedefd�� � ZdS )"�Snapshotaj
Class responsible for loading and saving snapshot files for the interval.
The files will be saved in a format of: `/var/lve/snapshots/[uid]/dump_time.snapshot`
dump_time is the timestamp/integer.
The directories `/var/lve/snapshots/[uid]` and the dump files themselves will be owned by user.
They will not be readable by other users.
� �incident�
compresslevel�returnNc �T � || _ || _ t j d� � | _ d S )Nzlib-snapshot)r
r �logging� getLogger�log)�selfr r
s ��/builddir/build/BUILDROOT/lve-stats-4.2.14-2.el8.x86_64/opt/cloudlinux/venv/lib/python3.11/site-packages/lvestats/lib/snapshot.py�__init__zSnapshot.__init__# s'