Commit Graph

30 Commits

Author SHA1 Message Date
Christopher Piro
aa93451dbf [thrift] iolists and binaries in Erlang
Summary: three related changes:
 * for numeric types in tBinaryProtocol call effectful_write with binary(), not [char()]
 * tBinaryProtocol:writeString now takes either [char()], iolist(), or binary() ... now you can use any of the three where a Thrift string is required
 * tBufferedTransport now buffers by building an iolist() rather than Buffer++Data.  zomg.

Reviewed By: eletuchy

Test Plan: everything seems to work as usual, and binary() works as expected

Revert Plan: ok


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665447 13f79535-47bb-0310-9956-ffa450edef68
2008-01-30 01:39:01 +00:00
Christopher Piro
21db52de16 [thrift] fix thrift_logger.erl when show_pid option is enabled
Summary: this gets rid of a lot of messy useless output every time the error logger prints something

Reviewed By: eletuchy

Test Plan: works as expected

Revert Plan: ok

Other Notes: contributed by Todd Lipcon (todd@amiestreet.com)


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665422 13f79535-47bb-0310-9956-ffa450edef68
2008-01-14 05:54:50 +00:00
Christopher Piro
26484fb7b1 [thrift] in erlang add {nodelay, true} and {reuseaddr, true} to gen_tcp socket options
Summary: for parity with the C++ implementation

Reviewed By: eletuchy

Test Plan: ok

Revert Plan: ok

Other Notes: contributed by Todd Lipcon (todd@amiestreet.com)


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665415 13f79535-47bb-0310-9956-ffa450edef68
2008-01-08 03:14:19 +00:00
Christopher Piro
7ab31e4fd1 [thrift] add show_pid option to thrift.app.src (Erlang)
Summary: we've been using this option in our apps but we never added it to thrift's own config

Reviewed By: eletuchy

Test Plan: ok

Other Notes: contributed by Jason Ganetsky (jason@amiestreet.com)


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665411 13f79535-47bb-0310-9956-ffa450edef68
2008-01-04 00:21:18 +00:00
Christopher Piro
a89cd7b03e [thrift] squelch crash reports in Erlang R12B-0
Summary: there's a new format for errors in R12B-0, so don't echo a crash report if it matches the new one

Reviewed By: eletuchy

Test Plan: completely unnecessary

Revert Plan: ok


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665400 13f79535-47bb-0310-9956-ffa450edef68
2007-12-19 00:00:39 +00:00
Christopher Piro
de11d85211 [thrift] gut Erlang exception handling
Summary: * move type field to tException from subclasses
          * add backtrace to tException
          * add oop:is_a
          * on exit, wrap exceptions in {thrift_exception, E} ... otherwise can't distinguish e.g. exit:{{tBinProtException, {tException, ...}}, Stack} vs. exit:{tBinProtException, {tException, ...} -- I hate erlang
          * all throws/exits to tException:throw which does the wrapping described above

Reviewed By: eletuchy

Test Plan: been using this code on my live server ^_^

Revert: OK


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665350 13f79535-47bb-0310-9956-ffa450edef68
2007-11-18 02:10:20 +00:00
Christopher Piro
10522a7f2b [thrift] fix-ups to Erlang thrift_logger
Summary:
 * no ?INFO for every oop:call ... way too expensive
 * unfactor symbol/1 ... it was that way for a reason apparently
 * upped crash report depth to 3

Reviewed By: eletuchy

Test Plan: /much/ less CPU eaten by logging

Revert Plan: ok


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665343 13f79535-47bb-0310-9956-ffa450edef68
2007-11-15 06:26:31 +00:00
Christopher Piro
c2e37c7a61 [thrift] change up Erlang crash reports, cleanups in t{,Binary}Protocol
Summary: crash reports aren't too important so don't be so verbose -- all the pertinent info shows up elsewhere anyway.  refactor while we're at it.

Reviewed By: eletuchy

Test Plan: ok

Revert Plan: ok


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665342 13f79535-47bb-0310-9956-ffa450edef68
2007-11-15 06:26:30 +00:00
Christopher Piro
53b6ef670c [thrift] whole ball of whitespace normalizations in Erlang
Summary: ill-formatted comments, trailing whitespace, and (gasp) tabs: all pwned.  better now than later.

Reviewed By: eletuchy

Test Plan: ok

Revert Plan: ok


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665339 13f79535-47bb-0310-9956-ffa450edef68
2007-11-15 06:26:28 +00:00
Christopher Piro
a1650fe55c [thrift] make open and close `effectful' in Erlang client
Summary: make uniform across all tTransports.  god i want `effectful' to go away dead.  soon.

Reviewed By: eletuchy

Test Plan: ok

Revert Plan: ok


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665338 13f79535-47bb-0310-9956-ffa450edef68
2007-11-15 06:26:27 +00:00
Christopher Piro
3121c8271f [thrift] Erlang client receive socket options
Summary: we want {active, false}, etc. for client sockets.  make it so.

Reviewed By: eletuchy

Test Plan: ok

Revert Plan: ok


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665337 13f79535-47bb-0310-9956-ffa450edef68
2007-11-15 06:26:26 +00:00
Christopher Piro
0d5cd8a6b9 [thrift] Erlang makefile includes to terse messages
Summary: filter out compiler path and flags and cruft

Reviewed By: eletuchy

Test Plan: ok

Revert Plan: ok


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665336 13f79535-47bb-0310-9956-ffa450edef68
2007-11-15 02:20:59 +00:00
Christopher Piro
6c74062262 [thrift] convert oop.erl errors and infos to macros
Summary: old-style error messages get switched over

Reviewed By: eletuchy

Test Plan: ok

Revert Plan: ok


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665335 13f79535-47bb-0310-9956-ffa450edef68
2007-11-15 02:20:58 +00:00
Christopher Piro
6c46f1a8c9 [thrift] gut Erlang Thrift configuration; start using get_env
Summary: I patterned some config stuff after iserve, but Erlang's built-in stuff is better

Reviewed By: gopher

Test Plan: works with recent ch server

Revert Plan: ok

Other Notes: default config given in thrift.app


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665307 13f79535-47bb-0310-9956-ffa450edef68
2007-10-23 09:47:15 +00:00
Christopher Piro
3b63fe4d3c [thrift] clean up error logging in Erlang
Summary: pushed all formatting out of thrift_error_logger.erl, reenable crash logs, standardize

Reviewed By: eletuchy

Test Plan: works with latest ch server


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665305 13f79535-47bb-0310-9956-ffa450edef68
2007-10-19 21:34:31 +00:00
Christopher Piro
524c3ecef7 [thrift] make thrift_logger.erl more robust against badmatch
Summary: more robust logic theres

Reviewed By: eletuchy

Test Plan: ok

Revert Plan: ok

Other Notes: the precommit hooks should forbid out-of-towners from being cited as reviewers


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665301 13f79535-47bb-0310-9956-ffa450edef68
2007-10-13 05:15:33 +00:00
Christopher Piro
b6dcd2b595 [thrift] retool oop.erl, fix tBufferedTransportFactory.erl
Summary: oop.erl used to assume that an undef or function_clause meant a method wasn't defined, but sometimes a method does exist and an undef happens while it's executing.

Case in point, getTransport in tBufferedTransportFactory totally didn't work and instead of exiting, oop.erl fell back silently to tTransportFactory, so everywhere I thought I was talking to tBufferedTransport, I was talking directly to the tSocket.  borkborkbork.

Blame: all me baby

Reviewed By: eletuchy

Test Plan: channel server works

Revert Plan: ok


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665299 13f79535-47bb-0310-9956-ffa450edef68
2007-10-13 01:11:46 +00:00
Christopher Piro
efd5eec211 [thrift] Erlang Thrift changes, take 3
Summary: svn ci missed a bunch of paths ... blew away the whole thing and copied from the git repo.  this is getting ridiculous.


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665285 13f79535-47bb-0310-9956-ffa450edef68
2007-10-02 01:33:37 +00:00
Christopher Piro
68940295e1 [thrift] otpification and sane configuration for Erlang Thrift
Summary: a small victory in the neverending quest of OTPifying this binding -- search for config files in ./conf/ (relative to the cwd of the emulator).  for example, when you start the channel server, ./conf/{channel,thrift}.conf should exist.  better than having to recompile to change a configuration ... reconfig should take care of that in running code.

Test Plan: works with channel server


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665284 13f79535-47bb-0310-9956-ffa450edef68
2007-10-02 00:35:12 +00:00
Christopher Piro
42fe4b9a3e [thrift] revert 61883
Summary: i suck at git/svn ... commited not enough and with no commitlog

Notes: YOU'RE DOING IT WRONG


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665283 13f79535-47bb-0310-9956-ffa450edef68
2007-10-02 00:24:07 +00:00
Christopher Piro
c7fd7639b7 Merge branch 'otp'
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665282 13f79535-47bb-0310-9956-ffa450edef68
2007-10-02 00:05:04 +00:00
Christopher Piro
93a0664aff [thrift] spruce up Erlang binding for tonight's release
Summary:
 * got rid of most of the otp_base jonx ... save that for a future release unfortunately
 * cleaned up the tutorial server, added -erl to tutorial.thrift's shebang
 * made better README and TODO

Test Plan: checked out a copy, read my directions, built and ran the tutorial, and pretended that it didn't blow


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665273 13f79535-47bb-0310-9956-ffa450edef68
2007-09-18 06:23:33 +00:00
Christopher Piro
fa0c857370 [thrift] erlang: log more tTransportExceptions
Summary: all tTEs were being filtered from the logs; now just tTEs that come from connections closing are suppressed

Test Plan: logs my bug in channel server :)

Notes: adds logic to thrift_logger, not removes (bad news bears)


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665199 13f79535-47bb-0310-9956-ffa450edef68
2007-08-11 01:15:57 +00:00
Christopher Piro
ee5988444f [thrift] handle timeouts and other errors gracefully (Erlang)
Reviewed By: iproctor

Test Plan: tutorial, channel

Revert Plan: ok


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665190 13f79535-47bb-0310-9956-ffa450edef68
2007-08-03 23:34:55 +00:00
Christopher Piro
c3c6c0c9c4 [thrift] make Erlang server noisy when handler has error
Summary: generate an error message at the server ... before only the client got the error

Reviewed By: iproctor

Test Plan: tutorial, channel server

Revert Plan: ok


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665187 13f79535-47bb-0310-9956-ffa450edef68
2007-08-01 23:42:12 +00:00
Christopher Piro
5b3a8f7a8b [thrift] improved error logging and handling for Erlang bindings
Summary:
 * custom, extensible error logger -- show only relevant stuff
 * clean up of errors in developer-supplied handler module
   now gives sane error messages and doesn't crash whole server
   (introduces tApplicationException_HANDLER_ERROR)
 * more precise catch in tErlProcessor (exits gracefully only if
   transport closes)

Reviewed By: iproctor

Test Plan: tutorial works

Revert Plan: ok


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665186 13f79535-47bb-0310-9956-ffa450edef68
2007-08-01 22:27:37 +00:00
Christopher Piro
5f5fdf3a20 [thrift] maps, lists, sets, and service inheritance for Erlang
Reviewed by: cpiro

Test Plan: tested wit tutorial/tutorial.thrift

Revert Plan: ok


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665175 13f79535-47bb-0310-9956-ffa450edef68
2007-07-25 22:41:00 +00:00
Christopher Piro
ae1f10f8f2 [thrift] misc. Erlang codegen improvements, cleanups
Summary:
 * const/enum namespacing
 * better formatting, less debugging comments in both source and gen-erl/

Notes:
 * in preparation for iproctor's whiz-bang map/list/set support


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665169 13f79535-47bb-0310-9956-ffa450edef68
2007-07-24 04:30:15 +00:00
Christopher Piro
094823a46c [thrift] highly concurrent Erlang goodness
Summary:
 * shim to use object-oriented code as gen_servers
 * high(er) performance Erlang-style server and transport
 * sane packaging based on otp-base, i.e. Makefiles and real structure

Test Plan: tutorial server offers the same (subset of) functionality as previous version

Revert Plan: ok


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665164 13f79535-47bb-0310-9956-ffa450edef68
2007-07-18 00:26:12 +00:00
Christopher Piro
2f5afceeaa [thrift] preliminary Erlang support (initial import)
Summary:
 * missing {list,map,set}s, inheritance is spotty
 * loose source code, plus everything is one process (application / gen_server behavior is forthcoming)
 * codegen is a mess, need t_fp_generator

Test Plan:
 * codegen invoked without -erl generates identical code for test/
 * calculatorHandler plus 'thrift -erl -r tutorial.thrift' more or less works

Revert Plan: ok


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665146 13f79535-47bb-0310-9956-ffa450edef68
2007-06-29 07:17:33 +00:00