Replay past events

@throws RuntimeException
491475
protected function replay(\Iterator $historyEvents): void
    {
        $isFirstEvent = true;
        foreach ($historyEvents as $pastEvent) {
            /** @var GenericJsonSchemaEvent $pastEvent */
            $this->version = $pastEvent->version();

            $pastEvent = $this->flavour->convertMessageReceivedFromNetwork($pastEvent, $isFirstEvent);
            $isFirstEvent = false;

            $this->apply($pastEvent);
        }
    }
877674
public function write(array $events = []): void
    {
        if ($this->isRolledBack) {
            throw new \RuntimeException('Cannot commit a rolledback transaction');
        }

        if ($this->isCommitted) {
            throw new \RuntimeException('Transaction is already committed');
        }

        $this->connection->transactionalWrite($this, $events, $this->userCredentials);
    }
947570
public final function rewind()
   {
       if (!$this->isReadable() || !$this->isSeekable()) {
           throw new RuntimeException("Can't rewind: stream is not readable");
       }
       rewind($this->stream);
       $this->meta["eof"] = false;
   }
869931
public function rewind() {
    $this->end = false;
    $this->nodeList = [];
    $this->processedOidList = [];
    $this->currentNode = $this->startNode;
  }
204362
public function rewind()
    {
        if (!self::$session) {
            Exception::i()->setMessage(self::ERROR_NOT_STARTED)->trigger();
        }

        reset($_SESSION);
    }
349664
public final void show() {
		if (firstTime) {
			firstTime = false;
			if (SwingUtilities.isEventDispatchThread()) {
				showIntern();
			} else {
				try {
					SwingUtilities.invokeAndWait(new Runnable() {
						public void run() {
							showIntern();
						}
					});
				} catch (final Exception ex) {
					ignore();
				}
			}
		} else {
			throw new IllegalStateException("This object cannot be reused!");
		}
	}
832339
public function rollback()
    {
        try {
            $this->dbHandler->rollback();

            // Clear all caches after rollback
            if ($this->contentTypeHandler instanceof CachingContentTypeHandler) {
                $this->contentTypeHandler->clearCache();
            }

            if ($this->languageHandler instanceof CachingLanguageHandler) {
                $this->languageHandler->clearCache();
            }
        } catch (Exception $e) {
            throw new RuntimeException($e->getMessage(), 0, $e);
        }
    }
1139464
public function rewind()
    {
        if ($this->_index == 0) {
            return;
        }

        if (!$this->_useBuffering) {
            $msg = 'You cannot rewind an un-buffered ResultSet. Use Query::bufferResults() to get a buffered ResultSet.';
            throw new Exception($msg);
        }

        $this->_index = 0;
    }
411745
public function rewind()
    {
        $this->recurIterator->rewind();
        // re-creating overridden event index.
        $index = [];
        foreach ($this->overriddenEvents as $key => $event) {
            $stamp = $event->DTSTART->getDateTime($this->timeZone)->getTimeStamp();
            $index[$stamp][] = $key;
        }
        krsort($index);
        $this->counter = 0;
        $this->overriddenEventsIndex = $index;
        $this->currentOverriddenEvent = null;

        $this->nextDate = null;
        $this->currentDate = clone $this->startDate;

        $this->next();
    }
689296
public function rewind()
    {
        $keys = array_keys($this->items);

        $this->currentKey = !empty($keys) ? reset($keys) : null;
    }
600181
private void replayEventsOverResultSet(QueryResult queryResult) throws Exception {
        Map<Integer, Future<Object>> future = readAccumulators();
        for (Map.Entry<Integer, Future<Object>> entry : future.entrySet()) {
            int partitionId = entry.getKey();
            Object eventsInOneAcc = entry.getValue().get();
            if (eventsInOneAcc == null) {
                continue;
            }
            eventsInOneAcc = mapServiceContext.toObject(eventsInOneAcc);
            List<QueryCacheEventData> eventDataList = (List<QueryCacheEventData>) eventsInOneAcc;
            for (QueryCacheEventData eventData : eventDataList) {
                if (eventData.getDataKey() == null) {
                    // this means a map-wide event like clear-all or evict-all
                    // is inside the accumulator buffers
                    removePartitionResults(queryResult, partitionId);
                } else {
                    add(queryResult, newQueryResultRow(eventData));
                }
            }
        }
    }
394835
def replay(self, start_block=1, end_block=None, filter_by=list(), **kwargs):
        
        return self.stream(
            filter_by=filter_by,
            start=start_block,
            stop=end_block,
            mode=self.mode,
            **kwargs
        )
138742
protected function reindex(array $events, int &$reindexed, SymfonyStyle $io, array $context, int $batch, bool $dryRun = false, bool $skipErrors = false): void
    {
        if ($dryRun) {
            $io->note(sprintf('DRY RUN - Would reindex event batch %d here.', $batch));
        } else {
            try {
                $this->getPbjx()->getEventSearch()->indexEvents($events, $context);
            } catch (\Throwable $e) {
                $io->error($e->getMessage());
                $io->note(sprintf('Failed to index batch %d.', $batch));
                $io->newLine(2);

                if (!$skipErrors) {
                    throw $e;
                }
            }
        }

        $reindexed += count($events);
    }
771192
public function rewind()
    {
        if (!$this->rewindable && !$this->firstCross) {
            throw new \Exception('Unable to traverse not rewindable iterator multiple time');
        }
        $this->firstCross = false;
        $this->position = 0;
    }
454499
public function replay(EventStream $historyEvents, $version = null)
    {
        if (null !== $version) {
            $this->version = $version;
        }

        $historyEvents->each(function (DomainMessage $pastEvent) {
            $this->version = $pastEvent->getVersion();
            $this->apply($pastEvent->getPayload());
        });
    }
571868
public boolean addAll(Collection<? extends SimulatorEvent> events) {
    long lastTimeStamp = (lastEvent == null) ? Long.MIN_VALUE : lastEvent
        .getTimeStamp();
    for (SimulatorEvent e : events) {
      if (e.getTimeStamp() < lastTimeStamp) {
        throw new IllegalArgumentException("Event happens in the past: "
            + e.getClass() + "(" + e.getTimeStamp() + "<" + lastTimeStamp);
      }
      e.setInternalCount(eventCount++);
    }
    return this.events.addAll(events);
  }
1196592
public void setRuntimeEventListener(RuntimeEventListener listener) {
        if (TraceComponent.isAnyTracingEnabled()
            && tc.isEntryEnabled())
            SibTr.entry(tc, "setRuntimeEventListener", listener);
        _runtimeEventListener = listener;
        if (TraceComponent.isAnyTracingEnabled()
            && tc.isEntryEnabled())
            SibTr.exit(tc, "setRuntimeEventListener");
    }