Reputation: 1037
I want to use fastutill classes in my spark streaming application (scala). I am using hashmap instead but based on Spark documentations , they suggest use fastutill classes instead of hashmap..First, i wnat to know if these classes worth and then want to know what is the equvalent class in fast utill for hashmap.
Particulalry I am using a hashmap
HashMap[Key_Object, ArrayBuffer[Value_object]..I wnated to know what is the best collection in fastutill
Upvotes: 0
Views: 973
Reputation: 968
I think you're looking for Object2ObjectOpenHashMap.java. It acts like a generic hashMap class. It's default hashing functions works okay IMO.
If you want to reduce hash-collisions or better performance, prefer Object2ObjectOpenCustomHashMap. You'll have to provide your context-specific custom hashing function when creating the hash-map.
Note that, FastUtil has plenty of other types that might work better for you, refer to their documentation which can be found here
Upvotes: 1