public class GridGgfsDataManager extends GridGgfsManager
ggfsCtx, log| Constructor and Description |
|---|
GridGgfsDataManager() |
| Modifier and Type | Method and Description |
|---|---|
Collection<org.gridgain.grid.ggfs.GridGgfsBlockLocation> |
affinity(GridGgfsFileInfo info,
long start,
long len)
Resolve affinity nodes for specified part of file.
|
Collection<org.gridgain.grid.ggfs.GridGgfsBlockLocation> |
affinity(GridGgfsFileInfo info,
long start,
long len,
long maxLen)
Resolve affinity nodes for specified part of file.
|
org.gridgain.grid.GridNode |
affinityNode(Object affinityKey)
Maps affinity key to node.
|
GridGgfsBlockKey |
blockKey(long blockIdx,
GridGgfsFileInfo fileInfo) |
void |
cleanBlocks(GridGgfsFileInfo fileInfo,
GridGgfsFileAffinityRange range,
boolean cleanNonColocated)
Tries to remove blocks affected by fragmentizer.
|
org.gridgain.grid.GridFuture<byte[]> |
dataBlock(GridGgfsFileInfo fileInfo,
org.gridgain.grid.ggfs.GridGgfsPath path,
long blockIdx,
GridGgfsSecondaryInputStreamWrapper inWrapper)
Get data block for specified file ID and block index.
|
org.gridgain.grid.GridFuture<Object> |
delete(GridGgfsFileInfo fileInfo)
Delete file's data from data cache.
|
long |
groupBlockSize()
Gets group block size (block size * group size).
|
List<Long> |
listLocalDataBlocks(GridGgfsFileInfo fileInfo)
Get list of local data blocks of the given file.
|
long |
maxSpaceSize() |
org.gridgain.grid.GridUuid |
nextAffinityKey(org.gridgain.grid.GridUuid prevAffKey)
Generates next affinity key for local node based on current topology.
|
protected void |
onKernalStart0() |
protected void |
onKernalStop0(boolean cancel) |
long |
spaceSize() |
void |
spreadBlocks(GridGgfsFileInfo fileInfo,
GridGgfsFileAffinityRange range)
Moves all colocated blocks in range to non-colocated keys.
|
protected void |
start0()
Start manager implementation.
|
byte[] |
storeDataBlocks(GridGgfsFileInfo fileInfo,
long reservedLen,
byte[] remainder,
int remainderLen,
ByteBuffer data,
boolean flush,
GridGgfsFileAffinityRange affinityRange,
GridGgfsFileWorkerBatch batch)
Store data blocks in file.
Note! If file concurrently deleted we'll get lost blocks. |
byte[] |
storeDataBlocks(GridGgfsFileInfo fileInfo,
long reservedLen,
byte[] remainder,
int remainderLen,
DataInput in,
int len,
boolean flush,
GridGgfsFileAffinityRange affinityRange,
GridGgfsFileWorkerBatch batch)
Store data blocks in file.
Note! If file concurrently deleted we'll got lost blocks. |
void |
writeClose(GridGgfsFileInfo fileInfo)
Notifies data manager that no further writes will be performed on stream.
|
org.gridgain.grid.GridFuture<Boolean> |
writeStart(GridGgfsFileInfo fileInfo)
Registers write future in ggfs data manager.
|
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 GridGgfsManagerpublic long spaceSize()
public long maxSpaceSize()
public org.gridgain.grid.GridUuid nextAffinityKey(@Nullable
org.gridgain.grid.GridUuid prevAffKey)
prevAffKey - Affinity key of previous block.public org.gridgain.grid.GridNode affinityNode(Object affinityKey)
affinityKey - Affinity key to map.public List<Long> listLocalDataBlocks(GridGgfsFileInfo fileInfo) throws org.gridgain.grid.GridException
fileInfo - File info.org.gridgain.grid.GridException - If failed.@Nullable public org.gridgain.grid.GridFuture<byte[]> dataBlock(GridGgfsFileInfo fileInfo, org.gridgain.grid.ggfs.GridGgfsPath path, long blockIdx, @Nullable GridGgfsSecondaryInputStreamWrapper inWrapper) throws org.gridgain.grid.GridException
fileInfo - File info.path - Path reading from.blockIdx - Block index.inWrapper - Optional secondary file system input stream wrapper.null if nothing found.org.gridgain.grid.GridException - If failed.public org.gridgain.grid.GridFuture<Boolean> writeStart(GridGgfsFileInfo fileInfo)
fileInfo - File info of file opened to write.public void writeClose(GridGgfsFileInfo fileInfo)
fileInfo - File info being written.@Nullable public byte[] storeDataBlocks(GridGgfsFileInfo fileInfo, long reservedLen, @Nullable byte[] remainder, int remainderLen, ByteBuffer data, boolean flush, GridGgfsFileAffinityRange affinityRange, @Nullable GridGgfsFileWorkerBatch batch) throws org.gridgain.grid.GridException
fileInfo - File info.reservedLen - Reserved length.remainder - Remainder.remainderLen - Remainder length.data - Data to store.flush - Flush flag.affinityRange - Affinity range to update if file write can be colocated.batch - Optional secondary file system worker batch.org.gridgain.grid.GridException - If failed.@Nullable public byte[] storeDataBlocks(GridGgfsFileInfo fileInfo, long reservedLen, @Nullable byte[] remainder, int remainderLen, DataInput in, int len, boolean flush, GridGgfsFileAffinityRange affinityRange, @Nullable GridGgfsFileWorkerBatch batch) throws org.gridgain.grid.GridException, IOException
fileInfo - File info.reservedLen - Reserved length.remainder - Remainder.remainderLen - Remainder length.in - Data to store.len - Data length to store.flush - Flush flag.affinityRange - File affinity range to update if file cal be colocated.batch - Optional secondary file system worker batch.flush flag is false.org.gridgain.grid.GridException - If failed.IOException - If store failed.public org.gridgain.grid.GridFuture<Object> delete(GridGgfsFileInfo fileInfo)
fileInfo - File details to remove data for.public GridGgfsBlockKey blockKey(long blockIdx, GridGgfsFileInfo fileInfo)
blockIdx - Block index.fileInfo - File info.public void cleanBlocks(GridGgfsFileInfo fileInfo, GridGgfsFileAffinityRange range, boolean cleanNonColocated)
cleanNonColocated is true, will remove
non-colocated blocks as well.fileInfo - File info to clean up.range - Range to clean up.cleanNonColocated - True if all blocks should be cleaned.public void spreadBlocks(GridGgfsFileInfo fileInfo, GridGgfsFileAffinityRange range)
fileInfo - File info to move data for.range - Range to move.public Collection<org.gridgain.grid.ggfs.GridGgfsBlockLocation> affinity(GridGgfsFileInfo info, long start, long len) throws org.gridgain.grid.GridException
info - File info to resolve affinity nodes for.start - Start position in the file.len - File part length to get affinity for.org.gridgain.grid.GridException - If failed.public Collection<org.gridgain.grid.ggfs.GridGgfsBlockLocation> affinity(GridGgfsFileInfo info, long start, long len, long maxLen) throws org.gridgain.grid.GridException
info - File info to resolve affinity nodes for.start - Start position in the file.len - File part length to get affinity for.maxLen - Maximum block length.org.gridgain.grid.GridException - If failed.public long groupBlockSize()
Copyright © 2014. All rights reserved.