[ARVADOS] updated: 75e196b201be758ffb857c3f2d33847e8cca0d18
git at public.curoverse.com
git at public.curoverse.com
Fri Sep 11 20:54:42 EDT 2015
Summary of changes:
services/keepstore/volume.go | 14 +++++++++-----
services/keepstore/volume_generic_test.go | 10 +++++-----
services/keepstore/volume_unix_test.go | 8 ++++----
services/keepstore/work_queue.go | 2 ++
4 files changed, 20 insertions(+), 14 deletions(-)
via 75e196b201be758ffb857c3f2d33847e8cca0d18 (commit)
from b9e48b6cbfff91b05af44cf1410120468a385aba (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 75e196b201be758ffb857c3f2d33847e8cca0d18
Author: radhika <radhika at curoverse.com>
Date: Fri Sep 11 20:33:50 2015 -0400
7179: A few golint suggested updates. There are still a lot of golint complaints.
diff --git a/services/keepstore/volume.go b/services/keepstore/volume.go
index daf003e..cdaec92 100644
--- a/services/keepstore/volume.go
+++ b/services/keepstore/volume.go
@@ -1,7 +1,3 @@
-// A Volume is an interface representing a Keep back-end storage unit:
-// for example, a single mounted disk, a RAID array, an Amazon S3 volume,
-// etc.
-
package main
import (
@@ -10,6 +6,9 @@ import (
"time"
)
+// A Volume is an interface representing a Keep back-end storage unit:
+// for example, a single mounted disk, a RAID array, an Amazon S3 volume,
+// etc.
type Volume interface {
// Get a block. IFF the returned error is nil, the caller must
// put the returned slice back into the buffer pool when it's
@@ -228,6 +227,7 @@ type RRVolumeManager struct {
counter uint32
}
+// MakeRRVolumeManager initializes RRVolumeManager
func MakeRRVolumeManager(volumes []Volume) *RRVolumeManager {
vm := &RRVolumeManager{}
for _, v := range volumes {
@@ -239,14 +239,17 @@ func MakeRRVolumeManager(volumes []Volume) *RRVolumeManager {
return vm
}
+// AllReadable returns an array of all readable volumes
func (vm *RRVolumeManager) AllReadable() []Volume {
return vm.readables
}
+// AllWritable returns an array of all writable volumes
func (vm *RRVolumeManager) AllWritable() []Volume {
return vm.writables
}
+// NextWritable returns the next writable
func (vm *RRVolumeManager) NextWritable() Volume {
if len(vm.writables) == 0 {
return nil
@@ -255,10 +258,11 @@ func (vm *RRVolumeManager) NextWritable() Volume {
return vm.writables[i%uint32(len(vm.writables))]
}
+// Close the RRVolumeManager
func (vm *RRVolumeManager) Close() {
}
-// VolumeStatus
+// VolumeStatus provides status information of the volume consisting of:
// * mount_point
// * device_num (an integer identifying the underlying storage system)
// * bytes_free
diff --git a/services/keepstore/volume_generic_test.go b/services/keepstore/volume_generic_test.go
index 9e2e6c6..3c4b051 100644
--- a/services/keepstore/volume_generic_test.go
+++ b/services/keepstore/volume_generic_test.go
@@ -299,18 +299,18 @@ func testIndexTo(t *testing.T, factory TestableVolumeFactory) {
buf := new(bytes.Buffer)
v.IndexTo("", buf)
- index_rows := strings.Split(string(buf.Bytes()), "\n")
- sort.Strings(index_rows)
- sorted_index := strings.Join(index_rows, "\n")
+ indexRows := strings.Split(string(buf.Bytes()), "\n")
+ sort.Strings(indexRows)
+ sortedIndex := strings.Join(indexRows, "\n")
m, err := regexp.MatchString(
`^\n`+TEST_HASH+`\+\d+ \d+\n`+
TEST_HASH_3+`\+\d+ \d+\n`+
TEST_HASH_2+`\+\d+ \d+$`,
- sorted_index)
+ sortedIndex)
if err != nil {
t.Error(err)
} else if !m {
- t.Errorf("Got index %q for empty prefix", sorted_index)
+ t.Errorf("Got index %q for empty prefix", sortedIndex)
}
for _, prefix := range []string{"f", "f15", "f15ac"} {
diff --git a/services/keepstore/volume_unix_test.go b/services/keepstore/volume_unix_test.go
index f23a9c9..011471c 100644
--- a/services/keepstore/volume_unix_test.go
+++ b/services/keepstore/volume_unix_test.go
@@ -163,17 +163,17 @@ func TestIsFull(t *testing.T) {
v := NewTestableUnixVolume(t, false, false)
defer v.Teardown()
- full_path := v.root + "/full"
+ fullPath := v.root + "/full"
now := fmt.Sprintf("%d", time.Now().Unix())
- os.Symlink(now, full_path)
+ os.Symlink(now, fullPath)
if !v.IsFull() {
t.Errorf("%s: claims not to be full", v)
}
- os.Remove(full_path)
+ os.Remove(fullPath)
// Test with an expired /full link.
expired := fmt.Sprintf("%d", time.Now().Unix()-3605)
- os.Symlink(expired, full_path)
+ os.Symlink(expired, fullPath)
if v.IsFull() {
t.Errorf("%s: should no longer be full", v)
}
diff --git a/services/keepstore/work_queue.go b/services/keepstore/work_queue.go
index f1878ff..27646ad 100644
--- a/services/keepstore/work_queue.go
+++ b/services/keepstore/work_queue.go
@@ -84,6 +84,7 @@ package main
import "container/list"
+// WorkQueue definition
type WorkQueue struct {
getStatus chan WorkQueueStatus
newlist chan *list.List
@@ -96,6 +97,7 @@ type WorkQueue struct {
DoneItem chan<- struct{}
}
+// WorkQueueStatus reflects the queue status.
type WorkQueueStatus struct {
InProgress int
Queued int
-----------------------------------------------------------------------
hooks/post-receive
--
More information about the arvados-commits
mailing list