private void restoreKey(Key key, ObjectContainer container, long now) { SendableGet[] reqs = container == null ? null : (schedCore == null ? null : schedCore.requestsForKey(key, container, clientContext)); SendableGet[] transientReqs = schedTransient.requestsForKey(key, container, clientContext); if (reqs == null && transientReqs == null) { // Not an error as this can happen due to race conditions etc. if (logMINOR) Logger.minor(this, "Restoring key but no keys queued?? for " + key); } if (reqs != null) { for (int i = 0; i < reqs.length; i++) { // Requests may or may not be returned activated from requestsForKey(), so don't check // But do deactivate them once we're done with them. container.activate(reqs[i], 1); reqs[i].requeueAfterCooldown(key, now, container, clientContext); container.deactivate(reqs[i], 1); } } if (transientReqs != null) { for (int i = 0; i < transientReqs.length; i++) transientReqs[i].requeueAfterCooldown(key, now, container, clientContext); } }