PreparedStatement

PreparedStatement

This object keeps track of the query plan a.k.a. metadata and preparedQuery bytes. It provides a way of retrieving last retrieved query plan. If a query plan is marked as expired, it will be refreshed. You can get the query plan via the getData method. If the query plan is not expired, getData will return the value immediately. If the object is marked as expired, getting the query plan will wait for a refresh to happen. If the refresh fails, all awaiting getData calls also return an error.

Constructor

new PreparedStatement()

Members

getData

Used for retrieveing the query plan (preparedQuery bytes and metadata)

getParameterTypes

handlePrepareQueryResponse

Callback for handling the call to bigtable.

handleTimerEnd

Begins the refresh.

isExpired

markAsExpired

This function should be called, when the server returns the FAILED_PRECONDITION error saying the query plan is expired. For more info refer to the ExecuteQueryStateMachine.

scheduleRefreshIfNeeded

Invoked when the query plan is retrieved from this object.

setupTimer

Schedules the refresh. It is deffered to the next tick to ensure that the current call stack is finished before a request to bigtable is made.

shouldRefreshSoon

Returns true if the validUntilTimestamp is close, meaning less than SHOULD_REFRESH_SOON_PERIOD_MS away.

startRefreshing

Performs a request to bigtable to get a refreshed query plan.