public interface PState extends PartitionedObject
RamaClusterManager
on a real cluster or
InProcessCluster
in a test environment.
pstate
.Modifier and Type | Interface and Description |
---|---|
static interface |
PState.Declaration
Builder-style interface for specifying options when declaring a PState in a module
|
static interface |
PState.MigratedSchema
Builder-style interface for declaring options on a migrated schema declared with
migrated(java.lang.Object, java.lang.String, com.rpl.rama.ops.RamaFunction1<?, ?>) |
static interface |
PState.Schema
Builder-style interface for declaring options on PState schemas
|
Modifier and Type | Method and Description |
---|---|
static PState.Schema |
fixedKeysSchema(java.lang.Object... keyAndSchemas)
Declare schema for map with different schema for each key.
|
static PState.Schema |
listSchema(java.lang.Class valClass)
Declare a list schema
|
static PState.Schema |
listSchema(PState.Schema valueSchema)
Declare a list schema
|
static PState.Schema |
mapSchema(java.lang.Class keyClass,
java.lang.Class valueSchema)
Declare a map schema
|
static PState.Schema |
mapSchema(java.lang.Class keyClass,
PState.Schema valueSchema)
Declare a map schema
|
static PState.MigratedSchema |
migrated(java.lang.Object schema,
java.lang.String migrationId,
RamaFunction1<?,?> migrationFunction)
Declares a migration at a location in a PState schema.
|
<T> ProxyState<T> |
proxy(java.lang.Object partitioningKey,
Path path)
Reactive query of PState using explicit partitioning key with
Path that must
navigate to exactly one value. |
<T> ProxyState<T> |
proxy(java.lang.Object partitioningKey,
Path path,
ProxyState.Callback<T> callback)
Reactive query of PState using explicit partitioning key with
Path that must
navigate to exactly one value. |
<T> ProxyState<T> |
proxy(Path path)
Reactive query of PState with
Path that must navigate to exactly one value. |
<T> ProxyState<T> |
proxy(Path path,
ProxyState.Callback<T> callback)
Reactive query of PState with
Path that must navigate to exactly one value. |
<T> java.util.concurrent.CompletableFuture<ProxyState<T>> |
proxyAsync(java.lang.Object partitioningKey,
Path path)
Reactive query of PState using explicit partitioning key with
Path that must
navigate to exactly one value. |
<T> java.util.concurrent.CompletableFuture<ProxyState<T>> |
proxyAsync(java.lang.Object partitioningKey,
Path path,
ProxyState.Callback<T> callback)
Reactive query of PState using explicit partitioning key with
Path that must
navigate to exactly one value. |
<T> java.util.concurrent.CompletableFuture<ProxyState<T>> |
proxyAsync(Path path)
Reactive query of PState with
Path that must navigate to exactly one value. |
<T> java.util.concurrent.CompletableFuture<ProxyState<T>> |
proxyAsync(Path path,
ProxyState.Callback<T> callback)
Reactive query of PState with
Path that must navigate to exactly one value. |
<T> java.util.List<T> |
select(java.lang.Object partitioningKey,
Path path)
Queries PState with
Path using explicit partitioning key. |
<T> java.util.List<T> |
select(Path path)
Queries PState with
Path . |
<T> java.util.concurrent.CompletableFuture<java.util.List<T>> |
selectAsync(java.lang.Object partitioningKey,
Path path)
Queries PState with
Path using explicit partitioning key. |
<T> java.util.concurrent.CompletableFuture<java.util.List<T>> |
selectAsync(Path path)
Queries PState with
Path . |
<T> T |
selectOne(java.lang.Object partitioningKey,
Path path)
Queries PState using explicit partitioning key with
Path that must navigate
to exactly one value. |
<T> T |
selectOne(Path path)
Queries PState with
Path that must navigate to exactly one value. |
<T> java.util.concurrent.CompletableFuture<T> |
selectOneAsync(java.lang.Object partitioningKey,
Path path)
Queries PState using explicit partitioning key with
Path that must navigate
to exactly one value. |
<T> java.util.concurrent.CompletableFuture<T> |
selectOneAsync(Path path)
Queries PState with
Path that must navigate to exactly one value. |
static PState.Schema |
setSchema(java.lang.Class valClass)
Declare a set schema
|
getObjectInfo
static PState.MigratedSchema migrated(java.lang.Object schema, java.lang.String migrationId, RamaFunction1<?,?> migrationFunction)
schema
- The new schema for this location in the PStatemigrationId
- Used to determine if a migration should be restarted or continue where it left off when the module is updated mid-migration. If this remains the same, it continues where it left off. Otherwise, it restarts from the beginning of the PState.migrationFunction
- A function that converts values at that position from the old schema to the new schema. It must be idempotent, as it may be called on either a migrated or unmigrated value.static PState.Schema mapSchema(java.lang.Class keyClass, java.lang.Class valueSchema)
keyClass
- Type of keys in mapvalueSchema
- Type of values in mapstatic PState.Schema mapSchema(java.lang.Class keyClass, PState.Schema valueSchema)
keyClass
- Type of keys in mapvalueSchema
- Schema for nested data structures for map valuesstatic PState.Schema setSchema(java.lang.Class valClass)
valClass
- Type of values in setstatic PState.Schema listSchema(java.lang.Class valClass)
valClass
- Type of values in liststatic PState.Schema listSchema(PState.Schema valueSchema)
valueSchema
- Schema for values in liststatic PState.Schema fixedKeysSchema(java.lang.Object... keyAndSchemas)
PState.fixedKeysSchema("a", Long.class, "b", PState.setSchema(String.class)
keyAndSchemas
- Alternating declarations of keys and the Class
or
PState.Schema
schema for that key<T> java.util.List<T> select(Path path)
Path
. If PState has more than one partition, Path
must
start with key
navigator and query will extract that key as partitioning
key. Blocking operation.T
- Type of navigated valuespath
- Query path<T> java.util.List<T> select(java.lang.Object partitioningKey, Path path)
Path
using explicit partitioning key. Blocking operation.T
- Type of navigated valuepartitioningKey
- Explicit partitioning keypath
- Query path<T> T selectOne(Path path)
Path
that must navigate to exactly one value. If PState
has more than one partition, Path
must start with key
navigator
and query will extract that key as partitioning key. Blocking operation.T
- Type of navigated valuepath
- Query path<T> T selectOne(java.lang.Object partitioningKey, Path path)
Path
that must navigate
to exactly one value. Blocking operation.T
- Type of navigated valuepartitioningKey
- Explicit partitioning keypath
- Query path<T> java.util.concurrent.CompletableFuture<java.util.List<T>> selectAsync(Path path)
Path
. If PState has more than one partition, Path
must
start with key
navigator and query will extract that key as partitioning
key. Non-blocking operation.T
- Type of navigated valuespath
- Query path<T> java.util.concurrent.CompletableFuture<java.util.List<T>> selectAsync(java.lang.Object partitioningKey, Path path)
Path
using explicit partitioning key. Non-blocking operation.T
- Type of navigated valuespartitioningKey
- Explicit partitioning keypath
- Query path<T> java.util.concurrent.CompletableFuture<T> selectOneAsync(Path path)
Path
that must navigate to exactly one value. If PState
has more than one partition, Path
must start with key
navigator
and query will extract that key as partitioning key. Non-blocking operation.T
- Type of navigated valuepath
- Query path<T> java.util.concurrent.CompletableFuture<T> selectOneAsync(java.lang.Object partitioningKey, Path path)
Path
that must navigate
to exactly one value. Non-blocking operation.T
- Type of navigated valuepartitioningKey
- Explicit partitioning keypath
- Query path<T> ProxyState<T> proxy(Path path)
Path
that must navigate to exactly one value. If PState
has more than one partition, Path
must start with key
navigator
and query will extract that key as partitioning key. Blocks until initial query finishes, then
receives fine-grained updates to returned ProxyState
in background.T
- Type of navigated valuepath
- Query path<T> ProxyState<T> proxy(java.lang.Object partitioningKey, Path path)
Path
that must
navigate to exactly one value. Blocks until initial query finishes, then
receives fine-grained updates to returned ProxyState
in background.T
- Type of navigated valuepartitioningKey
- Explicit partitioning keypath
- Query path<T> ProxyState<T> proxy(Path path, ProxyState.Callback<T> callback)
Path
that must navigate to exactly one value. Receives
fine-grained information about changes to value via provided callback. If PState
has more than one partition, Path
must start with key
navigator
and query will extract that key as partitioning key. Blocks until initial query finishes,
then receives fine-grained updates in background.T
- Type of navigated valuepath
- Query pathcallback
- Function that receives fine-grained information about changes. Callbacks
run on a separate dedicated thread.<T> ProxyState<T> proxy(java.lang.Object partitioningKey, Path path, ProxyState.Callback<T> callback)
Path
that must
navigate to exactly one value. Receives fine-grained information about changes to value
via provided callback. Blocks until initial query finishes, then receives fine-grained
updates in background.T
- Type of navigated valuepartitioningKey
- Explicit partitioning keypath
- Query pathcallback
- Function that receives fine-grained information about changes. Callbacks
run on a separate dedicated thread.<T> java.util.concurrent.CompletableFuture<ProxyState<T>> proxyAsync(Path path)
Path
that must navigate to exactly one value. If PState
has more than one partition, Path
must start with key
navigator
and query will extract that key as partitioning key. Non-blocking. Once ProxyState
is delivered to returned future, the ProxyState
receives fine-grained updates
in background.T
- Type of navigated valuepath
- Query path<T> java.util.concurrent.CompletableFuture<ProxyState<T>> proxyAsync(java.lang.Object partitioningKey, Path path)
Path
that must
navigate to exactly one value. Non-blocking. Once ProxyState
is delivered
to returned future, the ProxyState
receives fine-grained updates
in background.T
- Type of navigated valuepartitioningKey
- Explicit partitioning keypath
- Query path<T> java.util.concurrent.CompletableFuture<ProxyState<T>> proxyAsync(Path path, ProxyState.Callback<T> callback)
Path
that must navigate to exactly one value. Receives
fine-grained information about changes to value via provided callback. If PState
has more than one partition, Path
must start with key
navigator
and query will extract that key as partitioning key. Non-blocking. Once ProxyState
is delivered to returned future, the ProxyState
receives fine-grained updates
in background.T
- Type of navigated valuepath
- Query pathcallback
- Function that receives fine-grained information about changes. Callbacks
run on a separate dedicated thread.<T> java.util.concurrent.CompletableFuture<ProxyState<T>> proxyAsync(java.lang.Object partitioningKey, Path path, ProxyState.Callback<T> callback)
Path
that must
navigate to exactly one value. Receives fine-grained information about changes to value
via provided callback. Non-blocking. Once ProxyState
is delivered to returned
future, the ProxyState
receives fine-grained updates in background.T
- Type of navigated valuepartitioningKey
- Explicit partitioning keypath
- Query pathcallback
- Function that receives fine-grained information about changes. Callbacks
run on a separate dedicated thread.