@Override
    public void overwrite(StreamEvent streamEvent) {
        if (isOperationLogEnabled) {
            if (!isFullSnapshot()) {
                StreamEvent streamEvent2 = tableStreamEventFactory.newInstance();
                eventConverter.convertComplexEvent(streamEvent, streamEvent2);
                operationChangeLog.add(new Operation(OVERWRITE, streamEvent2));
            } else {
                operationChangeLog.clear();
                forceFullSnapshot = true;
            }
        }
        StreamEvent deletedEvent = null;
        if (primaryKeyData != null) {
            Object primaryKey = constructPrimaryKey(streamEvent, primaryKeyReferenceHolders);
            deletedEvent = primaryKeyData.put(primaryKey, streamEvent);
            if (deletedEvent != null) {
                handleCachePolicyAttributeUpdate(streamEvent);
            }
        }

        if (indexData != null) {
            for (Map.Entry<String, Integer> indexEntry : indexMetaData.entrySet()) {
                TreeMap<Object, Set<StreamEvent>> indexMap = indexData.get(indexEntry.getKey());
                Object key = streamEvent.getOutputData()[indexEntry.getValue()];
                if (deletedEvent != null) {
                    Set<StreamEvent> values = indexMap.get(key);
                    values.remove(deletedEvent);
                    if (values.size() == 0) {
                        indexMap.remove(key);
                    }
                }
                Set<StreamEvent> values = indexMap.get(key);
                if (values == null) {
                    values = new HashSet<StreamEvent>();
                    values.add(streamEvent);
                    indexMap.put(streamEvent.getOutputData()[indexEntry.getValue()], values);
                } else {
                    values.add(streamEvent);
                }
            }
        }
    }
EventHolder implementation where events will be indexed and stored. This will offer faster access compared to
other EventHolder implementations. User can only add unique events based on a given primary key.
modules/siddhi-core/src/main/java/io/siddhi/core/table/holder/IndexEventHolder.java