Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add meta file to DB system #258

Closed
wants to merge 7 commits into from
Closed

Conversation

azhsmesos
Copy link

The user can clearly see the current file data, and can easily do some operations, such as the user can clear the old data file.

zhaozhenhang@zhaozhenhangdeMacBook-Pro nutsdbtest % ls
0.dat		1.dat		2.dat		3.dat		4.dat		5.dat		6.dat		7.dat		meta.json
zhaozhenhang@zhaozhenhangdeMacBook-Pro nutsdbtest % cat meta.json
{
     "fileName": "0.dat",
     "minTs": 1670947210,
     "maxTs": 1670947213,
     "entryCount": 138,
     "entryBytes": 8202
}
{
     "fileName": "1.dat",
     "minTs": 1670947213,
     "maxTs": 1670947216,
     "entryCount": 134,
     "entryBytes": 8174
}
{
     "fileName": "2.dat",
     "minTs": 1670947216,
     "maxTs": 1670947218,
     "entryCount": 134,
     "entryBytes": 8174
}
{
     "fileName": "3.dat",
     "minTs": 1670947218,
     "maxTs": 1670947220,
     "entryCount": 134,
     "entryBytes": 8174
}
{
     "fileName": "4.dat",
     "minTs": 1670947220,
     "maxTs": 1670947222,
     "entryCount": 134,
     "entryBytes": 8174
}
{
     "fileName": "5.dat",
     "minTs": 1670947222,
     "maxTs": 1670947225,
     "entryCount": 134,
     "entryBytes": 8174
}
{
     "fileName": "6.dat",
     "minTs": 1670947225,
     "maxTs": 1670947227,
     "entryCount": 134,
     "entryBytes": 8174
}

@azhsmesos
Copy link
Author

The current operation is only logged when the segment file is full, so it has little impact on performanc.

@elliotchenzichang
Copy link
Member

Hi, just wondering how to UnMarshal this file to go object in runtime. Seems that it's not a JSON array schema in this file.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants