User-Defined Function API  6.0-6
 All Classes Functions Enumerations Enumerator
marklogic::Registry Class Referenceabstract

The MarkLogic Server native plugin registry. More...

#include <MarkLogic.h>

Public Member Functions

void version (unsigned pluginVersion=makeVersion(__DATE__, __TIME__), unsigned marklogicVersion=MARKLOGIC_API_VERSION)
 Register the version of your plugin library and the version of the MarkLogic Server Native Plugin API with which your plugin is compatible. More...
 
template<class T >
void registerAggregate (const char *name)
 Register an AggregateUDF implementation with MarkLogic Server. More...
 
virtual void registerAggregate (const char *name, AggregateFunction f)=0
 Register an AggregateUDF implementation with MarkLogic Server. More...
 

Protected Attributes

unsigned pluginVersion
 

Detailed Description

The MarkLogic Server native plugin registry.

You do not need to implement a subclass of this class.

MarkLogic server uses this interface to register and track native plugins. Your native plugin library must implement an extern "C" function called marklogicPlugin with the interface shown below. Your marklogicPlugin function must register the version of your plugin library and any interfaces exported by the library, such as an implementation of AggregateUDF. For example:

extern "C" void marklogicPlugin(Registry& r)
{
r.version();
r.registerAggregate<MyFirstAggregate>("first");
r.registerAggregate("second", &mySecondAggregateFactory);
}

For more information, see "Registering a Native Plugin at Runtime" in the Application Developer's Guide.

Member Function Documentation

template<class T >
void marklogic::Registry::registerAggregate ( const char *  name)
inline

Register an AggregateUDF implementation with MarkLogic Server.

This registration step gives MarkLogic Server a handle to a master object of your AggregateUDF subclass (T). The master object is used to clone additional objects to execute a MapReduce job and the map and reduce tasks within the job whenever your aggregate function is invoked.

Use this registration method to use the default object factory, which uses the default allocator and your AggregateUDF subclass default constructor.

Parameters
nameThe name of your aggregate function. Applications will invoke your aggregate function using this name and the relative path to your installed plugin.
virtual void marklogic::Registry::registerAggregate ( const char *  name,
AggregateFunction  f 
)
pure virtual

Register an AggregateUDF implementation with MarkLogic Server.

This registration step gives MarkLogic Server a handle to a master object of your AggregateUDF subclass (T). The master object is used to clone additional objects to execute a MapReduce job and the map and reduce tasks within the job whenever your aggregate function is invoked.

Use this registration method to supply a custom object factory function when using a custom allocator and/or constructor for your Aggregate UDF subclass. The object allocated by your factory functionn must persist until its close() method is called.

Parameters
nameThe name of your aggregate function. Applications will invoke your aggregate function using this name and the relative path to your installed plugin.
fThe object factory function with which to allocate objects of your AggregateUDF class.
void marklogic::Registry::version ( unsigned  pluginVersion = makeVersion(__DATE__, __TIME__),
unsigned  marklogicVersion = MARKLOGIC_API_VERSION 
)

Register the version of your plugin library and the version of the MarkLogic Server Native Plugin API with which your plugin is compatible.

By default, a plugin version is created for you from DATE and TIME. This version is used to detect when the hosts in a MarkLogic Server cluster are out of synch with respect to your plugin.

You should not supply a value for the MarkLogic API version other than the default (MARKLOGIC_API_VERSION).

Parameters
pluginVersionThe version of your plugin library.
marklogicVersionThe version of the MarkLogic Server Native Plugin API against which your plugin is compiled.

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