Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Use simple incrementing request ids instead of UUIDs.

  • Loading branch information...
commit ed4913c367a14bb89e6f058098f91a636b2bcf80 1 parent cc99799
Stephen Haberman authored
Showing with 8 additions and 4 deletions.
  1. +8 −4 src/main/scala/fakesdb/actions/Action.scala
12 src/main/scala/fakesdb/actions/Action.scala
View
@@ -1,7 +1,6 @@
package fakesdb.actions
import scala.xml.NodeSeq
-import java.util.UUID
import fakesdb._
abstract class Action(data: Data) {
@@ -9,7 +8,7 @@ abstract class Action(data: Data) {
def handle(params: Params): NodeSeq
protected def responseMetaData() = {
- <ResponseMetadata><RequestId>{requiestId}</RequestId><BoxUsage>0</BoxUsage></ResponseMetadata>
+ <ResponseMetadata><RequestId>{requestId}</RequestId><BoxUsage>0</BoxUsage></ResponseMetadata>
}
protected def parseDomain(params: Params): Domain = {
@@ -17,7 +16,12 @@ abstract class Action(data: Data) {
return data.getDomain(domainName).getOrElse(error("Invalid domain name "+domainName))
}
- protected def namespace = "http://sdb.amazonaws.com/doc/2009-04-15/"
- val requiestId = UUID.randomUUID()
+ val namespace = "http://sdb.amazonaws.com/doc/2009-04-15/"
+ val requestId = Action.requestCounter.incrementAndGet()
+
+}
+
+object Action {
+ private val requestCounter = new java.util.concurrent.atomic.AtomicInteger()
}
Please sign in to comment.
Something went wrong with that request. Please try again.