Send sampled data to the eventlogger if the global or component level debug flag is set (via nimbus api).
(Executor executor, List values,
String componentId, Object messageId, Random random, Queue<AddressedTuple> overflow)
| 220 | * Send sampled data to the eventlogger if the global or component level debug flag is set (via nimbus api). |
| 221 | */ |
| 222 | public void sendToEventLogger(Executor executor, List values, |
| 223 | String componentId, Object messageId, Random random, Queue<AddressedTuple> overflow) { |
| 224 | Map<String, DebugOptions> componentDebug = executor.getStormComponentDebug().get(); |
| 225 | DebugOptions debugOptions = componentDebug.get(componentId); |
| 226 | if (debugOptions == null) { |
| 227 | debugOptions = componentDebug.get(executor.getStormId()); |
| 228 | } |
| 229 | double spct = ((debugOptions != null) && (debugOptions.is_enable())) ? debugOptions.get_samplingpct() : 0; |
| 230 | if (spct > 0 && (random.nextDouble() * 100) < spct) { |
| 231 | sendUnanchored(StormCommon.EVENTLOGGER_STREAM_ID, |
| 232 | new Values(componentId, messageId, System.currentTimeMillis(), values), |
| 233 | executor.getExecutorTransfer(), overflow); |
| 234 | } |
| 235 | } |
| 236 | |
| 237 | private TopologyContext mkTopologyContext(StormTopology topology) throws IOException { |
| 238 | Map<String, Object> conf = workerData.getConf(); |
no test coverage detected