Class RemoteFileMetadata<K extends java.io.Serializable>
- java.lang.Object
-
- org.apache.nemo.runtime.executor.data.metadata.FileMetadata<K>
-
- org.apache.nemo.runtime.executor.data.metadata.RemoteFileMetadata<K>
-
- Type Parameters:
K
- the key type of its partitions.
@ThreadSafe public final class RemoteFileMetadata<K extends java.io.Serializable> extends FileMetadata<K>
This class represents a metadata for a remote file block. Because the data is stored in a remote file and globally accessed by multiple nodes, each read, or deletion for a block needs one instance of this metadata. The metadata is store in and read from a file (after a remote file block is committed).
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
commitBlock()
Write the collectedPartitionMetadata
s to the metadata file.static <T extends java.io.Serializable>
RemoteFileMetadata<T>create(java.lang.String metaFilePath)
Creates a new block metadata.void
deleteMetadata()
Deletes the metadata.static <T extends java.io.Serializable>
RemoteFileMetadata<T>open(java.lang.String metaFilePath)
Opens a existing block metadata in file.-
Methods inherited from class org.apache.nemo.runtime.executor.data.metadata.FileMetadata
getPartitionMetadataList, isCommitted, setCommitted, writePartitionMetadata
-
-
-
-
Method Detail
-
deleteMetadata
public void deleteMetadata() throws java.io.IOException
Description copied from class:FileMetadata
Deletes the metadata.- Specified by:
deleteMetadata
in classFileMetadata<K extends java.io.Serializable>
- Throws:
java.io.IOException
- if fail to delete.- See Also:
FileMetadata.deleteMetadata()
-
commitBlock
public void commitBlock() throws java.io.IOException
Write the collectedPartitionMetadata
s to the metadata file. Notifies that all writes are finished for the block corresponding to this metadata.- Specified by:
commitBlock
in classFileMetadata<K extends java.io.Serializable>
- Throws:
java.io.IOException
- if fail to commit.
-
create
public static <T extends java.io.Serializable> RemoteFileMetadata<T> create(java.lang.String metaFilePath)
Creates a new block metadata.- Type Parameters:
T
- the key type of the block's partitions.- Parameters:
metaFilePath
- the path of the file to write metadata.- Returns:
- the created block metadata.
-
open
public static <T extends java.io.Serializable> RemoteFileMetadata<T> open(java.lang.String metaFilePath) throws java.io.IOException
Opens a existing block metadata in file.- Type Parameters:
T
- the key type of the block's partitions.- Parameters:
metaFilePath
- the path of the file to write metadata.- Returns:
- the created block metadata.
- Throws:
java.io.IOException
- if fail to open.
-
-