class EntryTransition extends Object
Modifier and Type | Field and Description |
---|---|
private boolean |
available
true if the entry is transitioning from a state
where it could not be taken to one where it could be,
false otherwise. |
private EntryHandle |
handle
The
EntryHandle of the entry that changed |
private boolean |
newEntry
true if the transition is a write or
the commit of a write, false otherwise. |
private TransactableMgr |
txn
If this is a transition to visibility and/or availability, what
transaction the entry is now available/visible to.
|
private boolean |
visible
true if the entry is transitioning from a state
where it could not be read to one where it could be,
false otherwise. |
private Set |
watchers
Set of watchers that need to remember that they have seen
this transition already
|
Constructor and Description |
---|
EntryTransition(EntryHandle handle,
TransactableMgr txn,
boolean available,
boolean visible,
boolean newEntry)
Create a new
EntryTransition object
with the specified content. |
Modifier and Type | Method and Description |
---|---|
(package private) EntryHandle |
getHandle()
Return the
EntryHandle for entry undergoing the
visibility transition. |
(package private) TransactableMgr |
getTxn()
If this is a transition to visibility and/or availability, what
transaction the entry is now available/visible to.
|
(package private) boolean |
hasProcessed(TransitionWatcher w)
Return
true if the passed watcher has been passed
to processedBy . |
(package private) boolean |
isAvailable()
Returns
true if this is a transition from a state
where the entry could not be taken to one where it could be. |
(package private) boolean |
isNewEntry()
Return
true if this transition represents a
new entry becoming visible, otherwise return false . |
(package private) boolean |
isVisible()
Returns
true if this is a transition from a state
where the entry could not be read to one where it could be. |
(package private) void |
processedBy(TransitionWatcher w)
Record that a given watcher has processed this Transition and
does not need to again.
|
private final EntryHandle handle
EntryHandle
of the entry that changedprivate final TransactableMgr txn
null
the entry transitioned to a state where it is
available/visible to all.private final boolean available
true
if the entry is transitioning from a state
where it could not be taken to one where it could be,
false
otherwise.private final boolean visible
true
if the entry is transitioning from a state
where it could not be read to one where it could be,
false
otherwise.private final boolean newEntry
true
if the transition is a write or
the commit of a write, false
otherwise.private final Set watchers
EntryTransition(EntryHandle handle, TransactableMgr txn, boolean available, boolean visible, boolean newEntry)
EntryTransition
object
with the specified content.handle
- The EntryHandle
of the
the entry who's visibility is changing.txn
- If the entry is only visible in a particular
transaction, the Txn
for that
transaction, and null
otherwise.available
- true
if the entry is
transitioning from a state where it could not be
taken to one where it could be,
false
otherwise.visible
- true
if the entry is transitioning
from a state where it could not be read to one
where it could be, false
otherwise.newEntry
- true
if the entry is available and
the transition is because of a write or a write
that is being committed, false
otherwise.NullPointerException
- if handle is null.EntryHandle getHandle()
EntryHandle
for entry undergoing the
visibility transition.TransactableMgr getTxn()
null
the entry transitioned to a state where it is
available/visible to all.boolean isAvailable()
true
if this is a transition from a state
where the entry could not be taken to one where it could be.
Otherwise returns false
. Note, isVisible
returning true
implies that isAvailable
will also return true
.true
if this is a transition from a state
where the entry could not be taken to one where it could be.
Otherwise returns false
boolean isVisible()
true
if this is a transition from a state
where the entry could not be read to one where it could be.
Otherwise returns false
. Note, isVisible
returning true
implies that isAvailable
will also return true
.true
if this is a transition from a state
where the entry could not be read to one where it could be.
Otherwise returns false
boolean isNewEntry()
true
if this transition represents a
new entry becoming visible, otherwise return false
.true
if this transition represents a
new entry becoming visible, otherwise return false
.void processedBy(TransitionWatcher w)
processedBy
and hasProcessed
methods are only called from
a single thread. Note, we never remove watchers from the set of watchers that have processed this transition since in general we would only know to remove a watcher when this transition had already visited every template, at which point the entire EntryTransition object is eligible for GC (internally we could use a weak set, but once watchers start processing an EntryTransition, its life time is limited so it hardly seems worth the trouble)
boolean hasProcessed(TransitionWatcher w)
true
if the passed watcher has been passed
to processedBy
. Assumes that the processedBy
and hasProcessed
methods are only called from
a single thread.Copyright 2007-2013, multiple authors.
Licensed under the Apache License, Version 2.0, see the NOTICE file for attributions.