@@ -8,20 +8,20 @@ import org.json4s._
8
8
import org .json4s .native .Serialization
9
9
import scala .collection .Map
10
10
11
- class ScalaRawSocketSender (h: String , p: Int , to: Int , bufCap: Int )
11
+ class ScalaRawSocketSender (h : String , p : Int , to : Int , bufCap : Int )
12
12
extends Sender {
13
- implicit val formats = DefaultFormats + EventSerializer + MapSerializer
13
+ implicit val formats : Formats = DefaultFormats + EventSerializer + MapSerializer
14
14
val LOG = java.util.logging.Logger .getLogger(" ScalaRawSocketSender" )
15
15
val host = h
16
16
val port = p
17
- val bufferCapacity = bufCap
17
+ val bufferCapacity = bufCap
18
18
val timeout = to
19
19
val name = " %s_%d_%d_%d" .format(host, port, timeout, bufferCapacity)
20
20
val pendings = ByteBuffer .allocate(bufferCapacity)
21
21
val server = new InetSocketAddress (host, port)
22
22
val reconnector = new ExponentialDelayReconnector ()
23
- var socket : Socket = null
24
- var out : BufferedOutputStream = null
23
+ var socket : Socket = null
24
+ var out : BufferedOutputStream = null
25
25
open()
26
26
27
27
def this (host: String , port: Int ) {
@@ -96,7 +96,7 @@ class ScalaRawSocketSender(h:String, p:Int, to:Int, bufCap:Int)
96
96
}
97
97
98
98
def emit (tag : String , timestamp : Long , data : Map [String , Any ]): Boolean = {
99
- emit(new Event (tag, timestamp, data))
99
+ emit(Event (tag, timestamp, data))
100
100
}
101
101
102
102
def emit (event : Event ): Boolean = {
@@ -107,7 +107,7 @@ class ScalaRawSocketSender(h:String, p:Int, to:Int, bufCap:Int)
107
107
try {
108
108
// serialize tag, timestamp and data
109
109
val json = Serialization .write(event)
110
- return send(json.getBytes(" UTF-8" ))
110
+ send(json.getBytes(" UTF-8" ))
111
111
} catch {
112
112
case e : IOException =>
113
113
LOG .severe(s " Cannot serialize event: $event" )
@@ -155,14 +155,14 @@ class ScalaRawSocketSender(h:String, p:Int, to:Int, bufCap:Int)
155
155
clearBuffer()
156
156
} catch {
157
157
case e : IOException =>
158
- LOG .throwing(this .getClass() .getName() , " flush" , e)
158
+ LOG .throwing(this .getClass.getName, " flush" , e)
159
159
reconnector.addErrorHistory(System .currentTimeMillis())
160
160
}
161
161
}
162
162
163
163
def getName (): String = name
164
164
165
- override def toString () : String = {
165
+ override def toString : String = {
166
166
getName()
167
167
}
168
168
}
0 commit comments