tests: fs_windows: add Windows tests to reflect improved delete behavior
- Update delete tests to expect success with auto-cleanup
- Change tests to verify proper resource cleanup (unmap and close)
- Update test comments to reflect new expected behavior
- Use public APIs (cio_chunk_is_up) for state verification instead of directly accessing native functions
Signed-off-by: Eduardo Silva eduardo@chronosphere.io
版权所有:中国计算机学会技术支持:开源发展技术委员会
京ICP备13000930号-9
京公网安备 11010802032778号
Chunk I/O
Chunk I/O is a library to manage chunks of data in the file system and load in memory upon demand. It’s designed to support:
File System Structure
The library uses a root path to store the content, where different streams can be defined to store data files called chunks, e.g:
It’s up to the caller program how to define the names, basically it needs to set streams and associate chunks to it:
Creating a file system structure like the proposed one requires several checks and usage of I/O interfaces, Chunk I/O aims to abstract the internals of I/O interfaces providing helpers that behind the scenes relies on mmap(2), msync(2), munmap(2) and ftruncate(2).
File Layout
Each chunk file created by the library have the following layout:
cio - client tool
This repository provides a client tool called cio for testing and managing purposes. a quick start for testing could be to stream a file over STDIN and flush it under a specific stream and chunk name, e.g:
the command above specify to gather data from the standard input (-i), use a stream called stdin (-s stdin) and store the data into the chunk called data (-f data) and enabling some verbose messages (-vvv)
now that the chunk file has been generated you can list the content with the -l option:
Performance Test
The cli tool offers a simple performance test which can be used to measure how fast data can be processed and stored under different setups. The following options are available:
The following example will take the data sample file provided in chunkio source code of 400KB, run the performance test creating 1000 files of 2MB each (5 writes of 400KB per file):
Enabling the checksum mode with the option -k will calculate the CRC32 checksum of the content. This option will make it run slower but it provides an integrity check option inside each created file:
By default the synchronization mode to flush the changes to the file system is normal (based on MAP_ASYNC). In technical terms we let the Kernel decide when to flush the memory pages to disk based on it I/O strategy. If the program is killed or it crash while some pages have not been flushed, that file will be incomplete or corrupted. Depending of the use case, a user would prefer data safety over performance, for such scenario a synchronization mode called full (based on MAP_SYNC) is available through the -F option:
For most of scenarios running synchronization in normal mode is good enough, but we let the user to decide it own strategy.
TODO
License
Chunk I/O is under the terms of Apache License v2.0