FAQ
Dear All,
We want to run a php code on thrift server. The code is

<?php
error_reporting(E_ALL);
ini_set('display_errors', 'on');

$GLOBALS['THRIFT_ROOT'] = '/home/hadoop/cc/thrift'; define('ETCC_THRIFT_ROOT', $GLOBALS['THRIFT_ROOT']);

require_once(ETCC_THRIFT_ROOT.'/Thrift.php' ); require_once(ETCC_THRIFT_ROOT.'/transport/TSocket.php' ); require_once(ETCC_THRIFT_ROOT.'/transport/TBufferedTransport.php' ); require_once(ETCC_THRIFT_ROOT.'/protocol/TBinaryProtocol.php' );

$socket = new TSocket('hadoop-master', 50021); $socket->setSendTimeout(10000); $socket->setRecvTimeout(20000); $transport = new TBufferedTransport($socket); $protocol = new TBinaryProtocol($transport);

require_once(ETCC_THRIFT_ROOT.'/packages/hadoopfs/ThriftHadoopFileSystem.php');
$client = new ThriftHadoopFileSystemClient($protocol);

$transport->open();

try
{
$pathname = new Pathname(array('pathname' => 'foo'));
// $result = $client->listStatus($pathname);
$result = $client->create($pathname);
$client->close($result);
print_r($result);
}
catch(Exception $e)
{
print_r($e);
}

$transport->close();
?>

Wheneaver we runthe code it will return a error

TApplicationException Object ( [message:protected] => Invalid method name: 'create' [string:Exception:private] => [code:protected] => 1 [file:protected] => /usr/lib/hive/lib/php/packages/hadoopfs/ThriftHadoopFileSystem.php [line:protected] => 183 [trace:Exception:private] => Array ( [0] => Array ( [file] => /usr/lib/hive/lib/php/packages/hadoopfs/ThriftHadoopFileSystem.php [line] => 145 [function] => recv_create [class] => hadoopfs_ThriftHadoopFileSystemClient [type] => -> [args] => Array ( ) ) [1] => Array ( [file] => /var/www/html/debajit/threfttest.php [line] => 28 [function] => create [class] => hadoopfs_ThriftHadoopFileSystemClient [type] => -> [args] => Array ( [0] => hadoopfs_Pathname Object ( [pathname] => ) ) ) ) [previous:Exception:private] => )

Can any one help to fix the problem.

Thanks & regards

Arindam Mitra
Bridgetree Consultancy Pvt Ltd.
Kolkata-700156, India.
Mobile No:-8296042823
Email: amitra@bridgetree.com
Contact us: www.bridgetree.com

Search Discussions

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupscm-users @
categorieshadoop
postedJan 21, '13 at 5:51a
activeJan 21, '13 at 5:51a
posts1
users1
websitecloudera.com
irc#hadoop

1 user in discussion

Arindam Mitra: 1 post

People

Translate

site design / logo © 2022 Grokbase