Skip to content

Commit

Permalink
Merge pull request #64 from coryb/master
Browse files Browse the repository at this point in the history
preserve ctime/ftime on updates
  • Loading branch information
coryb committed Dec 26, 2013
2 parents 383082e + a7b0fe5 commit 9f85066
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/main/scala/com/netflix/edda/Collection.scala
Expand Up @@ -379,9 +379,9 @@ abstract class Collection(val ctx: Collection.Context) extends Queryable {
val oldRec = oldMap(pair._1)
val newRec = pair._2
if (newStateTimeForChange(newRec, oldRec)) {
pair._1 -> Collection.RecordUpdate(oldRec.copy(mtime = now, ltime = now), newRec)
pair._1 -> Collection.RecordUpdate(oldRec.copy(mtime = now, ltime = now), newRec.copy(ctime = oldRec.ctime, ftime = oldRec.ftime))
} else {
pair._1 -> Collection.RecordUpdate(oldRec.copy(mtime = now, ltime = now), newRec.copy(stime = oldRec.stime))
pair._1 -> Collection.RecordUpdate(oldRec.copy(mtime = now, ltime = now), newRec.copy(ctime = oldRec.ctime, ftime = oldRec.ftime, stime = oldRec.stime))
}
}
)
Expand Down
Expand Up @@ -115,7 +115,7 @@ object ElasticSearchDatastore {
}

private val dateTimeNoMillisRx = """^\d\d\d\d-\d\d-\d\dT\d\d:\d\d:\d\dZ$""".r
private val dateTimeRx = """^\d\d\d\d-\d\d-\d\dT\d\d:\d\d:\d\d(?:[.]\d\d?\d?)Z$""".r
private val dateTimeRx = """^\d\d\d\d-\d\d-\d\dT\d\d:\d\d:\d\d(?:[.]\d\d?\d?)Z$""".r

private[this] val logger = LoggerFactory.getLogger(getClass)
/** converts a ElasticSearch java object to a corresponding Scala basic object */
Expand Down

0 comments on commit 9f85066

Please sign in to comment.