4 ms·
Here's an example of improving the design of your interfaces to improve the problem... The mapper function now receives two extra arguments, one Writable of ke
by jganetsk 17y ago
Here's an example of improving the design of your interfaces to improve the problem...
The mapper function now receives two extra arguments, one Writable of key type and one Writable of value type.
The emit method now has zero arguments. When called, it emits the key-value pair represented by the Writables passed in to the mapper function.
Now, you are forced to use and reuse the Writable objects passed in to your mapper. Sure, you can allocate new ones, but they would be worthless since you can't do anything with them. This would, hopefully, stop programmers from allocating them.
No need to explicitly return things to any pools.