Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Use simple incrementing request ids instead of UUIDs.

  • Loading branch information...
commit ed4913c367a14bb89e6f058098f91a636b2bcf80 1 parent cc99799
Stephen Haberman authored

Showing 1 changed file with 8 additions and 4 deletions. Show diff stats Hide diff stats

  1. +8 4 src/main/scala/fakesdb/actions/Action.scala
12 src/main/scala/fakesdb/actions/Action.scala
... ... @@ -1,7 +1,6 @@
1 1 package fakesdb.actions
2 2
3 3 import scala.xml.NodeSeq
4   -import java.util.UUID
5 4 import fakesdb._
6 5
7 6 abstract class Action(data: Data) {
@@ -9,7 +8,7 @@ abstract class Action(data: Data) {
9 8 def handle(params: Params): NodeSeq
10 9
11 10 protected def responseMetaData() = {
12   - <ResponseMetadata><RequestId>{requiestId}</RequestId><BoxUsage>0</BoxUsage></ResponseMetadata>
  11 + <ResponseMetadata><RequestId>{requestId}</RequestId><BoxUsage>0</BoxUsage></ResponseMetadata>
13 12 }
14 13
15 14 protected def parseDomain(params: Params): Domain = {
@@ -17,7 +16,12 @@ abstract class Action(data: Data) {
17 16 return data.getDomain(domainName).getOrElse(error("Invalid domain name "+domainName))
18 17 }
19 18
20   - protected def namespace = "http://sdb.amazonaws.com/doc/2009-04-15/"
21   - val requiestId = UUID.randomUUID()
  19 + val namespace = "http://sdb.amazonaws.com/doc/2009-04-15/"
22 20
  21 + val requestId = Action.requestCounter.incrementAndGet()
  22 +
  23 +}
  24 +
  25 +object Action {
  26 + private val requestCounter = new java.util.concurrent.atomic.AtomicInteger()
23 27 }

0 comments on commit ed4913c

Please sign in to comment.
Something went wrong with that request. Please try again.