public final class FilePersistenceHandler extends java.lang.Object implements LazyPersistenceHandler
LazyPersistenceHandler.MetadataAndValue<V>
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
PERSISTED_REP_VERSION_NAME |
static int |
RESTART_COUNT_BEFORE_ZOMBIES_KILLED |
Constructor and Description |
---|
FilePersistenceHandler(ConfigContext cc, TransactionalFileManager fm, java.io.File dataRoot, java.io.File binaryRoot)
Constructor
|
Modifier and Type | Method and Description |
---|---|
void |
delete(Ref ref)
Deletes a resource
|
void |
dispose()
disposes this handler
|
boolean |
exists(Ref ref)
Returns true if the resource exists
|
java.io.File |
getDataFile(Ref ref)
this is a helper for the DRTs
|
Metadata[] |
getMetadata(java.lang.String typeId)
Returns metadata associated with all the resources of the given type (this is called once at startup, does not need to be too efficient)
|
void |
initialize(java.lang.String typeId)
initializes the handler for the given type.
|
void |
persist(Metadata md, java.lang.Object canonicalData)
Persists the given metadata and the resource data
|
void |
persist(java.util.Set<Ref> deleteSet, java.util.Map<Ref,LazyPersistenceHandler.MetadataAndValue> writeMap)
persists the following changes
|
java.lang.Object |
readData(Ref ref)
reads and returns the canonical data associated with a resource
|
public static final java.lang.String PERSISTED_REP_VERSION_NAME
public static final int RESTART_COUNT_BEFORE_ZOMBIES_KILLED
public FilePersistenceHandler(ConfigContext cc, TransactionalFileManager fm, java.io.File dataRoot, java.io.File binaryRoot)
public void initialize(java.lang.String typeId) throws java.lang.Exception
initialize
in interface PersistenceHandler
java.lang.Exception
public void dispose()
public Metadata[] getMetadata(java.lang.String typeId) throws java.lang.Exception
getMetadata
in interface PersistenceHandler
java.lang.Exception
public java.lang.Object readData(Ref ref) throws java.lang.Exception
readData
in interface PersistenceHandler
java.lang.Exception
public boolean exists(Ref ref)
exists
in interface PersistenceHandler
public void persist(Metadata md, java.lang.Object canonicalData) throws java.lang.Exception
persist
in interface PersistenceHandler
java.lang.Exception
public void delete(Ref ref) throws java.lang.Exception
delete
in interface PersistenceHandler
java.lang.Exception
public void persist(java.util.Set<Ref> deleteSet, java.util.Map<Ref,LazyPersistenceHandler.MetadataAndValue> writeMap) throws java.lang.Exception
persist
in interface LazyPersistenceHandler
java.lang.Exception
public java.io.File getDataFile(Ref ref)