Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

cleaned imports

  • Loading branch information...
commit fb750657c0bb28d6b317f71e8e4ec65551977b37 1 parent f34e921
Nick Kallen authored
View
6 src/main/scala/com/twitter/finagle/channel/BootstrapBroker.scala
@@ -1,10 +1,6 @@
package com.twitter.finagle.channel
-import org.jboss.netty.bootstrap.ClientBootstrap
-import org.jboss.netty.channel.{Channels, Channel, MessageEvent}
-
-import com.twitter.finagle.util.{Ok, Error}
-import com.twitter.finagle.util.Conversions._
+import org.jboss.netty.channel.{Channels, Channel}
class BootstrapBroker(bootstrap: BrokerClientBootstrap) extends ConnectingChannelBroker {
if (bootstrap.getOption("remoteAddress") eq null)
View
4 src/main/scala/com/twitter/finagle/channel/Broker.scala
@@ -4,11 +4,9 @@ import java.util.concurrent.TimeUnit
import java.net.SocketAddress
import org.jboss.netty.channel.{
- Channel, ChannelFuture, MessageEvent,
- ChannelLocal, DefaultChannelFuture}
+ MessageEvent, DefaultChannelFuture}
import org.jboss.netty.util.HashedWheelTimer
-import com.twitter.finagle.util.{Ok, Error, Cancelled}
import com.twitter.finagle.util.Conversions._
sealed abstract class Reply
View
4 src/main/scala/com/twitter/finagle/channel/BrokerAdapter.scala
@@ -1,10 +1,8 @@
package com.twitter.finagle.channel
import java.util.concurrent.atomic.AtomicReference
-
-import org.jboss.netty.channel._
-
import com.twitter.finagle.util.Conversions._
+import org.jboss.netty.channel._
class BrokerAdapter extends SimpleChannelUpstreamHandler {
val currentReplyFuture = new AtomicReference[ReplyFuture](null)
View
10 src/main/scala/com/twitter/finagle/channel/BrokeredChannel.scala
@@ -1,15 +1,11 @@
package com.twitter.finagle.channel
-import java.util.concurrent.LinkedBlockingQueue
-import java.util.concurrent.atomic.AtomicInteger
import java.nio.channels.NotYetConnectedException
-
+import com.twitter.finagle.util.Conversions._
import org.jboss.netty.channel._
import org.jboss.netty.channel.local.LocalAddress
import com.twitter.finagle.util.{Ok, Error, Cancelled, Serialized}
-import com.twitter.finagle.util.Conversions._
-
class BrokeredChannel(
factory: BrokeredChannelFactory,
pipeline: ChannelPipeline,
@@ -84,11 +80,11 @@ class BrokeredChannel(
waitingForReply = Some(next)
proxyMessages(next)
}
-
+
case Error(cause) =>
Channels.fireExceptionCaught(this, cause)
waitingForReply = None
-
+
case Cancelled =>
// XXXTODO
}
View
4 src/main/scala/com/twitter/finagle/channel/ChannelPool.scala
@@ -1,12 +1,10 @@
package com.twitter.finagle.channel
import collection.mutable.Queue
-
-import org.jboss.netty.bootstrap.ClientBootstrap
+import com.twitter.finagle.util.Conversions._
import org.jboss.netty.channel.{Channels, Channel}
import java.util.concurrent.ConcurrentLinkedQueue
-import com.twitter.finagle.util.Conversions._
import com.twitter.finagle.util._
class ChannelPool(clientBootstrap: BrokerClientBootstrap) extends Serialized
View
3  src/main/scala/com/twitter/finagle/channel/ConnectingChannelBroker.scala
@@ -1,8 +1,5 @@
package com.twitter.finagle.channel
-import java.nio.channels.ClosedChannelException
-
-import org.jboss.netty.bootstrap.ClientBootstrap
import org.jboss.netty.channel._
import com.twitter.finagle.util.{Ok, Error, Cancelled}
View
14 src/main/scala/com/twitter/finagle/channel/LoadedBroker.scala
@@ -1,18 +1,10 @@
package com.twitter.finagle.channel
import scala.util.Random
-import scala.collection.mutable.HashMap
-import scala.collection.JavaConversions._
-
-import java.util.concurrent.atomic.AtomicInteger
-import java.util.concurrent.ConcurrentHashMap
-
import org.jboss.netty.channel.MessageEvent
-
-import com.twitter.util.{Time, Duration}
-import com.twitter.util.TimeConversions._
-import com.twitter.finagle.util._
import com.twitter.finagle.util.Conversions._
+import com.twitter.util.Time
+import com.twitter.finagle.util._
/**
* This is F-bounded to ensure that we have a homogenous set of
@@ -91,7 +83,7 @@ class FailureAccruingLoadedBroker(
}
}
}
-
+
}
class LeastLoadedBroker[A <: LoadedBroker[A]](endpoints: Seq[A]) extends Broker {
View
4 src/main/scala/com/twitter/finagle/channel/PoolingBroker.scala
@@ -1,9 +1,5 @@
package com.twitter.finagle.channel
-import java.nio.channels.ClosedChannelException
-
-import com.twitter.finagle.util.{Error, Ok, Cancelled}
-import com.twitter.finagle.util.Conversions._
import org.jboss.netty.channel._
class PoolingBroker(channelPool: ChannelPool) extends ConnectingChannelBroker {
View
7 src/main/scala/com/twitter/finagle/channel/RetryingBroker.scala
@@ -6,11 +6,8 @@ import org.jboss.netty.channel.{
Channels, Channel, DownstreamMessageEvent,
MessageEvent, ChannelFuture}
import org.jboss.netty.util.{HashedWheelTimer, TimerTask, Timeout}
-
-import com.twitter.finagle.util.{Cancelled, Error, Ok}
import com.twitter.finagle.util.Conversions._
-
-import com.twitter.util.TimeConversions._
+import com.twitter.finagle.util.{Cancelled, Error, Ok}
import com.twitter.util.Duration
trait RetryingBrokerBase extends Broker {
@@ -74,7 +71,7 @@ class ExponentialBackoffRetryingBroker(val underlying: Broker, initial: Duration
def retryFuture(channel: Channel) = {
val future = Channels.future(channel)
-
+
timer.newTimeout(new TimerTask {
def run(to: Timeout) {
ExponentialBackoffRetryingBroker.this.delay *= multiplier
Please sign in to comment.
Something went wrong with that request. Please try again.