Merge branch '10956-arvput-pdh-fix'
[arvados.git] / sdk / go / keepclient / keepclient.go
index baf4bac02444170446c91a61c0b7469813bf308c..4f84afca61a413796fbb222eb5108473c449cfaf 100644 (file)
@@ -72,6 +72,7 @@ type KeepClient struct {
        lock               sync.RWMutex
        Client             *http.Client
        Retries            int
+       BlockCache         *BlockCache
 
        // set to 1 if all writable services are of disk type, otherwise 0
        replicasPerService int
@@ -406,6 +407,14 @@ func (kc *KeepClient) getSortedRoots(locator string) []string {
        return found
 }
 
+func (kc *KeepClient) cache() *BlockCache {
+       if kc.BlockCache != nil {
+               return kc.BlockCache
+       } else {
+               return DefaultBlockCache
+       }
+}
+
 type Locator struct {
        Hash  string
        Size  int      // -1 if data size is not known