code: public void subscribeToEvent(
  			ResultPartitionID partitionId,
  			EventListener<TaskEvent> eventListener,
  			Class<? extends TaskEvent> eventType) {
  		checkNotNull(partitionId);
  		checkNotNull(eventListener);
  		checkNotNull(eventType);
  
  		TaskEventHandler taskEventHandler;
  		synchronized (registeredHandlers) {
  			taskEventHandler = registeredHandlers.get(partitionId);
  		}
  		if (taskEventHandler == null) {
  			throw new IllegalStateException(
  				"Partition " + partitionId + " not registered at task event dispatcher.");
  		}
  		taskEventHandler.subscribe(eventListener, eventType);
  	}
docs: Subscribes a listener to this dispatcher for events on a partition.
  
  @param partitionId
  ID of the partition to subscribe for (must be registered via {@link
  #registerPartition(ResultPartitionID)} first!)
  @param eventListener
  the event listener to subscribe
  @param eventType
  event type to subscribe to