Apache-Hadoop-WebHDFS

 view release on metacpan or  search on metacpan

lib/Apache/Hadoop/WebHDFS.pm  view on Meta::CPAN

=item *  setpermission() - changes owner and group permissions on a file or directory on HDFS.  Path is required and permissions are optional.  

         $hdfsclient->setpermisssion({ path=>'/path/to/my/hdfs/directory',
                                       permisssion=>'640',
         });


=item *  setreplication() - changes replication count for a file on HDFS.  Path is required, replication is optional.

         $hdfsclient->setreplication({ path=>'/path/to/my/hdfs/directory',
                                       replication=>'10',
         });


=item *  settimes() - changes access and modifcation time for a file or directory on HDFS.   Path is required, both access and modification times are optional.  Remember these times are in java time, so make sure to convert ctime to java time by mult...

         $hdfsclient->setreplication({ path=>'/path/to/my/hdfs/directory',
                                       modificationtime=>$mymodtime,
                                       accesstime=>$myatime,
         });

=back


=head1 REQUIREMENTS

 Carp                   is used for various warnings and errors.
 WWW::Mechanize         is needed as this is a subclass.
 LWP::Debug             is required for debugging GSSAPI connections
 LWP::Authen::Negotiate is the magic sauce for working with secure hadoop clusters 
 parent                 included with Perl 5.10.1 and newer or found on CPAN for older versions of perl
 File::Map              required for reading contents of files into mmap'ed memory space instead of perl's symbol table.

=head1 EXAMPLE

=head2 list a HDFS directory on a secure hadop cluster

  #!/usr/bin/perl
  use strict;
  use warnings;
  use Data::Dumper;
  use Apache::Hadoop::WebHDFS;
  my $username=getlogin();
  my $hdfsclient = Apache::Hadoop::WebHDFS->new( {namenode        =>"mynamenode.example.com",
                                                  namenodeport    =>"50070",
                                                  authmethod      =>"gssapi",
                                                  user            =>$username,
                                                 });
  $hdfsclient->liststatus( {path=>'/user/$username'} );        
  if ($hdfsclient->success()) {
     print "Request SUCCESS: ", $hdfsclient->status() , "\n\n";
     print "Dumping content:\n";
     print Dumper $hdfsclient->content() ;
  } else {
     print "Request FAILED: ", $hdfsclient->status() , "\n";
  } 

	  
=head1 AUTHOR

Adam Faris, C<< <apache-hadoop-webhdfs at mekanix.org> >>

=head1 BUGS

  Please use github to report bugs and feature requests 
  https://github.com/opsmekanix/Apache-Hadoop-WebHDFS/issues

=head1 SUPPORT

You can find documentation for this module with the perldoc command.

    perldoc Apache::Hadoop::WebHDFS


You can also look for information at:

=over 4

=item * AnnoCPAN: Annotated CPAN documentation

L<http://annocpan.org/dist/Apache-Hadoop-WebHDFS>

=item * CPAN Ratings

L<http://cpanratings.perl.org/d/Apache-Hadoop-WebHDFS>

=item * Search CPAN

L<http://search.cpan.org/dist/Apache-Hadoop-WebHDFS/>

=back


=head1 ACKNOWLEDGEMENTS

I would like to acknowledge Andy Lester plus the numerous people who have 
worked on WWW::Mechanize, Anchim Grolms and team for providing 
LWP::Authen::Negotiate, and the contributors to LWP.  Thanks for providing 
awesome modules.

=head1 LICENSE AND COPYRIGHT

Copyright 2013 Adam Faris.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    L<http://www.apache.org/licenses/LICENSE-2.0>

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.


=cut


return 1;



( run in 1.955 second using v1.01-cache-2.11-cpan-98e64b0badf )