File tree Expand file tree Collapse file tree 4 files changed +11
-2
lines changed
linkerd/protocol/thrift/src
main/scala/io/buoyant/linkerd/protocol
test/scala/io/buoyant/linkerd/protocol Expand file tree Collapse file tree 4 files changed +11
-2
lines changed Original file line number Diff line number Diff line change 12
12
requests accepted by a server.
13
13
* Add a ` hostConnectionPool ` client config section to control the number of
14
14
connections maintained to destination hosts.
15
+ * Add a ` attemptTTwitterUpgrade ` thrift client config option to control whether
16
+ thrift protocol upgrade should be attempted.
15
17
16
18
## 0.2.0
17
19
Original file line number Diff line number Diff line change @@ -340,6 +340,8 @@ Thrift also supports additional *client* parameters:
340
340
currently supports `binary` for `TBinaryProtocol` (default) and
341
341
` compact` for `TCompactProtocol`. Typically this setting matches
342
342
the router's servers' `thriftProtocol` param.
343
+ * *attemptTTwitterUpgrade* -- controls whether thrift protocol upgrade should be
344
+ attempted. (default : true)
343
345
344
346
As an example : Here's a thrift router configuration that routes thrift--via
345
347
buffered transport using the TCompactProtocol --from port 4004 to port 5005
Original file line number Diff line number Diff line change @@ -5,7 +5,7 @@ import com.fasterxml.jackson.annotation.JsonIgnore
5
5
import com .twitter .finagle .Path
6
6
import com .twitter .finagle .Stack .Params
7
7
import com .twitter .finagle .Thrift .param
8
- import com .twitter .finagle .Thrift .param .ProtocolFactory
8
+ import com .twitter .finagle .Thrift .param .{ AttemptTTwitterUpgrade , ProtocolFactory }
9
9
import io .buoyant .linkerd .config .Parser
10
10
import io .buoyant .linkerd .config .types .ThriftProtocol
11
11
import io .buoyant .router .{RoutingFactory , Thrift }
@@ -58,10 +58,12 @@ case class ThriftServerConfig(
58
58
59
59
case class ThriftClientConfig (
60
60
thriftFramed : Option [Boolean ],
61
- thriftProtocol : Option [ThriftProtocol ]
61
+ thriftProtocol : Option [ThriftProtocol ],
62
+ attemptTTwitterUpgrade : Option [Boolean ]
62
63
) extends ClientConfig {
63
64
@ JsonIgnore
64
65
override def clientParams : Params = super .clientParams
65
66
.maybeWith(thriftFramed.map(param.Framed (_)))
66
67
.maybeWith(thriftProtocol.map(proto => param.ProtocolFactory (proto.factory)))
68
+ .maybeWith(attemptTTwitterUpgrade.map(AttemptTTwitterUpgrade (_)))
67
69
}
Original file line number Diff line number Diff line change @@ -2,6 +2,7 @@ package io.buoyant.linkerd.protocol
2
2
3
3
import com .fasterxml .jackson .databind .JsonMappingException
4
4
import com .twitter .finagle .Thrift .param
5
+ import com .twitter .finagle .Thrift .param .AttemptTTwitterUpgrade
5
6
import io .buoyant .linkerd .Linker
6
7
import io .buoyant .router .Thrift .param .MethodInDst
7
8
import org .apache .thrift .protocol .TCompactProtocol
@@ -17,6 +18,7 @@ class ThriftInitializerTest extends FunSuite {
17
18
| client:
18
19
| thriftFramed: false
19
20
| thriftProtocol: binary
21
+ | attemptTTwitterUpgrade: false
20
22
| servers:
21
23
| - thriftFramed: true
22
24
| thriftProtocol: compact
@@ -29,6 +31,7 @@ class ThriftInitializerTest extends FunSuite {
29
31
assert(! router.params[param.ProtocolFactory ].protocolFactory.isInstanceOf [TCompactProtocol .Factory ])
30
32
assert(router.servers.head.params[param.Framed ].enabled)
31
33
assert(router.servers.head.params[param.ProtocolFactory ].protocolFactory.isInstanceOf [TCompactProtocol .Factory ])
34
+ assert(! router.params[AttemptTTwitterUpgrade ].upgrade)
32
35
}
33
36
34
37
test(" unsupported thrift protocol" ) {
You can’t perform that action at this time.
0 commit comments