[jira] [Comment Edited] (IGNITE-1680) CPP: Implement basic API for user entry point lookup

2016-12-28 Thread Igor Sapego (JIRA)

[ 
https://issues.apache.org/jira/browse/IGNITE-1680?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15783242#comment-15783242
 ] 

Igor Sapego edited comment on IGNITE-1680 at 12/28/16 4:45 PM:
---

Vladimir,

1) Ok, already done.
2) Yeah, that's how it's implemented currently.
3) I like {{IgniteRpc}} the best. Is that OK with you?
4) I will think about it though I would not put such API in public just yet. We 
can always add it in future, once we need it and once we have better 
understanding of what should it be.
5) Do you mean specifying classes/functions in text form that should be called 
upon some event later? No, it's not possible. At least, there is no standard 
way to do that, because C++ does not provide reflection and don't even have 
standardized ABI to write any meaningful workaround code. We can force user to 
declare functions in specific way so that later we are going to be able to find 
and call them in runtime (this is the case with the {{IgniteModuleInit}} 
function - its name actually *can* be specified in textual form in 
configuration file), but we can not do the same with class methods. More than 
that, methods can be virtual and there is no standard ways to store vtable for 
class - it's implementation specific. Summarizing - no, there is no way to do 
that.



was (Author: isapego):
Vladimir,

1) Ok, already done.
2) Yeah, that's how it's implemented currently.
3) I like {{IgniteRpc}} the best. Is that OK with you?
4) I will think about it though I would not put such API in public just yet. We 
can always add it in future, once we need it and once we have better 
understanding of what should it be.
5) Do you mean specifying classes/functions in text form that should be called 
upon some event later? No, it's not possible. At least, there is no standard 
way to do that, because C++ does not provide reflection and don't even have 
standardized ABI to write any meaningful workaround code. We can force user to 
declare functions in specific way so that later we are going to be able to find 
and call them in runtime (this is the case with the {{IgniteModuleInit}} 
function - its name actually *can* be specified in textual form in 
configuration file), but we can not do the same with class methods. More than 
that, methods can be virtual and there is no standard ways to store vtable for 
class.

> CPP: Implement basic API for user entry point lookup
> 
>
> Key: IGNITE-1680
> URL: https://issues.apache.org/jira/browse/IGNITE-1680
> Project: Ignite
>  Issue Type: Task
>  Components: platforms
>Affects Versions: 1.1.4
>Reporter: Igor Sapego
>Assignee: Igor Sapego
>  Labels: cpp, roadmap
> Fix For: 2.0
>
>
> Need to implement IgniteCompute class for C++ with one basic method 
> IgniteCompute::Call(...) which will provide basic remote job execution API.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Comment Edited] (IGNITE-1680) CPP: Implement basic API for user entry point lookup

2016-12-27 Thread Igor Sapego (JIRA)

[ 
https://issues.apache.org/jira/browse/IGNITE-1680?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15715245#comment-15715245
 ] 

Igor Sapego edited comment on IGNITE-1680 at 12/27/16 12:31 PM:


Ok, here is concept that I have implemented and checked:
{code}
// If user has any jobs, processors or other classes, that
// may be invoked by the remote side, they should be registered
// in the following function. Every module should have no more
// than one function with the following signature. This function
// called by Ignite when module is loaded.
IGNITE_EXPORTED_CALL void IgniteModuleInit(ignite::InvokeManager& im)
{
im.RegisterCacheEntryProcessor();
im.RegisterCacheEntryProcessor();

im.RegisterJob();
im.RegisterJob();

...
}

// User classes should implement corresponding Ignite classes and 
// have static methods, that return class id. Something like:
class UserProcessor1 : public CacheEntryProcessor<...>
{
// User implements CacheEntryProcessor interface here...

// Function, that return some unique ID for the class.
static int64_t GetIgniteId()
{
...
}
}
{code}

What do you guys think?


was (Author: isapego):
Ok, here is concept that I have implemented and checked:
{code}
// If user has any jobs, processors or other classes, that
// may be invoked by the remote side, they should be registered
// in the following function. Every module should have no more
// than one function with the following signature. This function
// called by Ignite when module is loaded.
IGNITE_EXPORTED_CALL void IgniteModuleInit(ignite::InvokeManager& im)
{
im.RegisterCacheEntryProcessor();
im.RegisterCacheEntryProcessor();

im.RegisterJob();
im.RegisterJob();

...
}

// User classes should implement corresponding Ignite classes and 
// have static methods, that return class id. Something like:
class UserProcessor1 : public CacheEntryProcessor<...>
{
// User implements CacheEntryProcessor interface here...

// Function, that return some unique ID for the class.
static int64_t GetIgniteId()
{
...
}
}
{code}

What do you guys think?

> CPP: Implement basic API for user entry point lookup
> 
>
> Key: IGNITE-1680
> URL: https://issues.apache.org/jira/browse/IGNITE-1680
> Project: Ignite
>  Issue Type: Task
>  Components: platforms
>Affects Versions: 1.1.4
>Reporter: Igor Sapego
>Assignee: Igor Sapego
>  Labels: cpp, roadmap
> Fix For: 2.0
>
>
> Need to implement IgniteCompute class for C++ with one basic method 
> IgniteCompute::Call(...) which will provide basic remote job execution API.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Comment Edited] (IGNITE-1680) CPP: Implement basic API for user entry point lookup

2016-12-27 Thread Igor Sapego (JIRA)

[ 
https://issues.apache.org/jira/browse/IGNITE-1680?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15715245#comment-15715245
 ] 

Igor Sapego edited comment on IGNITE-1680 at 12/27/16 12:30 PM:


Ok, here is concept that I have implemented and checked:
{code}
// If user has any jobs, processors or other classes, that
// may be invoked by the remote side, they should be registered
// in the following function. Every module should have no more
// than one function with the following signature. This function
// called by Ignite when module is loaded.
IGNITE_EXPORTED_CALL void IgniteModuleInit(ignite::InvokeManager& im)
{
im.RegisterCacheEntryProcessor();
im.RegisterCacheEntryProcessor();

im.RegisterJob();
im.RegisterJob();

...
}

// User classes should implement corresponding Ignite classes and 
// have static methods, that return class id. Something like:
class UserProcessor1 : public CacheEntryProcessor<...>
{
// User implements CacheEntryProcessor interface here...

// Function, that return some unique ID for the class.
static int64_t GetIgniteId()
{
...
}
}
{code}

What do you guys think?


was (Author: isapego):
Ok, here is concept that I have implemented and checked:
{code}
// If user has any jobs, processors or other classes, that
// may be invoked by the remote side, they should be registered
// in the following function. Every module should have no more
// than one function with the following signature. This function
// called by Ignite when module is loaded.
IGNITE_EXPORTED_CALL void IgniteModuleInit(ignite::InvokeManager& im)
{
im.RegisterCacheEntryProcessor();
im.RegisterCacheEntryProcessor();

im.RegisterJob();
im.RegisterJob();

...
}

// User classes should implement corresponding Ignite classes and 
// have static methods, that return class id. Something like:
class UserProcessor1 : public CacheEntryProcessor<...>
{
// User implements CacheEntryProcessor interface here...

// Function, that return some unique ID for the class.
static int64_t GetIgniteId()
{
...
}
}
{code}

What do you guys think?

> CPP: Implement basic API for user entry point lookup
> 
>
> Key: IGNITE-1680
> URL: https://issues.apache.org/jira/browse/IGNITE-1680
> Project: Ignite
>  Issue Type: Task
>  Components: platforms
>Affects Versions: 1.1.4
>Reporter: Igor Sapego
>Assignee: Igor Sapego
>  Labels: cpp, roadmap
> Fix For: 2.0
>
>
> Need to implement IgniteCompute class for C++ with one basic method 
> IgniteCompute::Call(...) which will provide basic remote job execution API.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)