class OperatorSubtaskState implements CompositeStateHandle {

	@Override
	public void discardState() {
		try {
			List<StateObject> toDispose =
				new ArrayList<>(
						managedOperatorState.size() +
						rawOperatorState.size() +
						managedKeyedState.size() +
						rawKeyedState.size() +
						inputChannelState.size() +
						resultSubpartitionState.size());
			toDispose.addAll(managedOperatorState);
			toDispose.addAll(rawOperatorState);
			toDispose.addAll(managedKeyedState);
			toDispose.addAll(rawKeyedState);
			toDispose.addAll(collectUniqueDelegates(inputChannelState, resultSubpartitionState));
			StateUtil.bestEffortDiscardAllStateObjects(toDispose);
		} catch (Exception e) {
			LOG.warn("Error while discarding operator states.", e);
		}
	}

	public  OperatorSubtaskState();
	public  OperatorSubtaskState(
			@Nonnull StateObjectCollection<OperatorStateHandle> managedOperatorState,
			@Nonnull StateObjectCollection<OperatorStateHandle> rawOperatorState,
			@Nonnull StateObjectCollection<KeyedStateHandle> managedKeyedState,
			@Nonnull StateObjectCollection<KeyedStateHandle> rawKeyedState);
	public  OperatorSubtaskState(
		@Nonnull StateObjectCollection<OperatorStateHandle> managedOperatorState,
		@Nonnull StateObjectCollection<OperatorStateHandle> rawOperatorState,
		@Nonnull StateObjectCollection<KeyedStateHandle> managedKeyedState,
		@Nonnull StateObjectCollection<KeyedStateHandle> rawKeyedState,
		@Nonnull StateObjectCollection<InputChannelStateHandle> inputChannelState,
		@Nonnull StateObjectCollection<ResultSubpartitionStateHandle> resultSubpartitionState);
	public  OperatorSubtaskState(
			@Nullable OperatorStateHandle managedOperatorState,
			@Nullable OperatorStateHandle rawOperatorState,
			@Nullable KeyedStateHandle managedKeyedState,
			@Nullable KeyedStateHandle rawKeyedState,
			@Nullable StateObjectCollection<InputChannelStateHandle> inputChannelState,
			@Nullable StateObjectCollection<ResultSubpartitionStateHandle> resultSubpartitionState);

}