Reduce lock contention in RPTokenFactory

Description

RPTokenFactory.md5() is called for almost every query plan by TokenAwarePolicy.

This method calls java.security.MessageDigest.getInstance(java.lang.String) which is known to create lock contentions (see JDK-7092821).

There is a workaround, which consists of cloning a prototype instance of MessageDigest, cf. Guava's implementation.

Environment

None

Pull Requests

None
Fixed

Assignee

Unassigned

Reporter

Alexandre Dutra

Labels

PM Priority

None

Affects versions

None

Fix versions

Pull Request

None

Doc Impact

None

Size

None

External issue ID

None

External issue ID

None

Priority

Minor
Configure