getChunksMeta#
- swordfish.function.getChunksMeta()#
Return metadata of specified database chunks on the local datanode. If chunkPath is not specified, return metadata of all database chunks on the local data node.
- Parameters:
chunkPath (Constant, optional) – The DFS path to one or multiple database chunks. It supports wildcards %, * and ?.
top (Constant, optional) – A positive number indicating the maximum number of chunks in the output. The default value is 1024. If it is set to -1, the number of returned chunks is not limited.
- Returns:
A table containing the following columns:
site: Alias of the node
chunkId: The chunk ID
path: The path to database chunks
dfsPath: The DFS path to database chunks
type: The partition type. 0 for file chunk; 1 for tablet chunk.
flag: Flag for deletion.
flag=0: The chunk can be queried and accessed.
flag=1: The chunk has been logically marked as deleted and cannot be queried, but it has not been removed from disk.
size: The disk space (in bytes) occupied by the file chunk. It returns 0 for tablet chunks. Use the getTabletsMeta function to check the disk space tablet chunk occupies.
version: the version number
state: Chunk state.
0 (final state): Transaction has been completed or rolled back.
1 (before-commit state): The transaction is being executed on the chunk, such as writing or deleting data.
2 (after-commit state): The transaction has been committed.
3 (waiting-for-recovery state): When there is a version conflict or data corruption, this state occurs after the data node sends a recovery request to the controller and before the controller initiates the recovery.
4 (in-recovery state): This state occurs after the controller receives the recovery request and initiates the recovery. Upon the completion of recovery, the chunk reverts to the final state (0).
versionList: version list.
resolved: Whether the transaction of the chunk is in the commit phase that needs to be resolved. True indicates the transaction is in the resolution phase or needs to be resolved; False indicates the transaction has already completed the resolution phase or it is not required.
- Return type: