private class OutriggerServerImpl.ContentsQuery extends Object implements LeasedResource
Modifier and Type | Field and Description |
---|---|
private Iterator |
classesIterator
An iteration into
classes |
private EntryHolder.ContinuingQuery |
currentQuery
The current
ContinuingQuery |
private long |
expiration
The current expiration time
|
private EntryRep[] |
lastBatch
Last batch of entries returned
|
private Uuid |
lastEntry
Uuid of the last entry returned
|
private Object |
lock
Lock to prevent concurrent calls to
nextBatch |
private Set<EntryHandle> |
provisionallyRemovedEntrySet
Set of entries that we have encountered that have been
provisionally removed
|
private long |
remaining
Number of elements left to return before reaching the
the client specified limit
|
private EntryRep[] |
tmpls
The complete set of templates
|
private Txn |
txn
The transaction the query is being performed under
|
private Uuid |
uuid
Uuid associated with this query and its lease |
Modifier | Constructor and Description |
---|---|
private |
ContentsQuery(Uuid uuid,
EntryRep[] tmpls,
Txn txn,
long limit) |
Modifier and Type | Method and Description |
---|---|
private boolean |
advanceCurrentQuery(long now) |
private boolean |
cancel()
Remove this query, assumes caller holds lock on this
object.
|
Uuid |
getCookie()
Returns the universally unique identifier associated with this
lease.
|
long |
getExpiration()
Returns the expiration time of the lease.
|
private EntryRep[] |
nextBatch(Uuid lastReceived,
long now) |
void |
setExpiration(long newExpiration)
Changes the expiration time of the lease.
|
private final Uuid uuid
Uuid
associated with this query and its leaseprivate final Iterator classesIterator
classes
private final EntryRep[] tmpls
private final Txn txn
private final Object lock
nextBatch
private volatile long expiration
private EntryHolder.ContinuingQuery currentQuery
ContinuingQuery
private long remaining
private Uuid lastEntry
private EntryRep[] lastBatch
private final Set<EntryHandle> provisionallyRemovedEntrySet
private boolean advanceCurrentQuery(long now)
private EntryRep[] nextBatch(Uuid lastReceived, long now) throws TransactionException
TransactionException
private boolean cancel()
true
if query has not
been already removed.public void setExpiration(long newExpiration)
LeasedResource
setExpiration
in interface LeasedResource
newExpiration
- The new expiration time in milliseconds
since the beginning of the epochpublic long getExpiration()
LeasedResource
getExpiration
in interface LeasedResource
public Uuid getCookie()
LeasedResource
ReferentUuid
should return this object from their
getReferentUuid
method and should base their implementation of equals
on
this object.getCookie
in interface LeasedResource
Copyright 2007-2013, multiple authors.
Licensed under the Apache License, Version 2.0, see the NOTICE file for attributions.