Interface TraceSnapshot
- All Known Implementing Classes:
DBTraceSnapshot
-
Method Summary
Modifier and TypeMethodDescriptionvoiddelete()Delete this snapshot This does not delete any entries in other managers associated with this snapshot.Get the description of the snapshotIf this snapshot was created because of an event, get the thread that caused itlonggetKey()Get a key which orders the snapshot chronologicallylongGet the real creation time of this snapshot in milliseconds since the epochGet the schedule, if applicable and known, relating this snapshot to a previous oneGet the string representation of the schedulegetTrace()longGet the snapshot's version, esp., when it represents a cache entrybooleanisSnapOnly(boolean whenInconsistent) Check if a snapshot involves any steps of emulationbooleanisStale(boolean whenInconsistent) For an emulated snapshot, check if re-emulation is necessary to produce an up-to-date snapshot.voidsetDescription(String description) Set the human-consumable description of the snapshotvoidsetEventThread(TraceThread thread) If this snapshot was create because of an event, set the thread that caused itvoidsetRealTime(long millisSinceEpoch) Set the real creation time of this snapshot in milliseconds since Jan 1, 1970 12:00 AM (UTC)voidsetSchedule(TraceSchedule schedule) Set the schedule from some previous snapshot to this onevoidsetVersion(long version) Set the snapshot's version, esp., when it represents a cache entry
-
Method Details
-
getTrace
Trace getTrace() -
getKey
long getKey()Get a key which orders the snapshot chronologically- Returns:
- the database key
-
getDescription
String getDescription()Get the description of the snapshot- Returns:
- the description
-
setDescription
Set the human-consumable description of the snapshot- Parameters:
description- the description
-
getRealTime
long getRealTime()Get the real creation time of this snapshot in milliseconds since the epoch- Returns:
- the real time
-
setRealTime
void setRealTime(long millisSinceEpoch) Set the real creation time of this snapshot in milliseconds since Jan 1, 1970 12:00 AM (UTC)- Parameters:
millisSinceEpoch- the real time
-
getEventThread
TraceThread getEventThread()If this snapshot was created because of an event, get the thread that caused it- Returns:
- the event thread, if applicable
-
setEventThread
If this snapshot was create because of an event, set the thread that caused it- Parameters:
thread- the event thread, if applicable
-
getSchedule
TraceSchedule getSchedule()Get the schedule, if applicable and known, relating this snapshot to a previous oneThis information is not always known, or even applicable. If recording a single step, ideally, this is simply the previous snap plus one step of the event thread, e.g., for snap 6, the schedule would be "5:1". For an emulated machine cached in scratch space, this should be the schedule that would recover the same machine state.
The object managers in the trace pay no heed to this schedule. In particular, when retrieving the "most-recent" information from a snapshot with a known schedule, the "previous snap" part of that schedule is not taken into account. In other words, the managers still interpret time linearly, even though this schedule field might imply built-in forking.
- Returns:
- the (possibly null) schedule
-
getScheduleString
String getScheduleString()Get the string representation of the schedule- Returns:
- the (possibly empty) string representation of the schedule
-
setSchedule
Set the schedule from some previous snapshot to this one- Parameters:
schedule- the schedule
-
getVersion
long getVersion()Get the snapshot's version, esp., when it represents a cache entry- Returns:
- the version
- See Also:
-
setVersion
void setVersion(long version) Set the snapshot's version, esp., when it represents a cache entry- Parameters:
version- the version- See Also:
-
isSnapOnly
boolean isSnapOnly(boolean whenInconsistent) Check if a snapshot involves any steps of emulationA scratch snapshot, i.e., whose key is negative, without a schedule set is considered inconsistent.
- Parameters:
whenInconsistent- the value to return for a scratch snapshot without a set schedule- Returns:
- true if no emulation is involved
-
isStale
boolean isStale(boolean whenInconsistent) For an emulated snapshot, check if re-emulation is necessary to produce an up-to-date snapshot.For non-emulated snapshots, this always returns false. A non-emulated snapshot is a snapshot whose schedule includes no emulation steps. An emulation snapshot is stale when its version is less than the trace's emulator cache version. A scratch snapshot, i.e., whose key is negative, without a schedule set is considered inconsistent.
- Parameters:
whenInconsistent- the value to return for a scratch snapshot without a set schedule- Returns:
- true if re-emulation is needed
- See Also:
-
delete
void delete()Delete this snapshot This does not delete any entries in other managers associated with this snapshot. This simply deletes the marker and accompanying metadata. However, entries associated with deleted or otherwise non-existent snapshot keys may cause interesting behavior, especially for keys which exceed the latest snapshot key.
-