User-Defined Function API  9.0
 All Classes Functions Typedefs 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...
 
template<class T >
void  registerLexer (const char *name)
  Register a LexerUDF implementation with MarkLogic Server. More...
 
virtual void  registerLexer (const char *name, LexerFunction f)=0
  Register a LexerUDF implementation with MarkLogic Server. More...
 
template<class T >
void  registerStemmer (const char *name)
  Register a StemmerUDF implementation with MarkLogic Server. More...
 
virtual void  registerStemmer (const char *name, StemmerFunction f)=0
  Register a StemmerUDF 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
name The 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
name The name of your aggregate function. Applications will invoke your aggregate function using this name and the relative path to your installed plugin.
f The object factory function with which to allocate objects of your AggregateUDF class.
template<class T >
void marklogic::Registry::registerLexer ( const char *  name )
inline

Register a LexerUDF implementation with MarkLogic Server.

This registration step gives MarkLogic Server a handle to an instance of your LexerUDF subclass (T). Multiple instances may be constructed and stored in a pool for reuse.

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

Parameters
name The name of your lexer function. The language customization configuration will use this name with the relative path to your installed plugin to indicate that your lexer function should be used.
virtual void marklogic::Registry::registerLexer ( const char *  name,
LexerFunction  f 
)
pure virtual

Register a LexerUDF implementation with MarkLogic Server.

This registration step gives MarkLogic Server a handle to an instance of your LexerUDF subclass (T). Multiple instances may be constructed and stored in a pool for reuse.

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

Parameters
name The name of your lexer function. The language customization configuration will use this name with the relative path to your installed plugin to indicate that your lexer function should be used.
f The object factory function with which to allocate objects of your LexerUDF class.
template<class T >
void marklogic::Registry::registerStemmer ( const char *  name )
inline

Register a StemmerUDF implementation with MarkLogic Server.

This registration step gives MarkLogic Server a handle to an instance of your StemmerUDF subclass (T). Multiple instances may be constructed and stored in a pool for reuse.

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

Parameters
name The name of your stemmer function. The language customization configuration will use this name with the relative path to your installed plugin to indicate that your stemmer function should be used.
virtual void marklogic::Registry::registerStemmer ( const char *  name,
StemmerFunction  f 
)
pure virtual

Register a StemmerUDF implementation with MarkLogic Server.

This registration step gives MarkLogic Server a handle to an instance of your StemmerUDF subclass (T). Multiple instances may be constructed and stored in a pool for reuse.

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

Parameters
name The name of your stemmer function. The language customization configuration will use this name with the relative path to your installed plugin to indicate that your stemmer function should be used.
f The object factory function with which to allocate objects of your StemmerUDF 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
pluginVersion The version of your plugin library.
marklogicVersion The 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: