mirror of
https://github.com/dolthub/dolt.git
synced 2026-02-11 02:59:34 -06:00
Merge pull request #1059 from cmasone-attic/comments
Fix up DataStore comments
This commit is contained in:
@@ -26,10 +26,10 @@ type DataStore interface {
|
||||
// Delete removes the Dataset named datasetID from the map at the root of the DataStore. The Dataset data is not necessarily cleaned up at this time, but may be garbage collected in the future. If the update cannot be performed, e.g., because of a conflict, error will non-nil. The newest snapshot of the datastore is always returned.
|
||||
Delete(datasetID string) (DataStore, error)
|
||||
|
||||
// Copies all chunks reachable from (and including) |r| but not reachable from (and including) |exclude| from this DataStore to |sink|
|
||||
// CopyReachableChunksP copies to |sink| all chunks reachable from (and including) |r|, but that are not in the subtree rooted at |exclude|
|
||||
CopyReachableChunksP(r, exclude ref.Ref, sink chunks.ChunkSink, concurrency int)
|
||||
|
||||
// Copies all chunks reachable from (and including) |r| in |source| that aren't present in this DataStore
|
||||
// CopyMissingChunksP copies to sink all chunks reachable from (and including) |r| that it does not already have
|
||||
CopyMissingChunksP(r ref.Ref, sink chunks.ChunkStore, concurrency int)
|
||||
}
|
||||
|
||||
|
||||
@@ -55,7 +55,7 @@ func (ds *dataStoreCommon) Datasets() MapOfStringToRefOfCommit {
|
||||
return *ds.datasets
|
||||
}
|
||||
|
||||
// Copies all chunks reachable from (and including) |r| in |source| that aren't present in |sink|
|
||||
// CopyMissingChunksP copies to |sink| all chunks in ds that are reachable from (and including) |r|, skipping chunks that |sink| already has
|
||||
func (ds *dataStoreCommon) CopyMissingChunksP(sourceRef ref.Ref, sink chunks.ChunkStore, concurrency int) {
|
||||
tcs := &teeChunkSource{ds, sink}
|
||||
|
||||
|
||||
@@ -27,7 +27,7 @@ func (lds *LocalDataStore) Delete(datasetID string) (DataStore, error) {
|
||||
return newLocalDataStore(lds.ChunkStore), err
|
||||
}
|
||||
|
||||
// Copies all chunks reachable from (and including)|sourceRef| but not reachable from (and including) |exclude| in |source| to |sink|
|
||||
// CopyReachableChunksP copies to |sink| all chunks reachable from (and including) |r|, but that are not in the subtree rooted at |exclude|
|
||||
func (lds *LocalDataStore) CopyReachableChunksP(sourceRef, exclude ref.Ref, sink chunks.ChunkSink, concurrency int) {
|
||||
excludeRefs := map[ref.Ref]bool{}
|
||||
|
||||
|
||||
@@ -39,8 +39,8 @@ func (rds *RemoteDataStore) Delete(datasetID string) (DataStore, error) {
|
||||
return newRemoteDataStore(rds.ChunkStore), err
|
||||
}
|
||||
|
||||
// Asks remote server to figure out which chunks need to be copied and return them.
|
||||
func (rds *RemoteDataStore) CopyReachableChunksP(r, exclude ref.Ref, cs chunks.ChunkSink, concurrency int) {
|
||||
// CopyReachableChunksP copies to |sink| all chunks in rds that are reachable from (and including) |r|, but that are not in the subtree rooted at |exclude|.This implementation asks the remote server to return the desired chunks and writes them to |sink|.
|
||||
func (rds *RemoteDataStore) CopyReachableChunksP(r, exclude ref.Ref, sink chunks.ChunkSink, concurrency int) {
|
||||
// POST http://<host>/ref/sha1----?all=true&exclude=sha1----. Response will be chunk data if present, 404 if absent.
|
||||
u := rds.host()
|
||||
u.Path = path.Join(constants.RefPath, r.String())
|
||||
@@ -69,7 +69,7 @@ func (rds *RemoteDataStore) CopyReachableChunksP(r, exclude ref.Ref, cs chunks.C
|
||||
reader = gr
|
||||
}
|
||||
|
||||
chunks.Deserialize(reader, cs, nil)
|
||||
chunks.Deserialize(reader, sink, nil)
|
||||
}
|
||||
|
||||
// In order for keep alive to work we must read to EOF on every response. We may want to add a timeout so that a server that left its connection open can't cause all of ports to be eaten up.
|
||||
|
||||
Reference in New Issue
Block a user