|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface FSDatasetInterface
This is an interface for the underlying storage that stores blocks for a data node. Examples are the FSDataset (which stores blocks on dirs) and SimulatedFSDataset (which simulates data).
Nested Class Summary | |
---|---|
static class |
FSDatasetInterface.BlockWriteStreams
This class contains the output streams for the data and checksum of a block |
static class |
FSDatasetInterface.MetaDataInputStream
This class provides the input stream and length of the metadata of a block |
Method Summary | |
---|---|
void |
checkDataDir()
Check if all the data directories are healthy |
void |
finalizeBlock(org.apache.hadoop.dfs.Block b)
Finalizes the block previously opened for writing using writeToBlock. |
InputStream |
getBlockInputStream(org.apache.hadoop.dfs.Block b)
Returns an input stream to read the contents of the specified block |
InputStream |
getBlockInputStream(org.apache.hadoop.dfs.Block b,
long seekOffset)
Returns an input stream at specified offset of the specified block |
org.apache.hadoop.dfs.Block[] |
getBlockReport()
Returns the block report - the full list of blocks stored |
long |
getChannelPosition(org.apache.hadoop.dfs.Block b,
FSDatasetInterface.BlockWriteStreams stream)
Returns the current offset in the data stream. |
long |
getLength(org.apache.hadoop.dfs.Block b)
Returns the specified block's on-disk length (excluding metadata) |
FSDatasetInterface.MetaDataInputStream |
getMetaDataInputStream(org.apache.hadoop.dfs.Block b)
Returns metaData of block b as an input stream (and its length) |
long |
getMetaDataLength(org.apache.hadoop.dfs.Block b)
Returns the length of the metadata file of the specified block |
org.apache.hadoop.dfs.Block |
getStoredBlock(long blkid)
|
void |
invalidate(org.apache.hadoop.dfs.Block[] invalidBlks)
Invalidates the specified blocks |
boolean |
isValidBlock(org.apache.hadoop.dfs.Block b)
Is the block valid? |
boolean |
metaFileExists(org.apache.hadoop.dfs.Block b)
Does the meta file exist for this block? |
void |
setChannelPosition(org.apache.hadoop.dfs.Block b,
FSDatasetInterface.BlockWriteStreams stream,
long dataOffset,
long ckOffset)
Sets the file pointer of the data stream and checksum stream to the specified values. |
void |
shutdown()
Shutdown the FSDataset |
String |
toString()
Stringifies the name of the storage |
void |
unfinalizeBlock(org.apache.hadoop.dfs.Block b)
Unfinalizes the block previously opened for writing using writeToBlock. |
void |
updateBlock(org.apache.hadoop.dfs.Block oldblock,
org.apache.hadoop.dfs.Block newblock)
Update the block to the new generation stamp and length. |
FSDatasetInterface.BlockWriteStreams |
writeToBlock(org.apache.hadoop.dfs.Block b,
boolean isRecovery)
Creates the block and returns output streams to write data and CRC |
Methods inherited from interface org.apache.hadoop.dfs.datanode.metrics.FSDatasetMBean |
---|
getCapacity, getDfsUsed, getRemaining, getStorageInfo |
Method Detail |
---|
long getMetaDataLength(org.apache.hadoop.dfs.Block b) throws IOException
b
- - the block for which the metadata length is desired
IOException
FSDatasetInterface.MetaDataInputStream getMetaDataInputStream(org.apache.hadoop.dfs.Block b) throws IOException
b
- - the block
IOException
boolean metaFileExists(org.apache.hadoop.dfs.Block b) throws IOException
b
- - the block
IOException
long getLength(org.apache.hadoop.dfs.Block b) throws IOException
b
-
IOException
org.apache.hadoop.dfs.Block getStoredBlock(long blkid) throws IOException
IOException
InputStream getBlockInputStream(org.apache.hadoop.dfs.Block b) throws IOException
b
-
IOException
InputStream getBlockInputStream(org.apache.hadoop.dfs.Block b, long seekOffset) throws IOException
b
- seekOffset
-
IOException
FSDatasetInterface.BlockWriteStreams writeToBlock(org.apache.hadoop.dfs.Block b, boolean isRecovery) throws IOException
b
- isRecovery
- True if this is part of erro recovery, otherwise false
IOException
void updateBlock(org.apache.hadoop.dfs.Block oldblock, org.apache.hadoop.dfs.Block newblock) throws IOException
IOException
void finalizeBlock(org.apache.hadoop.dfs.Block b) throws IOException
b
-
IOException
void unfinalizeBlock(org.apache.hadoop.dfs.Block b) throws IOException
b
-
IOException
org.apache.hadoop.dfs.Block[] getBlockReport()
boolean isValidBlock(org.apache.hadoop.dfs.Block b)
b
-
void invalidate(org.apache.hadoop.dfs.Block[] invalidBlks) throws IOException
invalidBlks
- - the blocks to be invalidated
IOException
void checkDataDir() throws DiskChecker.DiskErrorException
DiskChecker.DiskErrorException
String toString()
toString
in class Object
void shutdown()
long getChannelPosition(org.apache.hadoop.dfs.Block b, FSDatasetInterface.BlockWriteStreams stream) throws IOException
b
- stream
- The stream to the data file and checksum file
IOException
void setChannelPosition(org.apache.hadoop.dfs.Block b, FSDatasetInterface.BlockWriteStreams stream, long dataOffset, long ckOffset) throws IOException
b
- stream
- The stream for the data file and checksum filedataOffset
- The position to which the file pointre for the data stream
should be setckOffset
- The position to which the file pointre for the checksum stream
should be set
IOException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |