public class GridGgfsMetaManager extends GridGgfsManager
ggfsCtx| Constructor and Description |
|---|
GridGgfsMetaManager() |
| Modifier and Type | Method and Description |
|---|---|
GridGgfsSecondaryOutputStreamDescriptor |
appendDual(org.apache.hadoop.fs.FileSystem fs,
org.gridgain.grid.ggfs.GridGgfsPath path,
int bufSize)
Append to a file in DUAL mode.
|
GridGgfsSecondaryOutputStreamDescriptor |
createDual(org.apache.hadoop.fs.FileSystem fs,
org.gridgain.grid.ggfs.GridGgfsPath path,
boolean simpleCreate,
org.apache.hadoop.fs.permission.FsPermission perm,
boolean overwrite,
int bufSize,
short replication,
long blockSize,
org.gridgain.grid.GridUuid affKey)
Create the file in DUAL mode.
|
boolean |
deleteDual(org.apache.hadoop.fs.FileSystem fs,
org.gridgain.grid.ggfs.GridGgfsPath path,
boolean recursive)
Delete path in DUAL mode.
|
Map<String,GridGgfsListingEntry> |
directoryListing(org.gridgain.grid.GridUuid fileId)
List child files for specified file ID.
|
boolean |
exists(org.gridgain.grid.GridUuid fileId)
Ensure that entry with the given ID exists in meta cache.
|
GridGgfsFileInfo |
fileForFragmentizer(Collection<org.gridgain.grid.GridUuid> exclude)
Gets first available file info for fragmentizer.
|
org.gridgain.grid.GridUuid |
fileId(org.gridgain.grid.ggfs.GridGgfsPath path)
Gets file ID for specified path.
|
org.gridgain.grid.GridUuid |
fileId(org.gridgain.grid.GridUuid parentId,
String fileName)
Gets file ID by its name from parent directory listing.
|
List<org.gridgain.grid.GridUuid> |
fileIds(org.gridgain.grid.ggfs.GridGgfsPath path)
Gets all file IDs for components of specified path.
|
GridGgfsFileInfo |
info(org.gridgain.grid.GridUuid fileId)
Gets file info by its ID.
|
Map<org.gridgain.grid.GridUuid,GridGgfsFileInfo> |
infos(Collection<org.gridgain.grid.GridUuid> fileIds)
Gets files details by their IDs.
|
GridGgfsFileInfo |
lock(org.gridgain.grid.GridUuid fileId)
Lock the file explicitly outside of transaction.
|
GridGgfsFileInfo |
lockInfo(GridGgfsFileInfo info)
Set lock on file info.
|
boolean |
mkdirsDual(org.apache.hadoop.fs.FileSystem fs,
org.gridgain.grid.ggfs.GridGgfsPath path,
Map<String,String> props)
Create directory in DUAL mode.
|
void |
move(org.gridgain.grid.GridUuid fileId,
String srcFileName,
org.gridgain.grid.GridUuid srcParentId,
String destFileName,
org.gridgain.grid.GridUuid destParentId)
Move or rename file.
|
protected void |
onKernalStart0() |
protected void |
onKernalStop0(boolean cancel) |
GridGgfsSecondaryInputStreamDescriptor |
openDual(org.apache.hadoop.fs.FileSystem fs,
org.gridgain.grid.ggfs.GridGgfsPath path,
int bufSize)
Open file in DUAL mode.
|
Collection<org.gridgain.grid.GridUuid> |
pendingDeletes()
Check whether there are any pending deletes and return collection of pending delete entry IDs.
|
GridGgfsFileInfo |
putIfAbsent(org.gridgain.grid.GridUuid parentId,
String fileName,
GridGgfsFileInfo newFileInfo)
Add file into file system structure.
|
GridGgfsFileInfo |
removeIfEmpty(org.gridgain.grid.GridUuid parentId,
String fileName,
org.gridgain.grid.GridUuid fileId,
org.gridgain.grid.ggfs.GridGgfsPath path,
boolean rmvLocked)
Remove file from the file system structure.
|
boolean |
renameDual(org.apache.hadoop.fs.FileSystem fs,
org.gridgain.grid.ggfs.GridGgfsPath src,
org.gridgain.grid.ggfs.GridGgfsPath dest)
Rename path in DUAL mode.
|
Boolean |
sampling()
Get sampling flag state.
|
boolean |
sampling(Boolean val)
Set sampling flag.
|
protected void |
start0()
Start manager implementation.
|
GridGgfsFileInfo |
synchronizeFileDual(org.apache.hadoop.fs.FileSystem fs,
org.gridgain.grid.ggfs.GridGgfsPath path)
Synchronizes with secondary file system.
|
void |
unlock(GridGgfsFileInfo info,
long modificationTime)
Remove explicit lock on file held by the current thread.
|
GridGgfsFileInfo |
updateDual(org.apache.hadoop.fs.FileSystem fs,
org.gridgain.grid.ggfs.GridGgfsPath path,
Map<String,String> props)
Update path in DUAL mode.
|
GridGgfsFileInfo |
updateInfo(org.gridgain.grid.GridUuid fileId,
org.gridgain.grid.lang.GridClosure<GridGgfsFileInfo,GridGgfsFileInfo> c)
Update file info in cache.
|
void |
updateParentListingAsync(org.gridgain.grid.GridUuid parentId,
org.gridgain.grid.GridUuid fileId,
String fileName,
long lenDelta,
long modificationTime)
Asynchronously updates record in parent listing.
|
GridGgfsFileInfo |
updateProperties(org.gridgain.grid.GridUuid parentId,
org.gridgain.grid.GridUuid fileId,
String fileName,
Map<String,String> props)
Update file info (file properties) in cache.
|
void |
updateTimes(org.gridgain.grid.GridUuid parentId,
org.gridgain.grid.GridUuid fileId,
String fileName,
long accessTime,
long modificationTime)
Updates last access and last modification times.
|
kernalStartInfo, kernalStopInfo, onKernalStart, onKernalStop, start, startInfo, stop, stop0, stopInfoprotected void start0()
throws org.gridgain.grid.GridException
start0 in class GridGgfsManagerorg.gridgain.grid.GridExceptionprotected void onKernalStart0()
throws org.gridgain.grid.GridException
onKernalStart0 in class GridGgfsManagerorg.gridgain.grid.GridException - If failed.protected void onKernalStop0(boolean cancel)
onKernalStop0 in class GridGgfsManager@Nullable
public org.gridgain.grid.GridUuid fileId(org.gridgain.grid.ggfs.GridGgfsPath path)
throws org.gridgain.grid.GridException
path - Path.null if such file doesn't exist.org.gridgain.grid.GridException - If failed.@Nullable
public org.gridgain.grid.GridUuid fileId(org.gridgain.grid.GridUuid parentId,
String fileName)
throws org.gridgain.grid.GridException
parentId - Parent directory ID to get child ID for.fileName - File name in parent listing to get file ID for.org.gridgain.grid.GridException - If failed.public List<org.gridgain.grid.GridUuid> fileIds(org.gridgain.grid.ggfs.GridGgfsPath path) throws org.gridgain.grid.GridException
null if such files don't exist.path - Path.org.gridgain.grid.GridException - If failed.public boolean exists(org.gridgain.grid.GridUuid fileId)
throws org.gridgain.grid.GridException
fileId - File id.True in case such entry exists.org.gridgain.grid.GridException - IF failed.@Nullable public GridGgfsFileInfo info(@Nullable org.gridgain.grid.GridUuid fileId) throws org.gridgain.grid.GridException
fileId - File ID to get details for.org.gridgain.grid.GridException - If failed.public Map<org.gridgain.grid.GridUuid,GridGgfsFileInfo> infos(Collection<org.gridgain.grid.GridUuid> fileIds) throws org.gridgain.grid.GridException
fileIds - file IDs to get details for.org.gridgain.grid.GridException - If failed.public GridGgfsFileInfo lock(org.gridgain.grid.GridUuid fileId) throws org.gridgain.grid.GridException
fileId - File ID to lock.null if file cannot be locked or doesn't exist.org.gridgain.grid.GridException - If failed.public GridGgfsFileInfo lockInfo(GridGgfsFileInfo info) throws org.gridgain.grid.GridException
info - File info.org.gridgain.grid.GridException - In case lock is already set on that file.public void unlock(GridGgfsFileInfo info, long modificationTime) throws org.gridgain.grid.GridException
info - File info to unlock.modificationTime - Modification time to write to file info.org.gridgain.grid.GridException - If failed.public Map<String,GridGgfsListingEntry> directoryListing(org.gridgain.grid.GridUuid fileId) throws org.gridgain.grid.GridException
fileId - File to list child files for.org.gridgain.grid.GridException - If failed.public GridGgfsFileInfo fileForFragmentizer(Collection<org.gridgain.grid.GridUuid> exclude) throws org.gridgain.grid.GridException
exclude - File IDs to exclude from result.org.gridgain.grid.GridException - If failed to get file for fragmentizer.public GridGgfsFileInfo putIfAbsent(org.gridgain.grid.GridUuid parentId, String fileName, GridGgfsFileInfo newFileInfo) throws org.gridgain.grid.GridException
parentId - Parent file ID.fileName - File name in the parent's listing.newFileInfo - File info to store in the parent's listing.null if passed file info was stored.org.gridgain.grid.GridException - If failed.public void move(org.gridgain.grid.GridUuid fileId,
String srcFileName,
org.gridgain.grid.GridUuid srcParentId,
String destFileName,
org.gridgain.grid.GridUuid destParentId)
throws org.gridgain.grid.GridException
fileId - File ID to move or rename.srcFileName - Original file name in the parent's listing.srcParentId - Parent directory ID.destFileName - New file name in the parent's listing after moving.destParentId - New parent directory ID.org.gridgain.grid.GridException - If failed.@Nullable public GridGgfsFileInfo removeIfEmpty(org.gridgain.grid.GridUuid parentId, String fileName, org.gridgain.grid.GridUuid fileId, org.gridgain.grid.ggfs.GridGgfsPath path, boolean rmvLocked) throws org.gridgain.grid.GridException
parentId - Parent file ID.fileName - New file name in the parent's listing.fileId - File ID to remove.path - Path of the deleted file.rmvLocked - Whether to remove this entry in case it is has explicit lock.null if such file no more exist.org.gridgain.grid.GridException - If failed.public Collection<org.gridgain.grid.GridUuid> pendingDeletes() throws org.gridgain.grid.GridException
org.gridgain.grid.GridException - If operation failed.@Nullable public GridGgfsFileInfo updateProperties(@Nullable org.gridgain.grid.GridUuid parentId, org.gridgain.grid.GridUuid fileId, String fileName, Map<String,String> props) throws org.gridgain.grid.GridException
parentId - Parent ID (null if file is root).fileName - To update listing.fileId - File ID to update information for.props - Properties to set for the file.null if such file ID not found.org.gridgain.grid.GridException - If operation failed.public void updateParentListingAsync(org.gridgain.grid.GridUuid parentId,
org.gridgain.grid.GridUuid fileId,
String fileName,
long lenDelta,
long modificationTime)
parentId - Parent ID.fileId - File ID.fileName - File name.lenDelta - Length delta.modificationTime - Last modification time.@Nullable public GridGgfsFileInfo updateInfo(org.gridgain.grid.GridUuid fileId, org.gridgain.grid.lang.GridClosure<GridGgfsFileInfo,GridGgfsFileInfo> c) throws org.gridgain.grid.GridException
fileId - File ID to update information for.c - Closure to update file's info inside transaction.null if such file ID not found.org.gridgain.grid.GridException - If failed.public boolean sampling(Boolean val) throws org.gridgain.grid.GridException
val - Sampling flag state or null to clear sampling state and mark it as "not set".True if sampling mode was actually changed by this call.org.gridgain.grid.GridException - If failed.public Boolean sampling() throws org.gridgain.grid.GridException
True in case sampling is enabled, false otherwise or null in case sampling
is not set.org.gridgain.grid.GridException - If failed.public GridGgfsSecondaryOutputStreamDescriptor createDual(org.apache.hadoop.fs.FileSystem fs, org.gridgain.grid.ggfs.GridGgfsPath path, boolean simpleCreate, @Nullable org.apache.hadoop.fs.permission.FsPermission perm, boolean overwrite, int bufSize, short replication, long blockSize, org.gridgain.grid.GridUuid affKey) throws org.gridgain.grid.GridException
fs - File system.path - Path.simpleCreate - "Simple create" flag.perm - Permission.overwrite - Overwrite flag.bufSize - Buffer size.replication - Replication factor.blockSize - Block size.affKey - Affinity key.org.gridgain.grid.GridException - If file creation failed.public GridGgfsSecondaryOutputStreamDescriptor appendDual(org.apache.hadoop.fs.FileSystem fs, org.gridgain.grid.ggfs.GridGgfsPath path, int bufSize) throws org.gridgain.grid.GridException
fs - File system.path - Path.bufSize - Buffer size.org.gridgain.grid.GridException - If output stream open for append has failed.public GridGgfsSecondaryInputStreamDescriptor openDual(org.apache.hadoop.fs.FileSystem fs, org.gridgain.grid.ggfs.GridGgfsPath path, int bufSize) throws org.gridgain.grid.GridException
fs - Secondary file system.path - Path to open.bufSize - Buffer size.org.gridgain.grid.GridException - If input stream open has failed.@Nullable public GridGgfsFileInfo synchronizeFileDual(org.apache.hadoop.fs.FileSystem fs, org.gridgain.grid.ggfs.GridGgfsPath path) throws org.gridgain.grid.GridException
fs - File system.path - Path.null if file not found.org.gridgain.grid.GridException - If sync task failed.public boolean mkdirsDual(org.apache.hadoop.fs.FileSystem fs,
org.gridgain.grid.ggfs.GridGgfsPath path,
Map<String,String> props)
throws org.gridgain.grid.GridException
fs - Secondary file system.path - Path to create.props - Properties to be applied.True in case rename was successful.org.gridgain.grid.GridException - If directory creation failed.public boolean renameDual(org.apache.hadoop.fs.FileSystem fs,
org.gridgain.grid.ggfs.GridGgfsPath src,
org.gridgain.grid.ggfs.GridGgfsPath dest)
throws org.gridgain.grid.GridException
fs - Secondary file system.src - Source path.dest - Destination path.org.gridgain.grid.GridException - If failed.public boolean deleteDual(org.apache.hadoop.fs.FileSystem fs,
org.gridgain.grid.ggfs.GridGgfsPath path,
boolean recursive)
throws org.gridgain.grid.GridException
fs - Secondary file system.path - Path to update.recursive - Recursive flag.org.gridgain.grid.GridException - If delete failed.public GridGgfsFileInfo updateDual(org.apache.hadoop.fs.FileSystem fs, org.gridgain.grid.ggfs.GridGgfsPath path, Map<String,String> props) throws org.gridgain.grid.GridException
fs - Secondary file system.path - Path to update.props - Properties to be applied.org.gridgain.grid.GridException - If update failed.public void updateTimes(org.gridgain.grid.GridUuid parentId,
org.gridgain.grid.GridUuid fileId,
String fileName,
long accessTime,
long modificationTime)
throws org.gridgain.grid.GridException
parentId - File parent ID.fileId - File ID to update.fileName - File name to update. Must match file ID.accessTime - Access time to set. If -1, will not be updated.modificationTime - Modification time to set. If -1, will not be updated.org.gridgain.grid.GridException - If update failed.Copyright © 2014. All rights reserved.