You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@thrift.apache.org by mygityf <gi...@git.apache.org> on 2016/02/14 04:40:13 UTC

[GitHub] thrift pull request: THRIFT-3631 Lua-This is JSON protocol impleme...

GitHub user mygityf opened a pull request:

    https://github.com/apache/thrift/pull/863

    THRIFT-3631 Lua-This is JSON protocol implement for thrift-lua library.

    TJsonProtocol.lua is new source of lua for thrift JSON protocol.
    Test result is expected of test_basic_server.lua, test_basic_client.lua.
    Test cases:
    client            <-------------->            server
    json_protocol_client.lua                 json_server.go (golang thrift server)
    json_client.go (golang thrift client) json_protocol_server.lua
    json_protocol_client.lua                 json_protocol_server.lua
    test_basic_server.lua                    test_basic_client.lua

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/gityf/thrift master

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/thrift/pull/863.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #863
    
----
commit 0d0cf5aa589389d40a2bd71a9e09e790634aff36
Author: unknown <wa...@xz-20141016zrqg.didichuxing.com>
Date:   2016-01-28T11:08:05Z

    To check element of self whether nil or not,avoid the value(false) of BOOL is lost.
    
    eg.
    Before:
      if self.argBool then
        oprot:writeFieldBegin('argBool', TType.BOOL, 13)
        oprot:writeBool(self.argBool)
        oprot:writeFieldEnd()
      end
    
    After:
      if self.argBool ~= nil then
        oprot:writeFieldBegin('argBool', TType.BOOL, 13)
        oprot:writeBool(self.argBool)
        oprot:writeFieldEnd()
      end
    
    Why:
      the value(false) for paramater self.argBool will be lost when condition is 'if self.argBool then' as before.

commit 8e61f5ae5cd82ede21d2fad0c67e9328a57a9bc5
Author: unknown <wa...@xz-20141016zrqg.didichuxing.com>
Date:   2016-01-28T11:29:54Z

    This is compact protocol lua implement for thrift.
    Here are some description for each source code file.
    
    luabpack.c
     To add bits operation function for thrift compact protocol.
     new functions:
     l_i64ToZigza,l_i32ToZigzag,l_zigzagToI32,l_zigzagToI64,l_toVarint32,l_toVarint64,l_packMesgType.
    
    TCompactProtocol.lua
     new source of lua for thrift compact protocol.
    
    compact_protocol_client.lua
     test client source code for thrift compact protocol.
    
    compact_protocol_server.lua
     test server source code for thrift compact protocol.
    
    rpc.thrift
     test thrift IDL file for test case(compact_protocol_client.lua,compact_protocol_server.lua).
    
    pcap offset hex of rpc test service.txt
     This is dump file create by tcpdump for test case.
    
    Test cases:
     client              <-------------->       server
     compact_protocol_client.lua                compact_server.go (golang thrift server)
     compact_client.go (golang thrift client)   compact_protocol_server.lua
     compact_protocol_client.lua                compact_protocol_server.lua
    
    Test console log:
    log for compact_protocol_client.lua:
    1       return 1 by FunCall.
    2       return 2 by FunCall.
    
    log for compact_protocol_server.lua:
    53      54      12      43      11.22   str value
    53      54      12      34      11.22   login
    name    namess
    pass    vpass
    10      val10
    20      val20
    ele1
    ele3
    ele2
    l1.
    l2.

commit df693bf78aaf9fd37eff5d972ed6225cd5e88e38
Author: WangYaofu <vo...@sina.cn>
Date:   2016-02-04T07:29:36Z

    THRIFT-3585 Lua: compact protocol implement of lua for thrift.
    
    To fix bug:
    Examples of problematic valus were negative i8 values (-128 ~ -1), some i32 values (0x40000000, -1 ...), i64 values.

commit 982c519b855a6fcdb1b8b49951cd6f8d39c8c8bb
Author: Wang Yaofu <vo...@sina.cn>
Date:   2016-02-04T07:40:37Z

    THRIFT-3585 Lua: compact protocol implement of lua for thrift. 
    
    #ifdef against Lua version macro added.
    lua_objlen for version macro _LUA51_ for lua5.1.
    lua_rawlen for lua5.2+.

commit 880e559e185d24005893d412f65e0199656e89a2
Author: WangYaofu <vo...@sina.cn>
Date:   2016-02-14T03:26:36Z

    THRIFT-3631 Lua-This is JSON protocol implement for thrift-lua library.
    TJsonProtocol.lua is new source of lua for thrift JSON protocol.

----


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] thrift pull request: THRIFT-3631 Lua-This is JSON protocol impleme...

Posted by mygityf <gi...@git.apache.org>.
Github user mygityf commented on the pull request:

    https://github.com/apache/thrift/pull/863#issuecomment-183872571
  
    pull request is moved to https://github.com/apache/thrift/pull/864 #864


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] thrift pull request: THRIFT-3631 Lua-This is JSON protocol impleme...

Posted by mygityf <gi...@git.apache.org>.
GitHub user mygityf reopened a pull request:

    https://github.com/apache/thrift/pull/863

    THRIFT-3631 Lua-This is JSON protocol implement for thrift-lua library.

    TJsonProtocol.lua is new source of lua for thrift JSON protocol.
    Test result is expected of test_basic_server.lua, test_basic_client.lua.
    Test cases:
    client            <-------------->            server
    json_protocol_client.lua                 json_server.go (golang thrift server)
    json_client.go (golang thrift client) json_protocol_server.lua
    json_protocol_client.lua                 json_protocol_server.lua
    test_basic_server.lua                    test_basic_client.lua

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/gityf/thrift master

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/thrift/pull/863.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #863
    
----
commit 0d0cf5aa589389d40a2bd71a9e09e790634aff36
Author: unknown <wa...@xz-20141016zrqg.didichuxing.com>
Date:   2016-01-28T11:08:05Z

    To check element of self whether nil or not,avoid the value(false) of BOOL is lost.
    
    eg.
    Before:
      if self.argBool then
        oprot:writeFieldBegin('argBool', TType.BOOL, 13)
        oprot:writeBool(self.argBool)
        oprot:writeFieldEnd()
      end
    
    After:
      if self.argBool ~= nil then
        oprot:writeFieldBegin('argBool', TType.BOOL, 13)
        oprot:writeBool(self.argBool)
        oprot:writeFieldEnd()
      end
    
    Why:
      the value(false) for paramater self.argBool will be lost when condition is 'if self.argBool then' as before.

commit 8e61f5ae5cd82ede21d2fad0c67e9328a57a9bc5
Author: unknown <wa...@xz-20141016zrqg.didichuxing.com>
Date:   2016-01-28T11:29:54Z

    This is compact protocol lua implement for thrift.
    Here are some description for each source code file.
    
    luabpack.c
     To add bits operation function for thrift compact protocol.
     new functions:
     l_i64ToZigza,l_i32ToZigzag,l_zigzagToI32,l_zigzagToI64,l_toVarint32,l_toVarint64,l_packMesgType.
    
    TCompactProtocol.lua
     new source of lua for thrift compact protocol.
    
    compact_protocol_client.lua
     test client source code for thrift compact protocol.
    
    compact_protocol_server.lua
     test server source code for thrift compact protocol.
    
    rpc.thrift
     test thrift IDL file for test case(compact_protocol_client.lua,compact_protocol_server.lua).
    
    pcap offset hex of rpc test service.txt
     This is dump file create by tcpdump for test case.
    
    Test cases:
     client              <-------------->       server
     compact_protocol_client.lua                compact_server.go (golang thrift server)
     compact_client.go (golang thrift client)   compact_protocol_server.lua
     compact_protocol_client.lua                compact_protocol_server.lua
    
    Test console log:
    log for compact_protocol_client.lua:
    1       return 1 by FunCall.
    2       return 2 by FunCall.
    
    log for compact_protocol_server.lua:
    53      54      12      43      11.22   str value
    53      54      12      34      11.22   login
    name    namess
    pass    vpass
    10      val10
    20      val20
    ele1
    ele3
    ele2
    l1.
    l2.

commit df693bf78aaf9fd37eff5d972ed6225cd5e88e38
Author: WangYaofu <vo...@sina.cn>
Date:   2016-02-04T07:29:36Z

    THRIFT-3585 Lua: compact protocol implement of lua for thrift.
    
    To fix bug:
    Examples of problematic valus were negative i8 values (-128 ~ -1), some i32 values (0x40000000, -1 ...), i64 values.

commit 982c519b855a6fcdb1b8b49951cd6f8d39c8c8bb
Author: Wang Yaofu <vo...@sina.cn>
Date:   2016-02-04T07:40:37Z

    THRIFT-3585 Lua: compact protocol implement of lua for thrift. 
    
    #ifdef against Lua version macro added.
    lua_objlen for version macro _LUA51_ for lua5.1.
    lua_rawlen for lua5.2+.

commit 880e559e185d24005893d412f65e0199656e89a2
Author: WangYaofu <vo...@sina.cn>
Date:   2016-02-14T03:26:36Z

    THRIFT-3631 Lua-This is JSON protocol implement for thrift-lua library.
    TJsonProtocol.lua is new source of lua for thrift JSON protocol.

----


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] thrift pull request: THRIFT-3631 Lua-This is JSON protocol impleme...

Posted by Jens-G <gi...@git.apache.org>.
Github user Jens-G commented on the pull request:

    https://github.com/apache/thrift/pull/863#issuecomment-183864997
  
    An extra test is not bad. But integrating into the standard ThriftTest suite similar to all other implementations would be awesome to let it become part of "make cross".


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] thrift pull request: THRIFT-3631 Lua-This is JSON protocol impleme...

Posted by mygityf <gi...@git.apache.org>.
Github user mygityf closed the pull request at:

    https://github.com/apache/thrift/pull/863


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] thrift pull request: THRIFT-3631 Lua-This is JSON protocol impleme...

Posted by mygityf <gi...@git.apache.org>.
Github user mygityf closed the pull request at:

    https://github.com/apache/thrift/pull/863


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] thrift pull request: THRIFT-3631 Lua-This is JSON protocol impleme...

Posted by nsuke <gi...@git.apache.org>.
Github user nsuke commented on the pull request:

    https://github.com/apache/thrift/pull/863#issuecomment-183870958
  
    @Jens-G yeah, that's what is happening here.
    Lua is recently added to make cross, although in a very limited client only state.
    So json protocol client cross tests can be enabled by adding 3 lines of code.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] thrift pull request: THRIFT-3631 Lua-This is JSON protocol impleme...

Posted by nsuke <gi...@git.apache.org>.
Github user nsuke commented on the pull request:

    https://github.com/apache/thrift/pull/863#issuecomment-183864730
  
    @mygityf thanks for another contribution !
    But it really needs cleanup.
    Does it make sense to you if I say "rebase to the current master and keep only the THRIFT-3631  commit" ?
    If you have really no idea, just paste the output of `git remote -v` and I'll tell you exactly what commands to run.
    
    After that, could you do the same as ebd71cedc3f7c641c76abc2ec13119465c5b02a6 to enable TJSONProtocol test ?
        



---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---