|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.indexdata.torus2.rw.impl.ProxyReaderWriter
com.indexdata.torus2.rw.impl.CachingReaderWriter
public class CachingReaderWriter
This RW prevents any disk writes or reads that have to do with worlds records and instead caches them purely in memory. The persisted parent list is consulted each time the cache is read, in case world records (full realms) are missing from the cache a request is made to retrieve them.
Field Summary |
---|
Fields inherited from class com.indexdata.torus2.rw.impl.ProxyReaderWriter |
---|
rw |
Constructor Summary | |
---|---|
CachingReaderWriter(RealmReaderWriter rw,
String host,
String proto,
boolean honorProto,
boolean honorAuth,
boolean honorPort)
|
Method Summary | |
---|---|
void |
deleteCachedAsOriginal(String id)
|
void |
deleteParentRealm(String prId)
|
void |
deleteWorldRecordsByParentId(String prId)
|
boolean |
isCachedAsParent()
In case the realm serves as parent to other realms within the same torus installation, the following function allows for fast propagation of changes to child realms. |
boolean |
open()
Attempts to open the realm store pointed to by this instance. |
Record.Layer |
readWorldRecord(String prefixId)
Retrieve world (within a set of parents) record by id. |
List<Record.Layer> |
readWorldRecordsForParent(String prId)
Retrieve a list of records for a parent specified within this realm, |
Record.Layer |
updateCachedAsOriginal(Record.Layer original)
|
ParentRealm |
writeParentRealm(ParentRealm pr)
|
List<Record.Layer> |
writeWorldRecordsForParent(List<Record.Layer> docs,
String prId)
Stores parent records for the given parent, updates each world record with an ID unique to this realm (so world records can be looked up without specifying parent) |
Methods inherited from class com.indexdata.torus2.rw.impl.ProxyReaderWriter |
---|
create, deleteMasterRecord, deleteOverrideRecord, describe, destroy, listRealms, readMasterRecord, readMasterRecords, readOverrideRecord, readOverrideRecords, readParentRealm, readParentRealms, writeMasterRecord, writeMasterRecord, writeOverrideRecord, writeOverrideRecord, writeParentRealm |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public CachingReaderWriter(RealmReaderWriter rw, String host, String proto, boolean honorProto, boolean honorAuth, boolean honorPort) throws InternalIOException
InternalIOException
Method Detail |
---|
public boolean open() throws InternalIOException
RealmReaderWriter
open
in interface RealmReaderWriter
open
in class ProxyReaderWriter
InternalIOException
public ParentRealm writeParentRealm(ParentRealm pr) throws InternalIOException
writeParentRealm
in interface RealmReaderWriter
writeParentRealm
in class ProxyReaderWriter
InternalIOException
public void deleteParentRealm(String prId) throws InternalIOException
deleteParentRealm
in interface RealmReaderWriter
deleteParentRealm
in class ProxyReaderWriter
InternalIOException
public List<Record.Layer> readWorldRecordsForParent(String prId) throws InternalIOException
RealmReaderWriter
readWorldRecordsForParent
in interface RealmReaderWriter
readWorldRecordsForParent
in class ProxyReaderWriter
InternalIOException
- when experiencing problems reading/parsing recordspublic Record.Layer readWorldRecord(String prefixId) throws InternalIOException, MalformedInputException
RealmReaderWriter
readWorldRecord
in interface RealmReaderWriter
readWorldRecord
in class ProxyReaderWriter
InternalIOException
- when experiencing problems reading/parsing records
MalformedInputException
- when the realmUniqueId is malformedpublic List<Record.Layer> writeWorldRecordsForParent(List<Record.Layer> docs, String prId) throws InternalIOException
RealmReaderWriter
writeWorldRecordsForParent
in interface RealmReaderWriter
writeWorldRecordsForParent
in class ProxyReaderWriter
InternalIOException
public void deleteWorldRecordsByParentId(String prId) throws InternalIOException
deleteWorldRecordsByParentId
in interface RealmReaderWriter
deleteWorldRecordsByParentId
in class ProxyReaderWriter
InternalIOException
public boolean isCachedAsParent() throws InternalIOException
RealmReaderWriter
isCachedAsParent
in interface RealmReaderWriter
isCachedAsParent
in class ProxyReaderWriter
InternalIOException
public void deleteCachedAsOriginal(String id) throws InternalIOException
deleteCachedAsOriginal
in interface RealmReaderWriter
deleteCachedAsOriginal
in class ProxyReaderWriter
InternalIOException
public Record.Layer updateCachedAsOriginal(Record.Layer original) throws InternalIOException
updateCachedAsOriginal
in interface RealmReaderWriter
updateCachedAsOriginal
in class ProxyReaderWriter
InternalIOException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |