org.apache.storm.messaging

## Class DeserializingConnectionCallback

- java.lang.Object
- - org.apache.storm.messaging.DeserializingConnectionCallback

- All Implemented Interfaces:
    IConnectionCallback, IMetric

      public class DeserializingConnectionCallback
      extends Object
      implements IConnectionCallback, IMetric

  A class that is called when a TaskMessage arrives.

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `DeserializingConnectionCallback(Map<String,Object> conf, GeneralTopologyContext context, WorkerState.ILocalTransferCallback callback)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `Object` | `getValueAndReset()` Returns serialized byte count traffic metrics.
    `void` | `recv(List<TaskMessage> batch)` A batch of new messages have arrived to be processed.
    `protected void` | `updateMetrics(int sourceTaskId, TaskMessage message)` Update serialized byte counts for each message.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### DeserializingConnectionCallback

          public DeserializingConnectionCallback(Map<String,Object> conf,
                                                 GeneralTopologyContext context,
                                                 WorkerState.ILocalTransferCallback callback)

  - ### Method Detail

    - #### recv

          public void recv(List<TaskMessage> batch)

      Description copied from interface: `IConnectionCallback`

      A batch of new messages have arrived to be processed.

      Specified by:
        `recv` in interface `IConnectionCallback`
      Parameters:
        `batch` - the messages to be processed

    - #### getValueAndReset

          public Object getValueAndReset()

      Returns serialized byte count traffic metrics.

      Specified by:
        `getValueAndReset` in interface `IMetric`
      Returns:
        Map of metric counts, or null if disabled

    - #### updateMetrics

          protected void updateMetrics(int sourceTaskId,
                                       TaskMessage message)

      Update serialized byte counts for each message.

      Parameters:
        `sourceTaskId` - source task
        `message` - serialized message

Copyright © 2021 The Apache Software Foundation. All rights reserved.