存储在 int[] selectRow = productsTable2.getSelectedRows();
中的账本大小每天都在增加。例如,3-4 年后,大小可以以 TB 为单位。有没有 -
答案 0 :(得分:0)
对于你的问题,我试着在源代码中找到答案,还有一点点答案
1、第一个问题:
在fabric v1.4.2源代码commom/ledger/blockfile_mgr.go
中,方法getTransactionByID
用作tx查询,根据这个方法,最终这个方法会调用方法getTxLoc
,我们可以知道什么时候我们查询一个tx,我们首先需要得到tx所在的block,我们可以通过index快速找到这个block(我对索引机制不是很了解,但我认为它对性能有帮助)
2、对于你的第二和第三个问题:
在fabric v1.4.2源代码commom/ledger/blockfile_mgr.go
中,方法addBlock
用作向块文件(位于/var/hyperledger/production/...blockfile_000000)添加块,我们可以找到一些此方法中的有用信息:
//Determine if we need to start a new file since the size of this block
//exceeds the amount of space left in the current file
//default value of maxBlockfileSize is 64 * 1024 * 1024
if currentOffset+totalBytesToAppend > mgr.conf.maxBlockfileSize {
mgr.moveToNextFile()
currentOffset = 0
}
表示当blockfile大于64 * 1024 * 1024时,会创建一个新的blockfile
3、最后一个问题
我没有找到相关信息
希望这些对你有帮助。