Move pkg/storage/erasure to pkg/encoding/erasure - and other cleanups

master
Harshavardhana 10 years ago
parent 80fa38a41f
commit d992bccd9a
  1. 1
      Makefile
  2. 0
      pkg/encoding/erasure/.gitignore
  3. 0
      pkg/encoding/erasure/BUILDDEPS.md
  4. 0
      pkg/encoding/erasure/CONTRIBUTING.md
  5. 0
      pkg/encoding/erasure/LICENSE.INTEL
  6. 0
      pkg/encoding/erasure/LICENSE.MINIO
  7. 0
      pkg/encoding/erasure/README.md
  8. 0
      pkg/encoding/erasure/RELEASE-NOTES.INTEL
  9. 0
      pkg/encoding/erasure/RELEASE-NOTES.MINIO
  10. 7
      pkg/encoding/erasure/cauchy_test.go
  11. 0
      pkg/encoding/erasure/ctypes.go
  12. 0
      pkg/encoding/erasure/doc.go
  13. 0
      pkg/encoding/erasure/docs/isa-l_open_src_2.10.pdf
  14. 0
      pkg/encoding/erasure/ec-base.c
  15. 0
      pkg/encoding/erasure/ec-base.h
  16. 0
      pkg/encoding/erasure/ec-code.h
  17. 0
      pkg/encoding/erasure/ec-common.h
  18. 0
      pkg/encoding/erasure/ec-ctypes.h
  19. 0
      pkg/encoding/erasure/ec-decode.c
  20. 0
      pkg/encoding/erasure/ec-encode.c
  21. 0
      pkg/encoding/erasure/ec-highlevel-func.c
  22. 0
      pkg/encoding/erasure/ec-multibinary.asm
  23. 0
      pkg/encoding/erasure/ec-reg-sizes.asm
  24. 0
      pkg/encoding/erasure/ec-vect-mul.h
  25. 0
      pkg/encoding/erasure/erasure_decode.go
  26. 0
      pkg/encoding/erasure/erasure_encode.go
  27. 0
      pkg/encoding/erasure/erasure_yasm_darwin.go
  28. 0
      pkg/encoding/erasure/erasure_yasm_linux.go
  29. 0
      pkg/encoding/erasure/erasure_yasm_windows.go
  30. 0
      pkg/encoding/erasure/gf-2vect-dot-prod-avx.asm
  31. 0
      pkg/encoding/erasure/gf-2vect-dot-prod-avx2.asm
  32. 0
      pkg/encoding/erasure/gf-2vect-dot-prod-sse.asm
  33. 0
      pkg/encoding/erasure/gf-3vect-dot-prod-avx.asm
  34. 0
      pkg/encoding/erasure/gf-3vect-dot-prod-avx2.asm
  35. 0
      pkg/encoding/erasure/gf-3vect-dot-prod-sse.asm
  36. 0
      pkg/encoding/erasure/gf-4vect-dot-prod-avx.asm
  37. 0
      pkg/encoding/erasure/gf-4vect-dot-prod-avx2.asm
  38. 0
      pkg/encoding/erasure/gf-4vect-dot-prod-sse.asm
  39. 0
      pkg/encoding/erasure/gf-5vect-dot-prod-avx.asm
  40. 0
      pkg/encoding/erasure/gf-5vect-dot-prod-avx2.asm
  41. 0
      pkg/encoding/erasure/gf-5vect-dot-prod-sse.asm
  42. 0
      pkg/encoding/erasure/gf-6vect-dot-prod-avx.asm
  43. 0
      pkg/encoding/erasure/gf-6vect-dot-prod-avx2.asm
  44. 0
      pkg/encoding/erasure/gf-6vect-dot-prod-sse.asm
  45. 0
      pkg/encoding/erasure/gf-vect-dot-prod-avx.asm
  46. 0
      pkg/encoding/erasure/gf-vect-dot-prod-avx2.asm
  47. 0
      pkg/encoding/erasure/gf-vect-dot-prod-sse.asm
  48. 0
      pkg/encoding/erasure/gf-vect-mul-avx.asm
  49. 0
      pkg/encoding/erasure/gf-vect-mul-sse.asm
  50. 0
      pkg/encoding/erasure/stdint.go
  51. 7
      pkg/encoding/erasure/vandermonde_test.go
  52. 2
      pkg/storage/donut/erasure/erasure1/erasure.go
  53. 4
      pkg/storage/donut/fragment/fragment1/fragment.go
  54. 9
      pkg/storage/donut/fragment/fragment1/fragment_test.go
  55. 1
      pkg/storage/donut/fragment/fragment_v1/.gitignore
  56. 5
      pkg/storage/fs/fs_test.go
  57. 5
      pkg/storage/inmemory/inmemory_test.go

@ -16,7 +16,6 @@ getdeps: checkdeps checkgopath
verifier: getdeps verifier: getdeps
@echo "Checking for offending code" @echo "Checking for offending code"
@go run buildscripts/verifier.go ${PWD} @go run buildscripts/verifier.go ${PWD}
@go vet ./...
build-all: verifier build-all: verifier
@echo "Building Libraries" @echo "Building Libraries"

@ -14,13 +14,12 @@
* limitations under the License. * limitations under the License.
*/ */
package erasure_test package erasure
import ( import (
"bytes" "bytes"
"testing" "testing"
"github.com/minio-io/minio/pkg/storage/erasure"
. "gopkg.in/check.v1" . "gopkg.in/check.v1"
) )
@ -31,11 +30,11 @@ var _ = Suite(&MySuite{})
func Test(t *testing.T) { TestingT(t) } func Test(t *testing.T) { TestingT(t) }
func (s *MySuite) TestCauchyDecode(c *C) { 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.") 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) chunks, length := e.Encode(data)
c.Assert(length, Equals, len(data)) c.Assert(length, Equals, len(data))

@ -14,21 +14,20 @@
* limitations under the License. * limitations under the License.
*/ */
package erasure_test package erasure
import ( import (
"bytes" "bytes"
"github.com/minio-io/minio/pkg/storage/erasure"
. "gopkg.in/check.v1" . "gopkg.in/check.v1"
) )
func (s *MySuite) TestVanderMondeDecode(c *C) { 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.") 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) chunks, length := e.Encode(data)
c.Logf("chunks length: %d", len(chunks)) c.Logf("chunks length: %d", len(chunks))
c.Logf("length: %d", length) c.Logf("length: %d", length)

@ -63,7 +63,7 @@ func validateHeader(header DataHeader) error {
return nil 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 { func Write(target io.Writer, key string, part uint8, length uint32, k, m uint8, technique EncoderTechnique, data io.Reader) error {
header := DataHeader{ header := DataHeader{
Key: key, Key: key,

@ -86,8 +86,8 @@ type DonutFrameFooter struct {
// Data buffer // Data buffer
type Data bytes.Buffer type Data bytes.Buffer
// WriteFrame - write donut format to input io.Writer, returns error upon any failure // Write - write donut format to input io.Writer, returns error upon any failure
func WriteFrame(target io.Writer, reader io.Reader, length uint64) error { func Write(target io.Writer, reader io.Reader, length uint64) error {
// write header // write header
header := DonutFrameHeader{ header := DonutFrameHeader{
MagicMINI: MagicMINI, MagicMINI: MagicMINI,

@ -14,7 +14,7 @@
* limitations under the License. * limitations under the License.
*/ */
package fragment_test package fragment
import ( import (
"bytes" "bytes"
@ -22,7 +22,6 @@ import (
"encoding/binary" "encoding/binary"
"testing" "testing"
"github.com/minio-io/minio/pkg/storage/donut/fragment/fragment_v1"
"github.com/minio-io/minio/pkg/utils/checksum/crc32c" "github.com/minio-io/minio/pkg/utils/checksum/crc32c"
. "gopkg.in/check.v1" . "gopkg.in/check.v1"
) )
@ -39,7 +38,7 @@ func (s *MySuite) TestSingleWrite(c *C) {
testData := "Hello, World" testData := "Hello, World"
testLength := uint64(len(testData)) testLength := uint64(len(testData))
err := fragment.WriteFrame(&testBuffer, bytes.NewBufferString(testData), testLength) err := Write(&testBuffer, bytes.NewBufferString(testData), testLength)
c.Assert(err, IsNil) c.Assert(err, IsNil)
testBufferLength := uint64(testBuffer.Len()) testBufferLength := uint64(testBuffer.Len())
@ -112,7 +111,7 @@ func (s *MySuite) TestSingleWrite(c *C) {
func (s *MySuite) TestLengthMismatchInWrite(c *C) { func (s *MySuite) TestLengthMismatchInWrite(c *C) {
var testData bytes.Buffer 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)) c.Assert(err, Not(IsNil))
} }
@ -122,7 +121,7 @@ func benchmarkSize(b *testing.B, size int) {
b.SetBytes(int64(size)) b.SetBytes(int64(size))
target := new(bytes.Buffer) target := new(bytes.Buffer)
for i := 0; i < b.N; i++ { for i := 0; i < b.N; i++ {
fragment.WriteFrame(target, bytes.NewReader(buf[:size]), uint64(size)) Write(target, bytes.NewReader(buf[:size]), uint64(size))
} }
} }

@ -14,7 +14,7 @@
* limitations under the License. * limitations under the License.
*/ */
package fs_test package fs
import ( import (
"io/ioutil" "io/ioutil"
@ -22,7 +22,6 @@ import (
"testing" "testing"
mstorage "github.com/minio-io/minio/pkg/storage" mstorage "github.com/minio-io/minio/pkg/storage"
"github.com/minio-io/minio/pkg/storage/fs"
. "gopkg.in/check.v1" . "gopkg.in/check.v1"
) )
@ -39,7 +38,7 @@ func (s *MySuite) TestAPISuite(c *C) {
path, err := ioutil.TempDir(os.TempDir(), "minio-fs-") path, err := ioutil.TempDir(os.TempDir(), "minio-fs-")
c.Check(err, IsNil) c.Check(err, IsNil)
storageList = append(storageList, path) storageList = append(storageList, path)
_, _, store := fs.Start(path) _, _, store := Start(path)
return store return store
} }
mstorage.APITestSuite(c, create) mstorage.APITestSuite(c, create)

@ -14,13 +14,12 @@
* limitations under the License. * limitations under the License.
*/ */
package inmemory_test package inmemory
import ( import (
"testing" "testing"
mstorage "github.com/minio-io/minio/pkg/storage" mstorage "github.com/minio-io/minio/pkg/storage"
"github.com/minio-io/minio/pkg/storage/inmemory"
. "gopkg.in/check.v1" . "gopkg.in/check.v1"
) )
@ -33,7 +32,7 @@ var _ = Suite(&MySuite{})
func (s *MySuite) TestAPISuite(c *C) { func (s *MySuite) TestAPISuite(c *C) {
create := func() mstorage.Storage { create := func() mstorage.Storage {
_, _, store := inmemory.Start() _, _, store := Start()
return store return store
} }

Loading…
Cancel
Save