public interface IStorageAdapter
All IStorageAdapter methods ( except init ) gets StorageAdapterContext object as the first parameter, which holds the connection information to the storage-adapter.
Modifier and Type | Method and Description |
---|---|
void |
addIndexes(String typeName,
SpaceIndex[] indexes) |
void |
commit(ServerTransaction xtn,
boolean anyUpdates)
Performs commit to transaction- delete taken entries, commit new entries.
|
int |
count(ITemplateHolder template,
String[] subClasses)
Returns the number of entries that match the template.
|
Class<?> |
getDataClass() |
Map<String,IEntryHolder> |
getEntries(Context context,
Object[] ids,
String typeName,
IEntryHolder[] templates)
Gets a map of entries from the storage adapter
|
IEntryHolder |
getEntry(Context context,
Object uid,
String classname,
IEntryHolder template)
Gets an entry object from the storage adapter.
|
SpaceSynchronizationEndpoint |
getSynchronizationInterceptor() |
void |
initialize()
Initializes the SA for work (first API called by engine) If initMode is WARM : SA is
required to set its internal working tables and environment to the state recorded in its
persistent storage, and verify that all the SA space-related data is in consistent state.
|
ISAdapterIterator |
initialLoad(Context context,
ITemplateHolder template) |
void |
insertEntry(Context context,
IEntryHolder entryHolder,
boolean origin,
boolean shouldReplicate)
Inserts a new entry to the SA storage.
|
void |
introduceDataType(ITypeDesc typeDesc) |
boolean |
isReadOnly()
If returns true - then the storage adapter is read-only and can't be written to.
|
ISAdapterIterator<IEntryHolder> |
makeEntriesIter(ITemplateHolder template,
long SCNFilter,
long leaseFilter,
IServerTypeDesc[] subClasses)
Returns an iterator with entries that match the template, and the other parameters.
|
void |
prepare(Context context,
ServerTransaction xtn,
ArrayList<IEntryHolder> pLocked,
boolean singleParticipant,
Map<String,Object> partialUpdatesAndInPlaceUpdatesInfo,
boolean shouldReplicate)
Performs prepare to transaction- write to SA all new entries under the xtn, mark taken
entries under the xtn
|
void |
removeEntry(Context context,
IEntryHolder entryHolder,
boolean origin,
boolean fromLeaseExpiration,
boolean shouldReplicate)
Removes an entry from the SA storage.
|
void |
rollback(ServerTransaction xtn,
boolean anyUpdates)
Performs rollback to transaction- rewrite taken entries, remove new entries.
|
void |
shutDown()
called by the engine after all connections have been closed.
|
boolean |
supportsExternalDB() |
boolean |
supportsGetEntries()
Denotes whether the implementing class has an implementation for
|
boolean |
supportsPartialUpdate() |
void |
updateEntry(Context context,
IEntryHolder updatedEntry,
boolean updateRedoLog,
boolean origin,
boolean[] partialUpdateValuesIndicators)
updates an entry.
|
void initialize() throws SAException
SAException
- - In case a SQL error occurred.ISAdapterIterator initialLoad(Context context, ITemplateHolder template) throws SAException
SAException
void insertEntry(Context context, IEntryHolder entryHolder, boolean origin, boolean shouldReplicate) throws SAException
entryHolder
- entry to insertSAException
void updateEntry(Context context, IEntryHolder updatedEntry, boolean updateRedoLog, boolean origin, boolean[] partialUpdateValuesIndicators) throws SAException
updatedEntry
- new content, same UID and classSAException
void removeEntry(Context context, IEntryHolder entryHolder, boolean origin, boolean fromLeaseExpiration, boolean shouldReplicate) throws SAException
entryHolder
- entry to removeSAException
void prepare(Context context, ServerTransaction xtn, ArrayList<IEntryHolder> pLocked, boolean singleParticipant, Map<String,Object> partialUpdatesAndInPlaceUpdatesInfo, boolean shouldReplicate) throws SAException
xtn
- transaction to preparepLocked
- a vector of all entries locked (written or taken) under the xtnsingleParticipant
- - if true, a transactional SA needs to do all the transaction
related operations in one DB transaction and the prepare is actually
the commit (no other transaction related APIs will be called for
this xtn)SAException
void rollback(ServerTransaction xtn, boolean anyUpdates) throws SAException
xtn
- transaction to roll-backanyUpdates
- true if any updates performed under tjis xtnSAException
IEntryHolder getEntry(Context context, Object uid, String classname, IEntryHolder template) throws SAException
uid
- ID of the entry to getclassname
- class of the entry to gettemplate
- selection template,may be null, currently used by cacheload/cachestore in
order to pass primery key fields when GS uid is not saved in an external DBSAException
Map<String,IEntryHolder> getEntries(Context context, Object[] ids, String typeName, IEntryHolder[] templates) throws SAException
ids
- the ids of the entries to gettypeName
- type of the entries to gettemplates
- templates matching the ids of the entries to getSAException
ISAdapterIterator<IEntryHolder> makeEntriesIter(ITemplateHolder template, long SCNFilter, long leaseFilter, IServerTypeDesc[] subClasses) throws SAException
template
- - the entries should match that template.SCNFilter
- - if != 0 gets only templates that are <= from SCNFilter.leaseFilter
- if != 0 gets only templates that have expiration_time >= leaseFilter.subClasses
- - array of sub classes of the template, the entries should belong to a
subcalss.SAException
void commit(ServerTransaction xtn, boolean anyUpdates) throws SAException
xtn
- transaction to commitanyUpdates
- true if any updates performed under tjis xtnSAException
int count(ITemplateHolder template, String[] subClasses) throws SAException
template
- - the entries should match the template.subClasses
- - subclassesof the template, the entries can be in one of them.SAException
void shutDown() throws SAException
SAException
boolean isReadOnly()
boolean supportsExternalDB()
boolean supportsPartialUpdate()
boolean supportsGetEntries()
void introduceDataType(ITypeDesc typeDesc)
SpaceSynchronizationEndpoint getSynchronizationInterceptor()
Class<?> getDataClass()
void addIndexes(String typeName, SpaceIndex[] indexes)
Copyright © GigaSpaces.