You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@storm.apache.org by Navin Ipe <na...@searchlighthealth.com> on 2016/09/15 10:17:20 UTC

Getting total number of bolt tasks from Storm's REST API

Hi,

I've been using Storm's REST API (
http://domainName:8080/api/v1/topology/summary) to retrieve the number of
bolts in my topology.






*JSONObject topology = new JSONObject(jsonText);JSONArray topos =
(JSONArray) topology.get(bolts);for(int i = 0; i < topos.length(); ++i) {
JSONObject j = topos.getJSONObject(i);   boltDetails.put(boltId,
j.getString(boltId));   boltDetails.put(tasks, j.getInt(tasks));}*

I was earlier using just 1 bolt MyBolt1, and created 10 tasks with it. The
REST API correctly informed me that there were 10 bolts.

When I added another bolt MyBolt2, and created another 10 tasks with it,
the REST API is still showing 10 bolts instead of 20 bolts. A single spout
(with 5 spout tasks) is emitting to both bolts.

Moreover, storm returns tasksTotal as = 40.

Why is tasksTotal not = 10+10+5 = 25?
How do I get the total number of bolt tasks only? 10+10=20?

-- 
Regards,
Navin

Re: Getting total number of bolt tasks from Storm's REST API

Posted by Jungtaek Lim <ka...@gmail.com>.
I haven't been receive such symptom.
Did you check it from UI page? UI also uses that API so UI should also show
wrong result.
And please check the result of REST API manually.
https://jsonformatter.curiousconcept.com/

If it's still returning wrong result, please file an issue with detailed
info.

Thanks,
Jungtaek Lim (HeartSaVioR)

2016년 9월 16일 (금) 오후 2:31, Navin Ipe <na...@searchlighthealth.com>님이 작성:

> Help. Anyone?
>
> On Thu, Sep 15, 2016 at 3:47 PM, Navin Ipe <
> navin.ipe@searchlighthealth.com> wrote:
>
>> Hi,
>>
>> I've been using Storm's REST API (
>> http://domainName:8080/api/v1/topology/summary) to retrieve the number
>> of bolts in my topology.
>>
>>
>>
>>
>>
>>
>> *JSONObject topology = new JSONObject(jsonText);JSONArray topos =
>> (JSONArray) topology.get(bolts);for(int i = 0; i < topos.length(); ++i) {
>> JSONObject j = topos.getJSONObject(i);   boltDetails.put(boltId,
>> j.getString(boltId));   boltDetails.put(tasks, j.getInt(tasks));}*
>>
>> I was earlier using just 1 bolt MyBolt1, and created 10 tasks with it.
>> The REST API correctly informed me that there were 10 bolts.
>>
>> When I added another bolt MyBolt2, and created another 10 tasks with it,
>> the REST API is still showing 10 bolts instead of 20 bolts. A single spout
>> (with 5 spout tasks) is emitting to both bolts.
>>
>> Moreover, storm returns tasksTotal as = 40.
>>
>> Why is tasksTotal not = 10+10+5 = 25?
>> How do I get the total number of bolt tasks only? 10+10=20?
>>
>> --
>> Regards,
>> Navin
>>
>
>
>
> --
> Regards,
> Navin
>

Re: Getting total number of bolt tasks from Storm's REST API

Posted by Navin Ipe <na...@searchlighthealth.com>.
Help. Anyone?

On Thu, Sep 15, 2016 at 3:47 PM, Navin Ipe <na...@searchlighthealth.com>
wrote:

> Hi,
>
> I've been using Storm's REST API (http://domainName:8080/api/
> v1/topology/summary) to retrieve the number of bolts in my topology.
>
>
>
>
>
>
> *JSONObject topology = new JSONObject(jsonText);JSONArray topos =
> (JSONArray) topology.get(bolts);for(int i = 0; i < topos.length(); ++i) {
> JSONObject j = topos.getJSONObject(i);   boltDetails.put(boltId,
> j.getString(boltId));   boltDetails.put(tasks, j.getInt(tasks));}*
>
> I was earlier using just 1 bolt MyBolt1, and created 10 tasks with it. The
> REST API correctly informed me that there were 10 bolts.
>
> When I added another bolt MyBolt2, and created another 10 tasks with it,
> the REST API is still showing 10 bolts instead of 20 bolts. A single spout
> (with 5 spout tasks) is emitting to both bolts.
>
> Moreover, storm returns tasksTotal as = 40.
>
> Why is tasksTotal not = 10+10+5 = 25?
> How do I get the total number of bolt tasks only? 10+10=20?
>
> --
> Regards,
> Navin
>



-- 
Regards,
Navin