Skip to content

Commit eba445a

Browse files
authored
Merge pull request #117 from retronym/topic/javaVersionField-fixup
2 parents b1a92a2 + bd8aabc commit eba445a

File tree

2 files changed

+22
-10
lines changed

2 files changed

+22
-10
lines changed

infrastructure/src/main/java/scala/bench/DataMigrator.java

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
import org.influxdb.dto.Query;
77
import org.influxdb.dto.QueryResult;
88

9-
import java.io.IOException;
109
import java.time.Instant;
1110
import java.util.*;
1211
import java.util.concurrent.TimeUnit;
@@ -54,7 +53,13 @@ public static void main(String[] args) {
5453
LinkedHashMap<String, Object> newFieldsMap = new LinkedHashMap<>();
5554
assert (newFieldNames.size() == newValues.size());
5655
for (int i = 0; i < newFieldNames.size(); i++) {
57-
newFieldsMap.put(newFieldNames.get(i), newValues.get(i));
56+
String fieldName = newFieldNames.get(i);
57+
boolean isLong = fieldName.equals("sampleCount");
58+
if (isLong) {
59+
newFieldsMap.put(fieldName, ((Number) newValues.get(i)).longValue());
60+
} else {
61+
newFieldsMap.put(fieldName, newValues.get(i));
62+
}
5863
}
5964
builder.fields(newFieldsMap);
6065
Instant parse = Instant.parse(time);

infrastructure/src/main/java/scala/bench/GitWalker.java

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,16 @@ public static GitWalkerResult walk(Repository repo) {
2929
.retentionPolicy("autogen")
3030
.consistency(InfluxDB.ConsistencyLevel.ALL)
3131
.build();
32-
createPoints("2.13.x", "fc1aea6712", batchPoints, repo, branchesMap);
33-
createPoints("2.12.x", "132a0587ab", batchPoints, repo, branchesMap);
34-
createPoints("v2.12.0", "05016d9035", batchPoints, repo, branchesMap);
35-
createPoints("2.11.x", "7ac15a1210", batchPoints, repo, branchesMap);
36-
createPoints("2.10.x", "cc672b023e", batchPoints, repo, branchesMap);
37-
createPoints("2.9.x", "33e1dac4e4", batchPoints, repo, branchesMap);
32+
createPoints("2.13.x", null,"fc1aea6712", batchPoints, repo, branchesMap);
33+
createPoints("2.12.x", null, "132a0587ab", batchPoints, repo, branchesMap);
34+
35+
// There used to be a release branch v2.12.0. Looks to be deleted now? Use the v2.12.0 tag as the tip of this
36+
// virtual branch.
37+
createPoints("v2.12.0", "9a6ace1637053c094bfd395de540fe43c658b335","05016d9035", batchPoints, repo, branchesMap);
38+
39+
createPoints("2.11.x", null, "7ac15a1210", batchPoints, repo, branchesMap);
40+
createPoints("2.10.x", null, "cc672b023e", batchPoints, repo, branchesMap);
41+
createPoints("2.9.x", null, "33e1dac4e4", batchPoints, repo, branchesMap);
3842
return new GitWalkerResult(batchPoints, branchesMap, repo);
3943
}
4044

@@ -50,14 +54,17 @@ private static int countParentsWithSameCommitTime(RevCommit revCommit) {
5054

5155
static long adjustCommitTime(RevCommit revCommit) {
5256
int numParentsWithSameCommitTime = countParentsWithSameCommitTime(revCommit);
53-
return (long) revCommit.getCommitTime() * 1000L + numParentsWithSameCommitTime * 10;
57+
return (long) revCommit.getCommitTime() * 1000L + numParentsWithSameCommitTime * 10L;
5458
}
5559

5660
public void upload(BatchPoints batchPoints) {
5761

5862
}
5963

60-
private static BatchPoints createPoints(String branch, String forkPoint, BatchPoints batchPoints, Repository repo, Map<String, String> branchesMap) {
64+
private static BatchPoints createPoints(String branch, String branchRef, String forkPoint, BatchPoints batchPoints, Repository repo, Map<String, String> branchesMap) {
65+
if (branchRef != null) {
66+
branch = branchRef;
67+
}
6168
try {
6269
ObjectId resolvedBranch = resolve(branch, repo);
6370
ObjectId resolvedForkPoint = resolve(forkPoint, repo);

0 commit comments

Comments
 (0)