public class PDC extends Protocol
Modifier and Type | Class and Description |
---|---|
protected static class |
PDC.Mapping |
Modifier and Type | Field and Description |
---|---|
protected java.util.concurrent.ConcurrentMap<Address,PhysicalAddress> |
cache |
protected java.lang.String |
cache_dir |
protected java.io.FilenameFilter |
filter |
protected Address |
local_addr |
protected java.io.File |
root_dir |
protected static java.lang.String |
SUFFIX |
after_creation_hook, down_prot, ergonomics, id, log, name, stack, stats, up_prot
Constructor and Description |
---|
PDC() |
Modifier and Type | Method and Description |
---|---|
protected static java.lang.String |
addressAsString(Address address) |
protected void |
createDiskCacheFile() |
protected boolean |
deleteFile(java.io.File file)
Attempts to delete the provided file.
Logging is performed on the result |
java.lang.Object |
down(Event evt)
An event is to be sent down the stack.
|
void |
init()
Called after instance has been created (null constructor) and before protocol is started.
|
java.lang.String |
printCache() |
protected void |
readCacheFromDisk()
Reads all mappings from disk
|
protected void |
removeNodeFromDisk(Address logical_addr) |
protected void |
writeNodeToDisk(Address logical_addr,
PhysicalAddress physical_addr) |
protected java.io.File |
writeToTempFile(java.io.File dir,
Address logical_addr,
Address physical_addr,
java.lang.String logical_name)
Writes the data to a temporary file.
The file is stored in the same directory as the other cluster files but is given the .tmp suffix |
accept, afterCreationHook, destroy, dumpStats, enableStats, getConfigurableObjects, getDownProtocol, getDownServices, getId, getIdsAbove, getLevel, getLog, getName, getProtocolStack, getSocketFactory, getThreadFactory, getTransport, getUpProtocol, getUpServices, getValue, isErgonomics, level, parse, printStats, providedDownServices, providedUpServices, requiredDownServices, requiredUpServices, resetStatistics, resetStats, setDownProtocol, setErgonomics, setId, setLevel, setProtocolStack, setSocketFactory, setUpProtocol, setValue, setValues, start, statsEnabled, stop, up, up
protected final java.util.concurrent.ConcurrentMap<Address,PhysicalAddress> cache
protected java.lang.String cache_dir
protected static final java.lang.String SUFFIX
protected java.io.File root_dir
protected java.io.FilenameFilter filter
protected Address local_addr
public java.lang.String printCache()
public void init() throws java.lang.Exception
Protocol
public java.lang.Object down(Event evt)
Protocol
down_prot.down()
. In case of a GET_ADDRESS event (which tries to
retrieve the stack's address from one of the bottom layers), the layer may need to send
a new response event back up the stack using up_prot.up()
.protected void createDiskCacheFile() throws java.io.IOException
java.io.IOException
protected void readCacheFromDisk()
protected void writeNodeToDisk(Address logical_addr, PhysicalAddress physical_addr)
protected java.io.File writeToTempFile(java.io.File dir, Address logical_addr, Address physical_addr, java.lang.String logical_name) throws java.lang.Exception
dir
- The disk cache root dirlogical_addr
- The logical addressphysical_addr
- The physical addressjava.lang.Exception
protected void removeNodeFromDisk(Address logical_addr)
protected static java.lang.String addressAsString(Address address)
protected boolean deleteFile(java.io.File file)
file
- Copyright © 1998-2020 Red Hat. All Rights Reserved.