Skip to content

Commit

Permalink
remove disk-based file support from client
Browse files Browse the repository at this point in the history
git-svn-id: http://code.sixapart.com/svn/mogilefs/trunk@413 f67b2e87-0811-0410-a7e0-dd94e48410d6
  • Loading branch information
bradfitz committed Sep 29, 2006
1 parent 89deb0e commit 5d23945
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 127 deletions.
1 change: 0 additions & 1 deletion MANIFEST
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ lib/MogileFS/Client.pm
lib/MogileFS/Admin.pm
lib/MogileFS/Backend.pm
lib/MogileFS/NewHTTPFile.pm
lib/MogileFS/NewDiskFile.pm
META.yml Module meta-data (added by MakeMaker)
t/00use.t
t/10-basics.t
39 changes: 15 additions & 24 deletions lib/MogileFS/Client.pm
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ use fields ('root', # filesystem root. only needed for now-deprecated NFS
use Time::HiRes ();
use MogileFS::Backend;
use MogileFS::NewHTTPFile;
use MogileFS::NewDiskFile;

our $AUTOLOAD;

Expand Down Expand Up @@ -88,7 +87,7 @@ sub set_pref_ip {
if $self->{backend};
}

# returns MogileFS::NewDiskFile object, or undef if no device
# returns MogileFS::NewHTTPFile object, or undef if no device
# available for writing
# ARGS: ( key, class, bytes?, opts? )
# where bytes is optional and the length of the file and opts is also optional
Expand Down Expand Up @@ -125,28 +124,21 @@ sub new_file {
my $main_dest = shift @$dests;
my ($main_devid, $main_path) = ($main_dest->[0], $main_dest->[1]);

# create a MogileFS::NewDiskFile object, based off of IO::File
if ($main_path =~ m!^http://!) {
return IO::WrapTie::wraptie('MogileFS::NewHTTPFile',
mg => $self,
fid => $res->{fid},
path => $main_path,
devid => $main_devid,
backup_dests => $dests,
class => $class,
key => $key,
content_length => $bytes+0,
);
} else {
return MogileFS::NewDiskFile->new(
mg => $self,
fid => $res->{fid},
path => $main_path,
devid => $main_devid,
class => $class,
key => $key
);
# create a MogileFS::NewHTTPFile object, based off of IO::File
unless ($main_path =~ m!^http://!) {
Carp::croak("This version of MogileFS::Client no longer supports non-http storage URLs.\n");
}

return IO::WrapTie::wraptie('MogileFS::NewHTTPFile',
mg => $self,
fid => $res->{fid},
path => $main_path,
devid => $main_devid,
backup_dests => $dests,
class => $class,
key => $key,
content_length => $bytes+0,
);
}

# Wrapper around new_file, print, and close.
Expand Down Expand Up @@ -262,7 +254,6 @@ sub get_file_data {
return undef;
}

# TODO: delete method on MogileFS::NewDiskFile object
# this method returns undef only on a fatal error such as inability to actually
# delete a resource and inability to contact the server. attempting to delete
# something that doesn't exist counts as success, as it doesn't exist.
Expand Down
102 changes: 0 additions & 102 deletions lib/MogileFS/NewDiskFile.pm

This file was deleted.

0 comments on commit 5d23945

Please sign in to comment.