diff --git a/summingbird-batch-hadoop/src/test/scala/com/twitter/summingbird/batch/HDFSStateLaws.scala b/summingbird-batch-hadoop/src/test/scala/com/twitter/summingbird/batch/HDFSStateLaws.scala index e217fab8d..705525e66 100644 --- a/summingbird-batch-hadoop/src/test/scala/com/twitter/summingbird/batch/HDFSStateLaws.scala +++ b/summingbird-batch-hadoop/src/test/scala/com/twitter/summingbird/batch/HDFSStateLaws.scala @@ -81,7 +81,8 @@ class HDFSStateLaws extends WordSpec { } } - def leftClosedRightOpenInterval(low: Timestamp, high: Timestamp) = Interval.leftClosedRightOpen[Timestamp](low, high).right.get + def leftClosedRightOpenInterval(low: Timestamp, high: Timestamp): Interval[Timestamp] = + Interval.leftClosedRightOpen[Timestamp](low, high) def shouldNotAcceptInterval(state: WaitingState[Interval[Timestamp]], interval: Interval[Timestamp], message: String = "PreparedState accepted a bad Interval!") = { state.begin.willAccept(interval) match { diff --git a/summingbird-batch/src/main/scala/com/twitter/summingbird/batch/BatchID.scala b/summingbird-batch/src/main/scala/com/twitter/summingbird/batch/BatchID.scala index e2bffd92c..4bf96bb83 100644 --- a/summingbird-batch/src/main/scala/com/twitter/summingbird/batch/BatchID.scala +++ b/summingbird-batch/src/main/scala/com/twitter/summingbird/batch/BatchID.scala @@ -93,7 +93,7 @@ object BatchID { .flatMap { case (min, max, cnt) => if ((min + cnt) == (max + 1L)) { - Some(Interval.leftClosedRightOpen(min, max.next).right.get) + Some[Interval[BatchID]](Interval.leftClosedRightOpen(min, max.next)) } else { // These batches are not contiguous, not an interval None diff --git a/summingbird-batch/src/main/scala/com/twitter/summingbird/batch/TimeStamp.scala b/summingbird-batch/src/main/scala/com/twitter/summingbird/batch/TimeStamp.scala index 9c64bee36..6a0e50722 100644 --- a/summingbird-batch/src/main/scala/com/twitter/summingbird/batch/TimeStamp.scala +++ b/summingbird-batch/src/main/scala/com/twitter/summingbird/batch/TimeStamp.scala @@ -56,13 +56,11 @@ object Timestamp { implicit val timestampSuccessible: Successible[Timestamp] = new Successible[Timestamp] { def next(old: Timestamp) = if (old.milliSinceEpoch != Long.MaxValue) Some(old.next) else None def ordering: Ordering[Timestamp] = Timestamp.orderingOnTimestamp - def partialOrdering = Timestamp.orderingOnTimestamp } implicit val timestampPredecessible: Predecessible[Timestamp] = new Predecessible[Timestamp] { def prev(old: Timestamp) = if (old.milliSinceEpoch != Long.MinValue) Some(old.prev) else None def ordering: Ordering[Timestamp] = Timestamp.orderingOnTimestamp - def partialOrdering = Timestamp.orderingOnTimestamp } // This is a right semigroup, that given any two Timestamps just take the one on the right. diff --git a/summingbird-batch/src/test/scala/com/twitter/summingbird/batch/BatchLaws.scala b/summingbird-batch/src/test/scala/com/twitter/summingbird/batch/BatchLaws.scala index b32247a98..131556175 100644 --- a/summingbird-batch/src/test/scala/com/twitter/summingbird/batch/BatchLaws.scala +++ b/summingbird-batch/src/test/scala/com/twitter/summingbird/batch/BatchLaws.scala @@ -68,10 +68,7 @@ object BatchLaws extends Properties("BatchID") { forAll(Arbitrary.arbitrary[BatchID], Gen.choose(0L, 1000L)) { (b1: BatchID, diff: Long) => // We can't enumerate too much: val b2 = b1 + diff - val interval = Interval.leftClosedRightOpen(b1, b2.next) match { - case Left(i) => i - case Right(i) => i - } + val interval: Interval[BatchID] = Interval.leftClosedRightOpen(b1, b2.next) (BatchID.toInterval(BatchID.range(b1, b2)) == Some(interval)) && BatchID.toIterable(interval).toList == BatchID.range(b1, b2).toList } diff --git a/summingbird-builder/src/main/scala/com/twitter/summingbird/scalding/VersionedState.scala b/summingbird-builder/src/main/scala/com/twitter/summingbird/scalding/VersionedState.scala index 1154796fa..5d03a57c8 100644 --- a/summingbird-builder/src/main/scala/com/twitter/summingbird/scalding/VersionedState.scala +++ b/summingbird-builder/src/main/scala/com/twitter/summingbird/scalding/VersionedState.scala @@ -81,7 +81,7 @@ private[scalding] class VersionedState(meta: HDFSMetadata, startDate: Option[Tim Interval.leftClosedRightOpen( batcher.earliestTimeOf(beginning), batcher.earliestTimeOf(end) - ).right.get + ) } def willAccept(available: Interval[Timestamp]) =