Implemented Rate limiter abstraction.

Review: https://reviews.apache.org/r/12018