[ARVADOS] updated: cd85fc2c07a0e9d8c34b81e4523ee3d1ebd696e9

git at public.curoverse.com git at public.curoverse.com
Wed May 21 16:08:09 EDT 2014


Summary of changes:
 sdk/go/src/arvados.org/keepclient/keepclient.go      | 11 +++++------
 sdk/go/src/arvados.org/keepclient/keepclient_test.go |  8 ++++----
 2 files changed, 9 insertions(+), 10 deletions(-)

       via  cd85fc2c07a0e9d8c34b81e4523ee3d1ebd696e9 (commit)
      from  48ffdd5ac196771381c8dc9ab47cfad5f1929720 (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 cd85fc2c07a0e9d8c34b81e4523ee3d1ebd696e9
Author: Peter Amstutz <peter.amstutz at curoverse.com>
Date:   Thu May 15 16:22:33 2014 -0400

    1885: Renamed DiscoverKeepDisks to DiscoverKeepServers, moved error.New()
    declarations to the top, changed some tests to use KeepClient copy instead of
    pointer.

diff --git a/sdk/go/src/arvados.org/keepclient/keepclient.go b/sdk/go/src/arvados.org/keepclient/keepclient.go
index de5066a..2738cef 100644
--- a/sdk/go/src/arvados.org/keepclient/keepclient.go
+++ b/sdk/go/src/arvados.org/keepclient/keepclient.go
@@ -18,6 +18,9 @@ import (
 // A Keep "block" is 64MB.
 const BLOCKSIZE = 64 * 1024 * 1024
 
+var BlockNotFound = errors.New("Block not found")
+var InsufficientReplicasError = errors.New("Could not write sufficient replicas")
+
 type KeepClient struct {
 	ApiServer     string
 	ApiToken      string
@@ -45,12 +48,12 @@ func MakeKeepClient() (kc KeepClient, err error) {
 		Want_replicas: 2,
 		Client:        &http.Client{Transport: tr}}
 
-	err = (&kc).DiscoverKeepDisks()
+	err = (&kc).DiscoverKeepServers()
 
 	return kc, err
 }
 
-func (this *KeepClient) DiscoverKeepDisks() error {
+func (this *KeepClient) DiscoverKeepServers() error {
 	// Construct request of keep disk list
 	var req *http.Request
 	var err error
@@ -429,8 +432,6 @@ func (this KeepClient) uploadToKeepServer(host string, hash string, body io.Read
 	}
 }
 
-var InsufficientReplicasError = errors.New("Could not write sufficient replicas")
-
 func (this KeepClient) putReplicas(
 	hash string,
 	requests chan ReadRequest,
@@ -545,8 +546,6 @@ func (this KeepClient) PutR(r io.Reader) (hash string, replicas int, err error)
 	}
 }
 
-var BlockNotFound = errors.New("Block not found")
-
 func (this KeepClient) Get(hash string) (reader io.ReadCloser,
 	contentLength int64, url string, err error) {
 	return this.AuthorizedGet(hash, "", "")
diff --git a/sdk/go/src/arvados.org/keepclient/keepclient_test.go b/sdk/go/src/arvados.org/keepclient/keepclient_test.go
index 756868c..3d38c60 100644
--- a/sdk/go/src/arvados.org/keepclient/keepclient_test.go
+++ b/sdk/go/src/arvados.org/keepclient/keepclient_test.go
@@ -470,7 +470,7 @@ func RunBogusKeepServer(st http.Handler, port int) (listener net.Listener, url s
 	return listener, url
 }
 
-func UploadToStubHelper(c *C, st http.Handler, f func(*KeepClient, string,
+func UploadToStubHelper(c *C, st http.Handler, f func(KeepClient, string,
 	io.ReadCloser, io.WriteCloser, chan UploadStatus)) {
 
 	listener, url := RunBogusKeepServer(st, 2990)
@@ -494,7 +494,7 @@ func (s *StandaloneSuite) TestUploadToStubKeepServer(c *C) {
 		make(chan string)}
 
 	UploadToStubHelper(c, st,
-		func(kc *KeepClient, url string, reader io.ReadCloser,
+		func(kc KeepClient, url string, reader io.ReadCloser,
 			writer io.WriteCloser, upload_status chan UploadStatus) {
 
 			go kc.uploadToKeepServer(url, st.expectPath, reader, upload_status, int64(len("foo")))
@@ -517,7 +517,7 @@ func (s *StandaloneSuite) TestUploadToStubKeepServerBufferReader(c *C) {
 		make(chan string)}
 
 	UploadToStubHelper(c, st,
-		func(kc *KeepClient, url string, reader io.ReadCloser,
+		func(kc KeepClient, url string, reader io.ReadCloser,
 			writer io.WriteCloser, upload_status chan UploadStatus) {
 
 			// Buffer for reads from 'r'
@@ -565,7 +565,7 @@ func (s *StandaloneSuite) TestFailedUploadToStubKeepServer(c *C) {
 	hash := "acbd18db4cc2f85cedef654fccc4a4d8"
 
 	UploadToStubHelper(c, st,
-		func(kc *KeepClient, url string, reader io.ReadCloser,
+		func(kc KeepClient, url string, reader io.ReadCloser,
 			writer io.WriteCloser, upload_status chan UploadStatus) {
 
 			go kc.uploadToKeepServer(url, hash, reader, upload_status, 3)

-----------------------------------------------------------------------


hooks/post-receive
-- 




More information about the arvados-commits mailing list