Technology Working Group - January 11, 2016

Jason Coposky, Chief Technologist

Agenda

  • New Plugin Framework
  • Proposed move to Resource IDs
  • Proposed Deprecations

New Plugin Framework

Existing plugin framework relies on type erasure via variadic parameters in the plugin operation:

 

typedef error( *plugin_operation )( plugin_context&, ... );

 

Chosen due to limitations of current compilers and ease of integration with Legacy code.

 

Issues include a serious lack of type safety across shared object boundaries

New Plugin Framework

Given the move to clang 3.7 we now have access to modern features:

  • Store std::function in a boost::any look up table
  • Use variadic templates to maintain type saftey

 

New Plugin Framework

Adding an operation to a plugin

template<typename... types_t>
error add_operation( const std::string&                _op,
std::function<error(plugin_context&, types_t...)> _f ) {

}

 

In the plugin implementation

resc->add_operation<T0,T1,T2>(

    "operation_name",

    std::function<error(plugin_context&,T0,T1,T2)( operation_impl ) );

New Plugin Framework

Calling a Plugin Operation

template< typename... types_t >
error call(rsComm_t*           _comm,
const std::string&                  _operation_name,
irods::first_class_object_ptr _fco,

types_t...                                 _t ) {

}

 

Calling a Plugin Operation

resc->call<T0,T1,T2>( comm, "operation_name", fco, t0, t1, t2 );

Consideration of move to Resource IDs

Currently resc_hier is stored as a string in r_data_main

  • followed existing convention for resc_name
  • allows for queries
  • causes full table scan for resource hierarchy changes
  • causes full table scan for change of resource name

 

Propose to move to storing leaf resource id as an integer

  • proper abstraction - ID only changes on data move
  • allows for instant resource name change
  • allows for instance resource hierarchy manipulation
  • resource hierarchy manipulation is a major feature of the 4.x series

Consideration of move to Resource IDs

Considerations:

Requires a change in schema for r_data_main

  • add resc_id as a bigint
  • deprecate use of resource hierarchy
  • update resc_id from leaf resource id for all data objs
  • hierarchy queries available as an API call

 

Code is near complete in a feature branch


Table update may exist as a separate script ran before the new package is installed, or as part of the upgrade

  • 7.4 million rows updated in 10 minutes

Proposed deprecations

X Message - Move to use of AMQP Message Bus

 

iphybun & bundleResc - not well tested, can be implemented as a resource plugin if required by membership or the community

Technology Working Group - January 11, 2016

By jason coposky

Technology Working Group - January 11, 2016

  • 2,283