public static final class Query.Timeout extends java.lang.Object implements Query.Controller
The timeout applies to the entire duration of fetching results, not just the time spent between individual fetches. A caller which is slowly processing results can timeout. More sophisticated timeouts can be implemented using custom Controller implementations.
Constructor and Description |
---|
Query.Timeout(long timeout,
java.util.concurrent.TimeUnit unit) |
Modifier and Type | Method and Description |
---|---|
void |
begin()
Called by query when it begins, possibly multiple times.
|
void |
close()
Always called by query when finished, even when it fails.
|
void |
continueCheck()
Periodically called by query to determine if it should continue.
|
long |
getTimeout()
Returns a non-negative value if controller imposes an absolute upper
bound on query execution time.
|
java.util.concurrent.TimeUnit |
getTimeoutUnit()
Returns the unit for the timeout, if applicable.
|
static Query.Timeout |
hours(long timeout)
Return a new Timeout in hours.
|
static Query.Timeout |
micros(long timeout)
Return a new Timeout in microseconds.
|
static Query.Timeout |
millis(long timeout)
Return a new Timeout in milliseconds.
|
static Query.Timeout |
minutes(long timeout)
Return a new Timeout in minutes.
|
static Query.Timeout |
nanos(long timeout)
Return a new Timeout in nanoseconds.
|
static Query.Timeout |
seconds(long timeout)
Return a new Timeout in seconds.
|
java.lang.String |
toString() |
public Query.Timeout(long timeout, java.util.concurrent.TimeUnit unit)
public static Query.Timeout nanos(long timeout)
public static Query.Timeout micros(long timeout)
public static Query.Timeout millis(long timeout)
public static Query.Timeout seconds(long timeout)
public static Query.Timeout minutes(long timeout)
public static Query.Timeout hours(long timeout)
public long getTimeout()
Query.Controller
getTimeout
in interface Query.Controller
public java.util.concurrent.TimeUnit getTimeoutUnit()
Query.Controller
getTimeoutUnit
in interface Query.Controller
public void begin()
Query.Controller
begin
in interface Query.Controller
public void continueCheck() throws FetchTimeoutException
Query.Controller
continueCheck
in interface Query.Controller
FetchTimeoutException
public void close()
Query.Controller
close
in interface Query.Controller
close
in interface java.io.Closeable
close
in interface java.lang.AutoCloseable
public java.lang.String toString()
toString
in class java.lang.Object
Copyright © 2006-2013 Amazon Technologies, Inc.. All Rights Reserved.