irods  4.2.8
About: iRODS (the integrated Rule Oriented Data System) is a distributed data-management system for creating data grids, digital libraries, persistent archives, and real-time data systems.
  Fossies Dox: irods-4.2.8.tar.gz  ("unofficial" and yet experimental doxygen-generated source code documentation)  

irods::resource_manager Class Reference

#include <irods_resource_manager.hpp>

Collaboration diagram for irods::resource_manager:
[legend]

Public Types

typedef std::vector< rodsLong_tleaf_bundle_t
 
typedef lookup_table< resource_ptr >::iterator iterator
 

Public Member Functions

 resource_manager ()
 
 resource_manager (const resource_manager &)
 
virtual ~resource_manager ()
 
error resolve (std::string, resource_ptr &)
 
error resolve (rodsLong_t, resource_ptr &)
 
error validate_vault_path (std::string, rodsServerHost_t *, std::string &)
 
error init_from_catalog (rsComm_t *)
 
error shut_down_resources ()
 
error init_from_type (std::string, std::string, std::string, std::string, resource_ptr &)
 
error get_root_resources (std::vector< std::string > &)
 
error get_hier_to_root_for_resc (const std::string &, std::string &)
 
std::vector< leaf_bundle_tgather_leaf_bundles_for_resc (const std::string &_resource_name)
 
void print_local_resources ()
 
bool need_maintenance_operations ()
 
int call_maintenance_operations (rcComm_t *)
 
std::vector< std::string > get_all_resc_hierarchies (void)
 
error hier_to_leaf_id (const std::string &, rodsLong_t &)
 
error leaf_id_to_hier (const rodsLong_t &, std::string &)
 
error resc_id_to_name (const rodsLong_t &, std::string &)
 
error resc_id_to_name (const std::string &, std::string &)
 
error is_coordinating_resource (const std::string &, bool &)
 
template<typename value_type >
error resolve_from_property (std::string _prop, value_type _value, resource_ptr &_resc)
 
iterator begin ()
 
iterator end ()
 

Private Member Functions

error load_resource_plugin (resource_ptr &, const std::string, const std::string, const std::string)
 
error process_init_results (genQueryOut_t *)
 
error init_child_map (void)
 
error gather_operations (void)
 
error start_resource_plugins (void)
 
error gather_operations_recursive (const std::string &, std::vector< std::string > &, std::vector< pdmo_type > &)
 private - lower level recursive call to gather the post disconnect More...
 
error gather_leaf_bundle_for_child (const std::string &, leaf_bundle_t &)
 
error get_parent_name (resource_ptr, std::string &)
 

Private Attributes

lookup_table< resource_ptrresource_name_map_
 
lookup_table< resource_ptr, long, std::hash< long > > resource_id_map_
 
std::vector< std::vector< pdmo_type > > maintenance_operations_
 

Detailed Description

Definition at line 30 of file irods_resource_manager.hpp.

Member Typedef Documentation

◆ iterator

◆ leaf_bundle_t

Description:\n groups decedent leafs by child

Definition at line 84 of file irods_resource_manager.hpp.

Constructor & Destructor Documentation

◆ resource_manager() [1/2]

irods::resource_manager::resource_manager ( )
Description:\n constructors

Definition at line 36 of file irods_resource_manager.cpp.

◆ resource_manager() [2/2]

irods::resource_manager::resource_manager ( const resource_manager )

Definition at line 41 of file irods_resource_manager.cpp.

◆ ~resource_manager()

irods::resource_manager::~resource_manager ( )
virtual

Definition at line 46 of file irods_resource_manager.cpp.

Member Function Documentation

◆ begin()

iterator irods::resource_manager::begin ( void  )
inline

Definition at line 191 of file irods_resource_manager.hpp.

References irods::lookup_table< ValueType, KeyType, HashType >::begin(), and resource_name_map_.

Referenced by get_resource_array(), and get_server_reports().

Here is the call graph for this function:

◆ call_maintenance_operations()

int irods::resource_manager::call_maintenance_operations ( rcComm_t _comm)
Description:\n exec the pdmos ( post disconnect maintenance operations ) in order

Definition at line 1016 of file irods_resource_manager.cpp.

References irods::error::code(), irods::log(), LOG_ERROR, maintenance_operations_, irods::error::ok(), PASSMSG, rodsLog(), and SYS_INTERNAL_ERR.

Referenced by agentMain().

Here is the call graph for this function:

◆ end()

iterator irods::resource_manager::end ( void  )
inline

Definition at line 192 of file irods_resource_manager.hpp.

References irods::lookup_table< ValueType, KeyType, HashType >::end(), and resource_name_map_.

Referenced by get_resource_array(), and get_server_reports().

Here is the call graph for this function:

◆ gather_leaf_bundle_for_child()

error irods::resource_manager::gather_leaf_bundle_for_child ( const std::string &  _resc_name,
leaf_bundle_t _bundle 
)
private
Description:\n helper function for gather_leaf_bundles_for_resc

Definition at line 472 of file irods_resource_manager.cpp.

References irods::error::ok(), PASS, resolve(), irods::RESOURCE_ID(), and SUCCESS.

Referenced by gather_leaf_bundles_for_resc().

Here is the call graph for this function:

◆ gather_leaf_bundles_for_resc()

std::vector< resource_manager::leaf_bundle_t > irods::resource_manager::gather_leaf_bundles_for_resc ( const std::string &  _resource_name)

Definition at line 519 of file irods_resource_manager.cpp.

References irods::experimental::filesystem::client::begin(), irods::error::code(), irods::experimental::filesystem::client::end(), gather_leaf_bundle_for_child(), irods::error::ok(), resolve(), irods::error::result(), and THROW.

Referenced by repl_file_rebalance().

Here is the call graph for this function:

◆ gather_operations()

error irods::resource_manager::gather_operations ( void  )
private
Description:\n top level function to gather the post disconnect maintenance

Definition at line 818 of file irods_resource_manager.cpp.

References irods::lookup_table< ValueType, KeyType, HashType >::begin(), irods::lookup_table< ValueType, KeyType, HashType >::end(), gather_operations_recursive(), maintenance_operations_, generate_iadmin_commands_for_41_to_42_upgrade::name, irods::error::ok(), PASSMSG, irods::RESOURCE_CHILDREN(), irods::RESOURCE_NAME(), resource_name_map_, and SUCCESS.

Referenced by init_from_catalog().

Here is the call graph for this function:

◆ gather_operations_recursive()

error irods::resource_manager::gather_operations_recursive ( const std::string &  _children,
std::vector< std::string > &  _proc_vec,
std::vector< pdmo_type > &  _resc_ops 
)
private

private - lower level recursive call to gather the post disconnect

Description:\n lower level recursive call to gather the post disconnect

Definition at line 887 of file irods_resource_manager.cpp.

References ERROR, irods::lookup_table< ValueType, KeyType, HashType >::get(), irods::error::ok(), deploy_schemas_locally::parser, PASSMSG, irods::RESOURCE_CHILDREN(), resource_name_map_, SUCCESS, and SYS_INVALID_INPUT_PARAM.

Referenced by gather_operations().

Here is the call graph for this function:

◆ get_all_resc_hierarchies()

std::vector< std::string > irods::resource_manager::get_all_resc_hierarchies ( void  )
Description:\n construct a vector of all resource hierarchies in the system

Definition at line 1056 of file irods_resource_manager.cpp.

References irods::error::code(), leaf_id_to_hier(), irods::error::ok(), irods::RESOURCE_ID(), resource_name_map_, irods::error::result(), and THROW.

Referenced by get_resc_id_cond_for_hier_cond().

Here is the call graph for this function:

◆ get_hier_to_root_for_resc()

error irods::resource_manager::get_hier_to_root_for_resc ( const std::string &  _resc_name,
std::string &  _hierarchy 
)
Description:\n create a partial hier string for a given resource to the root

Definition at line 434 of file irods_resource_manager.cpp.

References irods::error::code(), irods::hierarchy_parser::delimiter(), get_parent_name(), HIERARCHY_ERROR, irods::error::ok(), PASS, resolve(), and SUCCESS.

Referenced by _addChildToResource(), irsPhyPathReg(), and resolve_hierarchy_for_resc_from_cond_input().

Here is the call graph for this function:

◆ get_parent_name()

error irods::resource_manager::get_parent_name ( resource_ptr  _resc,
std::string &  _name 
)
private
Description:\n given a resource name get the parent name from the id

Definition at line 386 of file irods_resource_manager.cpp.

References ERROR, HIERARCHY_ERROR, irods::error::ok(), PASS, resolve(), irods::RESOURCE_NAME(), and irods::RESOURCE_PARENT().

Referenced by get_hier_to_root_for_resc().

Here is the call graph for this function:

◆ get_root_resources()

error irods::resource_manager::get_root_resources ( std::vector< std::string > &  _list)
Description:\n create a list of resources who do not have parents ( roots )

Definition at line 358 of file irods_resource_manager.cpp.

References irods::lookup_table< ValueType, KeyType, HashType >::begin(), irods::lookup_table< ValueType, KeyType, HashType >::end(), irods::error::ok(), PASS, irods::RESOURCE_NAME(), resource_name_map_, and SUCCESS.

Here is the call graph for this function:

◆ hier_to_leaf_id()

error irods::resource_manager::hier_to_leaf_id ( const std::string &  _hier,
rodsLong_t _id 
)

◆ init_child_map()

error irods::resource_manager::init_child_map ( void  )
private
Description:\n Initialize the child map from the resources lookup table

Definition at line 738 of file irods_resource_manager.cpp.

References irods::lookup_table< ValueType, KeyType, HashType >::has_entry(), irods::log(), LOG_DEBUG, LOG_ERROR, irods::error::ok(), PASS, resource_id_map_, resource_name_map_, irods::RESOURCE_PARENT(), irods::RESOURCE_PARENT_CONTEXT(), rodsLog(), and SUCCESS.

Referenced by init_from_catalog().

Here is the call graph for this function:

◆ init_from_catalog()

◆ init_from_type()

error irods::resource_manager::init_from_type ( std::string  _type,
std::string  _key,
std::string  _inst,
std::string  _ctx,
resource_ptr _resc 
)
Description:\n load a resource plugin given a resource type

Definition at line 718 of file irods_resource_manager.cpp.

References load_resource_plugin(), irods::error::ok(), PASSMSG, resource_name_map_, and SUCCESS.

Referenced by irods::structured_object::resolve().

Here is the call graph for this function:

◆ is_coordinating_resource()

error irods::resource_manager::is_coordinating_resource ( const std::string &  _resc_name,
bool &  _ret 
)
Description:\n check whether the specified resource name is a coordinating resource

Definition at line 1229 of file irods_resource_manager.cpp.

References ERROR, irods::lookup_table< ValueType, KeyType, HashType >::has_entry(), resource_name_map_, SUCCESS, and SYS_RESC_DOES_NOT_EXIST.

Here is the call graph for this function:

◆ leaf_id_to_hier()

error irods::resource_manager::leaf_id_to_hier ( const rodsLong_t _id,
std::string &  _hier 
)

◆ load_resource_plugin()

error irods::resource_manager::load_resource_plugin ( resource_ptr _plugin,
const std::string  _plugin_name,
const std::string  _inst_name,
const std::string  _context 
)
private
Description:\n load a resource plugin from a dynamic shared object

Definition at line 94 of file irods_resource_manager.cpp.

References irods::error::code(), LOG_DEBUG, irods::error::ok(), PASS, PLUGIN_ERROR_MISSING_SHARED_OBJECT, irods::PLUGIN_TYPE_RESOURCE(), irods::error::result(), rodsLog(), and SUCCESS.

Referenced by init_from_type(), and process_init_results().

Here is the call graph for this function:

◆ need_maintenance_operations()

bool irods::resource_manager::need_maintenance_operations ( )
Description:\n determine if any pdmos need to run before doing a connection

Definition at line 990 of file irods_resource_manager.cpp.

References irods::lookup_table< ValueType, KeyType, HashType >::begin(), irods::lookup_table< ValueType, KeyType, HashType >::end(), and resource_name_map_.

Referenced by agentMain().

Here is the call graph for this function:

◆ print_local_resources()

void irods::resource_manager::print_local_resources ( )
Description:\n print the list of local resources out to stderr

Definition at line 800 of file irods_resource_manager.cpp.

References irods::lookup_table< ValueType, KeyType, HashType >::begin(), irods::lookup_table< ValueType, KeyType, HashType >::end(), LOG_NOTICE, generate_iadmin_commands_for_41_to_42_upgrade::name, irods::error::ok(), irods::RESOURCE_LOCATION(), resource_name_map_, irods::RESOURCE_PATH(), and rodsLog().

Referenced by initServer().

Here is the call graph for this function:

◆ process_init_results()

error irods::resource_manager::process_init_results ( genQueryOut_t _result)
private
Description:\n take results from genQuery, extract values and create resources

Definition at line 542 of file irods_resource_manager.cpp.

References COL_R_CLASS_NAME, COL_R_CREATE_TIME, COL_R_FREE_SPACE, COL_R_LOC, COL_R_MODIFY_TIME, COL_R_RESC_CHILDREN, COL_R_RESC_COMMENT, COL_R_RESC_CONTEXT, COL_R_RESC_ID, COL_R_RESC_INFO, COL_R_RESC_NAME, COL_R_RESC_PARENT, COL_R_RESC_PARENT_CONTEXT, COL_R_RESC_STATUS, COL_R_TYPE_NAME, COL_R_VAULT_PATH, COL_R_ZONE_NAME, irods::EMPTY_RESC_HOST(), ERROR, getSqlResultByInx(), rodsHostAddr_t::hostAddr, INT_RESC_STATUS_DOWN, INT_RESC_STATUS_UP, SqlResult::len, load_resource_plugin(), irods::log(), LOG_NOTICE, LONG_NAME_LEN, NAME_LEN, NULL, irods::error::ok(), PASS, RESC_DOWN, RESC_QUOTA_UNINIT, resolveHost(), irods::RESOURCE_CHILDREN(), irods::RESOURCE_CLASS(), irods::RESOURCE_COMMENTS(), irods::RESOURCE_CONTEXT(), irods::RESOURCE_CREATE_TS(), irods::RESOURCE_FREESPACE(), irods::RESOURCE_HOST(), irods::RESOURCE_ID(), resource_id_map_, irods::RESOURCE_INFO(), irods::RESOURCE_LOCATION(), irods::RESOURCE_MODIFY_TS(), irods::RESOURCE_NAME(), resource_name_map_, irods::RESOURCE_PARENT(), irods::RESOURCE_PARENT_CONTEXT(), irods::RESOURCE_PATH(), irods::RESOURCE_QUOTA(), irods::RESOURCE_STATUS(), irods::RESOURCE_TYPE(), irods::RESOURCE_ZONE(), rodsLog(), GenQueryOut::rowCnt, rstrcpy(), SUCCESS, SYS_INVALID_INPUT_PARAM, UNMATCHED_KEY_OR_INDEX, SqlResult::value, and rodsHostAddr_t::zoneName.

Referenced by init_from_catalog().

Here is the call graph for this function:

◆ resc_id_to_name() [1/2]

error irods::resource_manager::resc_id_to_name ( const rodsLong_t _id,
std::string &  _name 
)
Description:\n get the resc name of the resource given an id

Definition at line 1162 of file irods_resource_manager.cpp.

References ERROR, irods::lookup_table< ValueType, KeyType, HashType >::has_entry(), irods::error::ok(), PASS, resource_id_map_, irods::RESOURCE_NAME(), SUCCESS, and SYS_RESC_DOES_NOT_EXIST.

Referenced by open_for_prefer_archive_policy(), and repl_object().

Here is the call graph for this function:

◆ resc_id_to_name() [2/2]

error irods::resource_manager::resc_id_to_name ( const std::string &  _id_str,
std::string &  _name 
)
Description:\n get the resc name of the resource given an id as a string

Definition at line 1192 of file irods_resource_manager.cpp.

References ERROR, irods::lookup_table< ValueType, KeyType, HashType >::has_entry(), irods::error::ok(), PASS, resource_id_map_, irods::RESOURCE_NAME(), SUCCESS, and SYS_RESC_DOES_NOT_EXIST.

Here is the call graph for this function:

◆ resolve() [1/2]

error irods::resource_manager::resolve ( rodsLong_t  _resc_id,
resource_ptr _value 
)

Definition at line 76 of file irods_resource_manager.cpp.

References ERROR, irods::lookup_table< ValueType, KeyType, HashType >::has_entry(), resource_id_map_, SUCCESS, and SYS_RESC_DOES_NOT_EXIST.

Here is the call graph for this function:

◆ resolve() [2/2]

◆ resolve_from_property()

template<typename value_type >
error irods::resource_manager::resolve_from_property ( std::string  _prop,
value_type  _value,
resource_ptr _resc 
)
inline
Description:\n resolve a resource from a match with a given property

Definition at line 126 of file irods_resource_manager.hpp.

References irods::lookup_table< ValueType, KeyType, HashType >::begin(), irods::lookup_table< ValueType, KeyType, HashType >::empty(), irods::lookup_table< ValueType, KeyType, HashType >::end(), ERROR, NULL, irods::error::ok(), PASSMSG, resource_name_map_, SUCCESS, SYS_INVALID_INPUT_PARAM, SYS_RESC_DOES_NOT_EXIST, and get_irods_version::value.

Referenced by irods::get_host_status_by_host_info().

Here is the call graph for this function:

◆ shut_down_resources()

error irods::resource_manager::shut_down_resources ( )
Description:\n call shutdown on resources before destruction

Definition at line 341 of file irods_resource_manager.cpp.

References irods::lookup_table< ValueType, KeyType, HashType >::begin(), irods::lookup_table< ValueType, KeyType, HashType >::end(), resource_name_map_, and SUCCESS.

Here is the call graph for this function:

◆ start_resource_plugins()

error irods::resource_manager::start_resource_plugins ( void  )
private
Description:\n top level function to call the start operation on the resource

Definition at line 967 of file irods_resource_manager.cpp.

References irods::lookup_table< ValueType, KeyType, HashType >::begin(), irods::lookup_table< ValueType, KeyType, HashType >::end(), irods::log(), irods::error::ok(), resource_name_map_, and SUCCESS.

Referenced by init_from_catalog().

Here is the call graph for this function:

◆ validate_vault_path()

error irods::resource_manager::validate_vault_path ( std::string  _physical_path,
rodsServerHost_t _svr_host,
std::string &  _out_path 
)

Member Data Documentation

◆ maintenance_operations_

std::vector< std::vector< pdmo_type > > irods::resource_manager::maintenance_operations_
private

Definition at line 240 of file irods_resource_manager.hpp.

Referenced by call_maintenance_operations(), and gather_operations().

◆ resource_id_map_

lookup_table< resource_ptr, long, std::hash<long> > irods::resource_manager::resource_id_map_
private

◆ resource_name_map_


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