ow2-proactive / scheduling

Multi-platform Scheduling and Workflows Engine
http://www.activeeon.com/workflows-scheduling
GNU Affero General Public License v3.0
62 stars 55 forks source link

Sanitize JobInternal #2306

Open lpellegr opened 9 years ago

lpellegr commented 9 years ago

InternalJob implementation is really weird.

Several changes should be made to improve readability and performance:

marcocast commented 9 years ago

Instead of TreeMap, we may consider as well HashTreePMap from pCollection lib as it provides immutability and better performance together with clean code. http://pcollections.googlecode.com/svn/trunk/docs/org/pcollections/HashTreePMap.html

lpellegr commented 9 years ago

Interesting. ImmutableSortedMap from Guava should be also considered if it is possible to use an immutable map. This would avoid importing yet another library.

fviale commented 9 years ago

If ImmutableSortedMap refers to an immutable map, it would not be well suited to the tasks maps as tasks are added dynamically during iterations/replications. Unless I missed something.

lpellegr commented 9 years ago

@fviale yes, that's why I said if it is possible to use an immutable map. It was a suggestion related to what Marco proposed.

fviale commented 9 years ago

We should as well consider LinkedHashMap, which preserves insertion order. As TaskIds are always incrementing, insertion order should match TaskIds order.