Esempio n. 1
0
function test()
{
    $p = new DummyProtocol();
    $v1 = new TestStruct();
    $v1->aString = str_repeat('x', 1000000);
    thrift_protocol_write_binary($p, 'foomethod', 1, $v1, 20, true);
    $p->getTransport()->buff = str_replace(pack('N', 1000000), pack('N', (1 << 32) - 2), $p->getTransport()->buff);
    thrift_protocol_read_binary($p, 'TestStruct', true);
}
Esempio n. 2
0
 public static function serialize($object)
 {
     $transport = new TMemoryBuffer();
     $protocol = new TBinaryProtocolAccelerated($transport);
     if (function_exists('thrift_protocol_write_binary')) {
         thrift_protocol_write_binary($protocol, $object->getName(), TMessageType::REPLY, $object, 0, $protocol->isStrictWrite());
         $protocol->readMessageBegin($unused_name, $unused_type, $unused_seqid);
     } else {
         $object->write($protocol);
     }
     return $transport->getBuffer();
 }
 public function send_close()
 {
     $args = new \ICANS\Component\IcansLoggingComponent\Flume\ThriftFlumeEventServer_close_args();
     $bin_accel = $this->output_ instanceof TProtocol::$TBINARYPROTOCOLACCELERATED && function_exists('thrift_protocol_write_binary');
     if ($bin_accel) {
         thrift_protocol_write_binary($this->output_, 'close', TMessageType::CALL, $args, $this->seqid_, $this->output_->isStrictWrite());
     } else {
         $this->output_->writeMessageBegin('close', TMessageType::CALL, $this->seqid_);
         $args->write($this->output_);
         $this->output_->writeMessageEnd();
         $this->output_->getTransport()->flush();
     }
 }
Esempio n. 4
0
 public static function serialize($object, $disable_hphp_extension = false)
 {
     $transport = new TMemoryBuffer();
     $protocol = new TBinaryProtocolAccelerated($transport);
     if (\hacklib_cast_as_boolean(function_exists('thrift_protocol_write_binary')) && !\hacklib_cast_as_boolean($disable_hphp_extension)) {
         thrift_protocol_write_binary($protocol, $object->getName(), TMessageType::REPLY, $object, 0, $protocol->isStrictWrite());
         $unused_name = $unused_type = $unused_seqid = null;
         $protocol->readMessageBegin($unused_name, $unused_type, $unused_seqid);
     } else {
         $object->write($protocol);
     }
     return $transport->getBuffer();
 }
 public function send_gen_id()
 {
     $args = new generator_service_gen_id_args();
     $bin_accel = $this->output_ instanceof Thrift\Protocol\TProtocol::$TBINARYPROTOCOLACCELERATED && function_exists('thrift_protocol_write_binary');
     if ($bin_accel) {
         thrift_protocol_write_binary($this->output_, 'gen_id', Thrift\Type\TMessageType::CALL, $args, $this->seqid_, $this->output_->isStrictWrite());
     } else {
         $this->output_->writeMessageBegin('gen_id', Thrift\Type\TMessageType::CALL, $this->seqid_);
         $args->write($this->output_);
         $this->output_->writeMessageEnd();
         $this->output_->getTransport()->flush();
     }
 }
Esempio n. 6
0
 public function send_GetPeerStatus()
 {
     $args = new ambition_ISearchService_GetPeerStatus_args();
     $bin_accel = $this->output_ instanceof TProtocol::$TBINARYPROTOCOLACCELERATED && function_exists('thrift_protocol_write_binary');
     if ($bin_accel) {
         thrift_protocol_write_binary($this->output_, 'GetPeerStatus', TMessageType::CALL, $args, $this->seqid_, $this->output_->isStrictWrite());
     } else {
         $this->output_->writeMessageBegin('GetPeerStatus', TMessageType::CALL, $this->seqid_);
         $args->write($this->output_);
         $this->output_->writeMessageEnd();
         $this->output_->getTransport()->flush();
     }
 }
Esempio n. 7
0
 public function send_getApiVersion()
 {
     $args = new \RedRoma\Aroma\MessageService\MessageService_getApiVersion_args();
     $bin_accel = $this->output_ instanceof TBinaryProtocolAccelerated && function_exists('thrift_protocol_write_binary');
     if ($bin_accel) {
         thrift_protocol_write_binary($this->output_, 'getApiVersion', TMessageType::CALL, $args, $this->seqid_, $this->output_->isStrictWrite());
     } else {
         $this->output_->writeMessageBegin('getApiVersion', TMessageType::CALL, $this->seqid_);
         $args->write($this->output_);
         $this->output_->writeMessageEnd();
         $this->output_->getTransport()->flush();
     }
 }
Esempio n. 8
0
 public function send_getToken($userID)
 {
     $args = new vng_zingme_payment_thrift_TToken_getToken_args();
     $args->userID = $userID;
     $bin_accel = $this->output_ instanceof TProtocol::$TBINARYPROTOCOLACCELERATED && function_exists('thrift_protocol_write_binary');
     if ($bin_accel) {
         thrift_protocol_write_binary($this->output_, 'getToken', TMessageType::CALL, $args, $this->seqid_, $this->output_->isStrictWrite());
     } else {
         $this->output_->writeMessageBegin('getToken', TMessageType::CALL, $this->seqid_);
         $args->write($this->output_);
         $this->output_->writeMessageEnd();
         $this->output_->getTransport()->flush();
     }
 }
Esempio n. 9
0
 public function send_getdata($arg)
 {
     $args = new TestT_getdata_args();
     $args->arg = $arg;
     $bin_accel = $this->output_ instanceof TProtocol::$TBINARYPROTOCOLACCELERATED && function_exists('thrift_protocol_write_binary');
     if ($bin_accel) {
         thrift_protocol_write_binary($this->output_, 'getdata', TMessageType::CALL, $args, $this->seqid_, $this->output_->isStrictWrite());
     } else {
         $this->output_->writeMessageBegin('getdata', TMessageType::CALL, $this->seqid_);
         $args->write($this->output_);
         $this->output_->writeMessageEnd();
         $this->output_->getTransport()->flush();
     }
 }
Esempio n. 10
0
 public function send_batchHttpReq($request)
 {
     $args = new BatchRpcService_batchHttpReq_args();
     $args->request = $request;
     $bin_accel = $this->output_ instanceof TProtocol::$TBINARYPROTOCOLACCELERATED && function_exists('thrift_protocol_write_binary');
     if ($bin_accel) {
         thrift_protocol_write_binary($this->output_, 'batchHttpReq', TMessageType::CALL, $args, $this->seqid_, $this->output_->isStrictWrite());
     } else {
         $this->output_->writeMessageBegin('batchHttpReq', TMessageType::CALL, $this->seqid_);
         $args->write($this->output_);
         $this->output_->writeMessageEnd();
         $this->output_->getTransport()->flush();
     }
 }
Esempio n. 11
0
 public function send_Search(\SearchThrift\SearchRequest $Request)
 {
     $args = new \SearchThrift\SearchService_Search_args();
     $args->Request = $Request;
     $bin_accel = $this->output_ instanceof TBinaryProtocolAccelerated && function_exists('thrift_protocol_write_binary');
     if ($bin_accel) {
         thrift_protocol_write_binary($this->output_, 'Search', TMessageType::CALL, $args, $this->seqid_, $this->output_->isStrictWrite());
     } else {
         $this->output_->writeMessageBegin('Search', TMessageType::CALL, $this->seqid_);
         $args->write($this->output_);
         $this->output_->writeMessageEnd();
         $this->output_->getTransport()->flush();
     }
 }
 public function send_UpdateState(\TUpdateStateRequest $request)
 {
     $args = new \StateStoreSubscriberService_UpdateState_args();
     $args->request = $request;
     $bin_accel = $this->output_ instanceof TProtocol::$TBINARYPROTOCOLACCELERATED && function_exists('thrift_protocol_write_binary');
     if ($bin_accel) {
         thrift_protocol_write_binary($this->output_, 'UpdateState', TMessageType::CALL, $args, $this->seqid_, $this->output_->isStrictWrite());
     } else {
         $this->output_->writeMessageBegin('UpdateState', TMessageType::CALL, $this->seqid_);
         $args->write($this->output_);
         $this->output_->writeMessageEnd();
         $this->output_->getTransport()->flush();
     }
 }
Esempio n. 13
0
 public function send_Send(\Impala\Test\ThriftDataParams $params)
 {
     $args = new \Impala\Test\NetworkTestService_Send_args();
     $args->params = $params;
     $bin_accel = $this->output_ instanceof TBinaryProtocolAccelerated && function_exists('thrift_protocol_write_binary');
     if ($bin_accel) {
         thrift_protocol_write_binary($this->output_, 'Send', TMessageType::CALL, $args, $this->seqid_, $this->output_->isStrictWrite());
     } else {
         $this->output_->writeMessageBegin('Send', TMessageType::CALL, $this->seqid_);
         $args->write($this->output_);
         $this->output_->writeMessageEnd();
         $this->output_->getTransport()->flush();
     }
 }
 public function send_UpdateState(\Impala\TUpdateStateRequest $params)
 {
     $args = new \Impala\StateStoreSubscriber_UpdateState_args();
     $args->params = $params;
     $bin_accel = $this->output_ instanceof TBinaryProtocolAccelerated && function_exists('thrift_protocol_write_binary');
     if ($bin_accel) {
         thrift_protocol_write_binary($this->output_, 'UpdateState', TMessageType::CALL, $args, $this->seqid_, $this->output_->isStrictWrite());
     } else {
         $this->output_->writeMessageBegin('UpdateState', TMessageType::CALL, $this->seqid_);
         $args->write($this->output_);
         $this->output_->writeMessageEnd();
         $this->output_->getTransport()->flush();
     }
 }
 public function send_retrieve($uid)
 {
     $args = new example_UserStorage_retrieve_args();
     $args->uid = $uid;
     $bin_accel = $this->output_ instanceof TProtocol::$TBINARYPROTOCOLACCELERATED && function_exists('thrift_protocol_write_binary');
     if ($bin_accel) {
         thrift_protocol_write_binary($this->output_, 'retrieve', TMessageType::CALL, $args, $this->seqid_, $this->output_->isStrictWrite());
     } else {
         $this->output_->writeMessageBegin('retrieve', TMessageType::CALL, $this->seqid_);
         $args->write($this->output_);
         $this->output_->writeMessageEnd();
         $this->output_->getTransport()->flush();
     }
 }
Esempio n. 16
0
 public function send_Log($messages)
 {
     $args = new scribe_Log_args();
     $args->messages = $messages;
     $bin_accel = $this->output_ instanceof TProtocol::$TBINARYPROTOCOLACCELERATED && function_exists('thrift_protocol_write_binary');
     if ($bin_accel) {
         thrift_protocol_write_binary($this->output_, 'Log', TMessageType::CALL, $args, $this->seqid_, $this->output_->isStrictWrite());
     } else {
         $this->output_->writeMessageBegin('Log', TMessageType::CALL, $this->seqid_);
         $args->write($this->output_);
         $this->output_->writeMessageEnd();
         $this->output_->getTransport()->flush();
     }
 }
Esempio n. 17
0
 public function send_Log(array $messages)
 {
     $args = new \scribe\thrift\scribe_Log_args();
     $args->messages = $messages;
     $bin_accel = $this->output_ instanceof TBinaryProtocolAccelerated && function_exists('thrift_protocol_write_binary');
     if ($bin_accel) {
         thrift_protocol_write_binary($this->output_, 'Log', TMessageType::CALL, $args, $this->seqid_, $this->output_->isStrictWrite());
     } else {
         $this->output_->writeMessageBegin('Log', TMessageType::CALL, $this->seqid_);
         $args->write($this->output_);
         $this->output_->writeMessageEnd();
         $this->output_->getTransport()->flush();
     }
 }
Esempio n. 18
0
 public function send_hql_query($command)
 {
     $args = new Hypertable_ThriftGen_HqlService_hql_query_args();
     $args->command = $command;
     $bin_accel = $this->output_ instanceof TProtocol::$TBINARYPROTOCOLACCELERATED && function_exists('thrift_protocol_write_binary');
     if ($bin_accel) {
         thrift_protocol_write_binary($this->output_, 'hql_query', TMessageType::CALL, $args, $this->seqid_, $this->output_->isStrictWrite());
     } else {
         $this->output_->writeMessageBegin('hql_query', TMessageType::CALL, $this->seqid_);
         $args->write($this->output_);
         $this->output_->writeMessageEnd();
         $this->output_->getTransport()->flush();
     }
 }
Esempio n. 19
0
 public function send_healthPoke(\RedRoma\Aroma\Endpoint\HealthPokeRequest $request)
 {
     $args = new \RedRoma\Aroma\Endpoint\ApplicationEndpoint_healthPoke_args();
     $args->request = $request;
     $bin_accel = $this->output_ instanceof TBinaryProtocolAccelerated && function_exists('thrift_protocol_write_binary');
     if ($bin_accel) {
         thrift_protocol_write_binary($this->output_, 'healthPoke', TMessageType::CALL, $args, $this->seqid_, $this->output_->isStrictWrite());
     } else {
         $this->output_->writeMessageBegin('healthPoke', TMessageType::CALL, $this->seqid_);
         $args->write($this->output_);
         $this->output_->writeMessageEnd();
         $this->output_->getTransport()->flush();
     }
 }
 public function send_addMultiLog($logs)
 {
     $args = new logcommentfilter_LogCommentFilterWriteService_addMultiLog_args();
     $args->logs = $logs;
     $bin_accel = $this->output_ instanceof TProtocol::$TBINARYPROTOCOLACCELERATED && function_exists('thrift_protocol_write_binary');
     if ($bin_accel) {
         thrift_protocol_write_binary($this->output_, 'addMultiLog', TMessageType::CALL, $args, $this->seqid_, $this->output_->isStrictWrite());
     } else {
         $this->output_->writeMessageBegin('addMultiLog', TMessageType::CALL, $this->seqid_);
         $args->write($this->output_);
         $this->output_->writeMessageEnd();
         $this->output_->getTransport()->flush();
     }
 }
Esempio n. 21
0
 public function send_execute(\Elasticsearch\RestRequest $request)
 {
     $args = new \Elasticsearch\Rest_execute_args();
     $args->request = $request;
     $bin_accel = $this->output_ instanceof TProtocol::$TBINARYPROTOCOLACCELERATED && function_exists('thrift_protocol_write_binary');
     if ($bin_accel) {
         thrift_protocol_write_binary($this->output_, 'execute', TMessageType::CALL, $args, $this->seqid_, $this->output_->isStrictWrite());
     } else {
         $this->output_->writeMessageBegin('execute', TMessageType::CALL, $this->seqid_);
         $args->write($this->output_);
         $this->output_->writeMessageEnd();
         $this->output_->getTransport()->flush();
     }
 }
Esempio n. 22
0
 public function send_getTrending($input)
 {
     $args = new \Topics\Topics_getTrending_args();
     $args->input = $input;
     $bin_accel = $this->output_ instanceof TBinaryProtocolAccelerated && function_exists('thrift_protocol_write_binary');
     if ($bin_accel) {
         thrift_protocol_write_binary($this->output_, 'getTrending', TMessageType::CALL, $args, $this->seqid_, $this->output_->isStrictWrite());
     } else {
         $this->output_->writeMessageBegin('getTrending', TMessageType::CALL, $this->seqid_);
         $args->write($this->output_);
         $this->output_->writeMessageEnd();
         $this->output_->getTransport()->flush();
     }
 }
Esempio n. 23
0
 public function send_getStudentInfo(\TTG\Request $request)
 {
     $args = new \TTG\TTGService_getStudentInfo_args();
     $args->request = $request;
     $bin_accel = $this->output_ instanceof TBinaryProtocolAccelerated && function_exists('thrift_protocol_write_binary');
     if ($bin_accel) {
         thrift_protocol_write_binary($this->output_, 'getStudentInfo', TMessageType::CALL, $args, $this->seqid_, $this->output_->isStrictWrite());
     } else {
         $this->output_->writeMessageBegin('getStudentInfo', TMessageType::CALL, $this->seqid_);
         $args->write($this->output_);
         $this->output_->writeMessageEnd();
         $this->output_->getTransport()->flush();
     }
 }
Esempio n. 24
0
 public function send_FileTransfer($filename, $content)
 {
     $args = new Exadoop_FileTransfer_args();
     $args->filename = $filename;
     $args->content = $content;
     $bin_accel = $this->output_ instanceof TProtocol::$TBINARYPROTOCOLACCELERATED && function_exists('thrift_protocol_write_binary');
     if ($bin_accel) {
         thrift_protocol_write_binary($this->output_, 'FileTransfer', TMessageType::CALL, $args, $this->seqid_, $this->output_->isStrictWrite());
     } else {
         $this->output_->writeMessageBegin('FileTransfer', TMessageType::CALL, $this->seqid_);
         $args->write($this->output_);
         $this->output_->writeMessageEnd();
         $this->output_->getTransport()->flush();
     }
 }
 public function send_Report(\CroutonThrift\Auth $auth, \CroutonThrift\ReportRequest $request)
 {
     $args = new \CroutonThrift\ReportingService_Report_args();
     $args->auth = $auth;
     $args->request = $request;
     $bin_accel = $this->output_ instanceof TBinaryProtocolAccelerated && function_exists('thrift_protocol_write_binary');
     if ($bin_accel) {
         thrift_protocol_write_binary($this->output_, 'Report', TMessageType::CALL, $args, $this->seqid_, $this->output_->isStrictWrite());
     } else {
         $this->output_->writeMessageBegin('Report', TMessageType::CALL, $this->seqid_);
         $args->write($this->output_);
         $this->output_->writeMessageEnd();
         $this->output_->getTransport()->flush();
     }
 }
Esempio n. 26
0
function test()
{
    $p = new DummyProtocol();
    $v1 = new TestStruct();
    $v1->aBool = false;
    $v1->anInt = -1234;
    $v1->aDouble = -1.2345;
    $v1->anInt64 = -1;
    $v1->anByte = -12;
    $v1->anI16 = -123;
    $v1->aFloat = 1.25;
    $v1->bFloat = 3.141592653589793;
    thrift_protocol_write_binary($p, 'foomethod', 1, $v1, 20, true);
    var_dump(thrift_protocol_read_binary($p, 'TestStruct', true));
}
Esempio n. 27
0
 public function send_order($userId, $listOrder, $param)
 {
     $args = new vng_zingme_payment_thrift_TGameServer_order_args();
     $args->userId = $userId;
     $args->listOrder = $listOrder;
     $args->param = $param;
     $bin_accel = $this->output_ instanceof TProtocol::$TBINARYPROTOCOLACCELERATED && function_exists('thrift_protocol_write_binary');
     if ($bin_accel) {
         thrift_protocol_write_binary($this->output_, 'order', TMessageType::CALL, $args, $this->seqid_, $this->output_->isStrictWrite());
     } else {
         $this->output_->writeMessageBegin('order', TMessageType::CALL, $this->seqid_);
         $args->write($this->output_);
         $this->output_->writeMessageEnd();
         $this->output_->getTransport()->flush();
     }
 }
Esempio n. 28
0
 public function send_adjustUser($userID, $adjustMoney, $adminSig, $reason, $clientIP, $time)
 {
     $args = new vng_zingme_payment_thrift_TAdminServer_adjustUser_args();
     $args->userID = $userID;
     $args->adjustMoney = $adjustMoney;
     $args->adminSig = $adminSig;
     $args->reason = $reason;
     $args->clientIP = $clientIP;
     $args->time = $time;
     $bin_accel = $this->output_ instanceof TProtocol::$TBINARYPROTOCOLACCELERATED && function_exists('thrift_protocol_write_binary');
     if ($bin_accel) {
         thrift_protocol_write_binary($this->output_, 'adjustUser', TMessageType::CALL, $args, $this->seqid_, $this->output_->isStrictWrite());
     } else {
         $this->output_->writeMessageBegin('adjustUser', TMessageType::CALL, $this->seqid_);
         $args->write($this->output_);
         $this->output_->writeMessageEnd();
         $this->output_->getTransport()->flush();
     }
 }
 protected function process_reverseVAC($seqid, $input, $output)
 {
     $args = new \proto\CloudHardDiskService_reverseVAC_args();
     $args->read($input);
     $input->readMessageEnd();
     $result = new \proto\CloudHardDiskService_reverseVAC_result();
     $result->success = $this->handler_->reverseVAC($args->token, $args->ptype);
     $bin_accel = $output instanceof TBinaryProtocolAccelerated && function_exists('thrift_protocol_write_binary');
     if ($bin_accel) {
         thrift_protocol_write_binary($output, 'reverseVAC', TMessageType::REPLY, $result, $seqid, $output->isStrictWrite());
     } else {
         $output->writeMessageBegin('reverseVAC', TMessageType::REPLY, $seqid);
         $result->write($output);
         $output->writeMessageEnd();
         $output->getTransport()->flush();
     }
 }
Esempio n. 30
0
 public function send_SetDevMod($devId, $mobile, $mod)
 {
     $args = new \thriftrpc\ThriftRpc_SetDevMod_args();
     $args->devId = $devId;
     $args->mobile = $mobile;
     $args->mod = $mod;
     $bin_accel = $this->output_ instanceof TBinaryProtocolAccelerated && function_exists('thrift_protocol_write_binary');
     if ($bin_accel) {
         thrift_protocol_write_binary($this->output_, 'SetDevMod', TMessageType::CALL, $args, $this->seqid_, $this->output_->isStrictWrite());
     } else {
         $this->output_->writeMessageBegin('SetDevMod', TMessageType::CALL, $this->seqid_);
         $args->write($this->output_);
         $this->output_->writeMessageEnd();
         $this->output_->getTransport()->flush();
     }
 }