Skip to content
This repository has been archived by the owner on Jan 20, 2022. It is now read-only.

Feature/remove java util date #295

Merged
merged 10 commits into from
Oct 13, 2013
Merged

Conversation

ianoc
Copy link
Collaborator

@ianoc ianoc commented Oct 13, 2013

No description provided.

def earliestTimeOf(batch: BatchID) = new Date(Long.MinValue)
override def toInterval(b: BatchID): Interval[Date] =
def batchOf(t: Timestamp) = currentBatch
def earliestTimeOf(batch: BatchID) = Timestamp(Long.MinValue)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's add Timestamp.Min as a val in object Timestamp for this one.

after: Batcher) extends Batcher {

val batchAtBound: BatchID = before.batchOf(new Date(beforeBound.upper.getTime - 1L)) + 1L
val batchAtBound: BatchID = before.batchOf(Timestamp(beforeBound.upper.milliSinceEpoch - 1L)) + 1L
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

some .prev on the Timestamp.

// Make sure we cover at least an hour in the usual case by multiplying by ms per hour
val int = Interval.leftClosedRightOpen(d, new Date(d.getTime + (60L * 60L * 1000L * sl.get)))
val int = Interval.leftClosedRightOpen(d, Timestamp(d.milliSinceEpoch + (60L * 60L * 1000L * sl.get)))
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add a def incrementMillis(millis: Long): Timestamp to Timestamp? (similar incrementSeconds?)

@ianoc
Copy link
Collaborator Author

ianoc commented Oct 13, 2013

Changing to keep the on-wire just be a long, but off wire will be Timestamp

object Timestamp {
val Max = Timestamp(Long.MaxValue)
val Min = Timestamp(Long.MinValue)

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

def now: Timestamp = Timestamp(System.currentTimeMillis)

wouldn't that clean things up a bit?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good call, adding.

johnynek added a commit that referenced this pull request Oct 13, 2013
@johnynek johnynek merged commit a4f0002 into develop Oct 13, 2013
@johnynek johnynek deleted the feature/remove_java_util_date branch October 13, 2013 02:48
snoble pushed a commit to snoble/summingbird that referenced this pull request Sep 8, 2017
snoble pushed a commit to snoble/summingbird that referenced this pull request Sep 8, 2017
# for free to subscribe to this conversation on GitHub. Already have an account? #.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants