org.apache.hadoop.hdfs.protocol
Class LayoutVersion

java.lang.Object
  extended by org.apache.hadoop.hdfs.protocol.LayoutVersion

@InterfaceAudience.Private
public class LayoutVersion
extends Object

This class tracks changes in the layout version of HDFS. Layout version is changed for following reasons:

  1. The layout of how namenode or datanode stores information on disk changes.
  2. A new operation code is added to the editlog.
  3. Modification such as format of a record, content of a record in editlog or fsimage.

How to update layout version:
When a change requires new layout version, please add an entry into LayoutVersion.Feature with a short enum name, new layout version and description of the change. Please see LayoutVersion.Feature for further details.


Nested Class Summary
static class LayoutVersion.Feature
          Enums for features that change the layout version.
 
Constructor Summary
LayoutVersion()
           
 
Method Summary
static int getCurrentLayoutVersion()
          Get the current layout version
static String getString()
          Gets formatted string that describes LayoutVersion information.
static boolean supports(LayoutVersion.Feature f, int lv)
          Returns true if a given feature is supported in the given layout version
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LayoutVersion

public LayoutVersion()
Method Detail

getString

public static String getString()
Gets formatted string that describes LayoutVersion information.


supports

public static boolean supports(LayoutVersion.Feature f,
                               int lv)
Returns true if a given feature is supported in the given layout version

Parameters:
f - Feature
lv - LayoutVersion
Returns:
true if f is supported in layout version lv

getCurrentLayoutVersion

public static int getCurrentLayoutVersion()
Get the current layout version



Copyright © 2009 The Apache Software Foundation