trait StateStore extends ReadStateStore
Base trait for a versioned key-value store which provides both read and write operations. Each
instance of a StateStore represents a specific version of state data, and such instances are
created through a StateStoreProvider.
Unlike ReadStateStore, abort method may not be called if the commit method succeeds
to commit the change. (hasCommitted returns true.) Otherwise, abort method will be called.
Implementation should deal with resource cleanup in both methods, and also need to guard with
double resource cleanup.
- Alphabetic
- By Inheritance
- StateStore
- ReadStateStore
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Abstract Value Members
-
abstract
def
abort(): Unit
Abort all the updates that have been made to the store.
Abort all the updates that have been made to the store. Implementations should ensure that no more updates (puts, removes) can be after an abort in order to avoid incorrect usage.
- Definition Classes
- StateStore → ReadStateStore
-
abstract
def
commit(): Long
Commit all the updates that have been made to the store, and return the new version.
Commit all the updates that have been made to the store, and return the new version. Implementations should ensure that no more updates (puts, removes) can be after a commit in order to avoid incorrect usage.
-
abstract
def
get(key: UnsafeRow): UnsafeRow
Get the current value of a non-null key.
Get the current value of a non-null key.
- returns
a non-null row if the key exists in the store, otherwise null.
- Definition Classes
- ReadStateStore
-
abstract
def
hasCommitted: Boolean
Whether all updates have been committed
-
abstract
def
id: StateStoreId
Unique identifier of the store
Unique identifier of the store
- Definition Classes
- ReadStateStore
-
abstract
def
iterator(): Iterator[UnsafeRowPair]
Return an iterator containing all the key-value pairs in the StateStore.
Return an iterator containing all the key-value pairs in the StateStore. Implementations must ensure that updates (puts, removes) can be made while iterating over this iterator.
- Definition Classes
- StateStore → ReadStateStore
-
abstract
def
metrics: StateStoreMetrics
Current metrics of the state store
-
abstract
def
put(key: UnsafeRow, value: UnsafeRow): Unit
Put a new value for a non-null key.
Put a new value for a non-null key. Implementations must be aware that the UnsafeRows in the params can be reused, and must make copies of the data as needed for persistence.
-
abstract
def
remove(key: UnsafeRow): Unit
Remove a single non-null key.
-
abstract
def
version: Long
Version of the data in this store before committing updates.
Version of the data in this store before committing updates.
- Definition Classes
- ReadStateStore
Concrete Value Members
-
final
def
!=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
##(): Int
- Definition Classes
- AnyRef → Any
-
final
def
==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
asInstanceOf[T0]: T0
- Definition Classes
- Any
-
def
clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( ... ) @native()
-
final
def
eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
equals(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
def
finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( classOf[java.lang.Throwable] )
-
final
def
getClass(): Class[_]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
-
def
getRange(start: Option[UnsafeRow], end: Option[UnsafeRow]): Iterator[UnsafeRowPair]
Get key value pairs with optional approximate
startandendextents.Get key value pairs with optional approximate
startandendextents. If the State Store implementation maintains indices for the data based on the optionalkeyIndexOrdinalover fieldskeySchema(seeStateStoreProvider.init()), then it can usestartandendto make a best-effort scan over the data. Default implementation returns the full data scan iterator, which is correct but inefficient. Custom implementations must ensure that updates (puts, removes) can be made while iterating over this iterator.- start
UnsafeRow having the
keyIndexOrdinalcolumn set with appropriate starting value.- end
UnsafeRow having the
keyIndexOrdinalcolumn set with appropriate ending value.- returns
An iterator of key-value pairs that is guaranteed not miss any key between start and end, both inclusive.
- Definition Classes
- ReadStateStore
-
def
hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
-
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
-
final
def
ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
final
def
notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
-
final
def
notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
- Definition Classes
- AnyRef
-
def
toString(): String
- Definition Classes
- AnyRef → Any
-
final
def
wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... ) @native()