From c604a3c0fee085679967460f50b563a8d58aedf1 Mon Sep 17 00:00:00 2001 From: Hari Shreedharan Date: Thu, 5 Jun 2014 09:17:05 -0700 Subject: [PATCH] SPARK-1729. Optimize imports. --- .../streaming/flume/EventTransformer.scala | 4 ++- .../flume/FlumePollingInputDStream.scala | 30 +++++++++++-------- .../spark/streaming/flume/FlumeUtils.scala | 4 ++- .../flume/FlumePollingReceiverSuite.scala | 19 +++++++----- 4 files changed, 35 insertions(+), 22 deletions(-) diff --git a/external/flume/src/main/scala/org/apache/spark/streaming/flume/EventTransformer.scala b/external/flume/src/main/scala/org/apache/spark/streaming/flume/EventTransformer.scala index 91f6171d57368..75b224afca39b 100644 --- a/external/flume/src/main/scala/org/apache/spark/streaming/flume/EventTransformer.scala +++ b/external/flume/src/main/scala/org/apache/spark/streaming/flume/EventTransformer.scala @@ -18,8 +18,10 @@ package org.apache.spark.streaming.flume import java.io.{ObjectOutput, ObjectInput} -import org.apache.spark.util.Utils + import scala.collection.JavaConversions._ + +import org.apache.spark.util.Utils import org.apache.spark.Logging /** diff --git a/external/flume/src/main/scala/org/apache/spark/streaming/flume/FlumePollingInputDStream.scala b/external/flume/src/main/scala/org/apache/spark/streaming/flume/FlumePollingInputDStream.scala index 2571f2d36f3f1..495f569f6359d 100644 --- a/external/flume/src/main/scala/org/apache/spark/streaming/flume/FlumePollingInputDStream.scala +++ b/external/flume/src/main/scala/org/apache/spark/streaming/flume/FlumePollingInputDStream.scala @@ -16,23 +16,29 @@ */ package org.apache.spark.streaming.flume -import scala.reflect.ClassTag -import org.apache.spark.streaming.StreamingContext -import org.apache.spark.storage.StorageLevel -import org.apache.spark.streaming.dstream.ReceiverInputDStream -import org.apache.spark.streaming.receiver.Receiver -import org.apache.spark.Logging + +import java.io.{ObjectOutput, ObjectInput, Externalizable} import java.net.InetSocketAddress +import java.nio.ByteBuffer import java.util.concurrent.{TimeUnit, Executors} + +import scala.collection.JavaConversions._ +import scala.collection.mutable +import scala.reflect.ClassTag + +import com.google.common.util.concurrent.ThreadFactoryBuilder import org.apache.avro.ipc.NettyTransceiver import org.apache.avro.ipc.specific.SpecificRequestor -import org.apache.spark.flume.{SparkSinkEvent, SparkFlumeProtocol} import org.jboss.netty.channel.socket.nio.NioClientSocketChannelFactory -import com.google.common.util.concurrent.ThreadFactoryBuilder -import java.io.{ObjectOutput, ObjectInput, Externalizable} -import java.nio.ByteBuffer -import scala.collection.JavaConversions._ -import scala.collection.mutable + +import org.apache.spark.Logging +import org.apache.spark.flume.{SparkSinkEvent, SparkFlumeProtocol} +import org.apache.spark.storage.StorageLevel +import org.apache.spark.streaming.StreamingContext +import org.apache.spark.streaming.dstream.ReceiverInputDStream +import org.apache.spark.streaming.receiver.Receiver + + class FlumePollingInputDStream[T: ClassTag]( @transient ssc_ : StreamingContext, diff --git a/external/flume/src/main/scala/org/apache/spark/streaming/flume/FlumeUtils.scala b/external/flume/src/main/scala/org/apache/spark/streaming/flume/FlumeUtils.scala index ca0059ff04dab..2ff8ce2a77d2d 100644 --- a/external/flume/src/main/scala/org/apache/spark/streaming/flume/FlumeUtils.scala +++ b/external/flume/src/main/scala/org/apache/spark/streaming/flume/FlumeUtils.scala @@ -17,11 +17,13 @@ package org.apache.spark.streaming.flume +import java.net.InetSocketAddress + import org.apache.spark.storage.StorageLevel import org.apache.spark.streaming.StreamingContext import org.apache.spark.streaming.api.java.{JavaReceiverInputDStream, JavaStreamingContext} import org.apache.spark.streaming.dstream.ReceiverInputDStream -import java.net.InetSocketAddress + object FlumeUtils { /** diff --git a/external/flume/src/test/scala/org/apache/spark/streaming/flume/FlumePollingReceiverSuite.scala b/external/flume/src/test/scala/org/apache/spark/streaming/flume/FlumePollingReceiverSuite.scala index 404759f291f39..dc64405872a2d 100644 --- a/external/flume/src/test/scala/org/apache/spark/streaming/flume/FlumePollingReceiverSuite.scala +++ b/external/flume/src/test/scala/org/apache/spark/streaming/flume/FlumePollingReceiverSuite.scala @@ -18,19 +18,22 @@ */ package org.apache.spark.streaming.flume -import org.apache.spark.streaming.{TestSuiteBase, TestOutputStream, StreamingContext} -import org.apache.spark.storage.StorageLevel +import java.net.InetSocketAddress +import java.util.concurrent.{Callable, ExecutorCompletionService, Executors} + +import scala.collection.JavaConversions._ import scala.collection.mutable.{SynchronizedBuffer, ArrayBuffer} -import org.apache.spark.streaming.util.ManualClock -import org.apache.flume.channel.MemoryChannel + import org.apache.flume.Context +import org.apache.flume.channel.MemoryChannel import org.apache.flume.conf.Configurables -import org.apache.spark.flume.sink.{SparkSinkConfig, SparkSink} -import scala.collection.JavaConversions._ import org.apache.flume.event.EventBuilder + +import org.apache.spark.flume.sink.{SparkSinkConfig, SparkSink} +import org.apache.spark.storage.StorageLevel import org.apache.spark.streaming.dstream.ReceiverInputDStream -import java.net.InetSocketAddress -import java.util.concurrent.{Callable, ExecutorCompletionService, Executors} +import org.apache.spark.streaming.util.ManualClock +import org.apache.spark.streaming.{TestSuiteBase, TestOutputStream, StreamingContext} class FlumePollingReceiverSuite extends TestSuiteBase {