com.bigdata.mdi
Class AbstractResourceMetadata

java.lang.Object
  extended by com.bigdata.mdi.AbstractResourceMetadata
All Implemented Interfaces:
IResourceMetadata, Params, Externalizable, Serializable, Cloneable
Direct Known Subclasses:
JournalMetadata, SegmentMetadata

public abstract class AbstractResourceMetadata
extends Object
implements IResourceMetadata, Externalizable, Params

Base class for IResourceMetadata implementations.

Version:
$Id: AbstractResourceMetadata.java 2265 2009-10-26 12:51:06Z thompsonbry $
Author:
Bryan Thompson
See Also:
Serialized Form

Field Summary
protected static org.apache.log4j.Logger log
           
 
Constructor Summary
  AbstractResourceMetadata()
          De-serialization constructor.
protected AbstractResourceMetadata(String filename, UUID uuid, long createTime)
           
 
Method Summary
 boolean equals(IResourceMetadata o)
          Compares two resource metadata objects for consistent state.
 boolean equals(Object o)
          Note: The JDK HashMap implementation requires that we define this method in order for HashMap.get(Object) to work correctly!
 long getCreateTime()
          The commit time associated with the creation of this resource.
 String getFile()
          The name of the file containing the resource (this is always relative to some local data directory).
 Map<String,Object> getParams()
          Return the fields of interest as an set of (name,value) pairs.
 UUID getUUID()
          The unique identifier for the resource.
 int hashCode()
          The hash code of the resource UUID.
 void readExternal(ObjectInput in)
           
 String toString()
          A human readable representation of the resource metadata.
 void writeExternal(ObjectOutput out)
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface com.bigdata.mdi.IResourceMetadata
isIndexSegment, isJournal
 

Field Detail

log

protected static final org.apache.log4j.Logger log
Constructor Detail

AbstractResourceMetadata

public AbstractResourceMetadata()
De-serialization constructor.


AbstractResourceMetadata

protected AbstractResourceMetadata(String filename,
                                   UUID uuid,
                                   long createTime)
Method Detail

getParams

public Map<String,Object> getParams()
Description copied from interface: Params
Return the fields of interest as an set of (name,value) pairs.

Specified by:
getParams in interface Params

hashCode

public final int hashCode()
Description copied from interface: IResourceMetadata
The hash code of the resource UUID.

Specified by:
hashCode in interface IResourceMetadata
Overrides:
hashCode in class Object

equals

public final boolean equals(Object o)
Note: The JDK HashMap implementation requires that we define this method in order for HashMap.get(Object) to work correctly!

Overrides:
equals in class Object

equals

public final boolean equals(IResourceMetadata o)
Compares two resource metadata objects for consistent state.

Specified by:
equals in interface IResourceMetadata
Returns:

getFile

public final String getFile()
Description copied from interface: IResourceMetadata
The name of the file containing the resource (this is always relative to some local data directory).

Note: This property is primarily used for debugging. It is NOT used by the ResourceManager. Instead, the ResourceManager builds up the mapping from resource UUID to local filename during startup.

Specified by:
getFile in interface IResourceMetadata

getUUID

public final UUID getUUID()
Description copied from interface: IResourceMetadata
The unique identifier for the resource.

Specified by:
getUUID in interface IResourceMetadata
See Also:
IRootBlockView#getUUID(), the UUID for an {@link AbstractJournal}., IndexSegmentCheckpoint#segmentUUID, the UUID for an {@link IndexSegment}.

getCreateTime

public final long getCreateTime()
Description copied from interface: IResourceMetadata
The commit time associated with the creation of this resource. When the index is an IndexSegment this is the commit time of the view from which that IndexSegment was generated. When the resource is a Journal, the create time is the commit time associated with the journal creation, which is generally an overflow operation. Regardless, the create time MUST be assigned by the same time source that is used to assign commit timestamps.

Specified by:
getCreateTime in interface IResourceMetadata

readExternal

public void readExternal(ObjectInput in)
                  throws IOException,
                         ClassNotFoundException
Specified by:
readExternal in interface Externalizable
Throws:
IOException
ClassNotFoundException

writeExternal

public void writeExternal(ObjectOutput out)
                   throws IOException
Specified by:
writeExternal in interface Externalizable
Throws:
IOException

toString

public String toString()
A human readable representation of the resource metadata.

Overrides:
toString in class Object


Copyright © 2006-2009 SYSTAP, LLC. All Rights Reserved.