HomePhabricator

Ensure all key transformations are applied by BagOStuff::makeKeyInternal()

Authored by ori.

Description

Ensure all key transformations are applied by BagOStuff::makeKeyInternal()

Currently we have to undo any transformations we apply to keys in getMulti() by
iterating over the response array keys reversing any changes. This is hairy and
complicated. So --

  • Replace calls to MemcachedBagOStuff::encodeKey() with calls to a new method, MemcachedBagOStuff::validateKeyEncoding(). The new method only validates that the key is compatible with memcached. If it is not, it throws an exception. If it is, it returns the key unmodified.
  • Remove MemcachedBagOStuff::{encode,decode}Key(), since they no longer serve a purpose, and have no callers.

Change-Id: If3e20c6a1a1b42fc1f2823aa660328e37c26eccb