lsm

Struct Pool

source
pub struct Pool {
    pub id: String,
    pub name: String,
    pub element_type: u64,
    pub unsupported_actions: u64,
    pub total_space: u64,
    pub free_space: u64,
    pub status: u64,
    pub status_info: Option<String>,
    pub system_id: String,
    /* private fields */
}

Fields§

§id: String

Identifier.

§name: String

Human friendly name.

§element_type: u64

The type of elements this pool could create. Valid element types are:

The values are stored in bitmap:

if (p.element_type & Pool::ELEMENT_TYPE_VOLUME) == 0 {
    println!("Pool {}/{} could create volume", p.name, p.id);
}
§unsupported_actions: u64

The actions does not supported by this pool. Valid values are:

The values are stored in bitmap:

if (p.unsupported_actions & Pool::UNSUPPORTED_VOLUME_GROW) == 0 {
    println!("Pool {}/{} cannot grow size of volume", p.name, p.id);
}
§total_space: u64

Total space in bytes.

§free_space: u64

Free space in bytes.

§status: u64

Pool status stored in bitmap. Valid status value are:

if (p.status & Pool::STATUS_OK) == 0 {
    println!("Pool {}/{} is not healthy", p.name, p.id);
}
§status_info: Option<String>

Additional message for status.

§system_id: String

Identifier of owner system.

Implementations§

source§

impl Pool

source

pub const ELEMENT_TYPE_POOL: u64 = 2u64

This pool could allocate space for sub-pool.

source

pub const ELEMENT_TYPE_VOLUME: u64 = 4u64

This pool could create volume.

source

pub const ELEMENT_TYPE_FS: u64 = 8u64

This pool could create file system.

source

pub const ELEMENT_TYPE_DELTA: u64 = 16u64

This pool could hold delta data for snapshots.

source

pub const ELEMENT_TYPE_VOLUME_FULL: u64 = 32u64

This pool could create fully allocated volume.

source

pub const ELEMENT_TYPE_VOLUME_THIN: u64 = 64u64

This pool could create thin provisioned volume.

source

pub const ELEMENT_TYPE_SYS_RESERVED: u64 = 1_024u64

This pool is reserved for system internal use.

source

pub const UNSUPPORTED_VOLUME_GROW: u64 = 1u64

This pool cannot grow size of its volume.

source

pub const UNSUPPORTED_VOLUME_SHRINK: u64 = 2u64

This pool cannot shrink size of its volume.

source

pub const STATUS_UNKNOWN: u64 = 1u64

Plugin failed to query pool status.

source

pub const STATUS_OK: u64 = 2u64

The data of this pool is accessible with not data lose. But it might along with Pool::STATUS_DEGRADED to indicate redundancy lose.

source

pub const STATUS_OTHER: u64 = 4u64

Vendor specific status. The Pool.status_info property will explain the detail.

source

pub const STATUS_DEGRADED: u64 = 16u64

Pool is lost data redundancy due to I/O error or offline of one or more RAID member. Often come with Pool::STATUS_OK to indicate data is still accessible with not data lose. Example:

  • RAID 6 pool lost access to 1 disk or 2 disks.

  • RAID 5 pool lost access to 1 disk.

source

pub const STATUS_ERROR: u64 = 32u64

Pool data is not accessible due to some members offline. Example:

  • RAID 5 pool lost access to 2 disks.

  • RAID 0 pool lost access to 1 disks.

source

pub const STATUS_STOPPED: u64 = 512u64

Pool is stopping by administrator. Pool data is not accessible.

source

pub const STATUS_STARTING: u64 = 1_024u64

Pool is reviving from STOPPED status. Pool data is not accessible yet.

source

pub const STATUS_RECONSTRUCTING: u64 = 4_096u64

Pool is reconstructing the hash data or mirror data. Mostly happen when disk revive from offline or disk replaced. Pool.status_info may contain progress of this reconstruction job. Often come with Pool::STATUS_DEGRADED and Pool::STATUS_OK.

source

pub const STATUS_VERIFYING: u64 = 8_192u64

Array is running integrity check on data of current pool. It might be started by administrator or array itself. The I/O performance will be impacted. Pool.status_info may contain progress of this verification job. Often come with Pool::STATUS_OK to indicate data is still accessible.

source

pub const STATUS_INITIALIZING: u64 = 16_384u64

Pool is not accessible and performing initializing task. Often happen on newly created pool.

source

pub const STATUS_GROWING: u64 = 32_768u64

Pool is growing its size and doing internal jobs. Pool.status_info can contain progress of this growing job. Often come with Pool::STATUS_OK to indicate data is still accessible.

Trait Implementations§

source§

impl Clone for Pool

source§

fn clone(&self) -> Pool

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Pool

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<'de> Deserialize<'de> for Pool

source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
source§

impl Serialize for Pool

source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

§

impl Freeze for Pool

§

impl RefUnwindSafe for Pool

§

impl Send for Pool

§

impl Sync for Pool

§

impl Unpin for Pool

§

impl UnwindSafe for Pool

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where T: Clone,

source§

unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> ToOwned for T
where T: Clone,

source§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

source§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,