vg
tools for working with variation graphs
Public Member Functions | Protected Member Functions | Protected Attributes | Friends | List of all members
vg::IndexingPlan Class Reference

#include <index_registry.hpp>

Public Member Functions

 IndexingPlan ()=default
 
 ~IndexingPlan ()=default
 
string output_filepath (const IndexName &identifier) const
 Get the suffix with which to save the given index's files. More...
 
string output_filepath (const IndexName &identifier, size_t chunk, size_t num_chunks) const
 
const vector< RecipeName > & get_steps () const
 Ge the steps of the plan. More...
 
bool is_intermediate (const IndexName &identifier) const
 
const map< string, string > get_scopes (const IndexName &identifier) const
 
const map< string, string > & get_scopes (const IndexName &identifier)
 
int64_t target_memory_usage () const
 The memory limit, with a little slosh for prediction inaccuracy. More...
 
int64_t literal_target_memory_usage () const
 The memory limit with no slosh. More...
 
set< RecipeNamedependents (const IndexName &identifier) const
 

Protected Member Functions

void add_scope (const IndexName &identifier, const string &key, const string &value)
 

Protected Attributes

vector< RecipeNamesteps
 
set< IndexNametargets
 The indexes to create as outputs. More...
 
map< IndexName, map< string, string > > scopes
 
IndexRegistryregistry
 

Friends

class IndexRegistry
 

Detailed Description

A plan for producing indexes, which knows what should be saved and what should be ephemeral. Wants to be nested inside IndexRegistry, but you can't forward-declare a nested class.

Constructor & Destructor Documentation

◆ IndexingPlan()

vg::IndexingPlan::IndexingPlan ( )
default

◆ ~IndexingPlan()

vg::IndexingPlan::~IndexingPlan ( )
default

Member Function Documentation

◆ add_scope()

void vg::IndexingPlan::add_scope ( const IndexName identifier,
const string &  key,
const string &  value 
)
protected

Add a scope to the scopes the given index will be qualified with when generated, if not present already.

◆ dependents()

set< RecipeName > vg::IndexingPlan::dependents ( const IndexName identifier) const

Returns the recipes in the plan that depend on this index, including the one in which it was created (if any).

◆ get_scopes() [1/2]

const map< string, string > & vg::IndexingPlan::get_scopes ( const IndexName identifier)

Get the scopes that the given index will be qualified with when generated. Only works for indexes that will be generated by the plan, not for inputs.

◆ get_scopes() [2/2]

const map< string, string > vg::IndexingPlan::get_scopes ( const IndexName identifier) const

Get the scopes that the given index will be qualified with when generated. Only works for indexes that will be generated by the plan, not for inputs.

◆ get_steps()

const vector< RecipeName > & vg::IndexingPlan::get_steps ( ) const

Ge the steps of the plan.

◆ is_intermediate()

bool vg::IndexingPlan::is_intermediate ( const IndexName identifier) const

Returns true if the given index is to be intermediate under the given plan, and false if it is to be preserved.

◆ literal_target_memory_usage()

int64_t vg::IndexingPlan::literal_target_memory_usage ( ) const

The memory limit with no slosh.

◆ output_filepath() [1/2]

string vg::IndexingPlan::output_filepath ( const IndexName identifier) const

Get the suffix with which to save the given index's files.

◆ output_filepath() [2/2]

string vg::IndexingPlan::output_filepath ( const IndexName identifier,
size_t  chunk,
size_t  num_chunks 
) const

Get the suffix with which to save the given index's files.

The path will substitute scopes into any {wildcards} in the index's suffix, and scopes not used in the suffix will appear in the filename in key order.

The suffix used will be the first one for which all wildcards can be substituted.

◆ target_memory_usage()

int64_t vg::IndexingPlan::target_memory_usage ( ) const

The memory limit, with a little slosh for prediction inaccuracy.

Friends And Related Function Documentation

◆ IndexRegistry

friend class IndexRegistry
friend

Member Data Documentation

◆ registry

IndexRegistry* vg::IndexingPlan::registry
protected

The registry that the plan is using. The registry must not move while the plan is in use. Can't be const because we need to get_work_dir() on it, which may create the work directory.

◆ scopes

map<IndexName, map<string, string> > vg::IndexingPlan::scopes
protected

The scopes qualifying each index in the plan (for example, if an index applies only to a particular sample, it will be scoped to the sample name). Stored using an ordered map to ensure a consistent iteration order.

◆ steps

vector<RecipeName> vg::IndexingPlan::steps
protected

The steps to be invoked in the plan. May be empty before the plan is actually planned.

◆ targets

set<IndexName> vg::IndexingPlan::targets
protected

The indexes to create as outputs.


The documentation for this class was generated from the following files: