@Override
                    public int compare(IncrementalSnapshotInfo o1, IncrementalSnapshotInfo o2) {
                        int results = o1.getId().compareTo(o2.getId());
                        if (results == 0) {
                            results = Long.compare(o2.getTime(), o1.getTime());
                            if (results == 0) {
                                return o2.getType().compareTo(o1.getType());
                            }
                        }
                        return results;
                    }
Service level implementation to take/restore snapshots of processing elements.
Memory   : PartitionId + QueryName + ElementId + PartitionGroupByKey + Item
Snapshot : PartitionId + PartitionGroupByKey + QueryName + ElementId + Item
modules/siddhi-core/src/main/java/io/siddhi/core/util/snapshot/SnapshotService.java