Browse Source

restore flat namespace interfaces

pull/254/head
zhaozhi 10 years ago
parent
commit
d30f93b5ec
  1. 19
      go/filer/cassandra_store/cassandra_store.go
  2. 10
      go/filer/flat_namespace/flat_namespace_filer.go
  3. 9
      go/filer/flat_namespace/flat_namespace_store.go

19
go/filer/cassandra_store/cassandra_store.go

@ -3,8 +3,6 @@ package cassandra_store
import (
"fmt"
"github.com/chrislusf/seaweedfs/go/filer"
"github.com/chrislusf/seaweedfs/go/filer/flat_namespace"
"github.com/chrislusf/seaweedfs/go/glog"
"github.com/gocql/gocql"
@ -87,20 +85,3 @@ func (c *CassandraStore) Close() {
c.session.Close()
}
}
func (c *CassandraStore) FindDirectory(dirPath string) (dirId filer.DirectoryId, err error) {
return 0, flat_namespace.ErrNotImplemented
}
func (c *CassandraStore) ListDirectories(dirPath string) (dirs []filer.DirectoryEntry, err error) {
return nil, flat_namespace.ErrNotImplemented
}
func (c *CassandraStore) ListFiles(dirPath string, lastFileName string, limit int) (files []filer.FileEntry, err error) {
return nil, flat_namespace.ErrNotImplemented
}
func (c *CassandraStore) DeleteDirectory(dirPath string, recursive bool) (err error) {
return flat_namespace.ErrNotImplemented
}
func (c *CassandraStore) Move(fromPath string, toPath string) error {
return flat_namespace.ErrNotImplemented
}

10
go/filer/flat_namespace/flat_namespace_filer.go

@ -29,16 +29,16 @@ func (filer *FlatNamespaceFiler) FindFile(fullFileName string) (fid string, err
return filer.store.Get(fullFileName)
}
func (filer *FlatNamespaceFiler) FindDirectory(dirPath string) (dirId filer.DirectoryId, err error) {
return filer.store.FindDirectory(dirPath)
return 0, ErrNotImplemented
}
func (filer *FlatNamespaceFiler) ListDirectories(dirPath string) (dirs []filer.DirectoryEntry, err error) {
return filer.store.ListDirectories(dirPath)
return nil, ErrNotImplemented
}
func (filer *FlatNamespaceFiler) ListFiles(dirPath string, lastFileName string, limit int) (files []filer.FileEntry, err error) {
return filer.store.ListFiles(dirPath, lastFileName, limit)
return nil, ErrNotImplemented
}
func (filer *FlatNamespaceFiler) DeleteDirectory(dirPath string, recursive bool) (err error) {
return filer.store.DeleteDirectory(dirPath, recursive)
return ErrNotImplemented
}
func (filer *FlatNamespaceFiler) DeleteFile(fullFileName string) (fid string, err error) {
@ -46,5 +46,5 @@ func (filer *FlatNamespaceFiler) DeleteFile(fullFileName string) (fid string, er
}
func (filer *FlatNamespaceFiler) Move(fromPath string, toPath string) error {
return filer.store.Move(fromPath, toPath)
return ErrNotImplemented
}

9
go/filer/flat_namespace/flat_namespace_store.go

@ -1,16 +1,9 @@
package flat_namespace
import "github.com/chrislusf/seaweedfs/go/filer"
import ()
type FlatNamespaceStore interface {
Put(fullFileName string, fid string) (err error)
Get(fullFileName string) (fid string, err error)
Delete(fullFileName string) (fid string, err error)
//redis store support these functions
FindDirectory(dirPath string) (dirId filer.DirectoryId, err error)
ListDirectories(dirPath string) (dirs []filer.DirectoryEntry, err error)
ListFiles(dirPath string, lastFileName string, limit int) (files []filer.FileEntry, err error)
DeleteDirectory(dirPath string, recursive bool) (err error)
Move(fromPath string, toPath string) error
}
Loading…
Cancel
Save