public class StandardQueryResult extends Object implements QueryResult, ProgressiveResult
| Modifier and Type | Class and Description |
|---|---|
private static class |
StandardQueryResult.EventIdComparator |
| Modifier and Type | Field and Description |
|---|---|
private boolean |
canceled |
private Object |
completionMonitor |
private long |
creationNanos |
private String |
error |
private Date |
expirationDate |
private long |
hitCount |
private static org.slf4j.Logger |
logger |
private SortedSet<ProvenanceEventRecord> |
matchingRecords |
private int |
numCompletedSteps |
private int |
numSteps |
private Query |
query |
private long |
queryTime |
private Lock |
readLock |
private ReadWriteLock |
rwLock |
static int |
TTL |
private Lock |
writeLock |
| Constructor and Description |
|---|
StandardQueryResult(Query query,
int numSteps) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
awaitCompletion(long time,
TimeUnit unit) |
(package private) void |
cancel() |
String |
getError() |
Date |
getExpiration() |
List<ProvenanceEventRecord> |
getMatchingEvents() |
int |
getPercentComplete() |
long |
getQueryTime() |
long |
getTotalHitCount() |
boolean |
isFinished() |
void |
setError(String error) |
void |
update(Collection<ProvenanceEventRecord> newEvents,
long totalHits) |
private void |
updateExpiration()
Must be called with write lock!
|
private static final org.slf4j.Logger logger
public static final int TTL
private final Query query
private final long creationNanos
private final int numSteps
private final ReadWriteLock rwLock
private final Lock readLock
private final Lock writeLock
private final SortedSet<ProvenanceEventRecord> matchingRecords
private long hitCount
private int numCompletedSteps
private Date expirationDate
private String error
private long queryTime
private final Object completionMonitor
private volatile boolean canceled
public StandardQueryResult(Query query, int numSteps)
public List<ProvenanceEventRecord> getMatchingEvents()
getMatchingEvents in interface QueryResultpublic long getTotalHitCount()
getTotalHitCount in interface ProgressiveResultgetTotalHitCount in interface QueryResultpublic long getQueryTime()
getQueryTime in interface QueryResultpublic Date getExpiration()
getExpiration in interface QueryResultpublic String getError()
getError in interface QueryResultpublic int getPercentComplete()
getPercentComplete in interface QueryResultpublic boolean isFinished()
isFinished in interface ProgressiveResultisFinished in interface QueryResultvoid cancel()
public void setError(String error)
setError in interface ProgressiveResultpublic void update(Collection<ProvenanceEventRecord> newEvents, long totalHits)
update in interface ProgressiveResultpublic boolean awaitCompletion(long time,
TimeUnit unit)
throws InterruptedException
awaitCompletion in interface QueryResultInterruptedExceptionprivate void updateExpiration()
Copyright © 2022 Apache NiFi Project. All rights reserved.