public class IgfsDataManager extends IgfsManager
igfsCtx, log| Constructor and Description |
|---|
IgfsDataManager() |
| Modifier and Type | Method and Description |
|---|---|
Collection<IgfsBlockLocation> |
affinity(IgfsEntryInfo info,
long start,
long len)
Resolve affinity nodes for specified part of file.
|
Collection<IgfsBlockLocation> |
affinity(IgfsEntryInfo info,
long start,
long len,
long maxLen)
Resolve affinity nodes for specified part of file.
|
ClusterNode |
affinityNode(Object affinityKey)
Maps affinity key to node.
|
Collection<ClusterNode> |
affinityNodes(Object affinityKey)
Maps affinity key to node.
|
IgfsBlockKey |
blockKey(long blockIdx,
IgfsEntryInfo fileInfo) |
void |
cleanBlocks(IgfsEntryInfo fileInfo,
IgfsFileAffinityRange range,
boolean cleanNonColocated)
Tries to remove blocks affected by fragmentizer.
|
IgniteInternalFuture<byte[]> |
dataBlock(IgfsEntryInfo fileInfo,
IgfsPath path,
long blockIdx,
IgfsSecondaryFileSystemPositionedReadable secReader)
Get data block for specified file ID and block index.
|
IgniteInternalFuture<Object> |
delete(IgfsEntryInfo fileInfo)
Delete file's data from data cache.
|
long |
groupBlockSize()
Gets group block size (block size * group size).
|
long |
maxSpaceSize() |
IgniteUuid |
nextAffinityKey(IgniteUuid prevAffKey)
Generates next affinity key for local node based on current topology.
|
protected void |
onKernalStart0() |
protected void |
onKernalStop0(boolean cancel) |
byte[] |
secondaryDataBlock(IgfsPath path,
long blockIdx,
IgfsSecondaryFileSystemPositionedReadable secReader,
int blockSize)
Get data block for specified block index from secondary reader.
|
long |
spaceSize() |
void |
spreadBlocks(IgfsEntryInfo fileInfo,
IgfsFileAffinityRange range)
Moves all collocated blocks in range to non-colocated keys.
|
protected void |
start0()
Start manager implementation.
|
byte[] |
storeDataBlocks(IgfsEntryInfo fileInfo,
long reservedLen,
byte[] remainder,
int remainderLen,
ByteBuffer data,
boolean flush,
IgfsFileAffinityRange affinityRange,
IgfsFileWorkerBatch batch)
Store data blocks in file.
|
byte[] |
storeDataBlocks(IgfsEntryInfo fileInfo,
long reservedLen,
byte[] remainder,
int remainderLen,
DataInput in,
int len,
boolean flush,
IgfsFileAffinityRange affinityRange,
IgfsFileWorkerBatch batch)
Store data blocks in file.
|
void |
writeClose(IgniteUuid fileId)
Notifies data manager that no further writes will be performed on stream.
|
IgniteInternalFuture<Boolean> |
writeStart(IgniteUuid fileId)
Registers write future in igfs data manager.
|
kernalStartInfo, kernalStopInfo, onKernalStart, onKernalStop, start, startInfo, stop, stop0, stopInfoprotected void start0()
throws IgniteCheckedException
start0 in class IgfsManagerIgniteCheckedExceptionprotected void onKernalStart0()
throws IgniteCheckedException
onKernalStart0 in class IgfsManagerIgniteCheckedException - If failed.protected void onKernalStop0(boolean cancel)
onKernalStop0 in class IgfsManagerpublic long spaceSize()
public long maxSpaceSize()
public IgniteUuid nextAffinityKey(@Nullable IgniteUuid prevAffKey)
prevAffKey - Affinity key of previous block.public ClusterNode affinityNode(Object affinityKey)
affinityKey - Affinity key to map.public Collection<ClusterNode> affinityNodes(Object affinityKey)
affinityKey - Affinity key to map.@Nullable public IgniteInternalFuture<byte[]> dataBlock(IgfsEntryInfo fileInfo, IgfsPath path, long blockIdx, @Nullable IgfsSecondaryFileSystemPositionedReadable secReader) throws IgniteCheckedException
fileInfo - File info.path - Path reading from.blockIdx - Block index.secReader - Optional secondary file system reader.null if nothing found.IgniteCheckedException - If failed.@Nullable public byte[] secondaryDataBlock(IgfsPath path, long blockIdx, IgfsSecondaryFileSystemPositionedReadable secReader, int blockSize) throws IgniteCheckedException
path - Path reading from.blockIdx - Block index.secReader - Optional secondary file system reader.blockSize - Block size.null if nothing found.IgniteCheckedException - If failed.public IgniteInternalFuture<Boolean> writeStart(IgniteUuid fileId)
fileId - File ID.public void writeClose(IgniteUuid fileId) throws IgniteCheckedException
fileId - File ID.IgniteCheckedException - If failed.@Nullable public byte[] storeDataBlocks(IgfsEntryInfo fileInfo, long reservedLen, @Nullable byte[] remainder, int remainderLen, ByteBuffer data, boolean flush, IgfsFileAffinityRange affinityRange, @Nullable IgfsFileWorkerBatch batch) throws IgniteCheckedException
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.IgniteCheckedException - If failed.@Nullable public byte[] storeDataBlocks(IgfsEntryInfo fileInfo, long reservedLen, @Nullable byte[] remainder, int remainderLen, DataInput in, int len, boolean flush, IgfsFileAffinityRange affinityRange, @Nullable IgfsFileWorkerBatch batch) throws IgniteCheckedException, 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.IgniteCheckedException - If failed.IOException - If store failed.public IgniteInternalFuture<Object> delete(IgfsEntryInfo fileInfo)
fileInfo - File details to remove data for.public IgfsBlockKey blockKey(long blockIdx, IgfsEntryInfo fileInfo)
blockIdx - Block index.fileInfo - File info.public void cleanBlocks(IgfsEntryInfo fileInfo, IgfsFileAffinityRange 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(IgfsEntryInfo fileInfo, IgfsFileAffinityRange range)
fileInfo - File info to move data for.range - Range to move.public Collection<IgfsBlockLocation> affinity(IgfsEntryInfo info, long start, long len) throws IgniteCheckedException
info - File info to resolve affinity nodes for.start - Start position in the file.len - File part length to get affinity for.IgniteCheckedException - If failed.public Collection<IgfsBlockLocation> affinity(IgfsEntryInfo info, long start, long len, long maxLen) throws IgniteCheckedException
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.IgniteCheckedException - If failed.public long groupBlockSize()
Follow @ApacheIgnite
Ignite Fabric : ver. 2.0.0 Release Date : April 30 2017