|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface ISyncService
The sync service provides a high-performance in-memory database for
fault and partition-tolerant replication of state data. It provides
eventually consistent semantics with versioning through vector clocks
and allows custom handling of resolution of inconsistent writes.
An important caveat to keep in mind is that keys should not be constructed
using any hash tables, because the serialized version will contain a
a potentially-inconsistent ordering of elements resulting in a failure
for keys to match. Using a java bean or a JsonNode
will avoid this
problem. Using strings as keys also avoids this problem.
Nested Class Summary | |
---|---|
static class |
ISyncService.Scope
|
Method Summary | ||
---|---|---|
|
getStoreClient(java.lang.String storeName,
java.lang.Class<K> keyClass,
java.lang.Class<V> valueClass)
Get a store client for the given store. |
|
|
getStoreClient(java.lang.String storeName,
java.lang.Class<K> keyClass,
java.lang.Class<V> valueClass,
IInconsistencyResolver<Versioned<V>> resolver)
Get a store client that will use the provided inconsistency resolver to resolve concurrent updates. |
|
|
getStoreClient(java.lang.String storeName,
com.fasterxml.jackson.core.type.TypeReference<K> keyType,
com.fasterxml.jackson.core.type.TypeReference<V> valueType)
Get a store client for the given store. |
|
|
getStoreClient(java.lang.String storeName,
com.fasterxml.jackson.core.type.TypeReference<K> keyType,
com.fasterxml.jackson.core.type.TypeReference<V> valueType,
IInconsistencyResolver<Versioned<V>> resolver)
Get a store client that will use the provided inconsistency resolver to resolve concurrent updates. |
|
void |
registerPersistentStore(java.lang.String storeName,
ISyncService.Scope scope)
Create a store with the given store name and scope that will be persistent across reboots. |
|
void |
registerStore(java.lang.String storeName,
ISyncService.Scope scope)
Create a store with the given store name and scope |
Method Detail |
---|
void registerStore(java.lang.String storeName, ISyncService.Scope scope) throws SyncException
storeName
- the name of the storescope
- the distribution scope for the data
SyncException
void registerPersistentStore(java.lang.String storeName, ISyncService.Scope scope) throws SyncException
storeName
- the name of the storescope
- the distribution scope for the data
SyncException
<K,V> IStoreClient<K,V> getStoreClient(java.lang.String storeName, java.lang.Class<K> keyClass, java.lang.Class<V> valueClass) throws UnknownStoreException
storeName
- the name of the store to retrievekeyClass
- the class for the underlying key needed for
deserializationvalueClass
- the class for the underlying value needed for
deserialization
UnknownStoreException
<K,V> IStoreClient<K,V> getStoreClient(java.lang.String storeName, java.lang.Class<K> keyClass, java.lang.Class<V> valueClass, IInconsistencyResolver<Versioned<V>> resolver) throws UnknownStoreException
storeName
- the name of the store to retrievekeyClass
- the class for the underlying key needed for
deserializationvalueClass
- the class for the underlying value needed for
deserializationresolver
- the inconsistency resolver to use for the store
UnknownStoreException
<K,V> IStoreClient<K,V> getStoreClient(java.lang.String storeName, com.fasterxml.jackson.core.type.TypeReference<K> keyType, com.fasterxml.jackson.core.type.TypeReference<V> valueType) throws UnknownStoreException
storeName
- the name of the store to retrievekeyType
- the type reference for the underlying key needed for
deserializationvalueType
- the type reference for the underlying value needed for
deserialization
UnknownStoreException
<K,V> IStoreClient<K,V> getStoreClient(java.lang.String storeName, com.fasterxml.jackson.core.type.TypeReference<K> keyType, com.fasterxml.jackson.core.type.TypeReference<V> valueType, IInconsistencyResolver<Versioned<V>> resolver) throws UnknownStoreException
storeName
- the name of the store to retrievekeyType
- the type reference for the underlying key needed for
deserializationvalueType
- the type reference for the underlying value needed for
deserializationresolver
- the inconsistency resolver to use for the store
UnknownStoreException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |