org.apache.hadoop.hdfs.server.common
Class GenerationStamp

java.lang.Object
  extended by org.apache.hadoop.hdfs.server.common.GenerationStamp
All Implemented Interfaces:
Comparable<GenerationStamp>

@InterfaceAudience.Private
public class GenerationStamp
extends Object
implements Comparable<GenerationStamp>

A GenerationStamp is a Hadoop FS primitive, identified by a long.


Field Summary
static long FIRST_VALID_STAMP
          The first valid generation stamp.
static long GRANDFATHER_GENERATION_STAMP
          Generation stamp of blocks that pre-date the introduction of a generation stamp.
 
Constructor Summary
GenerationStamp()
          Create a new instance, initialized to FIRST_VALID_STAMP.
 
Method Summary
 int compareTo(GenerationStamp that)
           
 boolean equals(Object o)
           
 long getStamp()
          Returns the current generation stamp
 int hashCode()
           
 long nextStamp()
          First increments the counter and then returns the stamp
 void setStamp(long stamp)
          Sets the current generation stamp
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

FIRST_VALID_STAMP

public static final long FIRST_VALID_STAMP
The first valid generation stamp.

See Also:
Constant Field Values

GRANDFATHER_GENERATION_STAMP

public static final long GRANDFATHER_GENERATION_STAMP
Generation stamp of blocks that pre-date the introduction of a generation stamp.

See Also:
Constant Field Values
Constructor Detail

GenerationStamp

public GenerationStamp()
Create a new instance, initialized to FIRST_VALID_STAMP.

Method Detail

getStamp

public long getStamp()
Returns the current generation stamp


setStamp

public void setStamp(long stamp)
Sets the current generation stamp


nextStamp

public long nextStamp()
First increments the counter and then returns the stamp


compareTo

public int compareTo(GenerationStamp that)
Specified by:
compareTo in interface Comparable<GenerationStamp>

equals

public boolean equals(Object o)
Overrides:
equals in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object


Copyright © 2009 The Apache Software Foundation