MentDB, The digital brain.  About me Home
Back / All functions / File System

Each of your JSON nodes are saved in blocks to form a record.
All blocks and records are searchable through position calculations in index and data files.
You can see the sizes of the data and index files at any time.

fs index sizefs data sizefs index calcul posfs index blockfs index countfs data blockfs data recordfs cache sizefs unused data blockfs unused nb blockfs unused last block

fs index size <page> <nbByPage>

Description

    To show the size of all index files (by page)

Parameters

    page:   The page - integer >= 1 - required
    nbByPage:   The number by page - integer>0 - required
admin
fs index size 1 10
mentdb
[
{
"percent_used": 6,
"current_max_block_size": 16,
"size": 200,
"current_block_size": 1,
"percent_graph": "|-----------------------------",
"indexFileId": 0
},
{
"percent_used": 12,
"current_max_block_size": 16,
"size": 200,
"current_block_size": 2,
"percent_graph": "|||---------------------------",
"indexFileId": 1
},
{
"percent_used": 31,
"current_max_block_size": 16,
"size": 200,
"current_block_size": 5,
"percent_graph": "|||||||||---------------------",
"indexFileId": 2
},
{
"percent_used": 25,
"current_max_block_size": 16,
"size": 200,
"current_block_size": 4,
"percent_graph": "|||||||-----------------------",
"indexFileId": 3
},
{
"percent_used": 37,
"current_max_block_size": 16,
"size": 200,
"current_block_size": 6,
"percent_graph": "|||||||||||-------------------",
"indexFileId": 4
},
{
"percent_used": 0,
"current_max_block_size": 16,
"size": 200,
"current_block_size": 0,
"percent_graph": "------------------------------",
"indexFileId": 5
},
{
"percent_used": 0,
"current_max_block_size": 16,
"size": 200,
"current_block_size": 0,
"percent_graph": "------------------------------",
"indexFileId": 6
},
{
"percent_used": 6,
"current_max_block_size": 16,
"size": 200,
"current_block_size": 1,
"percent_graph": "|-----------------------------",
"indexFileId": 7
},
{
"percent_used": 12,
"current_max_block_size": 16,
"size": 200,
"current_block_size": 2,
"percent_graph": "|||---------------------------",
"indexFileId": 8
},
{
"percent_used": 25,
"current_max_block_size": 16,
"size": 200,
"current_block_size": 4,
"percent_graph": "|||||||-----------------------",
"indexFileId": 9
}
]
admin
metric index files 1 10;
mentdb
Total block: 1000x16=16000
Total size: 1000x200=200000b
|----------------------------- 6% - 0 - used: 1, free: 15, total block: 16, size: 200b
|||--------------------------- 12% - 1 - used: 2, free: 14, total block: 16, size: 200b
|||||||||--------------------- 31% - 2 - used: 5, free: 11, total block: 16, size: 200b
|||||||----------------------- 25% - 3 - used: 4, free: 12, total block: 16, size: 200b
|||||||||||------------------- 37% - 4 - used: 6, free: 10, total block: 16, size: 200b
------------------------------ 0% - 5 - used: 0, free: 16, total block: 16, size: 200b
------------------------------ 0% - 6 - used: 0, free: 16, total block: 16, size: 200b
|----------------------------- 6% - 7 - used: 1, free: 15, total block: 16, size: 200b
|||--------------------------- 12% - 8 - used: 2, free: 14, total block: 16, size: 200b
|||||||----------------------- 25% - 9 - used: 4, free: 12, total block: 16, size: 200b

fs data size <page> <nbByPage>

Description

    To show the size of all data files in a page

Parameters

    page:   The page - integer >= 1 - required
    nbByPage:   The number by page - integer>0 - required
admin
fs data size 1 2
mentdb
[
{
"dataFileId": 0,
"percent_used": 0,
"current_max_block_size": 10000000,
"size": 1583616,
"current_block_size": 6186,
"nbUnusedBlock": 22,
"percent_graph": "------------------------------",
"lastUnusedBlock": 1577216
}
]
admin
metric data files 1 2;
mentdb
------------------------------ 0% - 0 - used: 6186, free: 9993814, total block: 10000000, size: 1583616b, max size: 2560Mb, last unused block: 1577216, nb unused block: 22

fs index calcul pos <key>

Description

    To calculate the index position for a specific key

Parameters

    key:   The key - string - required
admin
fs index calcul pos "W[cat]"
mentdb
{
"indexPosition": 8,
"key": "W[cat]",
"indexFileId": 115
}

fs index block <indexFileId> <position>

Description

    To show a specific block at a position in an index file (The first 8 bytes is the number of block from the index file)

Parameters

    indexFileId:   The index file id - integer >= 0 - required
    position:   The position - integer >= 0 - required
admin
fs index block 115 8
mentdb
{
"DataFileId": 0,
"DataPosition": 1575168
}

fs index count <indexFileId>

Description

    To show the number of block from an index file

Parameters

    indexFileId:   The index file id - integer >= 0 - required
admin
fs index count 115
mentdb
2

fs data block <dataFileId> <position>

Description

    To show a specific block at a position from a data file

Parameters

    dataFileId:   The data file id - integer >= 0 - required
    position:   The position - integer >= 0 - required
admin
#Here the collision block;
fs data block 0 1575168
mentdb
{
"nextBlockAddress": -1,
"data": "W1siV1tjYXRdIiwwLDE1NzU0MjRdXQ\u003d\u003d"
}

fs data record <dataFileId> <position>

Description

    To show all blocks in a record at the position in a data file

Parameters

    dataFileId:   The data file id - integer >= 0 - required
    position:   The position - integer >= 0 - required
admin
#Here the collision record;
fs data record 0 1575168
mentdb
[
{
"blockId": 1,
"block": {
"nextBlockAddress": -1,
"data": "W1siV1tjYXRdIiwwLDE1NzU0MjRdXQ\u003d\u003d"
},
"position": 1575168
},
"[[\"W[cat]\",0,1575424]]"
]
admin
#Here the data record W[cat];
fs data record 0 1575424
mentdb
[
{
"blockId": 1,
"block": {
"nextBlockAddress": -1,
"data": "eyJmbCI6eyJlbiI6eyJsdGwiOiJUSFs2dF0iLCJmdGwiOiJUSFs2dF0ifX0sInciOjIsImsiOiJXW2NhdF0ifQ\u003d\u003d"
},
"position": 1575424
},
"{\"fl\":{\"en\":{\"ltl\":\"TH[6t]\",\"ftl\":\"TH[6t]\"}},\"w\":2,\"k\":\"W[cat]\"}"
]
admin
#Here the data node W[cat];
node show W[cat]
mentdb
{
"fl": {
"en": {
"ltl": "TH[72]",
"ftl": "TH[6t]"
}
},
"w": 10,
"k": "W[cat]"
}

fs cache size

Description

    To show the cache size

admin
fs cache size
mentdb
512

fs unused data block <dataFileId> <limit>

Description

    To show the unused block list (after a block was deleted). The list return the last block before.

Parameters

    dataFileId:   The data file id - integer >= 0 - required
    limit:   The limit - integer >= 0 - required
admin
fs unused data block 0 10
mentdb
[
1577728,
1578752,
1579008,
57344,
1579520,
1579776,
1581312,
1580288,
1580032,
1579264,
1581824
]

fs unused nb block <dataFileId>

Description

    To show the number of unused data block (after a block was deleted)

Parameters

    dataFileId:   The data file id - integer >= 0 - required
admin
fs unused nb block 0
mentdb
22

fs unused last block <dataFileId>

Description

    To show the last unused data block (after a block was deleted)

Parameters

    dataFileId:   The data file id - integer >= 0 - required
admin
fs unused last block 0
mentdb
1577728




© 2012-2017 - Jimmitry Payet.