Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Thrift end-to-end passes

  • Loading branch information...
commit aa3b9fd249b6a1bbb30e4ac472ea7a234e79d021 1 parent b964921
Nick Kallen authored
View
17 finagle-core/src/main/scala/com/twitter/finagle/builder/ServerBuilder.scala
@@ -39,7 +39,6 @@ case class ServerBuilder[Req <: AnyRef, Res <: AnyRef](
_name: Option[String],
_sendBufferSize: Option[Int],
_recvBufferSize: Option[Int],
- _pipelineFactory: Option[ChannelPipelineFactory],
@gseitz
gseitz added a note

Just wondering, what was the reasoning behind removing the pipelineFactory field?

it's a codec concern. write/enhance a codec if you need to muck with the pipeline. you can do it this way: http://goo.gl/QVAAG

@gseitz
gseitz added a note

Right, Thanks for the clarification.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
_service: Option[Service[Req, Res]],
_bindTo: Option[SocketAddress],
_logger: Option[Logger],
@@ -57,7 +56,6 @@ case class ServerBuilder[Req <: AnyRef, Res <: AnyRef](
None, // name
None, // sendBufferSize
None, // recvBufferSize
- None, // pipelineFactory
None, // service
None, // bindTo
None, // logger
@@ -79,9 +77,6 @@ case class ServerBuilder[Req <: AnyRef, Res <: AnyRef](
def sendBufferSize(value: Int) = copy(_sendBufferSize = Some(value))
def recvBufferSize(value: Int) = copy(_recvBufferSize = Some(value))
- def pipelineFactory(value: ChannelPipelineFactory) =
- copy(_pipelineFactory = Some(value))
-
def service[Req <: AnyRef, Rep <: AnyRef](service: Service[Req, Rep]) =
copy(_service = Some(service))
@@ -106,13 +101,8 @@ case class ServerBuilder[Req <: AnyRef, Res <: AnyRef](
copy(_maxQueueDepth = Some(max))
def build(): Channel = {
- val (codec, pipelineFactory) = (_codec, _pipelineFactory) match {
- case (None, _) =>
- throw new IncompleteSpecification("No codec was specified")
- case (_, None) =>
- throw new IncompleteSpecification("No pipeline was specified")
- case (Some(codec), Some(pipeline)) =>
- (codec, pipeline)
+ val codec = _codec.getOrElse {
+ throw new IncompleteSpecification("No codec was specified")
}
val bs = new ServerBootstrap(_channelFactory getOrElse defaultChannelFactory)
@@ -150,9 +140,6 @@ case class ServerBuilder[Req <: AnyRef, Res <: AnyRef](
// pipeline.addLast("stats", new SampleHandler(statsReceiver))
// }
- for ((name, handler) <- pipelineFactory.getPipeline.toMap)
- pipeline.addLast(name, handler)
-
_service.foreach { service =>
pipeline.addLast("service", new ServiceToChannelHandler(service))
}
View
3  finagle-core/src/main/scala/com/twitter/finagle/stats/StatsRepository.scala
@@ -8,6 +8,9 @@ trait ReadableCounter extends Counter {
* An atomic snapshot of summary statistics.
*/
case class Summary(total: Float, count: Int) {
+ /**
+ * Arithmetic mean
+ */
val mean = total / count
}
View
1  .../com/twitter/finagle/thrift/ServiceEndToEnd.scala → .../twitter/finagle/thrift/ServiceEndToEndSpec.scala
@@ -42,6 +42,7 @@ object ServiceEndToEndSpec extends Specification {
val addr = RandomSocket.nextAddress()
val sillyService = new SillyService()
+
val server = ServerBuilder()
.codec(new Thrift)
.service(sillyService)
Please sign in to comment.
Something went wrong with that request. Please try again.