[ARVADOS] updated: 22928daa55bc0de7d539793ff27503affac8a39a
git at public.curoverse.com
git at public.curoverse.com
Thu Oct 15 12:34:19 EDT 2015
Summary of changes:
sdk/go/keepclient/keepclient.go | 119 ++++++++++++++++++++-----------
sdk/go/keepclient/keepclient_test.go | 134 ++++++++++++++++++++++++++++++-----
2 files changed, 196 insertions(+), 57 deletions(-)
via 22928daa55bc0de7d539793ff27503affac8a39a (commit)
via f19e50e99dc4939199a9b9a4381a775d40453267 (commit)
via 1f37045c831a45c6899ef0d44f3cccd15476831a (commit)
via cef1d949ecc75417a3575be79f683b2b0048953f (commit)
via 1996b03c10e45d4c1959b40333c57261a040bffb (commit)
via c4f5281d2453faf3184c367f54b29bb77ecf533b (commit)
via 3596b89edfbea42ce52d6c7112e4e18797895423 (commit)
via 8d4e8098591e5545a66670e60911599d5e0903ac (commit)
via d3c7b9502d9297d71225ebdbb81616f7613348b5 (commit)
via 8653e6d34f5d895ee56fe3657c7fc3ca3cf615f4 (commit)
from 3e0f54e6f4d0be807d3e3a0f2b6a49cfef0c6a5e (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
commit 22928daa55bc0de7d539793ff27503affac8a39a
Merge: 3e0f54e f19e50e
Author: radhika <radhika at curoverse.com>
Date: Thu Oct 15 12:32:07 2015 -0400
Merge branch 'master' into 7167-keep-rsync
Conflicts:
sdk/go/keepclient/keepclient.go
diff --cc sdk/go/keepclient/keepclient.go
index 4cd9f54,2f9ea44..67c304d
--- a/sdk/go/keepclient/keepclient.go
+++ b/sdk/go/keepclient/keepclient.go
@@@ -53,23 -55,30 +54,33 @@@ type KeepClient struct
replicasPerService int
}
-// Create a new KeepClient. This will contact the API server to discover Keep
-// servers.
+// MakeKeepClient creates a new KeepClient by contacting the API server to discover Keep servers.
func MakeKeepClient(arv *arvadosclient.ArvadosClient) (*KeepClient, error) {
- var matchTrue = regexp.MustCompile("^(?i:1|yes|true)$")
- insecure := matchTrue.MatchString(os.Getenv("ARVADOS_API_HOST_INSECURE"))
+ kc := New(arv)
+ return kc, kc.DiscoverKeepServers()
+}
+// New func creates a new KeepClient struct.
+// This func does not discover keep servers. It is the caller's responsibility.
+func New(arv *arvadosclient.ArvadosClient) *KeepClient {
+ defaultReplicationLevel := 2
+ value, err := arv.Discovery("defaultCollectionReplication")
+ if err == nil {
+ v, ok := value.(float64)
+ if ok && v > 0 {
+ defaultReplicationLevel = int(v)
+ }
+ }
+
kc := &KeepClient{
Arvados: arv,
- Want_replicas: 2,
+ Want_replicas: defaultReplicationLevel,
Using_proxy: false,
Client: &http.Client{Transport: &http.Transport{
- TLSClientConfig: &tls.Config{InsecureSkipVerify: insecure}}},
+ TLSClientConfig: &tls.Config{InsecureSkipVerify: arv.ApiInsecure}}},
+ Retries: 2,
}
- return kc, kc.DiscoverKeepServers()
+ return kc
}
// Put a block given the block hash, a reader, and the number of bytes
-----------------------------------------------------------------------
hooks/post-receive
--
More information about the arvados-commits
mailing list