class_docstr: An interface to specify the exchange map and reduce tasks.
  
  Subclasses should implement the `map` and `reduce` static methods.
  `map` method is to transform one input block into multiple output blocks.
  `reduce` is to combine multiple map output blocks. Both methods are
  single-task operations. See `ExchangeScheduler` for how to distribute
  the operations across multiple tasks.
  
  Any custom arguments for `map` and `reduce` methods should be specified by
  setting `map_args` and `reduce_args`.
  
  The concept here is similar to the exchange operator described in
  "Volcano - An Extensible and Parallel Query Evaluation System"
  (https://dl.acm.org/doi/10.1109/69.273032).
class_docstr_tok: ["An","interface","to","specify","the","exchange","map","and","reduce","tasks",".","Subclasses","should","implement","the","`","map","`","and","`","reduce","`","static","methods",".","`","map","`","method","is","to","transform","one","input","block","into","multiple","output","blocks",".","`","reduce","`","is","to","combine","multiple","map","output","blocks",".","Both","methods","are","single-task","operations",".","See","`","ExchangeScheduler","`","for","how","to","distribute","the","operations","across","multiple","tasks",".","Any","custom","arguments","for","`","map","`","and","`","reduce","`","methods","should","be","specified","by","setting","`","map_args","`","and","`","reduce_args","`",".","The","concept","here","is","similar","to","the","exchange","operator","described","in","''","Volcano","-","An","Extensible","and","Parallel","Query","Evaluation","System","''","(","https",":","\/\/dl.acm.org\/doi\/10.1109\/69.273032",")","."]
code: def __init__(
      self, map_args: List[Any] = None, reduce_args: List[Any] = None
  ):
      self._map_args = map_args or []
      self._reduce_args = reduce_args or []
      assert isinstance(self._map_args, list)
      assert isinstance(self._reduce_args, list)
  
file_path: ray/python/ray/data/_internal/planner/exchange/interfaces.py
imports: from typing import Any, Dict, List, Optional, Tuple, Union
  from ray.data._internal.execution.interfaces import RefBundle
  from ray.data._internal.stats import StatsDict
  from ray.data.block import Block, BlockMetadata
label_desc: Use image node_id 1 to create a new ExchangeTaskSpec object  with example: obj = ExchangeTaskSpec(map_args, reduce_args)