Any assistance that you can provide would be greatly appreciated.
SOLUTION THEORY
Are these problems related to the antlr libs? As they may have been built using different compilers and libraries that are installed on my system
REQUEST #1
In addition, I would appreciate any additional documentation and or code examples, especially on the following topics:
1. Compiling a CEL query.
2. Setting up the demo as done in the video.
3. Writing a CEL Query Client
4. Setting up Cayuga to receive Queries through TCP (sample config entries)
5. Interfacing Cayuga with a TCP stream (sample config entries and sample code)
6. Setting up the Web Example
Thank you.
RSVP.
Best Regards,
Ed
Edward Hoffman
cadence@optonline.net
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Your compilation problem is due to Visual Studio 2005 and 2008 mismatch. Cayuga was originally developed at VS 2005, and the provided binary library files (e.g. xerces) might have caused these linking issues.
Below is some additional information per your request:
There are many CEL query examples in Cayuga\test\CayugaQL\tests
Sample Cayuga config files can be found in Cayuga\test\examples\config. In particular, CTCNetworkConfig is an example for setting up input streams via TCP.
The message formats used to communicate with the Cayuga server are documented in Section 6 of the CAYUGA USER MANUAL。
At this moment we do not have additional documentation for setting up the web example, but the above information should be sufficient to get you started with developing a Cayuga query/event client. Let us know if you have additional questions, and we will consider compiling the relevant information into a document.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
1. In the \cayuga-system\extlib\lib directory there are "D" versions of each .dll. Is the "D" version the debugging version?
2. I can get the source for ANTLR and XERCES from source forge. Do I need to build the same versions or should I use the latest versions?
3. I have no source for what I assume are the dbgroup-utils (Corelib and Network), if they need to be rebuilt, where can I get source code.
4. Should I be rebuilding these with .NET 2.0 Framework or some other framework (e.g. 3.5)
5. I have read the FAQ. I wish to use Cayuga to read stream data from multiple disk files AND multiple TCP Sockets. (says OR in FAQ). Can I configure this so it operates from both streaming files and TCP sockets concurrently?
6.In addition to what is happening concurrently in Question 5 above, I wish to add run-time Command processor through a TCP Socket client can this operate concurrently with what is in Question 5.
7. I wish to create output events to trigger trades as a result of analytics on the feeds. These events would be sent to another server using TCP sockets. According to the manual if I specify an OutputEventHost it is "instead of listening to an incoming connection on a given port." I assume that means that Cayuga can only act as a Client or a server. If that is the case, is the best way to trigger an event:
a) developing an external message server that reads events from the witness log OR
b) modifying Cayuga to concurrently act as a client and a server OR
c) use another copy of Cayuga to read the message log of of the stream data Cayuga that acts only as a OutputEventHost.
I greatly appreciate your help.
Thanks
Ed
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I just went through upgrading the Cayuga Visual Studio project to
2008, and made the following notes.
As Edward has observed, the main complexity of the upgrade is in the
third party libraries -- in order for them to be used by Cayuga under
VS 2008, they have to themselves be compiled under VS 2008 as well.
Here is a new set of header/library files build from VS 2008. To use
them for Cayuga in VS 2008, place these files in the appropriate
directories in cayuga-system\extlib to replace the existing VS 2005
files. The only exceptions are the xerces DLL files, which are placed by
default in the top-level cayuga-system directory.
One other change I made is to replace wsock32.lib with ws2_32.lib in
the Cayuga project. Otherwise I ran into "unresolved symbol" linker
errors.
I have not checked in these files as they may disrupt the existing
Visual Studio 2005 set up in SVN, but if there is enough interest, I
can add a separate set of VS 2008 files to the SVN.
The following problems were encountered with cudb.
1. In the CayugaExtLibs.zip, there are no include files/directories distributed with the new cudb libraries. After moving the new libs into the old project when bulding (Debug and Release Versions) Core Engine link errors occur.
2. When building the dbgroup-utils from source using the dbgroup-utils\platforms\win32\dbgroup_utils.sln project, the following errors occur:
Updating headers
Synchronizing c:\Documents and Settings\Administrator\Desktop\Cayuga\CayugaExtLibs\dbgroup-utils\alg\src -- c:\Documents and Settings\Administrator\Desktop\Cayuga\CayugaExtLibs\dbgroup-utils\distrib\win32\alg\inc\cudb\alg\
The syntax of the command is incorrect.
Invalid number of parameters
Invalid number of parameters
Invalid number of parameters
Synchronizing c:\Documents -- c:\Documents
File not found - *.h
0 File(s) copied
File not found - *.hpp
0 File(s) copied
File not found - *.hh
0 File(s) copied
Synchronizing c:\Documents -- c:\Documents and Settings\Administrator\Desktop\Cayuga\CayugaExtLibs\dbgroup-utils\platforms\win32\and
c:\Documents\*, Are you sure (Y/N)?
Could Not Find c:\Documents and Settings\Administrator\Desktop\Cayuga\CayugaExtLibs\dbgroup-utils\platforms\win32\and
c:\Documents\*, Are you sure (Y/N)?
Could Not Find c:\Documents and Settings\Administrator\Desktop\Cayuga\CayugaExtLibs\dbgroup-utils\platforms\win32\and
c:\Documents\*, Are you sure (Y/N)?
Could Not Find c:\Documents and Settings\Administrator\Desktop\Cayuga\CayugaExtLibs\dbgroup-utils\platforms\win32\and
Invalid number of parameters
Invalid number of parameters
Invalid number of parameters
Project : error PRJ0019: A tool returned an error code from "Updating headers"
I assume I need to change the entries in the Post-Build Commandline property to point to the correct source and taget include directories. You may want to make note of that in any new installation instructions issued.
The following was encounter when rebuilding Xerces-c.
1. The Dubug lib has no _D suffix appended to its name. As there is no Librarian property displayed in the sln project, Will a simple name change of the ouput be OK or must the librarian prpoerty be added to the project and the correct _D suffix added?
3. The antlr build is OK.
RSVP.
Thanks.
Best Regards,
Ed
Edward Hoffman
cadence@optonline.net
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
The cudb header files should not have changed, thus I did not include them in the zip package. What linking errors did you encountered? Could this be related to wsock32.lib -> ws2_32.lib change as I noted in the previous post?
To compile dbgroup-utils (cudb), you may need to generated the .sln file, by running dbgroup-utils\platforms\win32\configure.bat
The _D suffix for debug library can be freely renamed -- in Visual Studio, if you build xerces under "debug" mode, the generated .lib and .dll files should have the _D postfix. Could you please double check?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Thanks. As suggested I have substituted winsock32.lib with ws2_32.lib. This eliminated all socket related link errors in the xerces-c and cayuga builds.
But there is still one other link problem. This occurs whether I use the antlr libs that were provided or I use the antlr2 libs from building from source that was provided (see below).
Debug Version Using antlr Libraries from your build
Error 49 error LNK2001: unresolved external symbol "public: static char const * const antlr::BaseAST::TYPE_NAME" (?TYPE_NAME@BaseAST@antlr@@2QBDB) CoreEngine.lib Cayuga
Error 50 error LNK2001: unresolved external symbol "public: static char const * const antlr::BaseAST::TYPE_NAME" (?TYPE_NAME@BaseAST@antlr@@2QBDB) CoreEngine.lib Cayuga
Error 51 error LNK2001: unresolved external symbol "public: static char const * const antlr::BaseAST::TYPE_NAME" (?TYPE_NAME@BaseAST@antlr@@2QBDB) CoreEngine.lib Cayuga
Error 52 error LNK2019: unresolved external symbol "public: static char const * const antlr::BaseAST::TYPE_NAME" (?TYPE_NAME@BaseAST@antlr@@2QBDB) referenced in function "public: virtual class antlr::ASTRefCount<class antlr::AST> __thiscall antlr::CommonAST::clone(void)const " (?clone@CommonAST@antlr@@UBE?AV?$ASTRefCount@VAST@antlr@@@2@XZ) CayugaQLLib.lib Cayuga
Error 53 fatal error LNK1120: 1 unresolved externals Debug\Cayuga.exe Cayuga
Release version using antlr2 Libraries from build from antlr2 source
Error 49 error LNK2001: unresolved external symbol "public: static char const * const antlr::BaseAST::TYPE_NAME" (?TYPE_NAME@BaseAST@antlr@@2QBDB) CoreEngine.lib Cayuga
Error 50 error LNK2001: unresolved external symbol "public: static char const * const antlr::BaseAST::TYPE_NAME" (?TYPE_NAME@BaseAST@antlr@@2QBDB) CoreEngine.lib Cayuga
Error 51 error LNK2001: unresolved external symbol "public: static char const * const antlr::BaseAST::TYPE_NAME" (?TYPE_NAME@BaseAST@antlr@@2QBDB) CoreEngine.lib Cayuga
Error 52 error LNK2019: unresolved external symbol "public: static char const * const antlr::BaseAST::TYPE_NAME" (?TYPE_NAME@BaseAST@antlr@@2QBDB) referenced in function "public: virtual class antlr::ASTRefCount<class antlr::AST> __thiscall antlr::CommonAST::clone(void)const " (?clone@CommonAST@antlr@@UBE?AV?$ASTRefCount@VAST@antlr@@@2@XZ) CayugaQLLib.lib Cayuga
Error 53 fatal error LNK1120: 1 unresolved externals Debug\Cayuga.exe Cayuga
Are some changes needed to the code for an improperly overloaded method?
RSVP.
Best Regards,
Ed
Edward Hoffman
cadence@optonline.net
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
This is strange because I successfully built the Cayuga server in VS 2008 without encountering this issue. Could you double check that for the new antlr library, you are using new versions of both the antlr header files and and .lib file? Also, try cleaning the previous build of CoreEngine and rebuild from stratch.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Edward, the above post should have answered your questions 1-3. Here are the remainder answers:
4. Cayuga code is written in standard C++, and is outside the .NET framework (so which release of .NET to use should not matter)
5. Currently the server cannot read from files and sockets at the same time -- it should not be too involved to make such an extension. Care to make a attempt? :) Either we can extend the server directly, or write a client adapter that turns files into TCP event streams.
6. Currently after Cayuga server starts in NETWORK mode, new queries (more generally, commands) can be submitted to it before the event stream processing starts in the Server. The code needs to be extended If you would like to add new queries during event processing run time.
7. Your understanding from the manual is correct: the event notification side of the Cayuga server can act either as a TCP Server or Client. This is controlled by OutputEventPort and OutputEventHost.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
So to make Cayuga more versatile, three extensions will need to be written:
1. A client adapter that turns files into TCP event streams. If I write this I will no longer need to access files and all my inputs will be TCP streams. This will solve the problem and its relatively easy to do.
2. A modification of the Core engine will be required so that it can dynamically load and unload queries. This is a more complex issue, and I agree with with the FAQ, it will require developing the equivalent of a class loader and it may effect multi-query optimization (MQO). I need to study the construction of the core engine to assess this.
3. A adapter is necessary so that it can act as a client to another server. I have some ideas for adding this without major modifications to the core engine. I will get back to you as soon as I have completely assessed the underlying architecture.
Ed
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
So to make Cayuga more versatile, three extensions will need to be written:
1. A client adapter that turns files into TCP event streams. If I write this I will no longer need to access files and all my inputs will be TCP streams. This will solve the problem and its relatively easy to do.
2. A modification of the Core engine will be required so that it can dynamically load and unload queries. This is a more complex issue, and I agree with with the FAQ, it will require developing the equivalent of a class loader and it may effect multi-query optimization (MQO). I need to study the construction of the core engine to assess this.
3. A adapter is necessary so that it can act as a client to another server. I have some ideas for adding this without major modifications to the core engine. I will get back to you as soon as I have completely assessed the underlying architecture.
Ed
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
All good ideas for extension. Item 2 seems the most involved one among the three. For Item 3, if all the output event streams of the Cayuga server are to be sent to a single destination, this can already be realized by setting the config parameters. So I assume you would like the Cayuga server to send different output streams to different destinations?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I am new to Cayuga language. I could see the user manual for understanding the setup in Visual studio 2005 / 2008 and also the samples for writing CELqueries.
Can I get to know, how do I use the Web / Cayuga User Interface for writing / loading the same?
Thanks
Krishnaprasad Narayanan
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
After reading about the release of Cayuga on LinkedIn, I downloaded and built the product under windows.
The Release version build is successful. But there are some problems with the building the debug version under Visual Studio 2008.
PROBLEM#1: When I build under the debug version I get multiple unresolved external references as follows:
Error 51 error LNK2001: unresolved external symbol "__declspec(dllimport) public: __thiscall std::_Container_base::~_Container_base(void)" (__imp_??1_Container_base@std@@QAE@XZ) CayugaQLLib.lib Cayuga
Error 52 error LNK2001: unresolved external symbol "__declspec(dllimport) public: __thiscall std::_Container_base::~_Container_base(void)" (__imp_??1_Container_base@std@@QAE@XZ) CayugaQLLib.lib Cayuga
Error 53 error LNK2001: unresolved external symbol "__declspec(dllimport) public: __thiscall std::_Container_base::~_Container_base(void)" (__imp_??1_Container_base@std@@QAE@XZ) CayugaQLLib.lib Cayuga
Error 54 error LNK2019: unresolved external symbol "__declspec(dllimport) public: __thiscall std::_Container_base::~_Container_base(void)" (__imp_??1_Container_base@std@@QAE@XZ) referenced in function "public: virtual void * __thiscall antlr::ParserInputState::`scalar deleting destructor'(unsigned int)" (??_GParserInputState@antlr@@UAEPAXI@Z) CayugaQLLib.lib Cayuga
Error 55 error LNK2001: unresolved external symbol "__declspec(dllimport) public: __thiscall std::_Container_base::~_Container_base(void)" (__imp_??1_Container_base@std@@QAE@XZ) CayugaQLLib.lib Cayuga
Error 56 error LNK2001: unresolved external symbol "__declspec(dllimport) public: __thiscall std::_Container_base::~_Container_base(void)" (__imp_??1_Container_base@std@@QAE@XZ) CayugaQLLib.lib Cayuga
Error 57 error LNK2001: unresolved external symbol "__declspec(dllimport) public: __thiscall std::_Container_base::~_Container_base(void)" (__imp_??1_Container_base@std@@QAE@XZ) CayugaQLLib.lib Cayuga
Error 58 error LNK2001: unresolved external symbol "__declspec(dllimport) public: __thiscall std::_Container_base::~_Container_base(void)" (__imp_??1_Container_base@std@@QAE@XZ) CayugaQLLib.lib Cayuga
Error 59 error LNK2001: unresolved external symbol "__declspec(dllimport) public: __thiscall std::_Container_base::~_Container_base(void)" (__imp_??1_Container_base@std@@QAE@XZ) CayugaQLLib.lib Cayuga
Error 60 error LNK2001: unresolved external symbol "__declspec(dllimport) public: void __thiscall std::_Container_base::_Orphan_all(void)const " (__imp_?_Orphan_all@_Container_base@std@@QBEXXZ) CayugaQLLib.lib Cayuga
Error 61 error LNK2019: unresolved external symbol "__declspec(dllimport) public: void __thiscall std::_Container_base::_Orphan_all(void)const " (__imp_?_Orphan_all@_Container_base@std@@QBEXXZ) referenced in function "public: unsigned int __thiscall std::vector<int,class std::allocator<int> >::max_size(void)const " (?max_size@?$vector@HV?$allocator@H@std@@@std@@QBEIXZ) CayugaQLLib.lib Cayuga
Error 62 error LNK2001: unresolved external symbol "__declspec(dllimport) public: void __thiscall std::_Container_base::_Orphan_all(void)const " (__imp_?_Orphan_all@_Container_base@std@@QBEXXZ) CayugaQLLib.lib Cayuga
Error 63 error LNK2001: unresolved external symbol "__declspec(dllimport) public: void __thiscall std::_Container_base::_Orphan_all(void)const " (__imp_?_Orphan_all@_Container_base@std@@QBEXXZ) CayugaQLLib.lib Cayuga
Error 64 error LNK2001: unresolved external symbol "__declspec(dllimport) public: void __thiscall std::_Container_base::_Orphan_all(void)const " (__imp_?_Orphan_all@_Container_base@std@@QBEXXZ) CayugaQLLib.lib Cayuga
Error 65 error LNK2001: unresolved external symbol "__declspec(dllimport) public: void __thiscall std::_Container_base::_Orphan_all(void)const " (__imp_?_Orphan_all@_Container_base@std@@QBEXXZ) CayugaQLLib.lib Cayuga
Error 66 error LNK2001: unresolved external symbol "__declspec(dllimport) public: void __thiscall std::_Container_base::_Orphan_all(void)const " (__imp_?_Orphan_all@_Container_base@std@@QBEXXZ) CayugaQLLib.lib Cayuga
Error 67 error LNK2001: unresolved external symbol "__declspec(dllimport) public: void __thiscall std::_Container_base::_Orphan_all(void)const " (__imp_?_Orphan_all@_Container_base@std@@QBEXXZ) CayugaQLLib.lib Cayuga
Error 68 error LNK2001: unresolved external symbol "__declspec(dllimport) public: void __thiscall std::_Container_base::_Orphan_all(void)const " (__imp_?_Orphan_all@_Container_base@std@@QBEXXZ) CayugaQLLib.lib Cayuga
Error 69 error LNK2001: unresolved external symbol "__declspec(dllimport) public: void __thiscall std::_Container_base::_Orphan_all(void)const " (__imp_?_Orphan_all@_Container_base@std@@QBEXXZ) CayugaQLLib.lib Cayuga
Error 70 error LNK2019: unresolved external symbol "__declspec(dllimport) public: __thiscall std::_Container_base::_Container_base(void)" (__imp_??0_Container_base@std@@QAE@XZ) referenced in function "int * __cdecl stdext::unchecked_copy<int *,int *>(int *,int *,int *)" (??$unchecked_copy@PAHPAH@stdext@@YAPAHPAH00@Z) CayugaQLLib.lib Cayuga
Error 71 error LNK2001: unresolved external symbol "__declspec(dllimport) public: __thiscall std::_Container_base::_Container_base(void)" (__imp_??0_Container_base@std@@QAE@XZ) CayugaQLLib.lib Cayuga
Error 72 error LNK2001: unresolved external symbol "__declspec(dllimport) public: __thiscall std::_Container_base::_Container_base(void)" (__imp_??0_Container_base@std@@QAE@XZ) CayugaQLLib.lib Cayuga
Error 73 error LNK2001: unresolved external symbol "__declspec(dllimport) public: __thiscall std::_Container_base::_Container_base(void)" (__imp_??0_Container_base@std@@QAE@XZ) CayugaQLLib.lib Cayuga
Error 74 error LNK2001: unresolved external symbol "__declspec(dllimport) public: __thiscall std::_Container_base::_Container_base(void)" (__imp_??0_Container_base@std@@QAE@XZ) CayugaQLLib.lib Cayuga
Error 75 error LNK2001: unresolved external symbol "__declspec(dllimport) public: __thiscall std::_Container_base::_Container_base(void)" (__imp_??0_Container_base@std@@QAE@XZ) CayugaQLLib.lib Cayuga
Error 76 error LNK2001: unresolved external symbol "__declspec(dllimport) public: __thiscall std::_Container_base::_Container_base(void)" (__imp_??0_Container_base@std@@QAE@XZ) CayugaQLLib.lib Cayuga
Error 77 error LNK2001: unresolved external symbol "__declspec(dllimport) public: __thiscall std::_Container_base::_Container_base(void)" (__imp_??0_Container_base@std@@QAE@XZ) CayugaQLLib.lib Cayuga
Error 78 error LNK2001: unresolved external symbol "__declspec(dllimport) public: __thiscall std::_Container_base::_Container_base(void)" (__imp_??0_Container_base@std@@QAE@XZ) CayugaQLLib.lib Cayuga
Error 79 error LNK2019: unresolved external symbol "__declspec(dllimport) public: __thiscall std::_Container_base::_Container_base(class std::_Container_base const &)" (__imp_??0_Container_base@std@@QAE@ABV01@@Z) referenced in function "public: __thiscall std::vector<bool,class std::allocator<bool> >::vector<bool,class std::allocator<bool> >(class std::vector<bool,class std::allocator<bool> > const &)" (??0?$vector@_NV?$allocator@_N@std@@@std@@QAE@ABV01@@Z) CayugaQLLib.lib Cayuga
Error 80 error LNK2001: unresolved external symbol "__declspec(dllimport) public: __thiscall std::_Container_base::_Container_base(class std::_Container_base const &)" (__imp_??0_Container_base@std@@QAE@ABV01@@Z) CayugaQLLib.lib Cayuga
Error 81 error LNK2001: unresolved external symbol "__declspec(dllimport) public: __thiscall std::_Container_base::_Container_base(class std::_Container_base const &)" (__imp_??0_Container_base@std@@QAE@ABV01@@Z) CayugaQLLib.lib Cayuga
Error 82 error LNK2001: unresolved external symbol "__declspec(dllimport) public: __thiscall std::_Container_base::_Container_base(class std::_Container_base const &)" (__imp_??0_Container_base@std@@QAE@ABV01@@Z) CayugaQLLib.lib Cayuga
Error 83 fatal error LNK1120: 4 unresolved externals Debug\Cayuga.exe Cayuga
PROBLEM #2
When I run StockMshapeConfig or CTCNetworkConfig I encounter a bug that may be related to ANTLR as follows:
Unhandled Exception in Cayuga.exe: 0x00000005” Access violation reading location 0x00000008.
The last entry in the stack trace is as follows:
Cayuga.exe!antlr::ASTRefCount<Cayuga::QLCompiler::CayugaQLAST>::operator Cayuga::QLCompiler::CayugaQLAST *() Line 88 + 0x16 bytes
The debugger points to the following line in \cayuga-system\extlib\inc\antlr\ASTRefCount.hpp:
T*Operator->() const { return ref ? static_cast,T*>(ref->ptr) :0;)
Any assistance that you can provide would be greatly appreciated.
SOLUTION THEORY
Are these problems related to the antlr libs? As they may have been built using different compilers and libraries that are installed on my system
REQUEST #1
In addition, I would appreciate any additional documentation and or code examples, especially on the following topics:
1. Compiling a CEL query.
2. Setting up the demo as done in the video.
3. Writing a CEL Query Client
4. Setting up Cayuga to receive Queries through TCP (sample config entries)
5. Interfacing Cayuga with a TCP stream (sample config entries and sample code)
6. Setting up the Web Example
Thank you.
RSVP.
Best Regards,
Ed
Edward Hoffman
cadence@optonline.net
Edward,
Your compilation problem is due to Visual Studio 2005 and 2008 mismatch. Cayuga was originally developed at VS 2005, and the provided binary library files (e.g. xerces) might have caused these linking issues.
Below is some additional information per your request:
There are many CEL query examples in Cayuga\test\CayugaQL\tests
Sample Cayuga config files can be found in Cayuga\test\examples\config. In particular, CTCNetworkConfig is an example for setting up input streams via TCP.
The message formats used to communicate with the Cayuga server are documented in Section 6 of the CAYUGA USER MANUAL。
At this moment we do not have additional documentation for setting up the web example, but the above information should be sufficient to get you started with developing a Cayuga query/event client. Let us know if you have additional questions, and we will consider compiling the relevant information into a document.
1. In the \cayuga-system\extlib\lib directory there are "D" versions of each .dll. Is the "D" version the debugging version?
2. I can get the source for ANTLR and XERCES from source forge. Do I need to build the same versions or should I use the latest versions?
3. I have no source for what I assume are the dbgroup-utils (Corelib and Network), if they need to be rebuilt, where can I get source code.
4. Should I be rebuilding these with .NET 2.0 Framework or some other framework (e.g. 3.5)
5. I have read the FAQ. I wish to use Cayuga to read stream data from multiple disk files AND multiple TCP Sockets. (says OR in FAQ). Can I configure this so it operates from both streaming files and TCP sockets concurrently?
6.In addition to what is happening concurrently in Question 5 above, I wish to add run-time Command processor through a TCP Socket client can this operate concurrently with what is in Question 5.
7. I wish to create output events to trigger trades as a result of analytics on the feeds. These events would be sent to another server using TCP sockets. According to the manual if I specify an OutputEventHost it is "instead of listening to an incoming connection on a given port." I assume that means that Cayuga can only act as a Client or a server. If that is the case, is the best way to trigger an event:
a) developing an external message server that reads events from the witness log OR
b) modifying Cayuga to concurrently act as a client and a server OR
c) use another copy of Cayuga to read the message log of of the stream data Cayuga that acts only as a OutputEventHost.
I greatly appreciate your help.
Thanks
Ed
I just went through upgrading the Cayuga Visual Studio project to
2008, and made the following notes.
As Edward has observed, the main complexity of the upgrade is in the
third party libraries -- in order for them to be used by Cayuga under
VS 2008, they have to themselves be compiled under VS 2008 as well.
Here is a new set of header/library files build from VS 2008. To use
them for Cayuga in VS 2008, place these files in the appropriate
directories in cayuga-system\extlib to replace the existing VS 2005
files. The only exceptions are the xerces DLL files, which are placed by
default in the top-level cayuga-system directory.
http://cayuga.sourceforge.net/CayugaExtLibsVS2008.zip
One other change I made is to replace wsock32.lib with ws2_32.lib in
the Cayuga project. Otherwise I ran into "unresolved symbol" linker
errors.
I have not checked in these files as they may disrupt the existing
Visual Studio 2005 set up in SVN, but if there is enough interest, I
can add a separate set of VS 2008 files to the SVN.
Alternatively, download these VS 2008 source code projects at
http://cayuga.sourceforge.net/CayugaExtLibs.zip
The project file locations are:
Antlr: Antlr2CPP\Antlr2\Antlr2.sln
xerces: xerces-c-src_2_8_0\Projects\Win32\VC8\xerces-all\xerces-all.sln
cudb: dbgroup-utils\platforms\win32\dbgroup_utils.sln
Simply build the above projects to obtain the library files.
Yet another alternative is to download them from the following locations:
Antlr V2: http://www.antlr2.org/download.html
grab a source file package http://www.antlr2.org/download/antlr-2.7.7.tar.gz
build under VS 2008
Xerces: http://xerces.apache.org/xerces-c/download.cgi
grab a source file package http://apache.mirror.facebook.net/xerces/c/2/sources/xerces-c-src_2_8_0.tar.gz
build under VS 2008
Cudb: see the above reference
Let me know if there are still questions.
Thank you for your efforts.
The following problems were encountered with cudb.
1. In the CayugaExtLibs.zip, there are no include files/directories distributed with the new cudb libraries. After moving the new libs into the old project when bulding (Debug and Release Versions) Core Engine link errors occur.
2. When building the dbgroup-utils from source using the dbgroup-utils\platforms\win32\dbgroup_utils.sln project, the following errors occur:
Updating headers
Synchronizing c:\Documents and Settings\Administrator\Desktop\Cayuga\CayugaExtLibs\dbgroup-utils\alg\src -- c:\Documents and Settings\Administrator\Desktop\Cayuga\CayugaExtLibs\dbgroup-utils\distrib\win32\alg\inc\cudb\alg\
The syntax of the command is incorrect.
Invalid number of parameters
Invalid number of parameters
Invalid number of parameters
Synchronizing c:\Documents -- c:\Documents
File not found - *.h
0 File(s) copied
File not found - *.hpp
0 File(s) copied
File not found - *.hh
0 File(s) copied
Synchronizing c:\Documents -- c:\Documents and Settings\Administrator\Desktop\Cayuga\CayugaExtLibs\dbgroup-utils\platforms\win32\and
c:\Documents\*, Are you sure (Y/N)?
Could Not Find c:\Documents and Settings\Administrator\Desktop\Cayuga\CayugaExtLibs\dbgroup-utils\platforms\win32\and
c:\Documents\*, Are you sure (Y/N)?
Could Not Find c:\Documents and Settings\Administrator\Desktop\Cayuga\CayugaExtLibs\dbgroup-utils\platforms\win32\and
c:\Documents\*, Are you sure (Y/N)?
Could Not Find c:\Documents and Settings\Administrator\Desktop\Cayuga\CayugaExtLibs\dbgroup-utils\platforms\win32\and
Invalid number of parameters
Invalid number of parameters
Invalid number of parameters
Project : error PRJ0019: A tool returned an error code from "Updating headers"
I assume I need to change the entries in the Post-Build Commandline property to point to the correct source and taget include directories. You may want to make note of that in any new installation instructions issued.
The following was encounter when rebuilding Xerces-c.
1. The Dubug lib has no _D suffix appended to its name. As there is no Librarian property displayed in the sln project, Will a simple name change of the ouput be OK or must the librarian prpoerty be added to the project and the correct _D suffix added?
3. The antlr build is OK.
RSVP.
Thanks.
Best Regards,
Ed
Edward Hoffman
cadence@optonline.net
Edward,
The cudb header files should not have changed, thus I did not include them in the zip package. What linking errors did you encountered? Could this be related to wsock32.lib -> ws2_32.lib change as I noted in the previous post?
To compile dbgroup-utils (cudb), you may need to generated the .sln file, by running dbgroup-utils\platforms\win32\configure.bat
The _D suffix for debug library can be freely renamed -- in Visual Studio, if you build xerces under "debug" mode, the generated .lib and .dll files should have the _D postfix. Could you please double check?
Mingsheng,
Thanks. As suggested I have substituted winsock32.lib with ws2_32.lib. This eliminated all socket related link errors in the xerces-c and cayuga builds.
But there is still one other link problem. This occurs whether I use the antlr libs that were provided or I use the antlr2 libs from building from source that was provided (see below).
Debug Version Using antlr Libraries from your build
Error 49 error LNK2001: unresolved external symbol "public: static char const * const antlr::BaseAST::TYPE_NAME" (?TYPE_NAME@BaseAST@antlr@@2QBDB) CoreEngine.lib Cayuga
Error 50 error LNK2001: unresolved external symbol "public: static char const * const antlr::BaseAST::TYPE_NAME" (?TYPE_NAME@BaseAST@antlr@@2QBDB) CoreEngine.lib Cayuga
Error 51 error LNK2001: unresolved external symbol "public: static char const * const antlr::BaseAST::TYPE_NAME" (?TYPE_NAME@BaseAST@antlr@@2QBDB) CoreEngine.lib Cayuga
Error 52 error LNK2019: unresolved external symbol "public: static char const * const antlr::BaseAST::TYPE_NAME" (?TYPE_NAME@BaseAST@antlr@@2QBDB) referenced in function "public: virtual class antlr::ASTRefCount<class antlr::AST> __thiscall antlr::CommonAST::clone(void)const " (?clone@CommonAST@antlr@@UBE?AV?$ASTRefCount@VAST@antlr@@@2@XZ) CayugaQLLib.lib Cayuga
Error 53 fatal error LNK1120: 1 unresolved externals Debug\Cayuga.exe Cayuga
Release version using antlr2 Libraries from build from antlr2 source
Error 49 error LNK2001: unresolved external symbol "public: static char const * const antlr::BaseAST::TYPE_NAME" (?TYPE_NAME@BaseAST@antlr@@2QBDB) CoreEngine.lib Cayuga
Error 50 error LNK2001: unresolved external symbol "public: static char const * const antlr::BaseAST::TYPE_NAME" (?TYPE_NAME@BaseAST@antlr@@2QBDB) CoreEngine.lib Cayuga
Error 51 error LNK2001: unresolved external symbol "public: static char const * const antlr::BaseAST::TYPE_NAME" (?TYPE_NAME@BaseAST@antlr@@2QBDB) CoreEngine.lib Cayuga
Error 52 error LNK2019: unresolved external symbol "public: static char const * const antlr::BaseAST::TYPE_NAME" (?TYPE_NAME@BaseAST@antlr@@2QBDB) referenced in function "public: virtual class antlr::ASTRefCount<class antlr::AST> __thiscall antlr::CommonAST::clone(void)const " (?clone@CommonAST@antlr@@UBE?AV?$ASTRefCount@VAST@antlr@@@2@XZ) CayugaQLLib.lib Cayuga
Error 53 fatal error LNK1120: 1 unresolved externals Debug\Cayuga.exe Cayuga
Are some changes needed to the code for an improperly overloaded method?
RSVP.
Best Regards,
Ed
Edward Hoffman
cadence@optonline.net
This is strange because I successfully built the Cayuga server in VS 2008 without encountering this issue. Could you double check that for the new antlr library, you are using new versions of both the antlr header files and and .lib file? Also, try cleaning the previous build of CoreEngine and rebuild from stratch.
My error, I did not copy the new antlr headers to the appropriate Cayuga directory. So far, the debug build is fine.
Thanks for you help.
Best regards,
Ed
Edward Hoffman
cadence@optonline.net
Edward, the above post should have answered your questions 1-3. Here are the remainder answers:
4. Cayuga code is written in standard C++, and is outside the .NET framework (so which release of .NET to use should not matter)
5. Currently the server cannot read from files and sockets at the same time -- it should not be too involved to make such an extension. Care to make a attempt? :) Either we can extend the server directly, or write a client adapter that turns files into TCP event streams.
6. Currently after Cayuga server starts in NETWORK mode, new queries (more generally, commands) can be submitted to it before the event stream processing starts in the Server. The code needs to be extended If you would like to add new queries during event processing run time.
7. Your understanding from the manual is correct: the event notification side of the Cayuga server can act either as a TCP Server or Client. This is controlled by OutputEventPort and OutputEventHost.
So to make Cayuga more versatile, three extensions will need to be written:
1. A client adapter that turns files into TCP event streams. If I write this I will no longer need to access files and all my inputs will be TCP streams. This will solve the problem and its relatively easy to do.
2. A modification of the Core engine will be required so that it can dynamically load and unload queries. This is a more complex issue, and I agree with with the FAQ, it will require developing the equivalent of a class loader and it may effect multi-query optimization (MQO). I need to study the construction of the core engine to assess this.
3. A adapter is necessary so that it can act as a client to another server. I have some ideas for adding this without major modifications to the core engine. I will get back to you as soon as I have completely assessed the underlying architecture.
Ed
So to make Cayuga more versatile, three extensions will need to be written:
1. A client adapter that turns files into TCP event streams. If I write this I will no longer need to access files and all my inputs will be TCP streams. This will solve the problem and its relatively easy to do.
2. A modification of the Core engine will be required so that it can dynamically load and unload queries. This is a more complex issue, and I agree with with the FAQ, it will require developing the equivalent of a class loader and it may effect multi-query optimization (MQO). I need to study the construction of the core engine to assess this.
3. A adapter is necessary so that it can act as a client to another server. I have some ideas for adding this without major modifications to the core engine. I will get back to you as soon as I have completely assessed the underlying architecture.
Ed
All good ideas for extension. Item 2 seems the most involved one among the three. For Item 3, if all the output event streams of the Cayuga server are to be sent to a single destination, this can already be realized by setting the config parameters. So I assume you would like the Cayuga server to send different output streams to different destinations?
I am new to Cayuga language. I could see the user manual for understanding the setup in Visual studio 2005 / 2008 and also the samples for writing CELqueries.
Can I get to know, how do I use the Web / Cayuga User Interface for writing / loading the same?
Thanks
Krishnaprasad Narayanan