apache / accumulo

Apache Accumulo
https://accumulo.apache.org
Apache License 2.0
1.07k stars 445 forks source link

only registers cleaner in native map when needed #4909

Closed keith-turner closed 2 months ago

keith-turner commented 2 months ago

Registering cleaners takes up resources and currently bumps into a global lock. The native map code is registering a cleaner for iterators, even in the case where the native code did not allocate an iterator. This code is called very frequently by scan threads.

This change does not register the cleaner in the case where the native code did not allocate a native iterator. This should cause less contention between scan threads that are unrelated to each other.

keith-turner commented 2 months ago

Notice this while researching the lock contention seen in #4910.