private void onServerEvent(ReplicaId replicaId, ServerErrorCode errorCode) {
    switch (errorCode) {
      case IOError:
      case DiskUnavailable:
        clusterMap.onReplicaEvent(replicaId, ReplicaEventType.Disk_Error);
        break;
      case PartitionReadOnly:
        clusterMap.onReplicaEvent(replicaId, ReplicaEventType.Partition_ReadOnly);
        clusterMap.onReplicaEvent(replicaId, ReplicaEventType.Disk_Ok);
        clusterMap.onReplicaEvent(replicaId, ReplicaEventType.Replica_Available);
        break;
      case TemporarilyDisabled:
      case ReplicaUnavailable:
        clusterMap.onReplicaEvent(replicaId, ReplicaEventType.Disk_Ok);
        clusterMap.onReplicaEvent(replicaId, ReplicaEventType.Replica_Unavailable);
        break;
      default:
        // other server error codes
        clusterMap.onReplicaEvent(replicaId, ReplicaEventType.Disk_Ok);
        clusterMap.onReplicaEvent(replicaId, ReplicaEventType.Replica_Available);
        break;
    }
    // Regardless of what the error code is (or there is no error), it is a node response event.
    clusterMap.onReplicaEvent(replicaId, ReplicaEventType.Node_Response);
  }
Act on an event in the form of a {@link ServerErrorCode} on the given {@link ReplicaId}
@param replicaId the {@link ReplicaId} to which the request that received the error was made.
@param errorCode the {@link ServerErrorCode} received for the request.
ambry-commons/src/main/java/com/github/ambry/commons/ResponseHandler.java