ostore.cache
Class CacheToDisk

java.lang.Object
  |
  +--ostore.cache.CacheToDisk

public class CacheToDisk
extends Object

Disk Interface - Read and Write using Simple Java I/O. Writes the actual Cacheable to disk using the CacheableIdentity for naming. If the CacheableIdentity stores more than 1 attribute (ie has guid and vhash), softlinks will be used.

Also creates 5 directoris specified in cachedir by the config files

Version:
$ID: CacheToDisk.java, v 1.0
Author:
Larry H. Tung

Constructor Summary
protected CacheToDisk(String cachedir, NodeId node_id)
           
 
Method Summary
 String fullString(SecureHash shash, int type)
          Converts all bytes of this SecureHash to a human-readable String
static CacheToDisk instance(NodeId node_id)
           
static void instanciate(String cachedir, NodeId node_id)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CacheToDisk

protected CacheToDisk(String cachedir,
                      NodeId node_id)
Method Detail

instanciate

public static void instanciate(String cachedir,
                               NodeId node_id)

instance

public static CacheToDisk instance(NodeId node_id)

fullString

public String fullString(SecureHash shash,
                         int type)
Converts all bytes of this SecureHash to a human-readable String

Parameters:
type - id of object to be written to disk
shash - SecureHash to be used to write to disk
Returns:
human-readable String representation of this Hash containing every nibble of this Hash's value and prepending a path to it, in this case /temp/ tag indicates what type of data is being written to disk