From d992bccd9abcbb1c08e08412a920949abd86cba0 Mon Sep 17 00:00:00 2001 From: Harshavardhana Date: Sat, 7 Mar 2015 00:15:58 -0800 Subject: [PATCH] Move pkg/storage/erasure to pkg/encoding/erasure - and other cleanups --- Makefile | 1 - pkg/{storage => encoding}/erasure/.gitignore | 0 pkg/{storage => encoding}/erasure/BUILDDEPS.md | 0 pkg/{storage => encoding}/erasure/CONTRIBUTING.md | 0 pkg/{storage => encoding}/erasure/LICENSE.INTEL | 0 pkg/{storage => encoding}/erasure/LICENSE.MINIO | 0 pkg/{storage => encoding}/erasure/README.md | 0 pkg/{storage => encoding}/erasure/RELEASE-NOTES.INTEL | 0 pkg/{storage => encoding}/erasure/RELEASE-NOTES.MINIO | 0 pkg/{storage => encoding}/erasure/cauchy_test.go | 7 +++---- pkg/{storage => encoding}/erasure/ctypes.go | 0 pkg/{storage => encoding}/erasure/doc.go | 0 .../erasure/docs/isa-l_open_src_2.10.pdf | 0 pkg/{storage => encoding}/erasure/ec-base.c | 0 pkg/{storage => encoding}/erasure/ec-base.h | 0 pkg/{storage => encoding}/erasure/ec-code.h | 0 pkg/{storage => encoding}/erasure/ec-common.h | 0 pkg/{storage => encoding}/erasure/ec-ctypes.h | 0 pkg/{storage => encoding}/erasure/ec-decode.c | 0 pkg/{storage => encoding}/erasure/ec-encode.c | 0 pkg/{storage => encoding}/erasure/ec-highlevel-func.c | 0 pkg/{storage => encoding}/erasure/ec-multibinary.asm | 0 pkg/{storage => encoding}/erasure/ec-reg-sizes.asm | 0 pkg/{storage => encoding}/erasure/ec-vect-mul.h | 0 pkg/{storage => encoding}/erasure/erasure_decode.go | 0 pkg/{storage => encoding}/erasure/erasure_encode.go | 0 pkg/{storage => encoding}/erasure/erasure_yasm_darwin.go | 0 pkg/{storage => encoding}/erasure/erasure_yasm_linux.go | 0 .../erasure/erasure_yasm_windows.go | 0 .../erasure/gf-2vect-dot-prod-avx.asm | 0 .../erasure/gf-2vect-dot-prod-avx2.asm | 0 .../erasure/gf-2vect-dot-prod-sse.asm | 0 .../erasure/gf-3vect-dot-prod-avx.asm | 0 .../erasure/gf-3vect-dot-prod-avx2.asm | 0 .../erasure/gf-3vect-dot-prod-sse.asm | 0 .../erasure/gf-4vect-dot-prod-avx.asm | 0 .../erasure/gf-4vect-dot-prod-avx2.asm | 0 .../erasure/gf-4vect-dot-prod-sse.asm | 0 .../erasure/gf-5vect-dot-prod-avx.asm | 0 .../erasure/gf-5vect-dot-prod-avx2.asm | 0 .../erasure/gf-5vect-dot-prod-sse.asm | 0 .../erasure/gf-6vect-dot-prod-avx.asm | 0 .../erasure/gf-6vect-dot-prod-avx2.asm | 0 .../erasure/gf-6vect-dot-prod-sse.asm | 0 .../erasure/gf-vect-dot-prod-avx.asm | 0 .../erasure/gf-vect-dot-prod-avx2.asm | 0 .../erasure/gf-vect-dot-prod-sse.asm | 0 pkg/{storage => encoding}/erasure/gf-vect-mul-avx.asm | 0 pkg/{storage => encoding}/erasure/gf-vect-mul-sse.asm | 0 pkg/{storage => encoding}/erasure/stdint.go | 0 pkg/{storage => encoding}/erasure/vandermonde_test.go | 7 +++---- pkg/storage/donut/erasure/erasure1/erasure.go | 2 +- .../fragment/{fragment_v1 => fragment1}/fragment.go | 4 ++-- .../fragment/{fragment_v1 => fragment1}/fragment_test.go | 9 ++++----- pkg/storage/donut/fragment/fragment_v1/.gitignore | 1 - pkg/storage/fs/fs_test.go | 5 ++--- pkg/storage/inmemory/inmemory_test.go | 5 ++--- 57 files changed, 17 insertions(+), 24 deletions(-) rename pkg/{storage => encoding}/erasure/.gitignore (100%) rename pkg/{storage => encoding}/erasure/BUILDDEPS.md (100%) rename pkg/{storage => encoding}/erasure/CONTRIBUTING.md (100%) rename pkg/{storage => encoding}/erasure/LICENSE.INTEL (100%) rename pkg/{storage => encoding}/erasure/LICENSE.MINIO (100%) rename pkg/{storage => encoding}/erasure/README.md (100%) rename pkg/{storage => encoding}/erasure/RELEASE-NOTES.INTEL (100%) rename pkg/{storage => encoding}/erasure/RELEASE-NOTES.MINIO (100%) rename pkg/{storage => encoding}/erasure/cauchy_test.go (91%) rename pkg/{storage => encoding}/erasure/ctypes.go (100%) rename pkg/{storage => encoding}/erasure/doc.go (100%) rename pkg/{storage => encoding}/erasure/docs/isa-l_open_src_2.10.pdf (100%) rename pkg/{storage => encoding}/erasure/ec-base.c (100%) rename pkg/{storage => encoding}/erasure/ec-base.h (100%) rename pkg/{storage => encoding}/erasure/ec-code.h (100%) rename pkg/{storage => encoding}/erasure/ec-common.h (100%) rename pkg/{storage => encoding}/erasure/ec-ctypes.h (100%) rename pkg/{storage => encoding}/erasure/ec-decode.c (100%) rename pkg/{storage => encoding}/erasure/ec-encode.c (100%) rename pkg/{storage => encoding}/erasure/ec-highlevel-func.c (100%) rename pkg/{storage => encoding}/erasure/ec-multibinary.asm (100%) rename pkg/{storage => encoding}/erasure/ec-reg-sizes.asm (100%) rename pkg/{storage => encoding}/erasure/ec-vect-mul.h (100%) rename pkg/{storage => encoding}/erasure/erasure_decode.go (100%) rename pkg/{storage => encoding}/erasure/erasure_encode.go (100%) rename pkg/{storage => encoding}/erasure/erasure_yasm_darwin.go (100%) rename pkg/{storage => encoding}/erasure/erasure_yasm_linux.go (100%) rename pkg/{storage => encoding}/erasure/erasure_yasm_windows.go (100%) rename pkg/{storage => encoding}/erasure/gf-2vect-dot-prod-avx.asm (100%) rename pkg/{storage => encoding}/erasure/gf-2vect-dot-prod-avx2.asm (100%) rename pkg/{storage => encoding}/erasure/gf-2vect-dot-prod-sse.asm (100%) rename pkg/{storage => encoding}/erasure/gf-3vect-dot-prod-avx.asm (100%) rename pkg/{storage => encoding}/erasure/gf-3vect-dot-prod-avx2.asm (100%) rename pkg/{storage => encoding}/erasure/gf-3vect-dot-prod-sse.asm (100%) rename pkg/{storage => encoding}/erasure/gf-4vect-dot-prod-avx.asm (100%) rename pkg/{storage => encoding}/erasure/gf-4vect-dot-prod-avx2.asm (100%) rename pkg/{storage => encoding}/erasure/gf-4vect-dot-prod-sse.asm (100%) rename pkg/{storage => encoding}/erasure/gf-5vect-dot-prod-avx.asm (100%) rename pkg/{storage => encoding}/erasure/gf-5vect-dot-prod-avx2.asm (100%) rename pkg/{storage => encoding}/erasure/gf-5vect-dot-prod-sse.asm (100%) rename pkg/{storage => encoding}/erasure/gf-6vect-dot-prod-avx.asm (100%) rename pkg/{storage => encoding}/erasure/gf-6vect-dot-prod-avx2.asm (100%) rename pkg/{storage => encoding}/erasure/gf-6vect-dot-prod-sse.asm (100%) rename pkg/{storage => encoding}/erasure/gf-vect-dot-prod-avx.asm (100%) rename pkg/{storage => encoding}/erasure/gf-vect-dot-prod-avx2.asm (100%) rename pkg/{storage => encoding}/erasure/gf-vect-dot-prod-sse.asm (100%) rename pkg/{storage => encoding}/erasure/gf-vect-mul-avx.asm (100%) rename pkg/{storage => encoding}/erasure/gf-vect-mul-sse.asm (100%) rename pkg/{storage => encoding}/erasure/stdint.go (100%) rename pkg/{storage => encoding}/erasure/vandermonde_test.go (91%) rename pkg/storage/donut/fragment/{fragment_v1 => fragment1}/fragment.go (96%) rename pkg/storage/donut/fragment/{fragment_v1 => fragment1}/fragment_test.go (91%) delete mode 100644 pkg/storage/donut/fragment/fragment_v1/.gitignore diff --git a/Makefile b/Makefile index 70e076898..071407f57 100644 --- a/Makefile +++ b/Makefile @@ -16,7 +16,6 @@ getdeps: checkdeps checkgopath verifier: getdeps @echo "Checking for offending code" @go run buildscripts/verifier.go ${PWD} - @go vet ./... build-all: verifier @echo "Building Libraries" diff --git a/pkg/storage/erasure/.gitignore b/pkg/encoding/erasure/.gitignore similarity index 100% rename from pkg/storage/erasure/.gitignore rename to pkg/encoding/erasure/.gitignore diff --git a/pkg/storage/erasure/BUILDDEPS.md b/pkg/encoding/erasure/BUILDDEPS.md similarity index 100% rename from pkg/storage/erasure/BUILDDEPS.md rename to pkg/encoding/erasure/BUILDDEPS.md diff --git a/pkg/storage/erasure/CONTRIBUTING.md b/pkg/encoding/erasure/CONTRIBUTING.md similarity index 100% rename from pkg/storage/erasure/CONTRIBUTING.md rename to pkg/encoding/erasure/CONTRIBUTING.md diff --git a/pkg/storage/erasure/LICENSE.INTEL b/pkg/encoding/erasure/LICENSE.INTEL similarity index 100% rename from pkg/storage/erasure/LICENSE.INTEL rename to pkg/encoding/erasure/LICENSE.INTEL diff --git a/pkg/storage/erasure/LICENSE.MINIO b/pkg/encoding/erasure/LICENSE.MINIO similarity index 100% rename from pkg/storage/erasure/LICENSE.MINIO rename to pkg/encoding/erasure/LICENSE.MINIO diff --git a/pkg/storage/erasure/README.md b/pkg/encoding/erasure/README.md similarity index 100% rename from pkg/storage/erasure/README.md rename to pkg/encoding/erasure/README.md diff --git a/pkg/storage/erasure/RELEASE-NOTES.INTEL b/pkg/encoding/erasure/RELEASE-NOTES.INTEL similarity index 100% rename from pkg/storage/erasure/RELEASE-NOTES.INTEL rename to pkg/encoding/erasure/RELEASE-NOTES.INTEL diff --git a/pkg/storage/erasure/RELEASE-NOTES.MINIO b/pkg/encoding/erasure/RELEASE-NOTES.MINIO similarity index 100% rename from pkg/storage/erasure/RELEASE-NOTES.MINIO rename to pkg/encoding/erasure/RELEASE-NOTES.MINIO diff --git a/pkg/storage/erasure/cauchy_test.go b/pkg/encoding/erasure/cauchy_test.go similarity index 91% rename from pkg/storage/erasure/cauchy_test.go rename to pkg/encoding/erasure/cauchy_test.go index 49b4fe4f9..c60cea005 100644 --- a/pkg/storage/erasure/cauchy_test.go +++ b/pkg/encoding/erasure/cauchy_test.go @@ -14,13 +14,12 @@ * limitations under the License. */ -package erasure_test +package erasure import ( "bytes" "testing" - "github.com/minio-io/minio/pkg/storage/erasure" . "gopkg.in/check.v1" ) @@ -31,11 +30,11 @@ var _ = Suite(&MySuite{}) func Test(t *testing.T) { TestingT(t) } func (s *MySuite) TestCauchyDecode(c *C) { - ep, _ := erasure.ParseEncoderParams(10, 5, erasure.Cauchy) + ep, _ := ParseEncoderParams(10, 5, Cauchy) data := []byte("Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.") - e := erasure.NewEncoder(ep) + e := NewEncoder(ep) chunks, length := e.Encode(data) c.Assert(length, Equals, len(data)) diff --git a/pkg/storage/erasure/ctypes.go b/pkg/encoding/erasure/ctypes.go similarity index 100% rename from pkg/storage/erasure/ctypes.go rename to pkg/encoding/erasure/ctypes.go diff --git a/pkg/storage/erasure/doc.go b/pkg/encoding/erasure/doc.go similarity index 100% rename from pkg/storage/erasure/doc.go rename to pkg/encoding/erasure/doc.go diff --git a/pkg/storage/erasure/docs/isa-l_open_src_2.10.pdf b/pkg/encoding/erasure/docs/isa-l_open_src_2.10.pdf similarity index 100% rename from pkg/storage/erasure/docs/isa-l_open_src_2.10.pdf rename to pkg/encoding/erasure/docs/isa-l_open_src_2.10.pdf diff --git a/pkg/storage/erasure/ec-base.c b/pkg/encoding/erasure/ec-base.c similarity index 100% rename from pkg/storage/erasure/ec-base.c rename to pkg/encoding/erasure/ec-base.c diff --git a/pkg/storage/erasure/ec-base.h b/pkg/encoding/erasure/ec-base.h similarity index 100% rename from pkg/storage/erasure/ec-base.h rename to pkg/encoding/erasure/ec-base.h diff --git a/pkg/storage/erasure/ec-code.h b/pkg/encoding/erasure/ec-code.h similarity index 100% rename from pkg/storage/erasure/ec-code.h rename to pkg/encoding/erasure/ec-code.h diff --git a/pkg/storage/erasure/ec-common.h b/pkg/encoding/erasure/ec-common.h similarity index 100% rename from pkg/storage/erasure/ec-common.h rename to pkg/encoding/erasure/ec-common.h diff --git a/pkg/storage/erasure/ec-ctypes.h b/pkg/encoding/erasure/ec-ctypes.h similarity index 100% rename from pkg/storage/erasure/ec-ctypes.h rename to pkg/encoding/erasure/ec-ctypes.h diff --git a/pkg/storage/erasure/ec-decode.c b/pkg/encoding/erasure/ec-decode.c similarity index 100% rename from pkg/storage/erasure/ec-decode.c rename to pkg/encoding/erasure/ec-decode.c diff --git a/pkg/storage/erasure/ec-encode.c b/pkg/encoding/erasure/ec-encode.c similarity index 100% rename from pkg/storage/erasure/ec-encode.c rename to pkg/encoding/erasure/ec-encode.c diff --git a/pkg/storage/erasure/ec-highlevel-func.c b/pkg/encoding/erasure/ec-highlevel-func.c similarity index 100% rename from pkg/storage/erasure/ec-highlevel-func.c rename to pkg/encoding/erasure/ec-highlevel-func.c diff --git a/pkg/storage/erasure/ec-multibinary.asm b/pkg/encoding/erasure/ec-multibinary.asm similarity index 100% rename from pkg/storage/erasure/ec-multibinary.asm rename to pkg/encoding/erasure/ec-multibinary.asm diff --git a/pkg/storage/erasure/ec-reg-sizes.asm b/pkg/encoding/erasure/ec-reg-sizes.asm similarity index 100% rename from pkg/storage/erasure/ec-reg-sizes.asm rename to pkg/encoding/erasure/ec-reg-sizes.asm diff --git a/pkg/storage/erasure/ec-vect-mul.h b/pkg/encoding/erasure/ec-vect-mul.h similarity index 100% rename from pkg/storage/erasure/ec-vect-mul.h rename to pkg/encoding/erasure/ec-vect-mul.h diff --git a/pkg/storage/erasure/erasure_decode.go b/pkg/encoding/erasure/erasure_decode.go similarity index 100% rename from pkg/storage/erasure/erasure_decode.go rename to pkg/encoding/erasure/erasure_decode.go diff --git a/pkg/storage/erasure/erasure_encode.go b/pkg/encoding/erasure/erasure_encode.go similarity index 100% rename from pkg/storage/erasure/erasure_encode.go rename to pkg/encoding/erasure/erasure_encode.go diff --git a/pkg/storage/erasure/erasure_yasm_darwin.go b/pkg/encoding/erasure/erasure_yasm_darwin.go similarity index 100% rename from pkg/storage/erasure/erasure_yasm_darwin.go rename to pkg/encoding/erasure/erasure_yasm_darwin.go diff --git a/pkg/storage/erasure/erasure_yasm_linux.go b/pkg/encoding/erasure/erasure_yasm_linux.go similarity index 100% rename from pkg/storage/erasure/erasure_yasm_linux.go rename to pkg/encoding/erasure/erasure_yasm_linux.go diff --git a/pkg/storage/erasure/erasure_yasm_windows.go b/pkg/encoding/erasure/erasure_yasm_windows.go similarity index 100% rename from pkg/storage/erasure/erasure_yasm_windows.go rename to pkg/encoding/erasure/erasure_yasm_windows.go diff --git a/pkg/storage/erasure/gf-2vect-dot-prod-avx.asm b/pkg/encoding/erasure/gf-2vect-dot-prod-avx.asm similarity index 100% rename from pkg/storage/erasure/gf-2vect-dot-prod-avx.asm rename to pkg/encoding/erasure/gf-2vect-dot-prod-avx.asm diff --git a/pkg/storage/erasure/gf-2vect-dot-prod-avx2.asm b/pkg/encoding/erasure/gf-2vect-dot-prod-avx2.asm similarity index 100% rename from pkg/storage/erasure/gf-2vect-dot-prod-avx2.asm rename to pkg/encoding/erasure/gf-2vect-dot-prod-avx2.asm diff --git a/pkg/storage/erasure/gf-2vect-dot-prod-sse.asm b/pkg/encoding/erasure/gf-2vect-dot-prod-sse.asm similarity index 100% rename from pkg/storage/erasure/gf-2vect-dot-prod-sse.asm rename to pkg/encoding/erasure/gf-2vect-dot-prod-sse.asm diff --git a/pkg/storage/erasure/gf-3vect-dot-prod-avx.asm b/pkg/encoding/erasure/gf-3vect-dot-prod-avx.asm similarity index 100% rename from pkg/storage/erasure/gf-3vect-dot-prod-avx.asm rename to pkg/encoding/erasure/gf-3vect-dot-prod-avx.asm diff --git a/pkg/storage/erasure/gf-3vect-dot-prod-avx2.asm b/pkg/encoding/erasure/gf-3vect-dot-prod-avx2.asm similarity index 100% rename from pkg/storage/erasure/gf-3vect-dot-prod-avx2.asm rename to pkg/encoding/erasure/gf-3vect-dot-prod-avx2.asm diff --git a/pkg/storage/erasure/gf-3vect-dot-prod-sse.asm b/pkg/encoding/erasure/gf-3vect-dot-prod-sse.asm similarity index 100% rename from pkg/storage/erasure/gf-3vect-dot-prod-sse.asm rename to pkg/encoding/erasure/gf-3vect-dot-prod-sse.asm diff --git a/pkg/storage/erasure/gf-4vect-dot-prod-avx.asm b/pkg/encoding/erasure/gf-4vect-dot-prod-avx.asm similarity index 100% rename from pkg/storage/erasure/gf-4vect-dot-prod-avx.asm rename to pkg/encoding/erasure/gf-4vect-dot-prod-avx.asm diff --git a/pkg/storage/erasure/gf-4vect-dot-prod-avx2.asm b/pkg/encoding/erasure/gf-4vect-dot-prod-avx2.asm similarity index 100% rename from pkg/storage/erasure/gf-4vect-dot-prod-avx2.asm rename to pkg/encoding/erasure/gf-4vect-dot-prod-avx2.asm diff --git a/pkg/storage/erasure/gf-4vect-dot-prod-sse.asm b/pkg/encoding/erasure/gf-4vect-dot-prod-sse.asm similarity index 100% rename from pkg/storage/erasure/gf-4vect-dot-prod-sse.asm rename to pkg/encoding/erasure/gf-4vect-dot-prod-sse.asm diff --git a/pkg/storage/erasure/gf-5vect-dot-prod-avx.asm b/pkg/encoding/erasure/gf-5vect-dot-prod-avx.asm similarity index 100% rename from pkg/storage/erasure/gf-5vect-dot-prod-avx.asm rename to pkg/encoding/erasure/gf-5vect-dot-prod-avx.asm diff --git a/pkg/storage/erasure/gf-5vect-dot-prod-avx2.asm b/pkg/encoding/erasure/gf-5vect-dot-prod-avx2.asm similarity index 100% rename from pkg/storage/erasure/gf-5vect-dot-prod-avx2.asm rename to pkg/encoding/erasure/gf-5vect-dot-prod-avx2.asm diff --git a/pkg/storage/erasure/gf-5vect-dot-prod-sse.asm b/pkg/encoding/erasure/gf-5vect-dot-prod-sse.asm similarity index 100% rename from pkg/storage/erasure/gf-5vect-dot-prod-sse.asm rename to pkg/encoding/erasure/gf-5vect-dot-prod-sse.asm diff --git a/pkg/storage/erasure/gf-6vect-dot-prod-avx.asm b/pkg/encoding/erasure/gf-6vect-dot-prod-avx.asm similarity index 100% rename from pkg/storage/erasure/gf-6vect-dot-prod-avx.asm rename to pkg/encoding/erasure/gf-6vect-dot-prod-avx.asm diff --git a/pkg/storage/erasure/gf-6vect-dot-prod-avx2.asm b/pkg/encoding/erasure/gf-6vect-dot-prod-avx2.asm similarity index 100% rename from pkg/storage/erasure/gf-6vect-dot-prod-avx2.asm rename to pkg/encoding/erasure/gf-6vect-dot-prod-avx2.asm diff --git a/pkg/storage/erasure/gf-6vect-dot-prod-sse.asm b/pkg/encoding/erasure/gf-6vect-dot-prod-sse.asm similarity index 100% rename from pkg/storage/erasure/gf-6vect-dot-prod-sse.asm rename to pkg/encoding/erasure/gf-6vect-dot-prod-sse.asm diff --git a/pkg/storage/erasure/gf-vect-dot-prod-avx.asm b/pkg/encoding/erasure/gf-vect-dot-prod-avx.asm similarity index 100% rename from pkg/storage/erasure/gf-vect-dot-prod-avx.asm rename to pkg/encoding/erasure/gf-vect-dot-prod-avx.asm diff --git a/pkg/storage/erasure/gf-vect-dot-prod-avx2.asm b/pkg/encoding/erasure/gf-vect-dot-prod-avx2.asm similarity index 100% rename from pkg/storage/erasure/gf-vect-dot-prod-avx2.asm rename to pkg/encoding/erasure/gf-vect-dot-prod-avx2.asm diff --git a/pkg/storage/erasure/gf-vect-dot-prod-sse.asm b/pkg/encoding/erasure/gf-vect-dot-prod-sse.asm similarity index 100% rename from pkg/storage/erasure/gf-vect-dot-prod-sse.asm rename to pkg/encoding/erasure/gf-vect-dot-prod-sse.asm diff --git a/pkg/storage/erasure/gf-vect-mul-avx.asm b/pkg/encoding/erasure/gf-vect-mul-avx.asm similarity index 100% rename from pkg/storage/erasure/gf-vect-mul-avx.asm rename to pkg/encoding/erasure/gf-vect-mul-avx.asm diff --git a/pkg/storage/erasure/gf-vect-mul-sse.asm b/pkg/encoding/erasure/gf-vect-mul-sse.asm similarity index 100% rename from pkg/storage/erasure/gf-vect-mul-sse.asm rename to pkg/encoding/erasure/gf-vect-mul-sse.asm diff --git a/pkg/storage/erasure/stdint.go b/pkg/encoding/erasure/stdint.go similarity index 100% rename from pkg/storage/erasure/stdint.go rename to pkg/encoding/erasure/stdint.go diff --git a/pkg/storage/erasure/vandermonde_test.go b/pkg/encoding/erasure/vandermonde_test.go similarity index 91% rename from pkg/storage/erasure/vandermonde_test.go rename to pkg/encoding/erasure/vandermonde_test.go index 4a817baff..83ddb15db 100644 --- a/pkg/storage/erasure/vandermonde_test.go +++ b/pkg/encoding/erasure/vandermonde_test.go @@ -14,21 +14,20 @@ * limitations under the License. */ -package erasure_test +package erasure import ( "bytes" - "github.com/minio-io/minio/pkg/storage/erasure" . "gopkg.in/check.v1" ) func (s *MySuite) TestVanderMondeDecode(c *C) { - ep, _ := erasure.ParseEncoderParams(10, 5, erasure.Vandermonde) + ep, _ := ParseEncoderParams(10, 5, Vandermonde) data := []byte("Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.") - e := erasure.NewEncoder(ep) + e := NewEncoder(ep) chunks, length := e.Encode(data) c.Logf("chunks length: %d", len(chunks)) c.Logf("length: %d", length) diff --git a/pkg/storage/donut/erasure/erasure1/erasure.go b/pkg/storage/donut/erasure/erasure1/erasure.go index b4719f94a..5cfe885b2 100644 --- a/pkg/storage/donut/erasure/erasure1/erasure.go +++ b/pkg/storage/donut/erasure/erasure1/erasure.go @@ -63,7 +63,7 @@ func validateHeader(header DataHeader) error { return nil } -// WriteData returns error upon any failure +// Write returns error upon any failure func Write(target io.Writer, key string, part uint8, length uint32, k, m uint8, technique EncoderTechnique, data io.Reader) error { header := DataHeader{ Key: key, diff --git a/pkg/storage/donut/fragment/fragment_v1/fragment.go b/pkg/storage/donut/fragment/fragment1/fragment.go similarity index 96% rename from pkg/storage/donut/fragment/fragment_v1/fragment.go rename to pkg/storage/donut/fragment/fragment1/fragment.go index 9a699486d..8901b2ddb 100644 --- a/pkg/storage/donut/fragment/fragment_v1/fragment.go +++ b/pkg/storage/donut/fragment/fragment1/fragment.go @@ -86,8 +86,8 @@ type DonutFrameFooter struct { // Data buffer type Data bytes.Buffer -// WriteFrame - write donut format to input io.Writer, returns error upon any failure -func WriteFrame(target io.Writer, reader io.Reader, length uint64) error { +// Write - write donut format to input io.Writer, returns error upon any failure +func Write(target io.Writer, reader io.Reader, length uint64) error { // write header header := DonutFrameHeader{ MagicMINI: MagicMINI, diff --git a/pkg/storage/donut/fragment/fragment_v1/fragment_test.go b/pkg/storage/donut/fragment/fragment1/fragment_test.go similarity index 91% rename from pkg/storage/donut/fragment/fragment_v1/fragment_test.go rename to pkg/storage/donut/fragment/fragment1/fragment_test.go index 4edee0729..3470205c3 100644 --- a/pkg/storage/donut/fragment/fragment_v1/fragment_test.go +++ b/pkg/storage/donut/fragment/fragment1/fragment_test.go @@ -14,7 +14,7 @@ * limitations under the License. */ -package fragment_test +package fragment import ( "bytes" @@ -22,7 +22,6 @@ import ( "encoding/binary" "testing" - "github.com/minio-io/minio/pkg/storage/donut/fragment/fragment_v1" "github.com/minio-io/minio/pkg/utils/checksum/crc32c" . "gopkg.in/check.v1" ) @@ -39,7 +38,7 @@ func (s *MySuite) TestSingleWrite(c *C) { testData := "Hello, World" testLength := uint64(len(testData)) - err := fragment.WriteFrame(&testBuffer, bytes.NewBufferString(testData), testLength) + err := Write(&testBuffer, bytes.NewBufferString(testData), testLength) c.Assert(err, IsNil) testBufferLength := uint64(testBuffer.Len()) @@ -112,7 +111,7 @@ func (s *MySuite) TestSingleWrite(c *C) { func (s *MySuite) TestLengthMismatchInWrite(c *C) { var testData bytes.Buffer - err := fragment.WriteFrame(&testData, bytes.NewBufferString("hello, world"), 5) + err := Write(&testData, bytes.NewBufferString("hello, world"), 5) c.Assert(err, Not(IsNil)) } @@ -122,7 +121,7 @@ func benchmarkSize(b *testing.B, size int) { b.SetBytes(int64(size)) target := new(bytes.Buffer) for i := 0; i < b.N; i++ { - fragment.WriteFrame(target, bytes.NewReader(buf[:size]), uint64(size)) + Write(target, bytes.NewReader(buf[:size]), uint64(size)) } } diff --git a/pkg/storage/donut/fragment/fragment_v1/.gitignore b/pkg/storage/donut/fragment/fragment_v1/.gitignore deleted file mode 100644 index 07be1efd3..000000000 --- a/pkg/storage/donut/fragment/fragment_v1/.gitignore +++ /dev/null @@ -1 +0,0 @@ -newfile \ No newline at end of file diff --git a/pkg/storage/fs/fs_test.go b/pkg/storage/fs/fs_test.go index 017b9501f..3f7e6508a 100644 --- a/pkg/storage/fs/fs_test.go +++ b/pkg/storage/fs/fs_test.go @@ -14,7 +14,7 @@ * limitations under the License. */ -package fs_test +package fs import ( "io/ioutil" @@ -22,7 +22,6 @@ import ( "testing" mstorage "github.com/minio-io/minio/pkg/storage" - "github.com/minio-io/minio/pkg/storage/fs" . "gopkg.in/check.v1" ) @@ -39,7 +38,7 @@ func (s *MySuite) TestAPISuite(c *C) { path, err := ioutil.TempDir(os.TempDir(), "minio-fs-") c.Check(err, IsNil) storageList = append(storageList, path) - _, _, store := fs.Start(path) + _, _, store := Start(path) return store } mstorage.APITestSuite(c, create) diff --git a/pkg/storage/inmemory/inmemory_test.go b/pkg/storage/inmemory/inmemory_test.go index 095e1502f..5385f1a28 100644 --- a/pkg/storage/inmemory/inmemory_test.go +++ b/pkg/storage/inmemory/inmemory_test.go @@ -14,13 +14,12 @@ * limitations under the License. */ -package inmemory_test +package inmemory import ( "testing" mstorage "github.com/minio-io/minio/pkg/storage" - "github.com/minio-io/minio/pkg/storage/inmemory" . "gopkg.in/check.v1" ) @@ -33,7 +32,7 @@ var _ = Suite(&MySuite{}) func (s *MySuite) TestAPISuite(c *C) { create := func() mstorage.Storage { - _, _, store := inmemory.Start() + _, _, store := Start() return store }