about summary refs log tree commit homepage
path: root/lib/mogilefs/mogilefs.rb
diff options
context:
space:
mode:
authorEric Wong <normalperson@yhbt.net>2008-12-22 20:44:45 -0800
committerEric Wong <normalperson@yhbt.net>2008-12-23 15:17:21 -0800
commitdd2089b2646e77fef396e2e62ad313851bfbf04e (patch)
treea1f912fff793e0ce1d67001b880dc19746bd064b /lib/mogilefs/mogilefs.rb
parent8e44957300037c8bfd029fb21b665ceb98e7817a (diff)
downloadmogilefs-client-dd2089b2646e77fef396e2e62ad313851bfbf04e.tar.gz
MogileFS 2.x upstream no longer supports it, and it's
become a maintenance burden and NFS is a horrible thing
anyways.

Attempting to use this with servers that support NFS will result
in MogileFS::UnsupportedPathError being raised.
Diffstat (limited to 'lib/mogilefs/mogilefs.rb')
-rw-r--r--lib/mogilefs/mogilefs.rb16
1 files changed, 4 insertions, 12 deletions
diff --git a/lib/mogilefs/mogilefs.rb b/lib/mogilefs/mogilefs.rb
index b7e2325..a1fc263 100644
--- a/lib/mogilefs/mogilefs.rb
+++ b/lib/mogilefs/mogilefs.rb
@@ -1,5 +1,4 @@
 require 'mogilefs/client'
-require 'mogilefs/nfsfile'
 require 'mogilefs/util'
 
 ##
@@ -11,11 +10,6 @@ class MogileFS::MogileFS < MogileFS::Client
   include MogileFS::Bigfile
 
   ##
-  # The path to the local MogileFS mount point if you are using NFS mode.
-
-  attr_reader :root
-
-  ##
   # The domain of keys for this MogileFS client.
 
   attr_reader :domain
@@ -27,12 +21,10 @@ class MogileFS::MogileFS < MogileFS::Client
 
   ##
   # Creates a new MogileFS::MogileFS instance.  +args+ must include a key
-  # :domain specifying the domain of this client.  A key :root will be used to
-  # specify the root of the NFS file system.
+  # :domain specifying the domain of this client.
 
   def initialize(args = {})
     @domain = args[:domain]
-    @root = args[:root]
 
     @get_file_data_timeout = 5
 
@@ -99,7 +91,6 @@ class MogileFS::MogileFS < MogileFS::Client
     paths = (1..res['paths'].to_i).map { |i| res["path#{i}"] }
     return paths if paths.empty?
     return paths if paths.first =~ /^http:\/\//
-    return paths.map { |path| File.join @root, path }
   end
 
   ##
@@ -134,12 +125,13 @@ class MogileFS::MogileFS < MogileFS::Client
 
     case path
     when nil, '' then
-      raise EmptyPathError
+      raise MogileFS::EmptyPathError
     when /^http:\/\// then
       MogileFS::HTTPFile.open(self, res['fid'], path, devid, klass, key,
                               dests, bytes, &block)
     else
-      MogileFS::NFSFile.open(self, res['fid'], path, devid, klass, key, &block)
+      raise MogileFS::UnsupportedPathError,
+            "path '#{path}' returned by backend is not supported"
     end
   end