Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit f62c76f

Browse files
committed
Merge pull request linkerd#103 from BuoyantIO/rmars/upgrade-finagle
Upgrade Finagle to 6.33.0
2 parents 0442437 + b5e83d8 commit f62c76f

File tree

6 files changed

+10
-63
lines changed

6 files changed

+10
-63
lines changed

k8s/src/main/scala/io/buoyant/k8s/EndpointsNamer.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ object master {
4848
log.debug("building %s client to %s", label, name)
4949
val client = (masterTls(), masterUnsafe()) match {
5050
case (false, _) => Http.client
51-
case (true, true) => Http.client.withTlsWithoutValidation()
51+
case (true, true) => Http.client.withTlsWithoutValidation
5252
case (true, _) => Http.client.withTls(setHost.host)
5353
}
5454
val service = client

linkerd/namer/k8s/src/main/scala/io/l5d/k8s.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ class k8s(val params: Stack.Params) extends NamerInitializer {
110110

111111
val client = (params[k8s.Tls], params[k8s.Tls.WithoutValidation]) match {
112112
case (k8s.Tls(false), _) => Http.client
113-
case (_, k8s.Tls.WithoutValidation(true)) => Http.client.withTlsWithoutValidation()
113+
case (_, k8s.Tls.WithoutValidation(true)) => Http.client.withTlsWithoutValidation
114114
case _ => Http.client.withTls(setHost.host)
115115
}
116116

linkerd/protocol/thrift/src/main/scala/io/buoyant/linkerd/protocol/ThriftInitializer.scala

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ package io.buoyant.linkerd
22
package protocol
33

44
import com.twitter.finagle.Path
5+
import com.twitter.finagle.Thrift.param
56
import io.buoyant.router.{Thrift, RoutingFactory}
67

78
class ThriftInitializer extends ProtocolInitializer {
@@ -20,7 +21,7 @@ class ThriftInitializer extends ProtocolInitializer {
2021
.configured(Server.Port(4114))
2122

2223
val Framed = Parsing.Param.Boolean("thriftFramed") { framed =>
23-
Thrift.param.Framed(framed)
24+
param.Framed(framed)
2425
}
2526

2627
val MethodInDst = Parsing.Param.Boolean("thriftMethodInDst") { methodInDst =>

project/Deps.scala

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,15 @@ object Deps {
44

55
// process lifecycle
66
val twitterServer =
7-
("com.twitter" %% "twitter-server" % "1.16.0").
7+
("com.twitter" %% "twitter-server" % "1.18.0").
88
exclude("com.twitter", "finagle-zipkin_2.11")
99

1010
def twitterUtil(mod: String) =
11-
"com.twitter" %% s"util-$mod" % "6.30.0"
11+
"com.twitter" %% s"util-$mod" % "6.32.0"
1212

1313
// networking
1414
def finagle(mod: String) =
15-
"com.twitter" %% s"finagle-$mod" % "6.31.0"
15+
"com.twitter" %% s"finagle-$mod" % "6.33.0"
1616

1717
// Jackson (parsing)
1818
val jacksonVersion = "2.4.4"

project/plugins.sbt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,4 @@ addSbtPlugin("com.eed3si9n" % "sbt-assembly" % "0.14.1")
1414
addSbtPlugin("se.marcuslonnberg" % "sbt-docker" % "1.2.0")
1515

1616
// scrooge
17-
addSbtPlugin("com.twitter" %% "scrooge-sbt-plugin" % "4.1.0")
17+
addSbtPlugin("com.twitter" %% "scrooge-sbt-plugin" % "4.5.0")

router/thrift/src/main/scala/io/buoyant/router/Thrift.scala

Lines changed: 2 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,6 @@ object Thrift extends Router[ThriftClientRequest, Array[Byte]]
1414
with FinagleServer[Array[Byte], Array[Byte]] {
1515

1616
object param {
17-
/**
18-
* XXX this should be removed once finagle subsumes this:
19-
* https://github.com/twitter/finagle/pull/451
20-
*/
21-
case class Framed(enabled: Boolean)
22-
implicit object Framed extends Stack.Param[Framed] {
23-
val default = Framed(true)
24-
}
25-
2617
case class MethodInDst(enabled: Boolean)
2718
implicit object MethodInDst extends Stack.Param[MethodInDst] {
2819
val default = MethodInDst(false)
@@ -53,20 +44,13 @@ object Thrift extends Router[ThriftClientRequest, Array[Byte]]
5344
}
5445
}
5546

56-
/**
57-
* @todo framed should be a Stack.Param
58-
*/
5947
case class Router(
6048
pathStack: Stack[ServiceFactory[ThriftClientRequest, Array[Byte]]] = Router.pathStack,
6149
boundStack: Stack[ServiceFactory[ThriftClientRequest, Array[Byte]]] = Router.boundStack,
62-
client0: StackClient[ThriftClientRequest, Array[Byte]] = Router.client,
50+
client: StackClient[ThriftClientRequest, Array[Byte]] = Router.client,
6351
params: Stack.Params = Router.defaultParams
6452
) extends StdStackRouter[ThriftClientRequest, Array[Byte], Router] {
6553

66-
val param.Framed(framed) = params[param.Framed]
67-
protected val client =
68-
FinagleThrift.client.copy(framed = framed).withStack(client0.stack)
69-
7054
protected def copy1(
7155
pathStack: Stack[ServiceFactory[ThriftClientRequest, Array[Byte]]] = this.pathStack,
7256
boundStack: Stack[ServiceFactory[ThriftClientRequest, Array[Byte]]] = this.boundStack,
@@ -86,45 +70,7 @@ object Thrift extends Router[ThriftClientRequest, Array[Byte]]
8670
def factory(): ServiceFactory[ThriftClientRequest, Array[Byte]] =
8771
router.factory()
8872

89-
object Server {
90-
val stack: Stack[ServiceFactory[Array[Byte], Array[Byte]]] =
91-
FinagleThrift.Server.stack
92-
93-
val defaultParams: Stack.Params =
94-
StackServer.defaultParams +
95-
ProtocolLibrary("thrift")
96-
}
97-
98-
/** Wraps Finagle-Thrift's server type with support for the [[param.Framed]] Param. */
99-
case class Server(
100-
underlying: FinagleThrift.Server = FinagleThrift.Server(Server.stack)
101-
) extends StackServer[Array[Byte], Array[Byte]] {
102-
def stack = underlying.stack
103-
def params = underlying.params
104-
def framed = params[param.Framed].enabled
105-
106-
override def withStack(stack: Stack[ServiceFactory[Array[Byte], Array[Byte]]]): Server =
107-
copy(underlying = underlying.withStack(stack))
108-
109-
override def withParams(ps: Stack.Params): Server =
110-
copy(underlying = underlying.withParams(ps))
111-
112-
override def configured[P: Stack.Param](p: P): Server =
113-
withParams(params + p)
114-
115-
override def configured[P](psp: (P, Stack.Param[P])): Server = {
116-
val (p, sp) = psp
117-
configured(p)(sp)
118-
}
119-
120-
def serve(
121-
addr: SocketAddress,
122-
factory: ServiceFactory[Array[Byte], Array[Byte]]
123-
): ListeningServer =
124-
underlying.copy(framed = framed).serve(addr, factory)
125-
}
126-
127-
val server = Server()
73+
val server = FinagleThrift.Server()
12874

12975
def serve(
13076
addr: SocketAddress,

0 commit comments

Comments
 (0)