Stateless vs Statefull Operations


 
map and filter takes elements from the stream and it provides
the resultant stream with zero or more elements.
There operation doesn't need to cache the state or elements.
Once the operation done on any element it doesn't need to cache its state for performing operation next element.
So, these map and filter are stateless operations.

While reduce, sort and distinct all such operation required to cache the state of elements because to perform such operation it needs to have the previous state of the operation.
So, these reduce, distinct and sort operations are state full operations.