This week in the repo

Brian Goetz brian.goetz at oracle.com
Tue Sep 25 15:04:55 PDT 2012


I plan to do a weekly summary of the putbacks to the repo, for those 
that are not following the putback messages.  Here is the first one.

*Week of Sept 17, 2012*

*Cleanup of size protocols in StreamAccessor and Spliterator (Mike). 
*Replaced various size(), getSize(), getSizeIfKnown(), 
getOrEstimateSize() methods with a pair of methods: getSizeIfKnown 
(returns -1 if unknown) and estimateSize() on Spliterator and 
StreamAccessor. Estimates are used largely for decomposition decisions 
and may be inaccurate (in the worst case, return MAX_VALUE); explicit 
sizes are used for optimizations such as pre-sizing target arrays. Also 
added getNaturalSplits() to Spliterator to indicate the most natural 
split arity from the perspective of the data structure; operations are 
free to ignore this.

*Rename of stream shapes (Henry). *The array/collection-like stream 
shape that had been known as "Linear" was renamed to "Value", and 
various other supporting classes and methods (ValuePipeline, chainValue) 
were renamed accordingly.

*Op merging (Brian). *For some Op implementations, it was possible to 
merge across related functions (merge {Any,All,None}MatchOp into 
MatchOp) and across shapes (merge MatchOp and BiMatchOp into one.) In 
some cases, this results in dramatic reduction in code duplication; in 
others (especially stateless intermediate ops), almost none.

*More specialized StreamSource implementations (Mike). *Add parallel() 
specialization to ArrayList, Vector. Still a lot of work left to do here.

*Migration to CountedCompleter (Brian). *All currently implemented 
parallel ops (except cumulate) are now based on CountedCompleter, and 
many based on an abstract base task class AbstractTask. AbstractTask now 
supports n-way splits instead of only binary splits, guided by 
Spliterator.getNaturalSplits.

*More parallel implementations (Brian). *Added parallel implementation 
of short-circuiting {any,all,none}Match.

*New ops (Paul). *Added limit(n), skip(n) stateful intermediate 
operations to Stream and MapStream. Added a stream concatenation 
operation to Stream and MapStream for serial and parallel operation.

*Infinite stream (Paul). *Added exploratory support for infinite stream 
generators.

*Refactored intermediate operation test helpers (Paul)*: Operations can 
be tested that may perform side-effects such as Tee and Concat. Easier 
to test a subset of operations.

*Refactored Stream to extend BaseStream (Brian)*: Streamable now generic 
in stream type. Streamable<T> becomes Streamable<Stream<T>>, 
MapStreamable<K,V> becomes Streamable<MapStream<K,V>>.




More information about the lambda-libs-spec-observers mailing list