[jira] [Commented] (THRIFT-591) Make the C++ runtime library be compatible with Windows and Visual Studio

2011-04-19 Thread Todd Lipcon (JIRA)

[ 
https://issues.apache.org/jira/browse/THRIFT-591?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13021846#comment-13021846
 ] 

Todd Lipcon commented on THRIFT-591:


Hey David. To clarify, you are -1 on changing over the current C++ 
implementation to ASIO, and also won't commit FB resources to 
testing/maintaining an ASIO-based implementation. But, if someone contributes a 
parallel set of C++ code based on ASIO that can work on Windows, as suggested 
by Bruce above, you're cool with that, right?

> Make the C++ runtime library be compatible with Windows and Visual Studio
> -
>
> Key: THRIFT-591
> URL: https://issues.apache.org/jira/browse/THRIFT-591
> Project: Thrift
>  Issue Type: New Feature
>  Components: C++ - Library
> Environment: Windows XP and above, Visual Studio 2005 and above
>Reporter: Rush Manbert
> Attachments: MSVCSupportUpdatedButUntestedForThrift-0.4.0.patch, 
> MsvcPatchSupportScripts.zip, 
> THRIFT-591_MSVCSupportUpdatedButUntestedForThrift-0.4.0.patch_error.log, 
> ThriftMsvcPatchForSvnRev818530.txt.zip, thrift-818530-patched.zip, 
> thriftWindowsRev818530BugFix.zip
>
>
> Modify the C++ runtime library to be compatible with Windows and able to be 
> built by Visual Studio.
> The work has been done and a patch is available. I will attach it soon.
> Note that this issue and the attached patch supercedes the patches that I 
> wrongly attached to JIRA 311. That issue is about making the C++ library 
> support async client/server interaction.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira


[VOTE] Thrift 0.6.1 RC0

2011-04-19 Thread Jake Farrell
All,

I propose that we accept
http://people.apache.org/~jfarrell/thrift/0.6.1/thrift-0.6.1-rc0.tar.gz as the
official Thrift 0.6.1 release. There where a couple small bug fixes against
the  0.6.x branch and this is mainly to get the java library published into 
the apache maven repository.

I generated this tarball by checking out
https://svn.apache.org/repos/asf/thrift/branches/0.6.x and running
"./bootstrap.sh && ./configure && make dist".

The GPG signature can be found at: 
http://people.apache.org/~jfarrell/thrift/0.6.1/thrift-0.6.1-rc0.tar.gz.asc.
It has an MD5 sum of dcd9d2d39aa22b615dd5c5ef2d7b7cfb.

The java library can be found at:
http://people.apache.org/~jfarrell/thrift/0.6.1/lib/java 
or
https://repository.apache.org/content/repositories/orgapachethrift-107
It has an MD5 sum of 21bf7163d03bff22ca0b6598ae3f05e0.

Please download, verify sig/sum, and install/test the libraries of your
choice.

This vote closes in 72 hours.

-Jake

[jira] [Commented] (THRIFT-1108) SSL support for the Ruby library

2011-04-19 Thread Alex (JIRA)

[ 
https://issues.apache.org/jira/browse/THRIFT-1108?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13021834#comment-13021834
 ] 

Alex commented on THRIFT-1108:
--

When I get a chance I will put in that version specific behavior. Regarding the 
test case, I already figured out why the patch fails and have fixed the problem.

> SSL support for the Ruby library 
> -
>
> Key: THRIFT-1108
> URL: https://issues.apache.org/jira/browse/THRIFT-1108
> Project: Thrift
>  Issue Type: Improvement
>  Components: Ruby - Library
>Affects Versions: 0.6
>Reporter: Alex
>Priority: Minor
>  Labels: ssl
> Attachments: ssl_support.diff
>
>
> Attached are modified versions of the socket and server_socket files which 
> include SSL support. I do not consider these implementations complete, 
> however they work well for my purposes.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira


[jira] [Updated] (THRIFT-1109) Deploy fb303 along side libthrift to maven repo

2011-04-19 Thread Jake Farrell (JIRA)

 [ 
https://issues.apache.org/jira/browse/THRIFT-1109?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Jake Farrell updated THRIFT-1109:
-

Fix Version/s: 0.7
   0.6.1

> Deploy fb303 along side libthrift to maven repo
> ---
>
> Key: THRIFT-1109
> URL: https://issues.apache.org/jira/browse/THRIFT-1109
> Project: Thrift
>  Issue Type: Improvement
>  Components: Java - Library
>Reporter: Jake Farrell
>Assignee: Jake Farrell
> Fix For: 0.6.1, 0.7
>
> Attachments: thrift-1109-0.6.x.thrift, thrift-1109-0.6.x.thrift
>
>


--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira


[jira] [Closed] (THRIFT-1109) Deploy fb303 along side libthrift to maven repo

2011-04-19 Thread Jake Farrell (JIRA)

 [ 
https://issues.apache.org/jira/browse/THRIFT-1109?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Jake Farrell closed THRIFT-1109.



> Deploy fb303 along side libthrift to maven repo
> ---
>
> Key: THRIFT-1109
> URL: https://issues.apache.org/jira/browse/THRIFT-1109
> Project: Thrift
>  Issue Type: Improvement
>  Components: Java - Library
>Reporter: Jake Farrell
>Assignee: Jake Farrell
> Fix For: 0.6.1, 0.7
>
> Attachments: thrift-1109-0.6.x.thrift, thrift-1109-0.6.x.thrift
>
>


--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira


[jira] [Closed] (THRIFT-363) Maven Deploy

2011-04-19 Thread Jake Farrell (JIRA)

 [ 
https://issues.apache.org/jira/browse/THRIFT-363?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Jake Farrell closed THRIFT-363.
---


> Maven Deploy
> 
>
> Key: THRIFT-363
> URL: https://issues.apache.org/jira/browse/THRIFT-363
> Project: Thrift
>  Issue Type: Improvement
>  Components: Java - Library
>Reporter: Gary Rudolph
>Assignee: Jake Farrell
> Fix For: 0.6.1, 0.7
>
> Attachments: THRIFT-363.patch, THRIFT-363.patch, THRIFT-363.patch, 
> THRIFT-363.patch, THRIFT-363.patch, THRIFT-363.patch, THRIFT-363.patch, 
> THRIFT-363.patch, pom.1.patch, thrift-363-0.6.x.patch, thrift-363.patch
>
>
> Please, deploy libthrift into a public maven repository. Preferably, to Maven 
> central, but if not at least the Apache.
> Maven Central: 
> http://maven.apache.org/guides/mini/guide-central-repository-upload.html
> Apache Incubator Repository: 
> http://people.apache.org/repo/m2-incubating-repository/
> The following is a sample pom.xml:
> http://maven.apache.org/POM/4.0.0"; 
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; 
> xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 
> http://maven.apache.org/maven-v4_0_0.xsd";>
> 4.0.0
> org.facebook.thrift
> libthrift
> 0.1-20090310
> jar
> Apache Thrift Library
>   http://incubator.apache.org/thrift/
>   Thrift is a software framework for scalable cross-language 
> services development. It combines a software stack with a code generation 
> engine to build services that work efficiently and seamlessly between C++, 
> Java, Python, PHP, Ruby, Erlang, Perl, Haskell, C#, Cocoa, Smalltalk, and 
> OCaml
>   
>   
>   The Apache Software License, Version 2.0
>   
> http://www.apache.org/licenses/LICENSE-2.0.txt
>   repo
>   
>   
>   
>   
> http://svn.apache.org/repos/asf/incubator/thrift/trunk
>   
> 

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira


[jira] [Updated] (THRIFT-363) Maven Deploy

2011-04-19 Thread Jake Farrell (JIRA)

 [ 
https://issues.apache.org/jira/browse/THRIFT-363?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Jake Farrell updated THRIFT-363:


Fix Version/s: (was: 0.6)
   0.6.1

> Maven Deploy
> 
>
> Key: THRIFT-363
> URL: https://issues.apache.org/jira/browse/THRIFT-363
> Project: Thrift
>  Issue Type: Improvement
>  Components: Java - Library
>Reporter: Gary Rudolph
>Assignee: Jake Farrell
> Fix For: 0.6.1, 0.7
>
> Attachments: THRIFT-363.patch, THRIFT-363.patch, THRIFT-363.patch, 
> THRIFT-363.patch, THRIFT-363.patch, THRIFT-363.patch, THRIFT-363.patch, 
> THRIFT-363.patch, pom.1.patch, thrift-363-0.6.x.patch, thrift-363.patch
>
>
> Please, deploy libthrift into a public maven repository. Preferably, to Maven 
> central, but if not at least the Apache.
> Maven Central: 
> http://maven.apache.org/guides/mini/guide-central-repository-upload.html
> Apache Incubator Repository: 
> http://people.apache.org/repo/m2-incubating-repository/
> The following is a sample pom.xml:
> http://maven.apache.org/POM/4.0.0"; 
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; 
> xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 
> http://maven.apache.org/maven-v4_0_0.xsd";>
> 4.0.0
> org.facebook.thrift
> libthrift
> 0.1-20090310
> jar
> Apache Thrift Library
>   http://incubator.apache.org/thrift/
>   Thrift is a software framework for scalable cross-language 
> services development. It combines a software stack with a code generation 
> engine to build services that work efficiently and seamlessly between C++, 
> Java, Python, PHP, Ruby, Erlang, Perl, Haskell, C#, Cocoa, Smalltalk, and 
> OCaml
>   
>   
>   The Apache Software License, Version 2.0
>   
> http://www.apache.org/licenses/LICENSE-2.0.txt
>   repo
>   
>   
>   
>   
> http://svn.apache.org/repos/asf/incubator/thrift/trunk
>   
> 

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira


Build failed in Jenkins: Thrift #132

2011-04-19 Thread Apache Hudson Server
See 

Changes:

[jfarrell] Thrift-1109: Deploy fb303 along side libthrift to maven repo
patch: jfarrell
client: contrib fb303 java
depends on: Thrift-363

Adding the ability to publish the fb303 java library as an artifact alongside 
libthrift to the apache maven repository.

[jfarrell] Thrift-363: Maven Deploy
Patch: jfarrell
Client lib: java

Adding the ability to publish the java client library as artifacts to the 
apache maven repository. 

Usage: ant -Drelease=true publish
Note: You must have a gpg key setup and push it to pgp.mit.edu and
  have a ~/.m2/settings.xml file containing your apache and gpg information.
  Thrift-1114 will help make this file more secure or unnecessary.

  

  
apache.releases.https
@APACHE_USERNAME@
@APACHE_PASSWORD@
  


  
gpg

  @GPG_PASSPHRASE@

  

  

--
[...truncated 1752 lines...]
/testframedtransport/CreateAndDestroy: OK
/testframedtransport/OpenAndClose: OK
/testframedtransport/ReadAndWrite: OK
PASS: testframedtransport
/testmemorybuffer/CreateAndDestroy: OK
/testmemorybuffer/OpenAndClose: OK
/testmemorybuffer/ReadAndWrite: OK
PASS: testmemorybuffer
/teststruct/InitializeObject: OK
PASS: teststruct
/testsimpleserver/SimpleServer: OK
PASS: testsimpleserver
/testdebugproto/DebugProto: OK
PASS: testdebugproto
/testoptionalrequired/OldSchool: OK
/testoptionalrequired/Simple: OK
/testoptionalrequired/Tricky1: OK
/testoptionalrequired/Tricky2: OK
/testoptionalrequired/Tricky3: OK
/testoptionalrequired/Tricky4: OK
PASS: testoptionalrequired
/testthrift/Server: OK
PASS: testthrifttest
PASS: testthrifttestclient
===
All 11 tests passed
===
make[5]: Leaving directory 
`
make[4]: Leaving directory 
`
make[3]: Leaving directory 
`
make[2]: Leaving directory 
`
Making check in csharp
make[2]: Entering directory 
`
make[2]: Nothing to be done for `check'.
make[2]: Leaving directory 
`
Making check in java
make[2]: Entering directory 
`
/usr/bin/ant 
Buildfile: 


setup.init:

mvn.ant.tasks.download:
  [get] Getting: 
http://repo1.maven.org/maven2/org/apache/maven/maven-ant-tasks/2.1.3/maven-ant-tasks-2.1.3.jar
  [get] To: 

  [get] Not modified - so not downloaded

mvn.init:
[artifact:dependencies] [WARNING] Overriding profile: 
'maven-ant-tasks-repo-profile' (source: pom) with new instance from source: pom

init:

compile:

dist:

BUILD SUCCESSFUL
Total time: 12 seconds
make  check-local
make[3]: Entering directory 
`
/usr/bin/ant 
Buildfile: 


setup.init:

mvn.ant.tasks.download:
  [get] Getting: 
http://repo1.maven.org/maven2/org/apache/maven/maven-ant-tasks/2.1.3/maven-ant-tasks-2.1.3.jar
  [get] To: 

  [get] Not modified - so not downloaded

mvn.init:
[artifact:dependencies] [WARNING] Overriding profile: 
'maven-ant-tasks-repo-profile' (source: pom) with new instance from source: pom

init:

compile:

dist:

BUILD SUCCESSFUL
Total time: 7 seconds
/usr/bin/ant  test
Buildfile: 


generate:
 [exec] 
[WARNING::41]
 64-bit constant "100" may not work in all languages.
 [exec] 
 [exec] 
[WARNING::169]
 64-bit constant "1099511627775" may not work in all languages.
 [exec] 
 [exec] 
[WARNING::179]
 64-bit constant "4294967295" may not work in all languages.
 [exec] 
 [exec] 
[WARNING::179]
 64-bit constant "1099511627775" may not work in all languages.
 [exec] 
 [exec] 
[WARNING::179]
 64-bit constant "281474976710655" may not work in al

[jira] [Resolved] (THRIFT-1109) Deploy fb303 along side libthrift to maven repo

2011-04-19 Thread Jake Farrell (JIRA)

 [ 
https://issues.apache.org/jira/browse/THRIFT-1109?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Jake Farrell resolved THRIFT-1109.
--

Resolution: Fixed

r1095218 Added the ability to publish fb303 library along side libthrift to the 
apache maven repo.

> Deploy fb303 along side libthrift to maven repo
> ---
>
> Key: THRIFT-1109
> URL: https://issues.apache.org/jira/browse/THRIFT-1109
> Project: Thrift
>  Issue Type: Improvement
>  Components: Java - Library
>Reporter: Jake Farrell
>Assignee: Jake Farrell
> Attachments: thrift-1109-0.6.x.thrift, thrift-1109-0.6.x.thrift
>
>


--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira


[jira] [Resolved] (THRIFT-363) Maven Deploy

2011-04-19 Thread Jake Farrell (JIRA)

 [ 
https://issues.apache.org/jira/browse/THRIFT-363?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Jake Farrell resolved THRIFT-363.
-

   Resolution: Fixed
Fix Version/s: 0.6

r1095216 Added the ability to publish libthrift to apache maven repo.

> Maven Deploy
> 
>
> Key: THRIFT-363
> URL: https://issues.apache.org/jira/browse/THRIFT-363
> Project: Thrift
>  Issue Type: Improvement
>  Components: Java - Library
>Reporter: Gary Rudolph
>Assignee: Jake Farrell
> Fix For: 0.7, 0.6
>
> Attachments: THRIFT-363.patch, THRIFT-363.patch, THRIFT-363.patch, 
> THRIFT-363.patch, THRIFT-363.patch, THRIFT-363.patch, THRIFT-363.patch, 
> THRIFT-363.patch, pom.1.patch, thrift-363-0.6.x.patch, thrift-363.patch
>
>
> Please, deploy libthrift into a public maven repository. Preferably, to Maven 
> central, but if not at least the Apache.
> Maven Central: 
> http://maven.apache.org/guides/mini/guide-central-repository-upload.html
> Apache Incubator Repository: 
> http://people.apache.org/repo/m2-incubating-repository/
> The following is a sample pom.xml:
> http://maven.apache.org/POM/4.0.0"; 
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; 
> xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 
> http://maven.apache.org/maven-v4_0_0.xsd";>
> 4.0.0
> org.facebook.thrift
> libthrift
> 0.1-20090310
> jar
> Apache Thrift Library
>   http://incubator.apache.org/thrift/
>   Thrift is a software framework for scalable cross-language 
> services development. It combines a software stack with a code generation 
> engine to build services that work efficiently and seamlessly between C++, 
> Java, Python, PHP, Ruby, Erlang, Perl, Haskell, C#, Cocoa, Smalltalk, and 
> OCaml
>   
>   
>   The Apache Software License, Version 2.0
>   
> http://www.apache.org/licenses/LICENSE-2.0.txt
>   repo
>   
>   
>   
>   
> http://svn.apache.org/repos/asf/incubator/thrift/trunk
>   
> 

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira


[jira] [Commented] (THRIFT-812) Demo of Thrift over ZeroMQ

2011-04-19 Thread Hudson (JIRA)

[ 
https://issues.apache.org/jira/browse/THRIFT-812?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13021781#comment-13021781
 ] 

Hudson commented on THRIFT-812:
---

Integrated in Thrift #131 (See 
[https://hudson.apache.org/hudson/job/Thrift/131/])
THRIFT-812 Demo of Thrift over ZeroMQ (C#)
Patch: Nils Huegelmann


> Demo of Thrift over ZeroMQ
> --
>
> Key: THRIFT-812
> URL: https://issues.apache.org/jira/browse/THRIFT-812
> Project: Thrift
>  Issue Type: New Feature
>  Components: C++ - Library, Python - Library
>Reporter: David Reiss
>Priority: Minor
> Fix For: 0.5
>
> Attachments: THRIFT-812-ThriftZmq-csharp.patch, 
> THRIFT-812_with_multicast_example.patch, 
> v1-0001-THRIFT-812.-contrib-Add-a-demo-of-using-Thrift-over-.patch, 
> v2-0001-THRIFT-812.-contrib-Add-a-demo-of-using-Thrift-over-.patch
>
>
> I played around with ZeroMQ a bit this weekend.  I thought it might be 
> informative to write some glue code to run Thrift requests with ZeroMQ as the 
> transport, so here it is.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira


[jira] [Commented] (THRIFT-1108) SSL support for the Ruby library

2011-04-19 Thread Michael Stockton (JIRA)

[ 
https://issues.apache.org/jira/browse/THRIFT-1108?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13021782#comment-13021782
 ] 

Michael Stockton commented on THRIFT-1108:
--

We've tried to keep thrift working with 1.8 and 1.9. I think your patch would 
need to include support for both to be accepted. If you look at the gem I 
referenced, it merely adds nonblocking methods to OpenSSL::SSL::SSLSocket. You 
can use the RUBY_VERSION constant to conditionally require openssl-nonblock.

If you include a test case in your patch which fails, it may be easier for me 
to see the problem you're having. Again, for inclusion, we'd ideal want SSL 
support to work with each transport.



> SSL support for the Ruby library 
> -
>
> Key: THRIFT-1108
> URL: https://issues.apache.org/jira/browse/THRIFT-1108
> Project: Thrift
>  Issue Type: Improvement
>  Components: Ruby - Library
>Affects Versions: 0.6
>Reporter: Alex
>Priority: Minor
>  Labels: ssl
> Attachments: ssl_support.diff
>
>
> Attached are modified versions of the socket and server_socket files which 
> include SSL support. I do not consider these implementations complete, 
> however they work well for my purposes.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira


[jira] [Commented] (THRIFT-812) Demo of Thrift over ZeroMQ

2011-04-19 Thread Roger Meier (JIRA)

[ 
https://issues.apache.org/jira/browse/THRIFT-812?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13021747#comment-13021747
 ] 

Roger Meier commented on THRIFT-812:


thanks nils!

just committed a slightly modified version of Zeromq for C#

> Demo of Thrift over ZeroMQ
> --
>
> Key: THRIFT-812
> URL: https://issues.apache.org/jira/browse/THRIFT-812
> Project: Thrift
>  Issue Type: New Feature
>  Components: C++ - Library, Python - Library
>Reporter: David Reiss
>Priority: Minor
> Fix For: 0.5
>
> Attachments: THRIFT-812-ThriftZmq-csharp.patch, 
> THRIFT-812_with_multicast_example.patch, 
> v1-0001-THRIFT-812.-contrib-Add-a-demo-of-using-Thrift-over-.patch, 
> v2-0001-THRIFT-812.-contrib-Add-a-demo-of-using-Thrift-over-.patch
>
>
> I played around with ZeroMQ a bit this weekend.  I thought it might be 
> informative to write some glue code to run Thrift requests with ZeroMQ as the 
> transport, so here it is.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira


[jira] [Updated] (THRIFT-1115) dynamic python object (de)serialization, using __slots__ for less memory, and custom object inheritance

2011-04-19 Thread Will Pierce (JIRA)

 [ 
https://issues.apache.org/jira/browse/THRIFT-1115?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Will Pierce updated THRIFT-1115:


Attachment: THRIFT-1115.python_dynamic_code_and_slots_v3.patch

Patch attached, version 3.

Changes from v2:
* test/py/TestClient.py: removed skipping of testException for Xception case
* test/py/Makefile.am: single variable for all gen-py-\* dirs now, and uses 
test -d instead of mkdir \|\| new
* lib/py/src/protocol/TBase.py: new name for TProtocolDynamic
* lib/py/src/protocol/TBase.py: removed unnecessary "is" testing from 
{{__eq__}} and made getattr() calls clearer
* lib/py/src/protocol/TBase.py: factored out read() and write() into TProtocol 
readStruct() and writeStruct()
* lib/py/src/protocol/TBase.py: added TExceptionBase class, old-style to be 
compatible with python2.4, reusing some TBase code without inheritance
* lib/py/src/protocol/__init__.py: renamed TProtocolDynamic to TBase
* lib/py/src/protocol/TProtocol.py: brought readStruct() and writeStruct() in 
from TBase
* compiler/cpp/src/generate/t_py_generator.cc: renames for TBase, and added 
TExceptionBase to handle python2.4 "interesting edge case", and added new 
"dynexc" optional flag to complete the feature set for pluggable base classing 
at compile time.

The tests pass on my local machine for python2.4 and 2.7.

> dynamic python object (de)serialization, using __slots__ for less memory, and 
> custom object inheritance
> ---
>
> Key: THRIFT-1115
> URL: https://issues.apache.org/jira/browse/THRIFT-1115
> Project: Thrift
>  Issue Type: New Feature
>  Components: Python - Compiler, Python - Library
>Reporter: Will Pierce
>Assignee: Will Pierce
> Attachments: THRIFT-1115.python_dynamic_code_and_slots_v1.patch, 
> THRIFT-1115.python_dynamic_code_and_slots_v2.patch, 
> THRIFT-1115.python_dynamic_code_and_slots_v3.patch, test_dynser.py, 
> test_size.py
>
>
> This patch adds several new features to the compiler for python and the 
> python libraries, and exercises the new features with expanded unit testing.
> This adds support for generating python classes that have no {{read()}} or 
> {{write()}} methods. Instead, the generated classes inherit from a new base 
> class, {{TProtocolDynamic}}. This new class implements the de/serialization 
> with {{read()}} and {{write()}} methods that iterate over the derived class's 
> "{{thrift_spec}}" class member that describes the structure and types of the 
> thrift.  This dynamic evaluation works with both binary and compact 
> protocols, and has the same hook as before for delegating de/serialization to 
> fastbinary.so for the "accelerated binary" protocol.  This new baseclass 
> {{read()}} method may even be more efficient than the generated explicit 
> {{read()}} code for objects with lots of attributes because it doesn't have a 
> case/switch style series of "{{if field_id == X...}}" nested inside a loop.  
> Instead, it indexes the decoded field ID into the {{thrift_spec}} tuple 
> directly.  That efficiency gain is probably just noise though, since the 
> dynamic process probably uses more CPU later on, though I haven't benchmarked 
> it. (Up[date: see the benchmarking results posted below for 
> construction/serialization/deserialization comparisons.)
> If the 'dynamic' flag is given as a -gen py: flag to the compiler, then the 
> generated classes no longer get individual {{\_\_repr\_\_}} and 
> {{\_\_eq\_\_}} and {{\_\_ne\_\_}} methods, instead they inherit from the 
> TProtocolDynamic base class implementation, which uses {{\_\_slots\_\_}} 
> instead of {{\_\_dict\_\_}} for repr and equality testing.
> When "dynamic" python classes are generated, they have very little code, just 
> a constructor and class data.  All the work of serialization and 
> deserialization is done by the base class.  This produces about 980 lines for 
> DebugProtoTest vs. 3540 lines in default "\-gen py" mode, or about 1/3 the 
> original code size.
> The {{\_\_slots\_\_}} support is available without requiring the dynamic base 
> class, so users can save memory using the slots flag to generate non-dict 
> based instances.  The memory difference between dict and slots based objects 
> is hard to measure, but seems to be around 10x smaller using slots, as long 
> as the base class also uses {{\_\_slots\_\_}}.  If the generated classes are 
> old-style, and use slots, there's no memory savings at all, because the base 
> class still creates a {{\_\_dict\_\_}} object for every instance.  Python is 
> just tricky when it comes to using {{\_\_slots\_\_}} best.
> The memory savings is pretty astounding using new-style classes and 
> {{\_\_slots\_\_}}.  Building DebugProtoTest.thrift with: -gen 
> py:dynamic,slots versus \-gen py results in

[jira] [Commented] (THRIFT-1115) dynamic python object (de)serialization, using __slots__ for less memory, and custom object inheritance

2011-04-19 Thread Will Pierce (JIRA)

[ 
https://issues.apache.org/jira/browse/THRIFT-1115?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13021545#comment-13021545
 ] 

Will Pierce commented on THRIFT-1115:
-

David, at first I didn't understand what you meant when you said "I think that 
the TProtocol.readStruct should be the real implementation and TBase.read 
should be the wrapper, not the other way around." It finally clicked.  I agree. 
 The code looks a lot cleaner without lots of repeated calls out to 
iprot.blah() and oprot.blah() all over the place.

I confirmed you are correct, that the {{__eq__}} method didn't need the extra 
check to compare "is" equality before testing != inequality.  Looking at the 
disassembled bytecode, they both generate the same COMPARE_OP followed by a 
JUMP instruction, so it was redundant.

I have an idea on how to work around the python2.4 exception issue.  The 
"interesting edge case" could be solved if the generated code for thrift 
exceptions inherited from something like TBase which implements the same API 
but is an old-style class.  After I moved the readStruct/writeStruct code out 
of TBase and into TProtocol, there's very little left (that's got to be good 
for a class named TBase).  With very little repeated code, I think we can have 
a TExceptionBase class that is old-style, so is raisable by python2.4, and 
still do dynamic read() and write() from TProtocol's new readStruct() and 
writeStruct().

I will have version 3 of this patch uploaded in the next hour.

> dynamic python object (de)serialization, using __slots__ for less memory, and 
> custom object inheritance
> ---
>
> Key: THRIFT-1115
> URL: https://issues.apache.org/jira/browse/THRIFT-1115
> Project: Thrift
>  Issue Type: New Feature
>  Components: Python - Compiler, Python - Library
>Reporter: Will Pierce
>Assignee: Will Pierce
> Attachments: THRIFT-1115.python_dynamic_code_and_slots_v1.patch, 
> THRIFT-1115.python_dynamic_code_and_slots_v2.patch, test_dynser.py, 
> test_size.py
>
>
> This patch adds several new features to the compiler for python and the 
> python libraries, and exercises the new features with expanded unit testing.
> This adds support for generating python classes that have no {{read()}} or 
> {{write()}} methods. Instead, the generated classes inherit from a new base 
> class, {{TProtocolDynamic}}. This new class implements the de/serialization 
> with {{read()}} and {{write()}} methods that iterate over the derived class's 
> "{{thrift_spec}}" class member that describes the structure and types of the 
> thrift.  This dynamic evaluation works with both binary and compact 
> protocols, and has the same hook as before for delegating de/serialization to 
> fastbinary.so for the "accelerated binary" protocol.  This new baseclass 
> {{read()}} method may even be more efficient than the generated explicit 
> {{read()}} code for objects with lots of attributes because it doesn't have a 
> case/switch style series of "{{if field_id == X...}}" nested inside a loop.  
> Instead, it indexes the decoded field ID into the {{thrift_spec}} tuple 
> directly.  That efficiency gain is probably just noise though, since the 
> dynamic process probably uses more CPU later on, though I haven't benchmarked 
> it. (Up[date: see the benchmarking results posted below for 
> construction/serialization/deserialization comparisons.)
> If the 'dynamic' flag is given as a -gen py: flag to the compiler, then the 
> generated classes no longer get individual {{\_\_repr\_\_}} and 
> {{\_\_eq\_\_}} and {{\_\_ne\_\_}} methods, instead they inherit from the 
> TProtocolDynamic base class implementation, which uses {{\_\_slots\_\_}} 
> instead of {{\_\_dict\_\_}} for repr and equality testing.
> When "dynamic" python classes are generated, they have very little code, just 
> a constructor and class data.  All the work of serialization and 
> deserialization is done by the base class.  This produces about 980 lines for 
> DebugProtoTest vs. 3540 lines in default "\-gen py" mode, or about 1/3 the 
> original code size.
> The {{\_\_slots\_\_}} support is available without requiring the dynamic base 
> class, so users can save memory using the slots flag to generate non-dict 
> based instances.  The memory difference between dict and slots based objects 
> is hard to measure, but seems to be around 10x smaller using slots, as long 
> as the base class also uses {{\_\_slots\_\_}}.  If the generated classes are 
> old-style, and use slots, there's no memory savings at all, because the base 
> class still creates a {{\_\_dict\_\_}} object for every instance.  Python is 
> just tricky when it comes to using {{\_\_slots\_\_}} best.
> The memory savings is pretty astounding using new-style cl

[jira] [Commented] (THRIFT-1115) dynamic python object (de)serialization, using __slots__ for less memory, and custom object inheritance

2011-04-19 Thread Will Pierce (JIRA)

[ 
https://issues.apache.org/jira/browse/THRIFT-1115?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13021531#comment-13021531
 ] 

Will Pierce commented on THRIFT-1115:
-

Hmm, bad news.  The TBase class needs to be a new-style class, or else the 
{{__slots__}} feature has no massive memory savings benefit.

Old style classes seem to always have a __dict__ object.  A quote from the 
python.org link from my previous comment is succinct:  "New Style classes can 
use descriptors (including __slots__), and Old Style classes cannot."

{noformat}
% cat ob.py 
#!/usr/bin/python
class cls_old:
  __slots__ = []
class cls_new(object):
  __slots__ = []

c_new = cls_new()
c_old = cls_old()

print 'Old style object __dict__:', c_old.__dict__  # has one.
print 'New style object __dict__:', c_new.__dict__  # does not, good!

% python ob.py
Old style object __dict__: {}
New style object __dict__:
Traceback (most recent call last):
  File "./ob.py", line 11, in 
print 'New style object __dict__:', c_new.__dict__
AttributeError: 'cls_new' object has no attribute '__dict__'
{noformat}


So, to get huge memory savings from {{__slots__}}, we need TBase to be a 
new-style class.  But, python2.4 won't let Exceptions derive from object, so 
there's a couple options ahead:

Either:
* Let it slide, and if someone chooses to use the -gen py:dynamic  option, warn 
that generated Exception structs will break on python <= 2.4.x.

Or:
* Generate exception classes that don't inherit from TBase, so they don't 
inherit from object, and can be raised in python2.4.
** They will either need to inherit from an old-style version of TBase that 
implements the same API.  Might be doable without duplicating any code 
anywhere, with a new TBaseSlots kind of class maybe...
** Or, the exception structs need to have their own explicitly generated read() 
and write() methods, so they won't have anything to do with TBase.  This isn't 
too awful, since exception structs are almost always going to be very simple 
objects.

Maybe "interesting edge case" was an understatement.

What do you think is the right approach?  I really want to see the memory 
savings from using {{__slots__}} and have super-small generated code files for 
my structs.  But supporting python2.4 is also important.

Maybe this is moot?  If someone tells the compiler to generate code with the 
optional 'dynamic' flag, then maybe it's just up to them to make sure they 
either avoid python2.4 and user-defined exceptions (if it's a non-RPC 
application), or use python2.5 or newer.  The default output from the compiler 
still works in all 100% cases, so this is really only a problem if someone uses 
the -gen py:dynamic feature.   Cavear emptor?

I'm interested in hearing feedback...

> dynamic python object (de)serialization, using __slots__ for less memory, and 
> custom object inheritance
> ---
>
> Key: THRIFT-1115
> URL: https://issues.apache.org/jira/browse/THRIFT-1115
> Project: Thrift
>  Issue Type: New Feature
>  Components: Python - Compiler, Python - Library
>Reporter: Will Pierce
>Assignee: Will Pierce
> Attachments: THRIFT-1115.python_dynamic_code_and_slots_v1.patch, 
> THRIFT-1115.python_dynamic_code_and_slots_v2.patch, test_dynser.py, 
> test_size.py
>
>
> This patch adds several new features to the compiler for python and the 
> python libraries, and exercises the new features with expanded unit testing.
> This adds support for generating python classes that have no {{read()}} or 
> {{write()}} methods. Instead, the generated classes inherit from a new base 
> class, {{TProtocolDynamic}}. This new class implements the de/serialization 
> with {{read()}} and {{write()}} methods that iterate over the derived class's 
> "{{thrift_spec}}" class member that describes the structure and types of the 
> thrift.  This dynamic evaluation works with both binary and compact 
> protocols, and has the same hook as before for delegating de/serialization to 
> fastbinary.so for the "accelerated binary" protocol.  This new baseclass 
> {{read()}} method may even be more efficient than the generated explicit 
> {{read()}} code for objects with lots of attributes because it doesn't have a 
> case/switch style series of "{{if field_id == X...}}" nested inside a loop.  
> Instead, it indexes the decoded field ID into the {{thrift_spec}} tuple 
> directly.  That efficiency gain is probably just noise though, since the 
> dynamic process probably uses more CPU later on, though I haven't benchmarked 
> it. (Up[date: see the benchmarking results posted below for 
> construction/serialization/deserialization comparisons.)
> If the 'dynamic' flag is given as a -gen py: flag to the compiler, then the 
> generated classes no longer ge

[jira] [Commented] (THRIFT-1115) dynamic python object (de)serialization, using __slots__ for less memory, and custom object inheritance

2011-04-19 Thread Will Pierce (JIRA)

[ 
https://issues.apache.org/jira/browse/THRIFT-1115?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13021526#comment-13021526
 ] 

Will Pierce commented on THRIFT-1115:
-

Took me some time to get back to this, but I am almost done with an updated 
patch that makes all but one of the changes you recommended.  Here's an update:

On the "interesting edge case" with exceptions.  Python 2.4 apparently doesn't 
let you raise an exception which is a new style class...  Here's a snippet of 
demo code (to run from trunk/test/py/ after "make check" has built the gen-py-* 
subdirectories):
{noformat}
% cat te.py
#!/usr/bin/python2.4
import sys, glob
sys.path.insert(0, 'gen-py-dynamicslots')
sys.path.insert(0, glob.glob('../../lib/py/build/lib.*')[0])
import thrift
import ThriftTest
import ThriftTest.ttypes
try:
raise ThriftTest.ttypes.Xception()
except ThriftTest.ttypes.Xception:
print 'OK!'
%
% python2.7 te.py 
OK!
% python2.4 te.py 
Traceback (most recent call last):
  File "te.py", line 9, in ?
raise ThriftTest.ttypes.Xception()
TypeError: exceptions must be classes, instances, or strings (deprecated), not 
Xception
% 
{noformat}

If you change the sys.path to include ./gen-py-default/ instead of 
./gen-py-dynamicslots/ then the code works for both python2.4 and python2.7.

The edge case is that the -gen py:dynamic option generates code that doesn't 
work with python2.4 for exception structs. The TestClient.py code has code in 
testException (in v1 and v2 of the patch) for skipping the exception test, if 
raising Xception itself raises the TypeError.  What's going on, is the 
generated Xception code for dynamic type code (-gen py:dynamic) has to use 
multiple inheritance to be both an Exception and a TBase (correct name).  The 
Exception makes it raisable, and the TBase gives it .read and .write (for the 
-gen py:dynamic case).  TBase inherits from object, so the weird python2.4 
limitation on exceptions kicks in.  (Found [this on 
python.org|http://wiki.python.org/moin/NewClassVsClassicClass] to explain it.)

I think this can be fixed by making TBase an old style class (remove 'object' 
from its class definition.)  I'm trying that now, and will post an update if it 
works and what impacts it has on the performance test results (if any).

To my mind, the edge case is that we don't really know what version of python 
will be used to execute this code, when we're generating code at compile time.  
An ugly way to work around this would be to let TBase remain a new style class, 
and offer an additional compiler flag to indicate that users' exception structs 
need to be old style classes, and generate out their explicit read and write 
methods so a class like Xception only inherits from Exception, which will 
always work in python 2.x and up.  That is pretty ugly though, to have two 
different serialization/deserialization methods in use at the same time, in the 
same code.

I'm hoping that just making TBase into an old-style class will just work 
without affecting any of the performance tests.  I'll post results soon.  The 
396 unit test cases all pass with TBase as an old style class, so now it's just 
performance tests that I have to check.


> dynamic python object (de)serialization, using __slots__ for less memory, and 
> custom object inheritance
> ---
>
> Key: THRIFT-1115
> URL: https://issues.apache.org/jira/browse/THRIFT-1115
> Project: Thrift
>  Issue Type: New Feature
>  Components: Python - Compiler, Python - Library
>Reporter: Will Pierce
>Assignee: Will Pierce
> Attachments: THRIFT-1115.python_dynamic_code_and_slots_v1.patch, 
> THRIFT-1115.python_dynamic_code_and_slots_v2.patch, test_dynser.py, 
> test_size.py
>
>
> This patch adds several new features to the compiler for python and the 
> python libraries, and exercises the new features with expanded unit testing.
> This adds support for generating python classes that have no {{read()}} or 
> {{write()}} methods. Instead, the generated classes inherit from a new base 
> class, {{TProtocolDynamic}}. This new class implements the de/serialization 
> with {{read()}} and {{write()}} methods that iterate over the derived class's 
> "{{thrift_spec}}" class member that describes the structure and types of the 
> thrift.  This dynamic evaluation works with both binary and compact 
> protocols, and has the same hook as before for delegating de/serialization to 
> fastbinary.so for the "accelerated binary" protocol.  This new baseclass 
> {{read()}} method may even be more efficient than the generated explicit 
> {{read()}} code for objects with lots of attributes because it doesn't have a 
> case/switch style series of "{{if field_id == X...}}" nested inside a loop.  
> Instead, it

[jira] [Updated] (THRIFT-1151) Produce more informative runtime error in case of schema and data mismatch during serialization

2011-04-19 Thread Anatoly Kanivetsky (JIRA)

 [ 
https://issues.apache.org/jira/browse/THRIFT-1151?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Anatoly Kanivetsky updated THRIFT-1151:
---

Attachment: diff.txt

> Produce more informative runtime error in case of schema and data mismatch 
> during serialization
> ---
>
> Key: THRIFT-1151
> URL: https://issues.apache.org/jira/browse/THRIFT-1151
> Project: Thrift
>  Issue Type: Improvement
>  Components: Erlang - Library
>Reporter: Anatoly Kanivetsky
> Attachments: diff.txt
>
>
> This patch adds generation of informative error during serialization of 
> struct, which is unmatched to it's struct_info.
> Instead of generating {error, enival} in gen_tcp during sending invalid 
> binary, it produces accurate error with some useful information.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira


[jira] [Created] (THRIFT-1151) Produce more informative runtime error in case of schema and data mismatch during serialization

2011-04-19 Thread Anatoly Kanivetsky (JIRA)
Produce more informative runtime error in case of schema and data mismatch 
during serialization
---

 Key: THRIFT-1151
 URL: https://issues.apache.org/jira/browse/THRIFT-1151
 Project: Thrift
  Issue Type: Improvement
  Components: Erlang - Library
Reporter: Anatoly Kanivetsky


This patch adds generation of informative error during serialization of struct, 
which is unmatched to it's struct_info.
Instead of generating {error, enival} in gen_tcp during sending invalid binary, 
it produces accurate error with some useful information.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira


[jira] [Issue Comment Edited] (THRIFT-1031) Patch to compile Thrift for vc++ 9.0 and 10.0

2011-04-19 Thread Dragan Okiljevic (JIRA)

[ 
https://issues.apache.org/jira/browse/THRIFT-1031?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13021494#comment-13021494
 ] 

Dragan Okiljevic edited comment on THRIFT-1031 at 4/19/11 9:00 AM:
---

@Deepak Muley
You may find the following comment: 
https://issues.apache.org/jira/browse/THRIFT-1123?focusedCommentId=13021475&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-13021475
 useful for both THRIFT-1123 and (possibly) THRIFT-1031. It describes two 
additional minor interventions needed to make your MSVC 2008/2010 Thrift 
project work like a charm.

  was (Author: dragan.okiljevic):
@Deepak Murley
You may find the following comment: 
https://issues.apache.org/jira/browse/THRIFT-1123?focusedCommentId=13021475&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-13021475
 useful for both THRIFT-1123 and (possibly) THRIFT-1031. It describes two 
additional minor interventions needed to make your MSVC 2008/2010 Thrift 
project work like a charm.
  
> Patch to compile Thrift for vc++ 9.0 and 10.0
> -
>
> Key: THRIFT-1031
> URL: https://issues.apache.org/jira/browse/THRIFT-1031
> Project: Thrift
>  Issue Type: Improvement
>  Components: C++ - Library
> Environment: Windows XP 32bit, vc++ 9.0, 10.0
>Reporter: James Dickson
>Priority: Trivial
> Fix For: 0.7
>
> Attachments: thrift_msvc.patch, thrift_msvc_v0_1.patch
>
>
> At our company we need clients running on Windows being able to connect to 
> our linux servers running hypertable. The attached patch enables the parts 
> needed by Hypertable to be compiled on Windows using either the VC++ 9.0 or 
> 10.0 compilers.
> Having read previous posts about ports using boost::asio we found these to be 
> too intrusive for our needs. This version uses pthreads_win32 and winsock2 
> and is as designed to be as un-intrusive as is possible to the original unix 
> code base. It is mostly #defines between unix sockets and winsock2 sockets. 
> We also tried to follow the folder structuring of the C# runtime that has 
> visual studio solutions to be consistent.
> More details are in the README as not all the functionality of the original 
> unix code base is available to windows users. We will add the missing 
> functionality, we just wanted to share what we had as for a Windows based 
> client for us it is sufficient.
> The patch is based on the latest revision in SVN, we would love feedback and 
> any code reviews. If there is any possibility of this being added to the main 
> trunk then that would be much appreciated, however we don't expect that.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira


[jira] [Issue Comment Edited] (THRIFT-1123) Patch to compile Thrift server and client for vc++ 9.0 and 10.0

2011-04-19 Thread Dragan Okiljevic (JIRA)

[ 
https://issues.apache.org/jira/browse/THRIFT-1123?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13021475#comment-13021475
 ] 

Dragan Okiljevic edited comment on THRIFT-1123 at 4/19/11 8:57 AM:
---

To use this patch for client&server C++ support in Visual Studion 2008 and 2010 
environment (while waiting for it's improved version from issue THRIFT-1031 
which is still under development and currently supports client side only) you 
need to make two more smaller changes, and your Win C++ Thrift powered project 
will work like a charm.

These interventions are needed for THRIFT-1123 and possibly THRIFT-1031

1. C++ code generated by Thrift compiler have compile errors if you define 
enums (some ambigious STL iterator as interpreted in Visual Studio) in .thrift 
file. The solution is easy and published as THRIFT-1139.

2. When communicating between WIN32 client and servers on one side and other 
implementation such as Java on the other side, double values are not correctly 
interpreted as current C++ Thrift implementation don't recognise WIN32 
environmant and decides to use wrong byte order (endianness). This does not 
affect int, string, complex and collection types, but affects double. The 
solution is easy and I'm providing it both inline and as a patch. It has been  
tested on Windows and transmited MBytes of collections/comples 
types/ints/doubles etc. between Java and C++.
Here is the solution, provided both inline and as 
"additional_thrift_cpp_visual_studio_2008_and_2010_endians_patch(concerning_ticket_1123_and_possibly_1031_patches).patch".
 To use this patch, just make sure that the main, 
"thrift_msvc_client_and_server.patch", is already applied.

{code:title=TProtocol.h|borderStyle=solid}

//around line 97 of TProtocol.h:

//#if __BYTE_ORDER == __BIG_ENDIAN
#if __BYTE_ORDER == __BIG_ENDIAN && !defined(WIN32)

//around line 118 of TProtocol.h:

//#elif __BYTE_ORDER == __LITTLE_ENDIAN
#elif __BYTE_ORDER == __LITTLE_ENDIAN || !defined(WIN32)

{code} 


  was (Author: dragan.okiljevic):
To use this patch for client&server C++ support in Visual Studion 2008 and 
2010 environment (while waiting for it's improved version from issue 
THRIFT-1031 which is still under development and currently supports client side 
only) you need to make two more smaller changes, and your Win C++ Thrift 
powered project will work like a charm.

These interventions are needed for THRIFT-1123 and possibly THRIFT-1031

1. C++ code generated by Thrift compiler have compile errors if you define 
enums (some ambigious STL iterator as interpreted in Visual Studio) in .thrift 
file. The solution is easy and published as THRIFT-1139.

2. When communicating between WIN32 client and servers on one side and other 
implementation such as Java on the other side, double values are not correctly 
interpreted as current C++ Thrift implementation don't recognise WIN32 
environmant and decides to use wrong byte order (endianness). This does not 
affect int, string, complex and collection types, but affects double. The 
solution is easy and I'm providing it both inline and as a patch. It has been  
tested on Windows and transmited MBytes of collections/comples 
types/ints/doubles etc. between Java and C++.
Here is the solution, provided both inline and as 
"additional_thrift_cpp_visual_studio_2008_and_2010_endians_patch(concerning_ticket_1123_and_possibly_1031_patches).patch".
 To use this patch, just make sure that the main, 
"thrift_msvc_client_and_server.patch", is already applied.

{code:title=TProtocol.h|borderStyle=solid}

//around line 97 of TProtocol.h

//#if __BYTE_ORDER == __BIG_ENDIAN
#if __BYTE_ORDER == __BIG_ENDIAN && !defined(WIN32)

//around line 118 of TProtocol.h
//#elif __BYTE_ORDER == __LITTLE_ENDIAN
#elif __BYTE_ORDER == __LITTLE_ENDIAN || !defined(WIN32)

{code} 

  
> Patch to compile Thrift server and client for vc++ 9.0 and 10.0
> ---
>
> Key: THRIFT-1123
> URL: https://issues.apache.org/jira/browse/THRIFT-1123
> Project: Thrift
>  Issue Type: Improvement
>  Components: C++ - Library
> Environment: Windows XP 32bit, vc++ 9.0, 10.0
>Reporter: Dragan Okiljevic
>Priority: Trivial
> Fix For: 0.7
>
> Attachments: 
> additional_thrift_cpp_visual_studio_2008_and_2010_endians_patch(concerning_ticket_1123_and_possibly_1031_patches).patch,
>  thrift_msvc_client_and_server.patch
>
>
> Extension of THRIFT-1031 patch published by James Dickson
> This patch is intended to provide Thrift C/C++ functionality on WIN32 
> platforms.
> The implementation is built on top of the patch "Patch to compile Thrift for 
> vc++ 9.0 and 10.0" by James Dickson published as THRIFT-1031. I just used 
> this code and ported more Thrieft C/C++ to WIN32 and added th

[jira] [Commented] (THRIFT-1031) Patch to compile Thrift for vc++ 9.0 and 10.0

2011-04-19 Thread Dragan Okiljevic (JIRA)

[ 
https://issues.apache.org/jira/browse/THRIFT-1031?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13021494#comment-13021494
 ] 

Dragan Okiljevic commented on THRIFT-1031:
--

@Deepak Murley
You may find the following comment: 
https://issues.apache.org/jira/browse/THRIFT-1123?focusedCommentId=13021475&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-13021475
 useful for both THRIFT-1123 and (possibly) THRIFT-1031. It describes two 
additional minor interventions needed to make your MSVC 2008/2010 Thrift 
project work like a charm.

> Patch to compile Thrift for vc++ 9.0 and 10.0
> -
>
> Key: THRIFT-1031
> URL: https://issues.apache.org/jira/browse/THRIFT-1031
> Project: Thrift
>  Issue Type: Improvement
>  Components: C++ - Library
> Environment: Windows XP 32bit, vc++ 9.0, 10.0
>Reporter: James Dickson
>Priority: Trivial
> Fix For: 0.7
>
> Attachments: thrift_msvc.patch, thrift_msvc_v0_1.patch
>
>
> At our company we need clients running on Windows being able to connect to 
> our linux servers running hypertable. The attached patch enables the parts 
> needed by Hypertable to be compiled on Windows using either the VC++ 9.0 or 
> 10.0 compilers.
> Having read previous posts about ports using boost::asio we found these to be 
> too intrusive for our needs. This version uses pthreads_win32 and winsock2 
> and is as designed to be as un-intrusive as is possible to the original unix 
> code base. It is mostly #defines between unix sockets and winsock2 sockets. 
> We also tried to follow the folder structuring of the C# runtime that has 
> visual studio solutions to be consistent.
> More details are in the README as not all the functionality of the original 
> unix code base is available to windows users. We will add the missing 
> functionality, we just wanted to share what we had as for a Windows based 
> client for us it is sufficient.
> The patch is based on the latest revision in SVN, we would love feedback and 
> any code reviews. If there is any possibility of this being added to the main 
> trunk then that would be much appreciated, however we don't expect that.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira


[jira] [Issue Comment Edited] (THRIFT-1123) Patch to compile Thrift server and client for vc++ 9.0 and 10.0

2011-04-19 Thread Dragan Okiljevic (JIRA)

[ 
https://issues.apache.org/jira/browse/THRIFT-1123?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13021479#comment-13021479
 ] 

Dragan Okiljevic edited comment on THRIFT-1123 at 4/19/11 8:46 AM:
---

Patch to fix byte order (endianness) on WIN32 C++ platform: 
"additional_thrift_cpp_visual_studio_2008_and_2010_endians_patch".

Make sure to apply it after the main patch: 
"thrift_msvc_client_and_server.patch".

  was (Author: dragan.okiljevic):
Patch to fix byte order (endianness) on WIN32 C++ platform: 
"additional_thrift_cpp_visual_studio_2008_and_2010_endians_patch".

Make sure to apply it after the main "thrift_msvc_client_and_server.patch".
  
> Patch to compile Thrift server and client for vc++ 9.0 and 10.0
> ---
>
> Key: THRIFT-1123
> URL: https://issues.apache.org/jira/browse/THRIFT-1123
> Project: Thrift
>  Issue Type: Improvement
>  Components: C++ - Library
> Environment: Windows XP 32bit, vc++ 9.0, 10.0
>Reporter: Dragan Okiljevic
>Priority: Trivial
> Fix For: 0.7
>
> Attachments: 
> additional_thrift_cpp_visual_studio_2008_and_2010_endians_patch(concerning_ticket_1123_and_possibly_1031_patches).patch,
>  thrift_msvc_client_and_server.patch
>
>
> Extension of THRIFT-1031 patch published by James Dickson
> This patch is intended to provide Thrift C/C++ functionality on WIN32 
> platforms.
> The implementation is built on top of the patch "Patch to compile Thrift for 
> vc++ 9.0 and 10.0" by James Dickson published as THRIFT-1031. I just used 
> this code and ported more Thrieft C/C++ to WIN32 and added them to original 
> VC projects created in THRIFT-1031.
> I express my gratitude to Mr. Dickson as his post gave me the roadmap how to 
> do the additional changes, that I hope, would be useful for the rest of the 
> community too.
> Besides client capabilities enabled in THRIFT-1031, the library can now be 
> used for building Thrift servers and using concurrency features. The dir/file 
> structure from THRIFT-1031 and usage of Config.h header for providing support 
> for both WIN32 and *NIX remains.
> The implementation was tested briefly on MSVC2008, MSVC2010 and Ubuntu, 
> communicating between C/C++ clients and servers and Java clients and servers. 
> As the author needs all of this functionality for one of his projects, the 
> testing and debugging will continue.
> Revision 1086435 from March, 28, 2011. was used for development and creation 
> of patch, but it should be possible to apply it on current trunk revision as 
> long as no changes are made to patched files in trunk.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira


[jira] [Issue Comment Edited] (THRIFT-1123) Patch to compile Thrift server and client for vc++ 9.0 and 10.0

2011-04-19 Thread Dragan Okiljevic (JIRA)

[ 
https://issues.apache.org/jira/browse/THRIFT-1123?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13021479#comment-13021479
 ] 

Dragan Okiljevic edited comment on THRIFT-1123 at 4/19/11 8:46 AM:
---

Patch to fix byte order (endianness) on WIN32 C++ platform: 
"additional_thrift_cpp_visual_studio_2008_and_2010_endians_patch".

Make sure to apply it after the main "thrift_msvc_client_and_server.patch".

  was (Author: dragan.okiljevic):
Patch to fix byte order (endianness) on WIN32 C++ platform.

Use after the main "thrift_msvc_client_and_server.patch".
  
> Patch to compile Thrift server and client for vc++ 9.0 and 10.0
> ---
>
> Key: THRIFT-1123
> URL: https://issues.apache.org/jira/browse/THRIFT-1123
> Project: Thrift
>  Issue Type: Improvement
>  Components: C++ - Library
> Environment: Windows XP 32bit, vc++ 9.0, 10.0
>Reporter: Dragan Okiljevic
>Priority: Trivial
> Fix For: 0.7
>
> Attachments: 
> additional_thrift_cpp_visual_studio_2008_and_2010_endians_patch(concerning_ticket_1123_and_possibly_1031_patches).patch,
>  thrift_msvc_client_and_server.patch
>
>
> Extension of THRIFT-1031 patch published by James Dickson
> This patch is intended to provide Thrift C/C++ functionality on WIN32 
> platforms.
> The implementation is built on top of the patch "Patch to compile Thrift for 
> vc++ 9.0 and 10.0" by James Dickson published as THRIFT-1031. I just used 
> this code and ported more Thrieft C/C++ to WIN32 and added them to original 
> VC projects created in THRIFT-1031.
> I express my gratitude to Mr. Dickson as his post gave me the roadmap how to 
> do the additional changes, that I hope, would be useful for the rest of the 
> community too.
> Besides client capabilities enabled in THRIFT-1031, the library can now be 
> used for building Thrift servers and using concurrency features. The dir/file 
> structure from THRIFT-1031 and usage of Config.h header for providing support 
> for both WIN32 and *NIX remains.
> The implementation was tested briefly on MSVC2008, MSVC2010 and Ubuntu, 
> communicating between C/C++ clients and servers and Java clients and servers. 
> As the author needs all of this functionality for one of his projects, the 
> testing and debugging will continue.
> Revision 1086435 from March, 28, 2011. was used for development and creation 
> of patch, but it should be possible to apply it on current trunk revision as 
> long as no changes are made to patched files in trunk.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira


[jira] [Updated] (THRIFT-1123) Patch to compile Thrift server and client for vc++ 9.0 and 10.0

2011-04-19 Thread Dragan Okiljevic (JIRA)

 [ 
https://issues.apache.org/jira/browse/THRIFT-1123?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Dragan Okiljevic updated THRIFT-1123:
-

Comment: was deleted

(was: Make sure to use this patch after applying the main WIN32 Thrift C++ 
patch: "thrift_msvc_client_and_server.patch")

> Patch to compile Thrift server and client for vc++ 9.0 and 10.0
> ---
>
> Key: THRIFT-1123
> URL: https://issues.apache.org/jira/browse/THRIFT-1123
> Project: Thrift
>  Issue Type: Improvement
>  Components: C++ - Library
> Environment: Windows XP 32bit, vc++ 9.0, 10.0
>Reporter: Dragan Okiljevic
>Priority: Trivial
> Fix For: 0.7
>
> Attachments: 
> additional_thrift_cpp_visual_studio_2008_and_2010_endians_patch(concerning_ticket_1123_and_possibly_1031_patches).patch,
>  thrift_msvc_client_and_server.patch
>
>
> Extension of THRIFT-1031 patch published by James Dickson
> This patch is intended to provide Thrift C/C++ functionality on WIN32 
> platforms.
> The implementation is built on top of the patch "Patch to compile Thrift for 
> vc++ 9.0 and 10.0" by James Dickson published as THRIFT-1031. I just used 
> this code and ported more Thrieft C/C++ to WIN32 and added them to original 
> VC projects created in THRIFT-1031.
> I express my gratitude to Mr. Dickson as his post gave me the roadmap how to 
> do the additional changes, that I hope, would be useful for the rest of the 
> community too.
> Besides client capabilities enabled in THRIFT-1031, the library can now be 
> used for building Thrift servers and using concurrency features. The dir/file 
> structure from THRIFT-1031 and usage of Config.h header for providing support 
> for both WIN32 and *NIX remains.
> The implementation was tested briefly on MSVC2008, MSVC2010 and Ubuntu, 
> communicating between C/C++ clients and servers and Java clients and servers. 
> As the author needs all of this functionality for one of his projects, the 
> testing and debugging will continue.
> Revision 1086435 from March, 28, 2011. was used for development and creation 
> of patch, but it should be possible to apply it on current trunk revision as 
> long as no changes are made to patched files in trunk.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira


[jira] [Updated] (THRIFT-1123) Patch to compile Thrift server and client for vc++ 9.0 and 10.0

2011-04-19 Thread Dragan Okiljevic (JIRA)

 [ 
https://issues.apache.org/jira/browse/THRIFT-1123?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Dragan Okiljevic updated THRIFT-1123:
-

Attachment: 
additional_thrift_cpp_visual_studio_2008_and_2010_endians_patch(concerning_ticket_1123_and_possibly_1031_patches).patch

Make sure to use this patch after applying the main WIN32 Thrift C++ patch: 
"thrift_msvc_client_and_server.patch"

> Patch to compile Thrift server and client for vc++ 9.0 and 10.0
> ---
>
> Key: THRIFT-1123
> URL: https://issues.apache.org/jira/browse/THRIFT-1123
> Project: Thrift
>  Issue Type: Improvement
>  Components: C++ - Library
> Environment: Windows XP 32bit, vc++ 9.0, 10.0
>Reporter: Dragan Okiljevic
>Priority: Trivial
> Fix For: 0.7
>
> Attachments: 
> additional_thrift_cpp_visual_studio_2008_and_2010_endians_patch(concerning_ticket_1123_and_possibly_1031_patches).patch,
>  thrift_msvc_client_and_server.patch
>
>
> Extension of THRIFT-1031 patch published by James Dickson
> This patch is intended to provide Thrift C/C++ functionality on WIN32 
> platforms.
> The implementation is built on top of the patch "Patch to compile Thrift for 
> vc++ 9.0 and 10.0" by James Dickson published as THRIFT-1031. I just used 
> this code and ported more Thrieft C/C++ to WIN32 and added them to original 
> VC projects created in THRIFT-1031.
> I express my gratitude to Mr. Dickson as his post gave me the roadmap how to 
> do the additional changes, that I hope, would be useful for the rest of the 
> community too.
> Besides client capabilities enabled in THRIFT-1031, the library can now be 
> used for building Thrift servers and using concurrency features. The dir/file 
> structure from THRIFT-1031 and usage of Config.h header for providing support 
> for both WIN32 and *NIX remains.
> The implementation was tested briefly on MSVC2008, MSVC2010 and Ubuntu, 
> communicating between C/C++ clients and servers and Java clients and servers. 
> As the author needs all of this functionality for one of his projects, the 
> testing and debugging will continue.
> Revision 1086435 from March, 28, 2011. was used for development and creation 
> of patch, but it should be possible to apply it on current trunk revision as 
> long as no changes are made to patched files in trunk.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira


[jira] [Updated] (THRIFT-1123) Patch to compile Thrift server and client for vc++ 9.0 and 10.0

2011-04-19 Thread Dragan Okiljevic (JIRA)

 [ 
https://issues.apache.org/jira/browse/THRIFT-1123?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Dragan Okiljevic updated THRIFT-1123:
-

Attachment: (was: 
additional_thrift_cpp_visual_studio_2008_and_2010_endians_patch(concerning_ticket_1123_and_possibly_1031_patches).patch)

> Patch to compile Thrift server and client for vc++ 9.0 and 10.0
> ---
>
> Key: THRIFT-1123
> URL: https://issues.apache.org/jira/browse/THRIFT-1123
> Project: Thrift
>  Issue Type: Improvement
>  Components: C++ - Library
> Environment: Windows XP 32bit, vc++ 9.0, 10.0
>Reporter: Dragan Okiljevic
>Priority: Trivial
> Fix For: 0.7
>
> Attachments: thrift_msvc_client_and_server.patch
>
>
> Extension of THRIFT-1031 patch published by James Dickson
> This patch is intended to provide Thrift C/C++ functionality on WIN32 
> platforms.
> The implementation is built on top of the patch "Patch to compile Thrift for 
> vc++ 9.0 and 10.0" by James Dickson published as THRIFT-1031. I just used 
> this code and ported more Thrieft C/C++ to WIN32 and added them to original 
> VC projects created in THRIFT-1031.
> I express my gratitude to Mr. Dickson as his post gave me the roadmap how to 
> do the additional changes, that I hope, would be useful for the rest of the 
> community too.
> Besides client capabilities enabled in THRIFT-1031, the library can now be 
> used for building Thrift servers and using concurrency features. The dir/file 
> structure from THRIFT-1031 and usage of Config.h header for providing support 
> for both WIN32 and *NIX remains.
> The implementation was tested briefly on MSVC2008, MSVC2010 and Ubuntu, 
> communicating between C/C++ clients and servers and Java clients and servers. 
> As the author needs all of this functionality for one of his projects, the 
> testing and debugging will continue.
> Revision 1086435 from March, 28, 2011. was used for development and creation 
> of patch, but it should be possible to apply it on current trunk revision as 
> long as no changes are made to patched files in trunk.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira


[jira] [Updated] (THRIFT-1123) Patch to compile Thrift server and client for vc++ 9.0 and 10.0

2011-04-19 Thread Dragan Okiljevic (JIRA)

 [ 
https://issues.apache.org/jira/browse/THRIFT-1123?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Dragan Okiljevic updated THRIFT-1123:
-

Attachment: 
additional_thrift_cpp_visual_studio_2008_and_2010_endians_patch(concerning_ticket_1123_and_possibly_1031_patches).patch

Patch to fix byte order (endianness) on WIN32 C++ platform.

Use after the main "thrift_msvc_client_and_server.patch".

> Patch to compile Thrift server and client for vc++ 9.0 and 10.0
> ---
>
> Key: THRIFT-1123
> URL: https://issues.apache.org/jira/browse/THRIFT-1123
> Project: Thrift
>  Issue Type: Improvement
>  Components: C++ - Library
> Environment: Windows XP 32bit, vc++ 9.0, 10.0
>Reporter: Dragan Okiljevic
>Priority: Trivial
> Fix For: 0.7
>
> Attachments: 
> additional_thrift_cpp_visual_studio_2008_and_2010_endians_patch(concerning_ticket_1123_and_possibly_1031_patches).patch,
>  thrift_msvc_client_and_server.patch
>
>
> Extension of THRIFT-1031 patch published by James Dickson
> This patch is intended to provide Thrift C/C++ functionality on WIN32 
> platforms.
> The implementation is built on top of the patch "Patch to compile Thrift for 
> vc++ 9.0 and 10.0" by James Dickson published as THRIFT-1031. I just used 
> this code and ported more Thrieft C/C++ to WIN32 and added them to original 
> VC projects created in THRIFT-1031.
> I express my gratitude to Mr. Dickson as his post gave me the roadmap how to 
> do the additional changes, that I hope, would be useful for the rest of the 
> community too.
> Besides client capabilities enabled in THRIFT-1031, the library can now be 
> used for building Thrift servers and using concurrency features. The dir/file 
> structure from THRIFT-1031 and usage of Config.h header for providing support 
> for both WIN32 and *NIX remains.
> The implementation was tested briefly on MSVC2008, MSVC2010 and Ubuntu, 
> communicating between C/C++ clients and servers and Java clients and servers. 
> As the author needs all of this functionality for one of his projects, the 
> testing and debugging will continue.
> Revision 1086435 from March, 28, 2011. was used for development and creation 
> of patch, but it should be possible to apply it on current trunk revision as 
> long as no changes are made to patched files in trunk.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira


[jira] [Issue Comment Edited] (THRIFT-1123) Patch to compile Thrift server and client for vc++ 9.0 and 10.0

2011-04-19 Thread Dragan Okiljevic (JIRA)

[ 
https://issues.apache.org/jira/browse/THRIFT-1123?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13021475#comment-13021475
 ] 

Dragan Okiljevic edited comment on THRIFT-1123 at 4/19/11 8:36 AM:
---

To use this patch for client&server C++ support in Visual Studion 2008 and 2010 
environment (while waiting for it's improved version from issue THRIFT-1031 
which is still under development and currently supports client side only) you 
need to make two more smaller changes, and your Win C++ Thrift powered project 
will work like a charm.

These interventions are needed for THRIFT-1123 and possibly THRIFT-1031

1. C++ code generated by Thrift compiler have compile errors if you define 
enums (some ambigious STL iterator as interpreted in Visual Studio) in .thrift 
file. The solution is easy and published as THRIFT-1139.

2. When communicating between WIN32 client and servers on one side and other 
implementation such as Java on the other side, double values are not correctly 
interpreted as current C++ Thrift implementation don't recognise WIN32 
environmant and decides to use wrong byte order (endianness). This does not 
affect int, string, complex and collection types, but affects double. The 
solution is easy and I'm providing it both inline and as a patch. It has been  
tested on Windows and transmited MBytes of collections/comples 
types/ints/doubles etc. between Java and C++.
Here is the solution, provided both inline and as 
"additional_thrift_cpp_visual_studio_2008_and_2010_endians_patch(concerning_ticket_1123_and_possibly_1031_patches).patch".
 To use this patch, just make sure that the main, 
"thrift_msvc_client_and_server.patch", is already applied.

{code:title=TProtocol.h|borderStyle=solid}

//around line 97 of TProtocol.h

//#if __BYTE_ORDER == __BIG_ENDIAN
#if __BYTE_ORDER == __BIG_ENDIAN && !defined(WIN32)

//around line 118 of TProtocol.h
//#elif __BYTE_ORDER == __LITTLE_ENDIAN
#elif __BYTE_ORDER == __LITTLE_ENDIAN || !defined(WIN32)

{code} 


  was (Author: dragan.okiljevic):
To use this patch for client&server C++ support in Visual Studion 2008 and 
2010 environment (while waiting for it's improved version from issue 
THRIFT-1031 which is still under development and currently supports client side 
only) you need to make two more smaller changes, and your Win C++ Thrift 
powered project will work like a charm.

These interventions are needed for THRIFT-1123 and possibly THRIFT-1031

1. C++ code generated by Thrift compiler have compile errors if you define 
enums (some ambigious STL iterator as interpreted in Visual Studio) in .thrift 
file. The solution is easy and published as THRIFT-1139.

2. When communicating between WIN32 client and servers on one side and other 
implementation such as Java on the other side, double values are not correctly 
interpreted as current C++ Thrift implementation don't recognise WIN32 
environmant and decides to use wrong byte order (endianness). This does not 
affect int, string, complex and collection types, but affects double. The 
solution is easy and I'm providing it both inline and as a patch. It has been  
tested on Windows and transmited MBytes of collections/comples 
types/ints/doubles etc. between Java and C++.
Here is the solution, provided both inline and as 
"thrift_cpp_visual_studio_2008_and_2010_endians_patch(concerning_ticket_1123_and_possibly_1031).patch".
 To use this patch, just make sure that the main, 
"thrift_msvc_client_and_server.patch", is already applied.

{code:title=TProtocol.h|borderStyle=solid}

//around line 97 of TProtocol.h

//#if __BYTE_ORDER == __BIG_ENDIAN
#if __BYTE_ORDER == __BIG_ENDIAN && !defined(WIN32)

//around line 118 of TProtocol.h
//#elif __BYTE_ORDER == __LITTLE_ENDIAN
#elif __BYTE_ORDER == __LITTLE_ENDIAN || !defined(WIN32)

{code} 

  
> Patch to compile Thrift server and client for vc++ 9.0 and 10.0
> ---
>
> Key: THRIFT-1123
> URL: https://issues.apache.org/jira/browse/THRIFT-1123
> Project: Thrift
>  Issue Type: Improvement
>  Components: C++ - Library
> Environment: Windows XP 32bit, vc++ 9.0, 10.0
>Reporter: Dragan Okiljevic
>Priority: Trivial
> Fix For: 0.7
>
> Attachments: thrift_msvc_client_and_server.patch
>
>
> Extension of THRIFT-1031 patch published by James Dickson
> This patch is intended to provide Thrift C/C++ functionality on WIN32 
> platforms.
> The implementation is built on top of the patch "Patch to compile Thrift for 
> vc++ 9.0 and 10.0" by James Dickson published as THRIFT-1031. I just used 
> this code and ported more Thrieft C/C++ to WIN32 and added them to original 
> VC projects created in THRIFT-1031.
> I express my gratitude to Mr. Dickson as his post gave me the roadmap how to 
> do the additi

[jira] [Commented] (THRIFT-1123) Patch to compile Thrift server and client for vc++ 9.0 and 10.0

2011-04-19 Thread Dragan Okiljevic (JIRA)

[ 
https://issues.apache.org/jira/browse/THRIFT-1123?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13021475#comment-13021475
 ] 

Dragan Okiljevic commented on THRIFT-1123:
--

To use this patch for client&server C++ support in Visual Studion 2008 and 2010 
environment (while waiting for it's improved version from issue THRIFT-1031 
which is still under development and currently supports client side only) you 
need to make two more smaller changes, and your Win C++ Thrift powered project 
will work like a charm.

These interventions are needed for THRIFT-1123 and possibly THRIFT-1031

1. C++ code generated by Thrift compiler have compile errors if you define 
enums (some ambigious STL iterator as interpreted in Visual Studio) in .thrift 
file. The solution is easy and published as THRIFT-1139.

2. When communicating between WIN32 client and servers on one side and other 
implementation such as Java on the other side, double values are not correctly 
interpreted as current C++ Thrift implementation don't recognise WIN32 
environmant and decides to use wrong byte order (endianness). This does not 
affect int, string, complex and collection types, but affects double. The 
solution is easy and I'm providing it both inline and as a patch. It has been  
tested on Windows and transmited MBytes of collections/comples 
types/ints/doubles etc. between Java and C++.
Here is the solution, provided both inline and as 
"thrift_cpp_visual_studio_2008_and_2010_endians_patch(concerning_ticket_1123_and_possibly_1031).patch".
 To use this patch, just make sure that the main, 
"thrift_msvc_client_and_server.patch", is already applied.

{code:title=TProtocol.h|borderStyle=solid}

//around line 97 of TProtocol.h

//#if __BYTE_ORDER == __BIG_ENDIAN
#if __BYTE_ORDER == __BIG_ENDIAN && !defined(WIN32)

//around line 118 of TProtocol.h
//#elif __BYTE_ORDER == __LITTLE_ENDIAN
#elif __BYTE_ORDER == __LITTLE_ENDIAN || !defined(WIN32)

{code} 


> Patch to compile Thrift server and client for vc++ 9.0 and 10.0
> ---
>
> Key: THRIFT-1123
> URL: https://issues.apache.org/jira/browse/THRIFT-1123
> Project: Thrift
>  Issue Type: Improvement
>  Components: C++ - Library
> Environment: Windows XP 32bit, vc++ 9.0, 10.0
>Reporter: Dragan Okiljevic
>Priority: Trivial
> Fix For: 0.7
>
> Attachments: thrift_msvc_client_and_server.patch
>
>
> Extension of THRIFT-1031 patch published by James Dickson
> This patch is intended to provide Thrift C/C++ functionality on WIN32 
> platforms.
> The implementation is built on top of the patch "Patch to compile Thrift for 
> vc++ 9.0 and 10.0" by James Dickson published as THRIFT-1031. I just used 
> this code and ported more Thrieft C/C++ to WIN32 and added them to original 
> VC projects created in THRIFT-1031.
> I express my gratitude to Mr. Dickson as his post gave me the roadmap how to 
> do the additional changes, that I hope, would be useful for the rest of the 
> community too.
> Besides client capabilities enabled in THRIFT-1031, the library can now be 
> used for building Thrift servers and using concurrency features. The dir/file 
> structure from THRIFT-1031 and usage of Config.h header for providing support 
> for both WIN32 and *NIX remains.
> The implementation was tested briefly on MSVC2008, MSVC2010 and Ubuntu, 
> communicating between C/C++ clients and servers and Java clients and servers. 
> As the author needs all of this functionality for one of his projects, the 
> testing and debugging will continue.
> Revision 1086435 from March, 28, 2011. was used for development and creation 
> of patch, but it should be possible to apply it on current trunk revision as 
> long as no changes are made to patched files in trunk.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira