Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Readded imports that were programmatically removed #135

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
@@ -1,6 +1,10 @@
package com.twitter.finagle.mysql package com.twitter.finagle.mysql


import com.twitter.finagle.mysql.util.Query import com.twitter.finagle.mysql.util.Query
import com.twitter.finagle.builder.ClientBuilder
import com.twitter.finagle.mysql.protocol._
import com.twitter.finagle.ServiceFactory
import com.twitter.util.Future


object Client { object Client {
/** /**
Expand Down
@@ -1,8 +1,11 @@
package com.twitter.finagle.mysql package com.twitter.finagle.mysql


import com.twitter.finagle.mysql.codec.{PacketFrameDecoder, Endec} import com.twitter.finagle._
import com.twitter.finagle.mysql.codec.{PacketFrameDecoder, Endec}
import com.twitter.finagle.mysql.protocol._ import com.twitter.finagle.mysql.protocol._
import com.twitter.finagle.mysql.protocol.Capability._ import com.twitter.finagle.mysql.protocol.Capability._
import com.twitter.util.Future
import org.jboss.netty.channel.{ChannelPipelineFactory, Channels, Channel}


class MySQL(username: String, password: String, database: Option[String]) class MySQL(username: String, password: String, database: Option[String])
extends CodecFactory[Request, Result] { extends CodecFactory[Request, Result] {
Expand Down Expand Up @@ -82,4 +85,4 @@ class AuthenticationProxy(
loginRes <- service(makeLoginReq(sg)) loginRes <- service(makeLoginReq(sg))
_ <- acceptLogin(loginRes) _ <- acceptLogin(loginRes)
} yield service } yield service
} }
@@ -1,3 +1,9 @@
import com.twitter.conversions.time._
import com.twitter.util.Try
import com.twitter.finagle.mysql._
import com.twitter.finagle.mysql.protocol._
import com.twitter.util.Future
import java.net.InetSocketAddress
import java.sql.Date import java.sql.Date


case class SwimmingRecord( case class SwimmingRecord(
Expand Down Expand Up @@ -132,4 +138,4 @@ object Main {
parseArgs(parsed + ("password" -> value), tail) parseArgs(parsed + ("password" -> value), tail)
case unknown :: tail => parsed case unknown :: tail => parsed
} }
} }
Expand Up @@ -2,6 +2,9 @@ package com.twitter.finagle.mysql.codec


import com.twitter.finagle.mysql.ClientError import com.twitter.finagle.mysql.ClientError
import com.twitter.finagle.mysql.protocol._ import com.twitter.finagle.mysql.protocol._
import com.twitter.logging.Logger
import org.jboss.netty.buffer.{ChannelBuffer, ChannelBuffers}
import org.jboss.netty.channel._


sealed trait State sealed trait State
case object Idle extends State case object Idle extends State
Expand Down Expand Up @@ -171,4 +174,4 @@ class Endec extends SimpleChannelHandler {
case _ => case _ =>
throw new ClientError("Endec: Unexpected state when defragmenting packets.") throw new ClientError("Endec: Unexpected state when defragmenting packets.")
} }
} }
Expand Up @@ -2,6 +2,10 @@ package com.twitter.finagle.mysql.codec


import com.twitter.finagle.mysql.protocol.{Packet, BufferReader} import com.twitter.finagle.mysql.protocol.{Packet, BufferReader}
import com.twitter.finagle.mysql.util.BufferUtil import com.twitter.finagle.mysql.util.BufferUtil
import com.twitter.logging.Logger
import org.jboss.netty.buffer.ChannelBuffer
import org.jboss.netty.channel.{Channel, ChannelHandlerContext}
import org.jboss.netty.handler.codec.frame.FrameDecoder


/** /**
* Decodes logical MySQL packets that could be fragmented across * Decodes logical MySQL packets that could be fragmented across
Expand Down Expand Up @@ -37,4 +41,4 @@ class PacketFrameDecoder extends FrameDecoder {


Packet(length, seq, body) Packet(length, seq, body)
} }
} }
Expand Up @@ -3,6 +3,8 @@ package com.twitter.finagle.mysql.protocol
import com.twitter.finagle.mysql.ClientError import com.twitter.finagle.mysql.ClientError
import java.nio.charset.{Charset => JCharset} import java.nio.charset.{Charset => JCharset}
import java.nio.ByteOrder import java.nio.ByteOrder
import org.jboss.netty.buffer.ChannelBuffer
import org.jboss.netty.buffer.ChannelBuffers.wrappedBuffer


/** /**
* The BufferReader and BufferWriter interfaces provide methods for * The BufferReader and BufferWriter interfaces provide methods for
Expand Down
@@ -1,5 +1,7 @@
package com.twitter.finagle.mysql.protocol package com.twitter.finagle.mysql.protocol


import org.jboss.netty.buffer.ChannelBuffer
import org.jboss.netty.buffer.ChannelBuffers.wrappedBuffer


/** /**
* Represents a logical packet received from MySQL. * Represents a logical packet received from MySQL.
Expand Down Expand Up @@ -37,4 +39,4 @@ object Packet {


def toChannelBuffer(size: Int, seq: Short, body: Array[Byte]): ChannelBuffer = def toChannelBuffer(size: Int, seq: Short, body: Array[Byte]): ChannelBuffer =
toChannelBuffer(size, seq, wrappedBuffer(body)) toChannelBuffer(size, seq, wrappedBuffer(body))
} }
@@ -1,5 +1,6 @@
package com.twitter.finagle.mysql.protocol package com.twitter.finagle.mysql.protocol


import com.twitter.util.Promise


case class PreparedStatement(statementId: Int, numberOfParams: Int) extends Result { case class PreparedStatement(statementId: Int, numberOfParams: Int) extends Result {
val statement: Promise[String] = new Promise[String]() val statement: Promise[String] = new Promise[String]()
Expand Down
@@ -1,5 +1,9 @@
package com.twitter.finagle.mysql.protocol package com.twitter.finagle.mysql.protocol


import com.twitter.logging.Logger
import org.jboss.netty.buffer.ChannelBuffer
import org.jboss.netty.buffer.ChannelBuffers.{wrappedBuffer, EMPTY_BUFFER}



object Command { object Command {
val COM_SLEEP = 0x00.toByte // internal thread state val COM_SLEEP = 0x00.toByte // internal thread state
Expand Down Expand Up @@ -179,4 +183,4 @@ case class CloseRequest(ps: PreparedStatement) extends CommandRequest(Command.CO
bw.writeByte(cmd).writeInt(ps.statementId) bw.writeByte(cmd).writeInt(ps.statementId)
bw.toChannelBuffer bw.toChannelBuffer
} }
} }