Databases Reference
In-Depth Information
In case it is a prime number, emit that number; otherwise just ignore it.
In any case, ack the tuple.
The use of JSON_BIGINT_AS_STRING in the json_decode function is a work-
around for a conversion problem between Java and PHP. Java sends
some very big numbers, and they are decoded with less precision in PHP,
which can cause problems. To work around this problem, tell PHP to
decode big numbers as strings and to avoid using double quotes when
printing numbers in JSON messages. PHP 5.4.0 or higher is required
for this parameter to work.
Messages like emit , ack , fail , and log have the following structure:
Emit
{
"command" : "emit" ,
"tuple" : [ "foo" , "bar" ]
}
Where the array has the values you are emitting for the tuple.
Ack
{
"command" : "ack" ,
"id" : 123456789
}
Where the id is the ID of the tuple you are processing.
Fail
{
"command" : "fail" ,
"id" : 123456789
}
Same as emit , the id is the ID of the tuple you are processing.
Log
{
"command" : "log" ,
"msg" : "some message to be logged by storm."
}
Putting it all together gives you the following PHP scripts.
 
Search WWH ::




Custom Search