|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--gov.nist.nlpir.irf.proxy.HandlesByOid
The HandlesByOid table is responsible for keeping track of the
handle of each persistent object by its object identifier (Oid).
Oids are assigned by IRF and handles may vary according to the
persistence mechanism used.
This class is abstract. Thus, there may be several implementations,
matching different families of handles. If all handles have the same
size when they're written to disk, then the OneSizeHandlesByOid class
can be used to get an actual instance of HandlesByOid. If they can be
different, then AnySizeHandlesByOid will work, as it uses a more
generic mechanism to match Handles to Oids.
Oid
,
Handle
, Serialized FormField Summary | |
protected static java.lang.String |
fileSeparator
Local copy of System file separator |
private static long |
handlesByOidAdds
Statistics on handlesByOid table and cache. |
private static HashingCache |
handlesByOidCache
Cache for handles by Oid |
protected static BufferedRandomAccessFile |
handlesByOidDataFile
The file used to keep track of handles by Oid. |
private static java.lang.String |
handlesByOidDataFileLocation
Used to find the file associating Handles to Oids. |
private static long |
handlesByOidGets
|
private static long |
handlesByOidGetsFromCache
|
private static long |
handlesByOidRemoves
|
private static long |
handlesByOidUpdates
|
private static int |
maxHandlesByOidCacheEntries
Initial size of the cache used to match handles to Oids. |
(package private) static long |
serialVersionUID
serial version universal id - put here so Java does not insert one which may change due to revisions and make it impossible to deserialize earlier versions of serialized objects |
Constructor Summary | |
HandlesByOid()
|
Method Summary | |
void |
addHandleByOid(Oid oid,
Handle handle)
Adds a handle to the table of handles by Oid |
Handle |
getHandleByOid(Oid oid)
Gets a handle from the table of handles by Oid |
java.lang.String |
getHandlesByOidDataFileLocation()
Gets the location of the handlesByOidDataFile; |
abstract long |
getHandlesByOidSize()
Gets the size of the table |
int |
getMaxHandlesByOidCacheEntries()
Returns the maximum number of entries in the cache |
java.lang.String |
getStatistics()
Returns a String that contains statistics about this table and the cache it embeds. |
void |
openHandlesByOid(java.lang.String directory)
Opens the handles-by-oid files |
protected abstract Handle |
readHandleForOid(Oid oid)
Reads the handle from the disk. |
void |
replaceHandleByOid(Oid oid,
Handle newHandle)
Replaces the entry in table of handles by Oid for the specified Oid with a new one using the same Oid the new handle passed. |
void |
setHandlesByOidDataFileLocation(java.lang.String location)
Sets the location of the handlesByOidDataFile |
void |
setMaxHandlesByOidCacheEntries(int maxHandlesByOidCacheEntries)
Changes the size of the cache used to match Handles to Oids |
void |
shutdown()
Makes sure modifications to cache entries are reflected in their persistent analogues. |
protected abstract void |
writeHandleForOid(Oid oid,
Handle handle)
Associates the given Handle to the given Oid in the file pointed by handlesByOidDataFile. |
Methods inherited from class java.lang.Object |
|
Field Detail |
static final long serialVersionUID
protected static BufferedRandomAccessFile handlesByOidDataFile
private static java.lang.String handlesByOidDataFileLocation
private static int maxHandlesByOidCacheEntries
private static HashingCache handlesByOidCache
protected static final java.lang.String fileSeparator
private static transient long handlesByOidAdds
private static transient long handlesByOidRemoves
private static transient long handlesByOidUpdates
private static transient long handlesByOidGets
private static transient long handlesByOidGetsFromCache
Constructor Detail |
public HandlesByOid()
Method Detail |
public void openHandlesByOid(java.lang.String directory)
directory
- directory in which to open the filespublic final void setHandlesByOidDataFileLocation(java.lang.String location)
location
- location of the handlesByOidDataFilepublic final int getMaxHandlesByOidCacheEntries()
public final java.lang.String getHandlesByOidDataFileLocation()
public java.lang.String getStatistics()
public void addHandleByOid(Oid oid, Handle handle)
handle
- handle to be savedOid
- object identified to be associated with the handleprotected abstract void writeHandleForOid(Oid oid, Handle handle)
oid
- Oid for which a handle is to be writtenhandle
- Handle to be associated with the specified OidHashingCache
public void replaceHandleByOid(Oid oid, Handle newHandle)
Oid
- for desired handlenewHandle
- the new handle to replace the existing onepublic Handle getHandleByOid(Oid oid)
Oid
- for desired object/handleprotected abstract Handle readHandleForOid(Oid oid)
public abstract long getHandlesByOidSize()
public void setMaxHandlesByOidCacheEntries(int maxHandlesByOidCacheEntries)
maxHandlesByOidCacheEntries
- maximum number of entries
allowed in handles by Oid cachepublic void shutdown()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |