CompactRangeIndex extends AbstractIndex { @Override void removeMapping(RegionEntry entry, int opCode) throws IMQException { if (opCode == BEFORE_UPDATE_OP) { if (!IndexManager.isObjectModificationInplace()) { if (oldKeyValue == null) { oldKeyValue = new ThreadLocal<OldKeyValuePair>(); } oldKeyValue.set(new OldKeyValuePair()); this.evaluator.evaluate(entry, false); } } else if (opCode == REMOVE_DUE_TO_GII_TOMBSTONE_CLEANUP) { if (oldKeyValue != null) { if (oldKeyValue.get() == null) { return; } indexStore.removeMapping(oldKeyValue.get().getOldKey(), entry); } else { indexStore.removeMapping(IndexManager.NULL, entry); } } else if (opCode == CLEAN_UP_THREAD_LOCALS) { if (oldKeyValue != null) { oldKeyValue.remove(); } } else { if (oldKeyValue != null) { oldKeyValue.remove(); } this.evaluator.evaluate(entry, false); this.internalIndexStats.incNumUpdates(); } } CompactRangeIndex(InternalCache cache, String indexName, Region region, String fromClause,
      String indexedExpression, String projectionAttributes, String origFromClause,
      String origIndexExpr, String[] definitions, IndexStatistics stats); IndexStore getIndexStorage(); @Override IndexType getType(); @Override void initializeIndex(boolean loadEntries); @Override boolean clear(); @Override List queryEquijoinCondition(IndexProtocol indx, ExecutionContext context); @Override int getSizeEstimate(Object key, int operator, int matchLevel); @Override ObjectType getResultSetType(); List expandValue(ExecutionContext context, Object lowerBoundKey, Object upperBoundKey,
      int lowerBoundOperator, int upperBoundOperator, Object value); String dump(); static void setTestHook(TestHook hook); @Override boolean isEmpty(); @Override Map getValueToEntriesMap(); void addSavedMappings(RegionEntry entry);  }
@Test public void testRemoveMapping() throws Exception { when(region.getCache()).thenReturn(cache); when(cache.getCachePerfStats()).thenReturn(cacheperfstat); when(cache.getQueryService()).thenReturn(queryservice); index.removeMapping(entry, 3); }