Thrift generation for Java
Summary: Java works, benchmark roundtrip at around 3ms, so right in between C++ and PHP
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@664775 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/lib/php/src/protocol/TProtocol.php b/lib/php/src/protocol/TProtocol.php
index 15938df..d703bd7 100644
--- a/lib/php/src/protocol/TProtocol.php
+++ b/lib/php/src/protocol/TProtocol.php
@@ -79,6 +79,8 @@
public abstract function writeSetEnd($out);
+ public abstract function writeBool($out, $bool);
+
public abstract function writeByte($out, $byte);
public abstract function writeI16($out, $i16);
@@ -127,6 +129,8 @@
public abstract function readSetEnd($in);
+ public abstract function readBool($in, &$bool);
+
public abstract function readByte($in, &$byte);
public abstract function readI16($in, &$i16);
@@ -146,6 +150,8 @@
*/
public function skip($in, $type) {
switch ($type) {
+ case TType::BOOL:
+ return $this->readBool($in, $bool);
case TType::BYTE:
return $this->readByte($in, $byte);
case TType::I16;
diff --git a/lib/php/src/protocol/TType.php b/lib/php/src/protocol/TType.php
index 22c1c3d..6ef0935 100644
--- a/lib/php/src/protocol/TType.php
+++ b/lib/php/src/protocol/TType.php
@@ -11,22 +11,22 @@
* Data types that can be sent via Thrift
*/
class TType {
- const STOP = 0;
- const VOID = 1;
- const BOOL = 2;
- const BYTE = 3;
- const I08 = 4;
- const I16 = 6;
- const I32 = 8;
- const I64 = 10;
+ const STOP = 0;
+ const VOID = 1;
+ const BOOL = 2;
+ const BYTE = 3;
+ const I08 = 4;
+ const I16 = 6;
+ const I32 = 8;
+ const I64 = 10;
const STRING = 11;
- const UTF7 = 11;
+ const UTF7 = 11;
const STRUCT = 12;
- const MAP = 13;
- const SET = 14;
- const LST = 15; // N.B. cannot use LIST keyword in PHP!
- const UTF8 = 16;
- const UTF16 = 17;
+ const MAP = 13;
+ const SET = 14;
+ const LST = 15; // N.B. cannot use LIST keyword in PHP!
+ const UTF8 = 16;
+ const UTF16 = 17;
}
/**
@@ -34,7 +34,7 @@
*/
class TMessageType {
const CALL = 1;
- const REPLY = 2;
+ const REPLY = 2;
}
?>