class SharingPhysicalSlotRequestBulk implements PhysicalSlotRequestBulk {

	@Override
	public void cancel(Throwable cause) {
		// pending requests must be canceled first otherwise they might be fulfilled by
		// allocated slots released from this bulk
		for (ExecutionSlotSharingGroup group : pendingRequests.keySet()) {
			for (ExecutionVertexID id : executions.get(group)) {
				logicalSlotRequestCanceller.accept(id, cause);
			}
		}
		for (ExecutionSlotSharingGroup group : fulfilledRequests.keySet()) {
			for (ExecutionVertexID id : executions.get(group)) {
				logicalSlotRequestCanceller.accept(id, cause);
			}
		}
	}

	  SharingPhysicalSlotRequestBulk(
			Map<ExecutionSlotSharingGroup, List<ExecutionVertexID>> executions,
			Map<ExecutionSlotSharingGroup, ResourceProfile> pendingRequests,
			BiConsumer<ExecutionVertexID, Throwable> logicalSlotRequestCanceller);

}