forked from deephaven/deephaven-core
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #5 from rcaudy/rwc-remove_dt
Remove io.deephaven.time.DateTime and migrate all usages to java.time.Instant
- Loading branch information
Showing
1,882 changed files
with
127,247 additions
and
128,969 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
54 changes: 0 additions & 54 deletions
54
BenchmarkSupport/src/main/java/io/deephaven/benchmarking/generator/DateColumnGenerator.java
This file was deleted.
Oops, something went wrong.
56 changes: 56 additions & 0 deletions
56
...markSupport/src/main/java/io/deephaven/benchmarking/generator/InstantColumnGenerator.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
/** | ||
* Copyright (c) 2016-2022 Deephaven Data Labs and Patent Pending | ||
*/ | ||
package io.deephaven.benchmarking.generator; | ||
|
||
import io.deephaven.engine.table.ColumnDefinition; | ||
import io.deephaven.time.DateTimeUtils; | ||
import io.deephaven.benchmarking.generator.random.ExtendedRandom; | ||
|
||
import java.time.Instant; | ||
|
||
public class InstantColumnGenerator implements ColumnGenerator<Instant> { | ||
|
||
private NumGenerator gen; | ||
private final ColumnDefinition<Instant> def; | ||
private final long min; | ||
private final long max; | ||
|
||
public InstantColumnGenerator(String name) { | ||
this(name, 0, Long.MAX_VALUE); | ||
} | ||
|
||
public InstantColumnGenerator(String name, Instant min, Instant max) { | ||
this(name, DateTimeUtils.epochNanos(min), DateTimeUtils.epochNanos(max)); | ||
} | ||
|
||
private InstantColumnGenerator(String name, long min, long max) { | ||
def = ColumnDefinition.ofTime(name); | ||
this.min = min; | ||
this.max = max; | ||
} | ||
|
||
@Override | ||
public ColumnDefinition<Instant> getDefinition() { | ||
return def; | ||
} | ||
|
||
@Override | ||
public String getUpdateString(String varName) { | ||
return def.getName() + "=(DateTime)" + varName + ".get()"; | ||
} | ||
|
||
@Override | ||
public String getName() { | ||
return def.getName(); | ||
} | ||
|
||
@Override | ||
public void init(ExtendedRandom random) { | ||
gen = new NumGenerator(min, max, random); | ||
} | ||
|
||
public Instant get() { | ||
return DateTimeUtils.epochNanosToInstant(gen.getLong()); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.