Okay that is a shame. I appreciate that internal and external APIs should 
always be decoupled, but I was just trying to look for an interim solution 
until you have an external API published. Thanks for your suggestion, but the 
use of a HTTP bridge here would incur a performance overhead which would remove 
the reason for doing this work, so that is not an option in this instance.

Is the creation of an external API for non-aggregate UDF in the roadmap?

Cheers Adam.

-----Original Message-----
From: [email protected] 
[mailto:[email protected]] On Behalf Of John Snelson
Sent: 12 June 2014 12:26
To: MarkLogic Developer Discussion
Subject: Re: [MarkLogic Dev General] Non-Aggregate UDF

On Linux that would be way too complicated - the external APIs are quite 
different from the internal APIs (which is good practice BTW), and the internal 
APIs have much too broad a surface area. On Windows it's flat out not possible, 
as the MarkLogic executable doesn't export symbols for the internal APIs.

Another way that people often do this is via an HTTP call to REST endpoint 
running locally which performs the desired action. As far as I know HTTP to 
localhost is an optimized path on most OSs these days.

John

On 12/06/14 12:17, Retter, Adam (RBI-UK) wrote:
> Is there any way that I can do this using the internal API? And would you be 
> willing to provide me with the minimum documentation to do this. I assume 
> that I just need to extend a specific class and place my library onto a 
> system load path somewhere? If you could share the .hpp file for the internal 
> module base class that could be enough perhaps? p.s. It has been sometime 
> since I have done C++ so my terminology may be way off!
>
>
>
> -----Original Message-----
> From: [email protected] 
> [mailto:[email protected]] On Behalf Of John 
> Snelson
> Sent: 12 June 2014 12:14
> To: MarkLogic Developer Discussion
> Subject: Re: [MarkLogic Dev General] Non-Aggregate UDF
>
> Hi Adam,
>
> The short answer is that you can't - we haven't written an external 
> API for that yet. The longer answer is that you can kind of twist the 
> aggregate UDF API to do that by just having blank map and reduce 
> methods
> - but obviously you'll pay the cost of visiting the D-nodes each time they 
> get called.
>
> John
>
> On 12/06/14 10:00, Retter, Adam (RBI-UK) wrote:
>> Hi there,
>>
>> I would like to create some extension functions in C++. I believe 
>> that you call these UDF (User Defined Functions), however I can only 
>> seem to find documentation for creating Aggregate UDF functions. In 
>> this instance I am not interested in the content of the database, 
>> indexes or map-reduce, rather I want to create a set of XQuery 
>> functions that bridge to an external system, this bridge needs to use 
>> a proprietary communications protocol.
>>
>> Can someone please point me to the documentation on how to create 
>> non-Agrregate UDF functions?
>>
>> Cheers Adam.
>

-- 
John Snelson, Lead Engineer                    http://twitter.com/jpcs
MarkLogic Corporation                         http://www.marklogic.com
_______________________________________________
General mailing list
[email protected]
http://developer.marklogic.com/mailman/listinfo/general

DISCLAIMER
This message is intended only for the use of the person(s) ("Intended 
Recipient") to whom it is addressed. It may contain information, which is 
privileged and confidential. Accordingly any dissemination, distribution, 
copying or other use of this message or any of its content by any person other 
than the Intended Recipient may constitute a breach of civil or criminal law 
and is strictly prohibited. If you are not the Intended Recipient, please 
contact the sender as soon as possible.
Reed Business Information Limited. Registered Office: Quadrant House, The 
Quadrant, Sutton, Surrey, SM2 5AS, UK. 
Registered in England under Company No. 151537

_______________________________________________
General mailing list
[email protected]
http://developer.marklogic.com/mailman/listinfo/general

Reply via email to