-
Notifications
You must be signed in to change notification settings - Fork 5
improve export format #118
Comments
Before this PR all data-types (files, versions, trashbin...) were stored inside a single files directory which closely followed ownClouds home-folder layout. This allowed for fast iteration but also coupled the format to ownCloud which in turn introduced some design quirks (/files/files/) in files.jsonl (#111) All data type specific folders are now stored in the root directory of the export which allows simpler mapping from metadata (#118). This is also reflected in the architecture: The exporter traverses down from the specific directories instead from the home. A special "root folder" was introduced in files.jsonl to further decouple things from owncloud and to be able to carry the e-tag for the whole tree. Instead of "/files", "/" is now root in the export. Path class has been added to reduce path-merging boilerplate.
Before this PR all data-types (files, versions, trashbin...) were stored inside a single files directory which closely followed ownClouds home-folder layout. This allowed for fast iteration but also coupled the format to ownCloud which in turn introduced some design quirks (/files/files/) in files.jsonl (#111) All data type specific folders are now stored in the root directory of the export which allows simpler mapping from metadata (#118). This is also reflected in the architecture: The exporter traverses down from the specific directories instead from the home. A special "root folder" was introduced in files.jsonl to further decouple things from owncloud and to be able to carry the e-tag for the whole tree. Instead of "/files", "/" is now root in the export. Path class has been added to reduce path-merging boilerplate.
Before this PR all data-types (files, versions, trashbin...) were stored inside a single files directory which closely followed ownClouds home-folder layout. This allowed for fast iteration but also coupled the format to ownCloud which in turn introduced some design quirks (/files/files/) in files.jsonl (#111) All data type specific folders are now stored in the root directory of the export which allows simpler mapping from metadata (#118). This is also reflected in the architecture: The exporter traverses down from the specific directories instead from the home. A special "root folder" was introduced in files.jsonl to further decouple things from owncloud and to be able to carry the e-tag for the whole tree. Instead of "/files", "/" is now root in the export. Path class has been added to reduce path-merging boilerplate.
Any pointers on how to model versions in the export in a platform independet manner? (oCis)@butonic @felixboehm Possible avenues: 1. Add versions array to each entry in files.jsonlThis could potentially bloat files.jsonl, and this is only etag, owner and timestamp. {
"type": "file",
"path": "/Rop/versioned.txt",
"eTag": "3a1f4a6ab721bd13ae9abe79088d5a69",
"permissions": 27,
"mtime": 1573372163,
"versions": {
"1573372157": {
"etag": "83cbf4a6423c1bf846650f50c987b135",
"owner": "admin",
"timestamp": 1573372157
},
"1573372158": {
"etag": "befa0fe4cb4f672d9db9ca532059069d",
"owner": "admin",
"timestamp": 1573372158
},
"1573372159": {
"etag": "f6c61a371083277bb3fe5583444da1f7",
"owner": "admin",
"timestamp": 1573372159
},
"1573372161": {
"etag": "258067b818ff1633cec4fe6b244e4319",
"owner": "admin",
"timestamp": 1573372161
},
"1573372163": {
"etag": "ba5d239ac8b84cb092ff5a0bd1ea9f3a",
"owner": "admin",
"timestamp": 1573372163
}
}
} Storage-Path and some other fields are ommited because I assume this an implementation detail. The target system should know by itself where to put it's versions. Please correct me If this assumption is wrong but following this train of tought we could simplify even further: {
"type": "file",
"path": "/Rop/versioned.txt",
"eTag": "3a1f4a6ab721bd13ae9abe79088d5a69",
"permissions": 27,
"mtime": 1573372163,
"versions": [
"1573372157"
"1573372158"
"1573372159"
"1573372161"
]
}
As the files_version directory mirrors the user-dir but with all files suffixed with .v$VERSION the importer can recreate everything from the version-string by using the path of the file. Downsides of the above approach are that the etag, mtime etc. for the version is lost (future clients with version-sync!). This also won't work for systems where versions are organized differently. 2. Don't link files to versions (like in ownCloud)
@butonic Will this be even possible in oCis i.e iterating over files-metadata and modifying retroactively? Only knowing the path and maybe the Storage? Any toughts? |
Before this PR all data-types (files, versions, trashbin...) were stored inside a single files directory which closely followed ownClouds home-folder layout. This allowed for fast iteration but also coupled the format to ownCloud which in turn introduced some design quirks (/files/files/) in files.jsonl (#111) All data type specific folders are now stored in the root directory of the export which allows simpler mapping from metadata (#118). This is also reflected in the architecture: The exporter traverses down from the specific directories instead from the home. A special "root folder" was introduced in files.jsonl to further decouple things from owncloud and to be able to carry the e-tag for the whole tree. Instead of "/files", "/" is now root in the export. Path class has been added to reduce path-merging boilerplate.
I'd go with a separate file. then an import does not need to read all version information and afaict we will need to bypass the cs3 api to add versions anyway. same for trashbin. |
Milestone: Improvements on "export format" https://github.com/owncloud/data_exporter/milestone/2
Open issues
Spec
Simplified Structure
After development
The text was updated successfully, but these errors were encountered: