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)  

libdeferred.cpp File Reference
#include "msParam.h"
#include "generalAdmin.h"
#include "miscServerFunct.hpp"
#include "irods_resource_plugin.hpp"
#include "irods_file_object.hpp"
#include "irods_physical_object.hpp"
#include "irods_collection_object.hpp"
#include "irods_string_tokenize.hpp"
#include "irods_hierarchy_parser.hpp"
#include "irods_resource_redirect.hpp"
#include "irods_stacktrace.hpp"
#include "irods_kvp_string_parser.hpp"
#include "irods_random.hpp"
#include <iostream>
#include <sstream>
#include <vector>
#include <string>
#include <boost/lexical_cast.hpp>
#include <boost/function.hpp>
#include <boost/any.hpp>
Include dependency graph for libdeferred.cpp:

Go to the source code of this file.

Classes

class  deferred_resource
 

Functions

const std::string DEFER_POLICY_KEY ("defer_policy")
 
const std::string DEFER_POLICY_LOCALHOST ("localhost_defer_policy")
 
template<typename DEST_TYPE >
irods::error deferred_check_params (irods::plugin_context &_ctx)
 
irods::error get_next_child_in_hier (const std::string &_name, const std::string &_hier, irods::plugin_property_map &_props, irods::resource_ptr &_resc)
 
template<typename DEST_TYPE >
irods::error deferred_get_resc_for_call (irods::plugin_context &_ctx, irods::resource_ptr &_resc)
 
irods::error deferred_start_operation (irods::plugin_property_map &, irods::resource_child_map &)
 
irods::error deferred_get_next_child_resource (irods::resource_child_map &_cmap, std::string &_next_child)
 
irods::error deferred_file_create (irods::plugin_context &_ctx)
 
irods::error deferred_file_open (irods::plugin_context &_ctx)
 
irods::error deferred_file_read (irods::plugin_context &_ctx, void *_buf, int _len)
 
irods::error deferred_file_write (irods::plugin_context &_ctx, void *_buf, int _len)
 
irods::error deferred_file_close (irods::plugin_context &_ctx)
 
irods::error deferred_file_unlink (irods::plugin_context &_ctx)
 
irods::error deferred_file_stat (irods::plugin_context &_ctx, struct stat *_statbuf)
 
irods::error deferred_file_lseek (irods::plugin_context &_ctx, long long _offset, int _whence)
 
irods::error deferred_file_mkdir (irods::plugin_context &_ctx)
 
irods::error deferred_file_rmdir (irods::plugin_context &_ctx)
 
irods::error deferred_file_opendir (irods::plugin_context &_ctx)
 
irods::error deferred_file_closedir (irods::plugin_context &_ctx)
 
irods::error deferred_file_readdir (irods::plugin_context &_ctx, struct rodsDirent **_dirent_ptr)
 
irods::error deferred_file_rename (irods::plugin_context &_ctx, const char *_new_file_name)
 
irods::error deferred_file_truncate (irods::plugin_context &_ctx)
 
irods::error deferred_file_getfs_freespace (irods::plugin_context &_ctx)
 
irods::error deferred_file_stage_to_cache (irods::plugin_context &_ctx, const char *_cache_file_name)
 
irods::error deferred_file_sync_to_arch (irods::plugin_context &_ctx, const char *_cache_file_name)
 
irods::error deferred_file_registered (irods::plugin_context &_ctx)
 
irods::error deferred_file_unregistered (irods::plugin_context &_ctx)
 
irods::error deferred_file_modified (irods::plugin_context &_ctx)
 
irods::error deferred_file_notify (irods::plugin_context &_ctx, const std::string *_opr)
 
irods::error deferred_redirect_for_operation (irods::plugin_context &_ctx, const std::string *_opr, const std::string *_curr_host, irods::hierarchy_parser *_out_parser, float *_out_vote)
 
irods::error deferred_file_resolve_hierarchy (irods::plugin_context &_ctx, const std::string *_opr, const std::string *_curr_host, irods::hierarchy_parser *_out_parser, float *_out_vote)
 
irods::error deferred_file_rebalance (irods::plugin_context &_ctx)
 
irods::resourceplugin_factory (const std::string &_inst_name, const std::string &_context)
 

Function Documentation

◆ DEFER_POLICY_KEY()

const std::string DEFER_POLICY_KEY ( "defer_policy"  )

=-=-=-=-=-=-=-

Description:\n Key to deferral policy requested

Referenced by deferred_resource::deferred_resource().

◆ DEFER_POLICY_LOCALHOST()

const std::string DEFER_POLICY_LOCALHOST ( "localhost_defer_policy"  )

=-=-=-=-=-=-=-

Description:\n string specifiying the prefer localhost deferral policy

Referenced by deferred_resource::deferred_resource().

◆ deferred_check_params()

template<typename DEST_TYPE >
irods::error deferred_check_params ( irods::plugin_context _ctx)
inline

=-=-=-=-=-=-=-

Description:\n Check the general parameters passed in to most plugin functions

Definition at line 43 of file libdeferred.cpp.

References ASSERT_PASS, SUCCESS, and irods::plugin_context::valid().

Here is the call graph for this function:

◆ deferred_file_close()

irods::error deferred_file_close ( irods::plugin_context _ctx)

=-=-=-=-=-=-=-

Description:\n interface for POSIX Close

Definition at line 279 of file libdeferred.cpp.

References ASSERT_PASS, irods::plugin_context::comm(), irods::plugin_context::fco(), irods::RESOURCE_OP_CLOSE(), and SUCCESS.

Referenced by plugin_factory().

Here is the call graph for this function:

◆ deferred_file_closedir()

irods::error deferred_file_closedir ( irods::plugin_context _ctx)
Description:\n interface for POSIX closedir

Definition at line 429 of file libdeferred.cpp.

References ASSERT_PASS, irods::plugin_context::comm(), irods::plugin_context::fco(), irods::RESOURCE_OP_CLOSEDIR(), and SUCCESS.

Referenced by plugin_factory().

Here is the call graph for this function:

◆ deferred_file_create()

irods::error deferred_file_create ( irods::plugin_context _ctx)

=-=-=-=-=-=-=-

Description:\n interface for POSIX create

Definition at line 190 of file libdeferred.cpp.

References ASSERT_PASS, irods::plugin_context::comm(), irods::plugin_context::fco(), irods::RESOURCE_OP_CREATE(), and SUCCESS.

Referenced by plugin_factory().

Here is the call graph for this function:

◆ deferred_file_getfs_freespace()

irods::error deferred_file_getfs_freespace ( irods::plugin_context _ctx)

=-=-=-=-=-=-=-

Description:\n interface to determine free space on a device given a path

Definition at line 515 of file libdeferred.cpp.

References ASSERT_PASS, irods::plugin_context::comm(), irods::plugin_context::fco(), irods::RESOURCE_OP_FREESPACE(), and SUCCESS.

Referenced by plugin_factory().

Here is the call graph for this function:

◆ deferred_file_lseek()

irods::error deferred_file_lseek ( irods::plugin_context _ctx,
long long  _offset,
int  _whence 
)

=-=-=-=-=-=-=-

Description:\n interface for POSIX lseek

Definition at line 343 of file libdeferred.cpp.

References ASSERT_PASS, irods::plugin_context::comm(), irods::plugin_context::fco(), irods.pypyodbc::long, irods::RESOURCE_OP_LSEEK(), and SUCCESS.

Referenced by plugin_factory().

Here is the call graph for this function:

◆ deferred_file_mkdir()

irods::error deferred_file_mkdir ( irods::plugin_context _ctx)

=-=-=-=-=-=-=-

Description:\n interface for POSIX mkdir

Definition at line 366 of file libdeferred.cpp.

References ASSERT_PASS, irods::plugin_context::comm(), irods::plugin_context::fco(), irods::RESOURCE_OP_MKDIR(), and SUCCESS.

Referenced by plugin_factory().

Here is the call graph for this function:

◆ deferred_file_modified()

irods::error deferred_file_modified ( irods::plugin_context _ctx)

=-=-=-=-=-=-=-

Description:\n interface to notify of a file modification

Definition at line 624 of file libdeferred.cpp.

References ASSERT_PASS, irods::plugin_context::comm(), irods::plugin_context::fco(), irods::RESOURCE_OP_MODIFIED(), and SUCCESS.

Referenced by plugin_factory().

Here is the call graph for this function:

◆ deferred_file_notify()

irods::error deferred_file_notify ( irods::plugin_context _ctx,
const std::string *  _opr 
)

=-=-=-=-=-=-=-

Description:\n interface to notify a resource of an operation

Definition at line 645 of file libdeferred.cpp.

References ASSERT_PASS, irods::plugin_context::comm(), irods::plugin_context::fco(), irods::RESOURCE_OP_NOTIFY(), and SUCCESS.

Referenced by plugin_factory().

Here is the call graph for this function:

◆ deferred_file_open()

irods::error deferred_file_open ( irods::plugin_context _ctx)

Definition at line 211 of file libdeferred.cpp.

References ASSERT_PASS, irods::plugin_context::comm(), irods::plugin_context::fco(), irods::RESOURCE_OP_OPEN(), and SUCCESS.

Referenced by plugin_factory().

Here is the call graph for this function:

◆ deferred_file_opendir()

irods::error deferred_file_opendir ( irods::plugin_context _ctx)

=-=-=-=-=-=-=-

Description:\n interface for POSIX opendir

Definition at line 408 of file libdeferred.cpp.

References ASSERT_PASS, irods::plugin_context::comm(), irods::plugin_context::fco(), irods::RESOURCE_OP_OPENDIR(), and SUCCESS.

Referenced by plugin_factory().

Here is the call graph for this function:

◆ deferred_file_read()

irods::error deferred_file_read ( irods::plugin_context _ctx,
void *  _buf,
int  _len 
)

=-=-=-=-=-=-=-

Description:\n interface for POSIX Read

Definition at line 232 of file libdeferred.cpp.

References ASSERT_PASS, irods::plugin_context::comm(), irods::plugin_context::fco(), irods::RESOURCE_OP_READ(), and SUCCESS.

Referenced by plugin_factory().

Here is the call graph for this function:

◆ deferred_file_readdir()

irods::error deferred_file_readdir ( irods::plugin_context _ctx,
struct rodsDirent **  _dirent_ptr 
)

=-=-=-=-=-=-=-

Description:\n interface for POSIX readdir

Definition at line 450 of file libdeferred.cpp.

References ASSERT_PASS, irods::plugin_context::comm(), irods::plugin_context::fco(), irods::RESOURCE_OP_READDIR(), and SUCCESS.

Referenced by plugin_factory().

Here is the call graph for this function:

◆ deferred_file_rebalance()

◆ deferred_file_registered()

irods::error deferred_file_registered ( irods::plugin_context _ctx)

=-=-=-=-=-=-=-

Description:\n interface to notify of a file registration

Definition at line 582 of file libdeferred.cpp.

References ASSERT_PASS, irods::plugin_context::comm(), irods::plugin_context::fco(), irods::RESOURCE_OP_REGISTERED(), and SUCCESS.

Referenced by plugin_factory().

Here is the call graph for this function:

◆ deferred_file_rename()

irods::error deferred_file_rename ( irods::plugin_context _ctx,
const char *  _new_file_name 
)

=-=-=-=-=-=-=-

Description:\n interface for POSIX rename

Definition at line 472 of file libdeferred.cpp.

References ASSERT_PASS, irods::plugin_context::comm(), irods::plugin_context::fco(), irods::RESOURCE_OP_RENAME(), and SUCCESS.

Referenced by plugin_factory().

Here is the call graph for this function:

◆ deferred_file_resolve_hierarchy()

irods::error deferred_file_resolve_hierarchy ( irods::plugin_context _ctx,
const std::string *  _opr,
const std::string *  _curr_host,
irods::hierarchy_parser _out_parser,
float *  _out_vote 
)

=-=-=-=-=-=-=-

Description:\n used to allow the resource to determine which host
should provide the requested operation

Definition at line 769 of file libdeferred.cpp.

References irods::hierarchy_parser::add_child(), irods::CREATE_OPERATION(), deferred_redirect_for_operation(), ERROR, irods::lookup_table< ValueType, KeyType, HashType >::get(), INVALID_OPERATION, generate_iadmin_commands_for_41_to_42_upgrade::name, NULL, irods::error::ok(), irods::OPEN_OPERATION(), PASSMSG, irods::plugin_context::prop_map(), irods::RESOURCE_NAME(), SYS_INVALID_INPUT_PARAM, irods::UNLINK_OPERATION(), and irods::WRITE_OPERATION().

Referenced by plugin_factory().

Here is the call graph for this function:

◆ deferred_file_rmdir()

irods::error deferred_file_rmdir ( irods::plugin_context _ctx)

=-=-=-=-=-=-=-

Description:\n interface for POSIX rmdir

Definition at line 387 of file libdeferred.cpp.

References ASSERT_PASS, irods::plugin_context::comm(), irods::plugin_context::fco(), irods::RESOURCE_OP_RMDIR(), and SUCCESS.

Referenced by plugin_factory().

Here is the call graph for this function:

◆ deferred_file_stage_to_cache()

irods::error deferred_file_stage_to_cache ( irods::plugin_context _ctx,
const char *  _cache_file_name 
)

=-=-=-=-=-=-=-

Description:\n This routine copys data from the archive resource to the cache resource
in a compound resource composition

Definition at line 537 of file libdeferred.cpp.

References ASSERT_PASS, irods::plugin_context::comm(), irods::plugin_context::fco(), irods::RESOURCE_OP_STAGETOCACHE(), and SUCCESS.

Referenced by plugin_factory().

Here is the call graph for this function:

◆ deferred_file_stat()

irods::error deferred_file_stat ( irods::plugin_context _ctx,
struct stat *  _statbuf 
)

=-=-=-=-=-=-=-

Description:\n interface for POSIX Stat

Definition at line 321 of file libdeferred.cpp.

References ASSERT_PASS, irods::plugin_context::comm(), irods::plugin_context::fco(), irods::RESOURCE_OP_STAT(), and SUCCESS.

Referenced by plugin_factory().

Here is the call graph for this function:

◆ deferred_file_sync_to_arch()

irods::error deferred_file_sync_to_arch ( irods::plugin_context _ctx,
const char *  _cache_file_name 
)

=-=-=-=-=-=-=-

Description:\n This routine is for testing the TEST_STAGE_FILE_TYPE.
Just copy the file from cacheFilename to filename. optionalInfo info is not used.

Definition at line 560 of file libdeferred.cpp.

References ASSERT_PASS, irods::plugin_context::comm(), irods::plugin_context::fco(), irods::RESOURCE_OP_SYNCTOARCH(), and SUCCESS.

Referenced by plugin_factory().

Here is the call graph for this function:

◆ deferred_file_truncate()

irods::error deferred_file_truncate ( irods::plugin_context _ctx)

=-=-=-=-=-=-=-

Description:\n interface to determine free space on a device given a path

Definition at line 494 of file libdeferred.cpp.

References ASSERT_PASS, irods::plugin_context::comm(), irods::plugin_context::fco(), irods::RESOURCE_OP_TRUNCATE(), and SUCCESS.

Referenced by plugin_factory().

Here is the call graph for this function:

◆ deferred_file_unlink()

irods::error deferred_file_unlink ( irods::plugin_context _ctx)

=-=-=-=-=-=-=-

Description:\n interface for POSIX Unlink

Definition at line 300 of file libdeferred.cpp.

References ASSERT_PASS, irods::plugin_context::comm(), irods::plugin_context::fco(), irods::RESOURCE_OP_UNLINK(), and SUCCESS.

Referenced by plugin_factory().

Here is the call graph for this function:

◆ deferred_file_unregistered()

irods::error deferred_file_unregistered ( irods::plugin_context _ctx)

=-=-=-=-=-=-=-

Description:\n interface to notify of a file unregistration

Definition at line 603 of file libdeferred.cpp.

References ASSERT_PASS, irods::plugin_context::comm(), irods::plugin_context::fco(), irods::RESOURCE_OP_UNREGISTERED(), and SUCCESS.

Referenced by plugin_factory().

Here is the call graph for this function:

◆ deferred_file_write()

irods::error deferred_file_write ( irods::plugin_context _ctx,
void *  _buf,
int  _len 
)

=-=-=-=-=-=-=-

Description:\n interface for POSIX Write

Definition at line 256 of file libdeferred.cpp.

References ASSERT_PASS, irods::plugin_context::comm(), irods::plugin_context::fco(), irods::RESOURCE_OP_WRITE(), and SUCCESS.

Referenced by plugin_factory().

Here is the call graph for this function:

◆ deferred_get_next_child_resource()

irods::error deferred_get_next_child_resource ( irods::resource_child_map _cmap,
std::string &  _next_child 
)

=-=-=-=-=-=-=-

Description:\n given the property map the properties next_child and child_vector,
select the next property in the vector to be tapped as the RR resc

Definition at line 147 of file libdeferred.cpp.

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

Here is the call graph for this function:

◆ deferred_get_resc_for_call()

template<typename DEST_TYPE >
irods::error deferred_get_resc_for_call ( irods::plugin_context _ctx,
irods::resource_ptr _resc 
)
Description:\n get the resource for the child in the hierarchy
to pass on the call

Definition at line 103 of file libdeferred.cpp.

References ASSERT_PASS, irods::plugin_context::fco(), irods::lookup_table< ValueType, KeyType, HashType >::get(), get_next_child_in_hier(), generate_iadmin_commands_for_41_to_42_upgrade::name, irods::plugin_context::prop_map(), irods::RESOURCE_NAME(), and SUCCESS.

Here is the call graph for this function:

◆ deferred_redirect_for_operation()

◆ deferred_start_operation()

irods::error deferred_start_operation ( irods::plugin_property_map ,
irods::resource_child_map  
)
Description:\n Start Up Operation - initialize the deferred number generator

Definition at line 137 of file libdeferred.cpp.

References SUCCESS.

◆ get_next_child_in_hier()

irods::error get_next_child_in_hier ( const std::string &  _name,
const std::string &  _hier,
irods::plugin_property_map _props,
irods::resource_ptr _resc 
)

=-=-=-=-=-=-=-

Description:\n get the next resource shared pointer given this resources name
as well as the object's hierarchy string

Definition at line 59 of file libdeferred.cpp.

References ASSERT_ERROR, ASSERT_PASS, CHILD_NOT_FOUND, irods::lookup_table< ValueType, KeyType, HashType >::get(), irods::lookup_table< ValueType, KeyType, HashType >::has_entry(), irods.six::next, irods::RESC_CHILD_MAP_PROP(), and SUCCESS.

Referenced by deferred_get_resc_for_call().

Here is the call graph for this function:

◆ plugin_factory()

irods::resource* plugin_factory ( const std::string &  _inst_name,
const std::string &  _context 
)

Definition at line 911 of file libdeferred.cpp.

References irods::plugin_base::add_operation(), deferred_file_close(), deferred_file_closedir(), deferred_file_create(), deferred_file_getfs_freespace(), deferred_file_lseek(), deferred_file_mkdir(), deferred_file_modified(), deferred_file_notify(), deferred_file_open(), deferred_file_opendir(), deferred_file_read(), deferred_file_readdir(), deferred_file_rebalance(), deferred_file_registered(), deferred_file_rename(), deferred_file_resolve_hierarchy(), deferred_file_rmdir(), deferred_file_stage_to_cache(), deferred_file_stat(), deferred_file_sync_to_arch(), deferred_file_truncate(), deferred_file_unlink(), deferred_file_unregistered(), deferred_file_write(), error, irods.pypyodbc::long, irods::RESOURCE_CHECK_PATH_PERM(), irods::RESOURCE_CREATE_PATH(), irods::RESOURCE_OP_CLOSE(), irods::RESOURCE_OP_CLOSEDIR(), irods::RESOURCE_OP_CREATE(), irods::RESOURCE_OP_FREESPACE(), irods::RESOURCE_OP_LSEEK(), irods::RESOURCE_OP_MKDIR(), irods::RESOURCE_OP_MODIFIED(), irods::RESOURCE_OP_NOTIFY(), irods::RESOURCE_OP_OPEN(), irods::RESOURCE_OP_OPENDIR(), irods::RESOURCE_OP_READ(), irods::RESOURCE_OP_READDIR(), irods::RESOURCE_OP_REBALANCE(), irods::RESOURCE_OP_REGISTERED(), irods::RESOURCE_OP_RENAME(), irods::RESOURCE_OP_RESOLVE_RESC_HIER(), irods::RESOURCE_OP_RMDIR(), irods::RESOURCE_OP_STAGETOCACHE(), irods::RESOURCE_OP_STAT(), irods::RESOURCE_OP_SYNCTOARCH(), irods::RESOURCE_OP_TRUNCATE(), irods::RESOURCE_OP_UNLINK(), irods::RESOURCE_OP_UNREGISTERED(), irods::RESOURCE_OP_WRITE(), and irods::plugin_base::set_property().

Here is the call graph for this function: