Camel.BlockFile¶
- Subclasses:
None
Methods¶
- Inherited:
- Structs:
class |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Virtual Methods¶
- Inherited:
|
|
Properties¶
None
Signals¶
- Inherited:
Fields¶
- Inherited:
Name |
Type |
Access |
Description |
---|---|---|---|
parent |
r |
Class Details¶
- class Camel.BlockFile(**kwargs)¶
- Bases:
- Abstract:
No
- Structure:
- classmethod new(path, flags, version, block_size)¶
- Parameters:
path (
str
) – a path with file name of the newCamel.BlockFile
flags (
int
) – file open flags to useversion (
str
) – a version stringblock_size (
int
) – block size, currently ignored
- Returns:
The new block file, or
None
if it could not be created.- Return type:
Allocate a new block file, stored at path. version contains an 8 character version string which must match the head of the file, or the file will be intitialised.
block_size is currently ignored and is set to
Camel.BLOCK_SIZE
.
- attach_block(bl)¶
- Parameters:
bl (
Camel.Block
) – aCamel.Block
Reattach a block that has been detached.
- detach_block(bl)¶
- Parameters:
bl (
Camel.Block
) – aCamel.Block
Detatch a block from the block file’s cache. The block should be unref’d or attached when finished with. The block file will perform no writes of this block or flushing of it if the cache fills.
- get_cache_limit()¶
- Returns:
Current block cache limit of self.
- Return type:
New in version 3.24.
- get_root()¶
- Returns:
A
Camel.BlockRoot
of self.- Return type:
New in version 3.24.
- get_root_block()¶
- Returns:
A root
Camel.Block
of self.- Return type:
New in version 3.24.
- rename(path)¶
- Parameters:
path (
str
) – path with filename to rename to- Returns:
0 on success, -1 on error; errno is set on failure
- Return type:
Renames existing block file to a new path.
- set_cache_limit(block_cache_limit)¶
- Parameters:
block_cache_limit (
int
) – a new block cache limit to set
Sets a new block cache limit for self.
New in version 3.24.
- sync()¶
- Returns:
-1 on io error.
- Return type:
Sync all dirty blocks to disk, including the root block.
- sync_block(bl)¶
- Parameters:
bl (
Camel.Block
) – aCamel.Block
- Returns:
-1 on io error.
- Return type:
Flush a block to disk immediately. The block will only be flushed to disk if it is marked as dirty (touched).
- touch_block(bl)¶
- Parameters:
bl (
Camel.Block
) – aCamel.Block
Mark a block as dirty. The block will be written to disk if it ever expires from the cache.
- unref_block(bl)¶
- Parameters:
bl (
Camel.Block
) – aCamel.Block
Mark a block as unused. If a block is used it will not be written to disk, or flushed from memory.
If a block is detatched and this is the last reference, the block will be freed.