public <K> void updateIndex(
     StubIndexKey key,
     int fileId,
     final Map<K, TIntArrayList> oldValues,
     Map<K, TIntArrayList> newValues) {
   try {
     final MyIndex<K> index = (MyIndex<K>) myIndices.get(key);
     index.updateWithMap(
         fileId,
         newValues,
         new Callable<Collection<K>>() {
           @Override
           public Collection<K> call() throws Exception {
             return oldValues.keySet();
           }
         });
   } catch (StorageException e) {
     LOG.info(e);
     requestRebuild();
   }
 }