cassandra-pr mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dineshjoshi <...@git.apache.org>
Subject [GitHub] cassandra issue #244: Refactor and add samplers for CASSANDRA-14436
Date Sat, 04 Aug 2018 03:05:40 GMT
Github user dineshjoshi commented on the issue:

    https://github.com/apache/cassandra/pull/244
  
    Stepping back a bit, I see the samplers are stateful classes that are enabled and disabled.
This means, if there is an exception in the rmi thread that is executing the `beginLocalSampling`
and `finishLocalSampling`, the samplers will continue to run indefinitely and this might cause
issues. It would be best to instantiate Samplers on demand with a specific Duration. Each
sampler can stop accepting new samples once the duration expires. This would also mean that
you no longer have to keep enabling disabling samplers - allowing you to get rid of `enabled`
and other internal state variables could be made immutable for example in `FrequencySampler`,
`StreamSummary` can be declared as `final` and initialized in the constructor.
    
    If you want all samplers to start sampling exactly at the same moment (not sure if that
is a requirement) then you could potentially use a shared countdown latch. The thread instantiating
the samplers can decrement it once it is done creating and initializing all samplers. WDYT?


---

---------------------------------------------------------------------
To unsubscribe, e-mail: pr-unsubscribe@cassandra.apache.org
For additional commands, e-mail: pr-help@cassandra.apache.org


Mime
View raw message