NAME

Hadoop::IO::RCFile::Reader::FileStreamReader

VERSION

version 0.003

SYNOPSIS

my $reader = Hadoop::IO::RCFile::Reader::FileStreamReader->new({
                        file => "/user/hive/warehouse/db_name.db/table_name/000000_0",
                        webhdfs_client => $webhdfs_client
                    });
my ($len_read, $content) = $reader->read($len) if $reader->has_more();

DESCRIPTION

This module creates an abstract interface to access the raw file in hdfs.

NAME

Hadoop::IO::RCFile::Reader::FileStreamReader - Read the HDFS file through the WebHDFS API

METHODS

new

The constructor. Accepts parameters in key => value format.

file

webhdfs_client

read

Try to read next $len byte from the file, accept $len as parameter. Return 2 paramter, first one is number of bytes able to read from the file, second is the content as string.Return (-1,undef) if end of file reached already.

read_byte

has_more

Return true if more bytes can be read, else return false.

AUTHORS

  • Philippe Bruhat

  • Sabbir Ahmed

  • Somesh Malviya

  • Vikentiy Fesunov

COPYRIGHT AND LICENSE

This software is copyright (c) 2023 by Booking.com.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.