----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/38280/#review99312 -----------------------------------------------------------
I'm proposing some changes in this review which I think will greatly simplify the code. commons/src/main/java/org/apache/aurora/common/stats/TimeSeriesRepositoryImpl.java (line 123) <https://reviews.apache.org/r/38280/#comment156218> A lot of the mechanics here can be removed if BuildInfo just returned a Map<String, String>. This means checking of the properties are there and checking if the properties can be turned into a string. Also what is the benefit of turning numeric properties into Longs? Shouldn't we just export all the keys as Strings into the stat system? commons/src/main/java/org/apache/aurora/common/util/BuildInfo.java (line 40) <https://reviews.apache.org/r/38280/#comment156217> Since the properties we are interested in are basically a Map<String, String> I suggest we instead store a Map instead of a java properties object (which is mutable). We can initialize it to a an empty ImmutableMap and get rid of the Optional. `fetchProperties()` can load the properties and transform it into a Map by using Guava's `fromProperties` method: http://docs.guava-libraries.googlecode.com/git/javadoc/com/google/common/collect/Maps.html#fromProperties%28java.util.Properties%29 - Zameer Manji On Sept. 16, 2015, 2:53 p.m., Joe Smith wrote: > > ----------------------------------------------------------- > This is an automatically generated e-mail. To reply, visit: > https://reviews.apache.org/r/38280/ > ----------------------------------------------------------- > > (Updated Sept. 16, 2015, 2:53 p.m.) > > > Review request for Aurora, Maxim Khutornenko and Zameer Manji. > > > Bugs: AURORA-1473 > https://issues.apache.org/jira/browse/AURORA-1473 > > > Repository: aurora > > > Description > ------- > > Restore build properties within Scheduler vars endpoint and snapshots > > > Diffs > ----- > > api/src/main/thrift/org/apache/aurora/gen/storage.thrift > 670ba0850987308370e3c766048ad6ba246d9e29 > build-support/generate-build-properties PRE-CREATION > build.gradle 9c78aff101793b25e4c1196c170eaf282f73a9bf > > commons/src/main/java/org/apache/aurora/common/stats/TimeSeriesRepositoryImpl.java > c314a0d51e9377c7fe4371a05d7a9375a47a7bf5 > commons/src/main/java/org/apache/aurora/common/util/BuildInfo.java > PRE-CREATION > > commons/src/main/java/org/apache/aurora/common/util/testing/FakeBuildInfo.java > PRE-CREATION > > commons/src/test/java/org/apache/aurora/common/stats/TimeSeriesRepositoryImplTest.java > 89c134315dfdb4c55447032171ec3be8ec73823d > > src/main/java/org/apache/aurora/scheduler/storage/backup/TemporaryStorage.java > d76596c7422786e58b5a8aa79f324911cfd29b25 > > src/main/java/org/apache/aurora/scheduler/storage/log/SnapshotStoreImpl.java > 50838de8708d78fc0bd7ee672b7c7ba02dfcd505 > src/test/java/org/apache/aurora/scheduler/storage/backup/RecoveryTest.java > cc9c066556385c073962903691c037b0c07cc94c > > src/test/java/org/apache/aurora/scheduler/storage/log/SnapshotStoreImplTest.java > 6e032a6cef86e5f408bfc0d853a52c7f898d0db8 > > Diff: https://reviews.apache.org/r/38280/diff/ > > > Testing > ------- > > `./gradlew build -Pq` > > > Thanks, > > Joe Smith > >