MyCQ.CQManager Interface Reference
Manages continuous queries of a MyCQ Server.
More...
List of all members.
Public Member Functions |
void | createCQ (string cqName, string cqStatement, int cqResultQueueSize) |
| Create a CQ(Continuous Query) and CQResultQueue in a MyCQ Server.
|
void | deleteCQ (string cqName) |
| Delete a CQ(Continuous Query).
|
void | deleteAllCQ () |
| Delete all CQ(Continuous Query)s in a MyCQ Server.
|
string | getCQStatement (string cqName) |
| Get a CQ(Continuous Query) statement in a MyCQ Server.
|
void | setHeartBeat (int msec) |
| Set heart beat. (Heart beat is the speed value of continuous query scheduling.).
|
int | getHeartBeat () |
| Get heart beat. (Heart beat is the speed value of continuous query scheduling.).
|
List< string > | getAllCQNames () |
| Get all CQ(Continuous Query) names in a MyCQ Server.
|
List< string > | getCQNamesByQueueName (string queueName) |
| Get all CQ(Continuous Query) names related to a queue name in a MyCQ Server.
|
Detailed Description
Manages continuous queries of a MyCQ Server.
using System;
using System.Collections.Generic;
using MyCQ;
namespace MyCQClientNETExample
{
class ExamCQManager
{
void examSetQueueSchema(QueueSchema queueSchema)
{
queueSchema.addBoolean("boolean");
queueSchema.addByte("byte");
queueSchema.addShort("short");
queueSchema.addUShort("ushort");
queueSchema.addInt("int");
queueSchema.addLong("long");
queueSchema.addFloat("float");
queueSchema.addDouble("double");
queueSchema.addDate("date");
queueSchema.addTime("time");
queueSchema.addDateTime("datetime");
queueSchema.addString("string", 100);
queueSchema.addVarString("varstring");
queueSchema.addBinary("binary", 100);
queueSchema.addVarBinary("varbinary");
}
public void sample()
{
MyCQClient client = MyCQFactory.getMyCQClient();
try
{
client.connect("localhost", 3030, "root", "1234");
QueueManager queueManager = client.getQueueManager();
CQManager cqManager = client.getCQManager();
cqManager.deleteAllCQ();
queueManager.deleteAllQueues();
QueueSchema queueSchema = MyCQFactory.getQueueSchema();
examSetQueueSchema(queueSchema);
queueManager.createP2PQueue("p2pQueue", queueSchema, 100);
queueManager.createTopicQueue("topicQueue", queueSchema, 100);
string cq1 = "window p2pQueue as win1[size=30sec, slide=30sec] select count(*) from win1";
cqManager.createCQ("cq1", cq1, 100);
string cq2 = "window topicQueue as win1[size=30sec, slide=30sec] select count(*) from win1";
cqManager.createCQ("cq2", cq2, 100);
List<string> result;
result = cqManager.getAllCQNames();
foreach (string str in result)
{
Console.WriteLine(str);
Console.WriteLine(cqManager.getCQStatement(str));
}
result = cqManager.getCQNamesByQueueName("p2pQueue");
foreach (string str in result)
{
Console.WriteLine(str);
}
cqManager.setHeartBeat(500);
Console.WriteLine("heart beat:" + cqManager.getHeartBeat());
cqManager.setHeartBeat(1000);
Console.WriteLine("heart beat:" + cqManager.getHeartBeat());
cqManager.deleteCQ("cq1");
cqManager.deleteAllCQ();
queueManager.deleteAllQueues();
}
catch (MyCQException ex)
{
Console.WriteLine("code:" + ex.getCode() + ", message:" + ex.getMessage());
}
client.close();
}
}
}
Member Function Documentation
void MyCQ.CQManager.createCQ |
( |
string |
cqName, |
|
|
string |
cqStatement, |
|
|
int |
cqResultQueueSize | |
|
) |
| | |
Create a CQ(Continuous Query) and CQResultQueue in a MyCQ Server.
- Parameters:
-
| cqName | A continuous query name to create. CQResultQueue name will be the equal name to cq name. (size:= under 64). A cq name is a combination of alphabets and numerics which starts with alphabet character. |
| cqStatement | A continuous query statement. See MyCQL documents. |
| cqResultQueueSize | An integer greater than zero that will be the size of a cq result queue to be created. |
- Exceptions:
-
| MyCQException | An error occurred while creating a new continuos query. |
void MyCQ.CQManager.deleteAllCQ |
( |
|
) |
|
Delete all CQ(Continuous Query)s in a MyCQ Server.
- Exceptions:
-
void MyCQ.CQManager.deleteCQ |
( |
string |
cqName |
) |
|
Delete a CQ(Continuous Query).
- Parameters:
-
| cqName | A continuous query name to delete. |
- Exceptions:
-
| MyCQException | An error occurred while deleting a continuos query. |
List<string> MyCQ.CQManager.getAllCQNames |
( |
|
) |
|
Get all CQ(Continuous Query) names in a MyCQ Server.
- Returns:
- CQ name list.
- Exceptions:
-
List<string> MyCQ.CQManager.getCQNamesByQueueName |
( |
string |
queueName |
) |
|
Get all CQ(Continuous Query) names related to a queue name in a MyCQ Server.
- Parameters:
-
- Returns:
- CQ name list.
- Exceptions:
-
string MyCQ.CQManager.getCQStatement |
( |
string |
cqName |
) |
|
Get a CQ(Continuous Query) statement in a MyCQ Server.
- Parameters:
-
| cqName | A continuous query name. |
- Returns:
- CQ statement.
- Exceptions:
-
int MyCQ.CQManager.getHeartBeat |
( |
|
) |
|
Get heart beat. (Heart beat is the speed value of continuous query scheduling.).
- Returns:
- An integer(msec>=0) value of miliseconds.
- Exceptions:
-
void MyCQ.CQManager.setHeartBeat |
( |
int |
msec |
) |
|
Set heart beat. (Heart beat is the speed value of continuous query scheduling.).
- Parameters:
-
| msec | An integer(msec>=0) value of miliseconds. |
- Exceptions:
-
The documentation for this interface was generated from the following file: