public class Inode
extends java.lang.Object
0) length of the saved file 1-14) direct fragment addresses (to 224k) 15) pointer to the indirect block
0-1023) single indirect fragment addresses (16M, 2^24) 1024-1535) double indirect block addresses (16G, 2^34) 1536-2047) triple indirect block addresses (to 8T, 2^43)
Modifier and Type | Field and Description |
---|---|
static int |
BLOCK_SIZE |
static int |
DIRECT_BLOCKS |
static long |
DIRECT_MAX |
static int |
DOUBLE_INDIRECT_BLOCKS |
static long |
DOUBLE_INDIRECT_MAX |
static int |
INDIRECT_BLOCKS |
static int |
INLINE_BLOB_SIZE |
static long |
INLINE_MAX |
static int |
INODE_SIZE |
static int |
MINI_FRAG_BLOB_SIZE |
static int |
MINI_FRAG_MAX |
static int |
MINI_FRAG_SIZE |
static int |
SINGLE_INDIRECT_BLOCKS |
static long |
SINGLE_INDIRECT_MAX |
static int |
TRIPLE_INDIRECT_BLOCKS |
Constructor and Description |
---|
Inode() |
Inode(BlockStore store) |
Inode(BlockStore store,
StoreTransaction xa) |
Modifier and Type | Method and Description |
---|---|
byte[] |
getBuffer()
Returns the buffer.
|
long |
getLength()
Returns the length.
|
BlockStore |
getStore()
Returns the backing store.
|
void |
init(BlockStore store,
StoreTransaction xa,
byte[] buffer,
int offset) |
static boolean |
isValid(BlockStore store,
byte[] bytes,
int offset)
Validate the inode
|
java.io.InputStream |
openInputStream()
Opens a read stream to the inode.
|
java.io.OutputStream |
openOutputStream()
Opens a byte output stream to the inode.
|
java.io.Reader |
openReader()
Opens a char reader to the inode.
|
java.io.Writer |
openWriter()
Opens a char writer to the inode.
|
static long |
readLong(byte[] buffer,
int offset)
Reads the long.
|
void |
remove()
Deletes the inode
|
static void |
writeLong(byte[] buffer,
int offset,
long v)
Writes the long.
|
static int |
writeToStream(byte[] inode,
int inodeOffset,
BlockStore store,
java.io.OutputStream os,
long offset,
long length)
Writes the inode value to a stream.
|
void |
writeToStream(java.io.OutputStream os,
long offset,
long length)
Writes the inode value to a stream.
|
void |
writeToStream(OutputStreamWithBuffer os)
Writes the inode value to a stream.
|
void |
writeToStreamOld(OutputStreamWithBuffer os,
long offset,
long length)
Writes the inode value to a stream.
|
void |
writeToWriter(java.io.Writer writer)
Writes the inode value to a stream.
|
public static final int INODE_SIZE
public static final int INLINE_BLOB_SIZE
public static final int BLOCK_SIZE
public static final int MINI_FRAG_SIZE
public static final int MINI_FRAG_BLOB_SIZE
public static final int INDIRECT_BLOCKS
public static final int DIRECT_BLOCKS
public static final int SINGLE_INDIRECT_BLOCKS
public static final int DOUBLE_INDIRECT_BLOCKS
public static final int TRIPLE_INDIRECT_BLOCKS
public static final long INLINE_MAX
public static final int MINI_FRAG_MAX
public static final long DIRECT_MAX
public static final long SINGLE_INDIRECT_MAX
public static final long DOUBLE_INDIRECT_MAX
public Inode()
public Inode(BlockStore store, StoreTransaction xa)
public Inode(BlockStore store)
public BlockStore getStore()
public byte[] getBuffer()
public long getLength()
public void init(BlockStore store, StoreTransaction xa, byte[] buffer, int offset)
public java.io.InputStream openInputStream()
public void writeToStream(OutputStreamWithBuffer os) throws java.io.IOException
java.io.IOException
public void writeToStreamOld(OutputStreamWithBuffer os, long offset, long length) throws java.io.IOException
java.io.IOException
public void writeToStream(java.io.OutputStream os, long offset, long length) throws java.io.IOException
java.io.IOException
public static int writeToStream(byte[] inode, int inodeOffset, BlockStore store, java.io.OutputStream os, long offset, long length) throws java.io.IOException
java.io.IOException
public void writeToWriter(java.io.Writer writer) throws java.io.IOException
java.io.IOException
public java.io.OutputStream openOutputStream()
public java.io.Reader openReader()
public java.io.Writer openWriter()
public void remove()
public static boolean isValid(BlockStore store, byte[] bytes, int offset)
public static long readLong(byte[] buffer, int offset)
public static void writeLong(byte[] buffer, int offset, long v)