Skip to content

Commit

Permalink
Three changes: import from the correct package, switch from Math to s…
Browse files Browse the repository at this point in the history
…cala.math, switch to .iterator. The second 2 are optional.
  • Loading branch information
Steve Jenson committed Dec 12, 2010
1 parent 439642c commit 0cb5811
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
Expand Up @@ -157,7 +157,7 @@ object SnowflakeServer {

if (timestamps.toSeq.size > 0) {
val avg = timestamps.foldLeft(0L)(_ + _) / peerCount
if (Math.abs(System.currentTimeMillis - avg) > 10000) {
if (math.abs(System.currentTimeMillis - avg) > 10000) {
log.error("Timestamp sanity check failed. Mean timestamp is %d, but mine is %d, " +
"so I'm more than 10s away from the mean", avg, System.currentTimeMillis)
throw new IllegalStateException("timestamp sanity check failed")
Expand Down
@@ -1,8 +1,8 @@
/** Copyright 2010 Twitter, Inc. */
package com.twitter.service.snowflake.client

import gen.Snowflake
import gen.Snowflake.Client
import com.twitter.service.snowflake.gen.Snowflake
import com.twitter.service.snowflake.gen.Snowflake.Client
import net.lag.configgy.{Config, Configgy}
import net.lag.logging.Logger
import org.apache.commons.pool.impl.{GenericObjectPool, StackKeyedObjectPoolFactory}
Expand Down
Expand Up @@ -116,7 +116,7 @@ class IdWorkerSpec extends Specification {
"sleep if we would rollover twice in the same millisecond" in {
var queue = new scala.collection.mutable.Queue[Long]()
val worker = new WakingIdWorker(1, 1)
val iter = List(2L, 2L, 3L).elements
val iter = List(2L, 2L, 3L).iterator
worker.timeMaker = (() => iter.next)
worker.sequence = 4095
worker.nextId
Expand Down

0 comments on commit 0cb5811

Please sign in to comment.