[ARVADOS] updated: 9ef386f6e405db49df44a24e4cdfe5a0c0742f62

git at public.curoverse.com git at public.curoverse.com
Wed Nov 12 16:57:27 EST 2014


Summary of changes:
 sdk/go/keepclient/root_sorter.go | 2 --
 1 file changed, 2 deletions(-)

  discards  c03de9a01ff9b5ef7b2c84f1b975443e7cf0a28b (commit)
  discards  6be15c02ce34180a79fbe79b955f173cbae14055 (commit)
  discards  439f1f8c1284b85af874df89c50fd5c1b3f80165 (commit)
       via  9ef386f6e405db49df44a24e4cdfe5a0c0742f62 (commit)
       via  d833a28612bb22e1489536b3b0dfe8eb00196fda (commit)
       via  754ff84aab18b623b37f21377c639694e6ea0ed7 (commit)

This update added new revisions after undoing existing revisions.  That is
to say, the old revision is not a strict subset of the new revision.  This
situation occurs when you --force push a change and generate a repository
containing something like this:

 * -- * -- B -- O -- O -- O (c03de9a01ff9b5ef7b2c84f1b975443e7cf0a28b)
            \
             N -- N -- N (9ef386f6e405db49df44a24e4cdfe5a0c0742f62)

When this happens we assume that you've already had alert emails for all
of the O revisions, and so we here report only the revisions in the N
branch from the common base, B.

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 9ef386f6e405db49df44a24e4cdfe5a0c0742f62
Author: Tom Clegg <tom at curoverse.com>
Date:   Wed Nov 12 16:54:36 2014 -0500

    2853: Avoid using reserved word "hash" as a variable name.

diff --git a/sdk/python/arvados/keep.py b/sdk/python/arvados/keep.py
index 23d8c20..f4c8596 100644
--- a/sdk/python/arvados/keep.py
+++ b/sdk/python/arvados/keep.py
@@ -517,16 +517,16 @@ class KeepClient(object):
                     r['service_port'])
             _logger.debug(str(self._keep_services))
 
-    def _service_weight(self, hash, service_uuid):
+    def _service_weight(self, data_hash, service_uuid):
         """Compute the weight of a Keep service endpoint for a data
         block with a known hash.
 
         The weight is md5(h + u) where u is the last 15 characters of
         the service endpoint's UUID.
         """
-        return hashlib.md5(hash + service_uuid[-15:]).hexdigest()
+        return hashlib.md5(data_hash + service_uuid[-15:]).hexdigest()
 
-    def weighted_service_roots(self, hash, force_rebuild=False):
+    def weighted_service_roots(self, data_hash, force_rebuild=False):
         """Return an array of Keep service endpoints, in the order in
         which they should be probed when reading or writing data with
         the given hash.
@@ -534,14 +534,14 @@ class KeepClient(object):
         self.build_services_list(force_rebuild)
 
         # Sort the available services by weight (heaviest first) for
-        # this hash, and return their service_roots (base URIs) in
-        # that order.
+        # this data_hash, and return their service_roots (base URIs)
+        # in that order.
         sorted_roots = [
             svc['_service_root'] for svc in sorted(
                 self._keep_services,
                 reverse=True,
-                key=lambda svc: self._service_weight(hash, svc['uuid']))]
-        _logger.debug(hash + ': ' + str(sorted_roots))
+                key=lambda svc: self._service_weight(data_hash, svc['uuid']))]
+        _logger.debug(data_hash + ': ' + str(sorted_roots))
         return sorted_roots
 
     def map_new_services(self, roots_map, md5_s, force_rebuild, **headers):

commit d833a28612bb22e1489536b3b0dfe8eb00196fda
Author: Tom Clegg <tom at curoverse.com>
Date:   Wed Nov 12 16:53:39 2014 -0500

    2853: Fix reference to reference set.

diff --git a/sdk/go/keepclient/root_sorter_test.go b/sdk/go/keepclient/root_sorter_test.go
index 8b63449..455715d 100644
--- a/sdk/go/keepclient/root_sorter_test.go
+++ b/sdk/go/keepclient/root_sorter_test.go
@@ -39,7 +39,7 @@ func (*RootSorterSuite) JustOneRoot(c *C) {
 func (*RootSorterSuite) ReferenceSet(c *C) {
 	fakeroots := FakeServiceRoots(16)
 	// These reference probe orders are explained further in
-	// ../../python/arvados/keep.py:
+	// ../../python/tests/test_keep_client.py:
 	expected_orders := []string{
 		"3eab2d5fc9681074",
 		"097dba52e648f1c3",

commit 754ff84aab18b623b37f21377c639694e6ea0ed7
Author: Tom Clegg <tom at curoverse.com>
Date:   Wed Nov 12 16:53:00 2014 -0500

    2853: Use Md5String() in getWeight().

diff --git a/sdk/go/keepclient/root_sorter.go b/sdk/go/keepclient/root_sorter.go
index 7a73d95..c2780bc 100644
--- a/sdk/go/keepclient/root_sorter.go
+++ b/sdk/go/keepclient/root_sorter.go
@@ -1,8 +1,6 @@
 package keepclient
 
 import (
-	"crypto/md5"
-	"fmt"
 	"sort"
 )
 
@@ -29,14 +27,12 @@ func NewRootSorter(serviceRoots map[string]string, hash string) (*RootSorter) {
 }
 
 func (rs RootSorter) getWeight(hash string, uuid string) (string) {
-	var service_key []byte
 	if len(uuid) == 27 {
-		service_key = []byte(hash + uuid[12:])
+		return Md5String(hash + uuid[12:])
 	} else {
 		// Only useful for testing, a set of one service root, etc.
-		service_key = []byte(hash + uuid)
+		return Md5String(hash + uuid)
 	}
-	return fmt.Sprintf("%x", md5.Sum(service_key))
 }
 
 func (rs RootSorter) GetSortedRoots() ([]string) {

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


hooks/post-receive
-- 




More information about the arvados-commits mailing list