code: public static void switchCache() throws InterruptedException {
  		//swith between two cache
  		if (cacheReference == masterCache) {
  			cacheReference = slaveCache;
  			masterCache.clear();
  		} else {
  			cacheReference = masterCache;
  			slaveCache.clear();
  		}
  	}
docs: Switch online and standby cache
  
  @throws InterruptedException