org.apache.hadoop.hdfs.server.namenode
Class FSImageSerialization

java.lang.Object
  extended by org.apache.hadoop.hdfs.server.namenode.FSImageSerialization

@InterfaceAudience.Private
@InterfaceStability.Evolving
public class FSImageSerialization
extends Object

Static utility functions for serializing various pieces of data in the correct format for the FSImage file. Some members are currently public for the benefit of the Offline Image Viewer which is located outside of this package. These members should be made package-protected when the OIV is refactored.


Method Summary
static byte[] readBytes(DataInputStream in)
           
static byte[][] readPathComponents(DataInputStream in)
          Reading the path from the image and converting it to byte[][] directly this saves us an array copy and conversions to and from String
static String readString(DataInputStream in)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

readString

public static String readString(DataInputStream in)
                         throws IOException
Throws:
IOException

readBytes

public static byte[] readBytes(DataInputStream in)
                        throws IOException
Throws:
IOException

readPathComponents

public static byte[][] readPathComponents(DataInputStream in)
                                   throws IOException
Reading the path from the image and converting it to byte[][] directly this saves us an array copy and conversions to and from String

Parameters:
in -
Returns:
the array each element of which is a byte[] representation of a path component
Throws:
IOException


Copyright © 2009 The Apache Software Foundation