57 Commits

Author SHA1 Message Date
ashmrtn
36346548d7
Change user/host information in kopia (#328)
These fields can be used to lookup snapshots in kopia as they are part
of the `Source` struct. They are also stored in the kopia sessions but
they should not cause session collisions. Sessions have unique IDs to go
along with this information.
2022-07-12 16:12:58 -07:00
ashmrtn
2415addd05
Allow getting data from kopia for a directory subtree (#299)
* Implement getting data for directory subtree

Return a slice of collections with data for a given directory subtree in
kopia. Traverse the full directory before creating a DataCollection
instead of sending items as they are found because future
implementations may cause blocking on send. This could reduce
parallelism because the code won't be able to find other directories to
traverse until the files are seen. Kopia also currently loads the entire
directory at once so there's not much benefit to streaming.

System will now continuing pulling data until completion and report all
errors at the end of the run.

* Tests for getting persisted subtree data including some error cases
2022-07-11 18:22:28 +00:00
Vaibhav Kamra
fa190da682
Rename restorepoint to backup (#314) 2022-07-11 16:06:04 +00:00
Vaibhav Kamra
6e9bd634e4
Create RestorePoint and RestorePointDetails (#290)
Update the backup operation to create RestorePoint and RestorePointDetails models in the repository

Add modelstore to the operation to allow backup/restore operations to update/query for corso models

Closes #268
2022-07-08 01:41:40 +00:00
ashmrtn
5605a204d1
Factor out common code for getting kopia items (#298)
* Factor out common code for getting kopia items

Both directory and single item restore in kopia need to do common tasks
like getting the item in question. Factor out that common code and
adjust tests to prep for directory restore.
2022-07-07 16:04:06 -07:00
ashmrtn
1143a33ce6
Allow multiple items in DataCollection from kopia (#296)
Use a slice to back the data instead of adding directly to the channel
for two reasons (this may change in the future though):
  * kopia loads all data about a directory at the same time
  * consumers of the DataCollection may not pull items from the channel
    at a fast rate, which could block adding to the channel. This could
    lead to delays in discovering other directories to traverse in
    multi-threaded scenarios
2022-07-07 14:54:46 -07:00
ashmrtn
70e7a1e2d3
Split KopiaWrapper into handle and backup/restore logic (#281)
* Split KopiaWrapper into repo handle and logic

With ModelStore, multiple structs need a reference to the kopia repo.
Make a small wrapper class (conn) that can open and initialize a repo. The
wrapper handles concurrent closes and opens and does ref counting to
ensure it only drops the kopia handle when the last reference is closed.

Rename KopiaWrapper to Wrapper and keep backup/restore functionality
in it.
2022-07-06 11:09:35 -07:00