You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@thrift.apache.org by 罗辉 <lu...@celloud.cn> on 2015/08/18 10:33:17 UTC

thrift exception:Thrift::TException=HASH(0x1c33560)

I used thrift to operate Tachyon via perl in my code below.here are my operation steps.
1.install, build,tachyon0.6.4
2.install,make,make install thrift0.9.2
3.  ./bin/tachyon thriftGen
4.cd $THRIFT_HOME, thrift -gen perl {$TACHYON_HOME}/core/src/thrift/tachyon.thrift
5.write below code test.pl and run "perl test.pl", and got an exception
my code :
#!/bin/env perl
#use strict;
#use warnings;
#use lib ¨./perl-src¨;
#use lib ¨./perl-src/packages¨;
 
#push (@INC,"/usr/lib/thrift/gen-perl");
BEGIN{push(@INC,"/usr/lib/thrift/gen-perl")};
use Data::Dumper;
use Thrift;
use Thrift::BinaryProtocol;
use Thrift::Socket;
use Thrift::BufferedTransport;
use MasterService;
use WorkerService;
 
my $host="192.168.100.7";
my $port="19998";
my $socket    = new Thrift::Socket($host,$port);
my $transport = new Thrift::BufferedTransport($socket,1024,1024);
my $protocol  = new Thrift::BinaryProtocol($transport);
my $client    = new MasterServiceClient($protocol);
my $newFilePath = "/newfile";
my $newFileUfsPath = "/";
my $blockSizeByte = "1024";
my $recursive = "false";
eval { $transport->open () };
my $file = $client->user_createFile("/newfile","/",1024,false);

my exception:
[root@master thrift]# perl test.pl
Thrift::TException=HASH(0x1c33560)













Best wishes.


San.Luo
Celloud

Mailbox:luohui@celloud.cn
Website:www.celloud.org
Address:2109,Building 4,Zhubang 2000, Chao Yang Road,Chao Yang District,Beijing,China
 ZipCode:100020












Re:thrift exception:Thrift::TException=HASH(0x1c33560)

Posted by 罗辉 <lu...@celloud.cn>.
After execute "thrift -gen perl {$TACHYON_HOME}/core/src/thrift/tachyon.thrift" ,there will generate 2 perl pm module "MasterService.pm" and "ClientService.pm". As I understand these 2 module could be help to start master and client.
And attach these 2 module ,hope could be help.
 







Best wishes.


San.Luo




在2015年08月18 16时33分,"罗辉"<lu...@celloud.cn>写道:

I used thrift to operate Tachyon via perl in my code below.here are my operation steps.
1.install, build,tachyon0.6.4
2.install,make,make install thrift0.9.2
3.  ./bin/tachyon thriftGen
4.cd $THRIFT_HOME, thrift -gen perl {$TACHYON_HOME}/core/src/thrift/tachyon.thrift
5.write below code test.pl and run "perl test.pl", and got an exception
my code :
#!/bin/env perl
#use strict;
#use warnings;
#use lib ¨./perl-src¨;
#use lib ¨./perl-src/packages¨;
 
#push (@INC,"/usr/lib/thrift/gen-perl");
BEGIN{push(@INC,"/usr/lib/thrift/gen-perl")};
use Data::Dumper;
use Thrift;
use Thrift::BinaryProtocol;
use Thrift::Socket;
use Thrift::BufferedTransport;
use MasterService;
use WorkerService;
 
my $host="192.168.100.7";
my $port="19998";
my $socket    = new Thrift::Socket($host,$port);
my $transport = new Thrift::BufferedTransport($socket,1024,1024);
my $protocol  = new Thrift::BinaryProtocol($transport);
my $client    = new MasterServiceClient($protocol);
my $newFilePath = "/newfile";
my $newFileUfsPath = "/";
my $blockSizeByte = "1024";
my $recursive = "false";
eval { $transport->open () };
my $file = $client->user_createFile("/newfile","/",1024,false);

my exception:
[root@master thrift]# perl test.pl
Thrift::TException=HASH(0x1c33560)













Best wishes.


San.Luo
Celloud

Mailbox:luohui@celloud.cn
Website:www.celloud.org
Address:2109,Building 4,Zhubang 2000, Chao Yang Road,Chao Yang District,Beijing,China
 ZipCode:100020