ckb_indexer_sync

Struct SecondaryDB

Source
pub struct SecondaryDB { /* private fields */ }
Expand description

Open DB as secondary instance with specified column families

Implementations§

Source§

impl SecondaryDB

Source

pub fn open_cf<P, I, N>( opts: &Options, path: P, cf_names: I, secondary_path: String, ) -> Self
where P: AsRef<Path>, I: IntoIterator<Item = N>, N: Into<String>,

Open a SecondaryDB

Source

pub fn get_pinned( &self, col: Col, key: &[u8], ) -> Result<Option<DBPinnableSlice<'_>>, Error>

Return the value associated with a key using RocksDB’s PinnableSlice from the given column so as to avoid unnecessary memory copy.

Source

pub fn try_catch_up_with_primary(&self) -> Result<(), Error>

Make the secondary instance catch up with the primary by tailing and replaying the MANIFEST and WAL of the primary.

Trait Implementations§

Source§

impl ChainStore for SecondaryDB

Source§

fn cache(&self) -> Option<&StoreCache>

Return cache reference
Source§

fn freezer(&self) -> Option<&Freezer>

Return freezer reference
Source§

fn get(&self, col: Col, key: &[u8]) -> Option<DBPinnableSlice<'_>>

Return the bytes associated with a key value and the given column family.
Source§

fn get_iter(&self, col: Col, mode: IteratorMode<'_>) -> DBIterator<'_>

Return an iterator over the database key-value pairs in the given column family.
Source§

fn borrow_as_data_loader(&self) -> BorrowedDataLoaderWrapper<'_, Self>

Return the borrowed data loader wrapper
Source§

fn get_block(&self, h: &Byte32) -> Option<BlockView>

Get block by block header hash
Source§

fn get_block_header(&self, hash: &Byte32) -> Option<HeaderView>

Get header by block header hash
Source§

fn get_block_body(&self, hash: &Byte32) -> Vec<TransactionView>

Get block body by block header hash
Source§

fn get_unfrozen_block(&self, hash: &Byte32) -> Option<BlockView>

Get unfrozen block from ky-store with given hash
Source§

fn get_block_txs_hashes(&self, hash: &Byte32) -> Vec<Byte32>

Get all transaction-hashes in block body by block header hash
Source§

fn get_block_proposal_txs_ids( &self, hash: &Byte32, ) -> Option<ProposalShortIdVec>

Get proposal short id by block header hash
Source§

fn get_block_uncles(&self, hash: &Byte32) -> Option<UncleBlockVecView>

Get block uncles by block header hash
Source§

fn get_block_extension(&self, hash: &Byte32) -> Option<Bytes>

Get block extension by block header hash
Source§

fn get_block_ext(&self, block_hash: &Byte32) -> Option<BlockExt>

Get block ext by block header hash Read more
Source§

fn get_block_hash(&self, number: u64) -> Option<Byte32>

Get block header hash by block number
Source§

fn get_block_number(&self, hash: &Byte32) -> Option<u64>

Get block number by block header hash
Source§

fn is_main_chain(&self, hash: &Byte32) -> bool

TODO(doc): @quake
Source§

fn get_tip_header(&self) -> Option<HeaderView>

TODO(doc): @quake
Source§

fn transaction_exists(&self, hash: &Byte32) -> bool

Returns true if the transaction confirmed in main chain. Read more
Source§

fn get_transaction(&self, hash: &Byte32) -> Option<(TransactionView, Byte32)>

Get commit transaction and block hash by its hash
Source§

fn get_transaction_info(&self, hash: &Byte32) -> Option<TransactionInfo>

TODO(doc): @quake
Source§

fn get_transaction_with_info( &self, hash: &Byte32, ) -> Option<(TransactionView, TransactionInfo)>

Gets transaction and associated info with correspond hash
Source§

fn have_cell(&self, out_point: &OutPoint) -> bool

Return whether cell is live
Source§

fn get_cell(&self, out_point: &OutPoint) -> Option<CellMeta>

Gets cell meta data with out_point
Source§

fn get_cell_data(&self, out_point: &OutPoint) -> Option<(Bytes, Byte32)>

TODO(doc): @quake
Source§

fn get_cell_data_hash(&self, out_point: &OutPoint) -> Option<Byte32>

TODO(doc): @quake
Source§

fn get_current_epoch_ext(&self) -> Option<EpochExt>

Gets current epoch ext
Source§

fn get_epoch_ext(&self, hash: &Byte32) -> Option<EpochExt>

Gets epoch ext by epoch index
Source§

fn get_epoch_index(&self, number: u64) -> Option<Byte32>

Gets epoch index by epoch number
Source§

fn get_block_epoch_index(&self, block_hash: &Byte32) -> Option<Byte32>

Gets epoch index by block hash
Source§

fn get_block_epoch(&self, hash: &Byte32) -> Option<EpochExt>

TODO(doc): @quake
Source§

fn is_uncle(&self, hash: &Byte32) -> bool

TODO(doc): @quake
Source§

fn get_uncle_header(&self, hash: &Byte32) -> Option<HeaderView>

Gets header by uncle header hash
Source§

fn block_exists(&self, hash: &Byte32) -> bool

TODO(doc): @quake
Source§

fn get_cellbase(&self, hash: &Byte32) -> Option<TransactionView>

Gets cellbase by block hash
Source§

fn get_latest_built_filter_data_block_hash(&self) -> Option<Byte32>

Gets latest built filter data block hash
Source§

fn get_block_filter(&self, hash: &Byte32) -> Option<Bytes>

Gets block filter data by block hash
Source§

fn get_block_filter_hash(&self, hash: &Byte32) -> Option<Byte32>

Gets block filter hash by block hash
Source§

fn get_packed_block(&self, hash: &Byte32) -> Option<Block>

Gets block bytes by block hash
Source§

fn get_packed_block_header(&self, hash: &Byte32) -> Option<Header>

Gets block header bytes by block hash
Source§

fn get_header_digest(&self, position_u64: u64) -> Option<HeaderDigest>

Gets a header digest.
Source§

fn get_ancestor(&self, base: &Byte32, number: u64) -> Option<HeaderView>

Gets ancestor block header by a base block hash and number
Source§

impl Clone for SecondaryDB

Source§

fn clone(&self) -> SecondaryDB

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

Auto Trait Implementations§

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> AsAny for T
where T: Any,

Source§

fn as_any(&self) -> &(dyn Any + 'static)

Cast to trait Any
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 u8)

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

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

Source§

fn __clone_box(&self, _: Private) -> *mut ()

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> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
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<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> ErasedDestructor for T
where T: 'static,

Source§

impl<T> MaybeSendSync for T