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.
Rewrite Java Time Libs (deephaven#3856)
A complete rewrite of the time libraries and standardization of engine operations in terms of java.time.* types. * Replace Joda and Deephaven types with standard java.time.* types. * Remove deprecated methods. * Consistently name methods and parameters. * Add missing methods. * Handle parsing more data formats, especially ISO formats. * Change literal formats to be in line with ISO. * User customizable time zone aliases. * Use the java default time zone as the default time zone. * High test coverage. --------- Co-authored-by: Ryan Caudy <[email protected]> Co-authored-by: Colin Alworth <[email protected]>
- Loading branch information
1 parent
4ef4d32
commit a4f154d
Showing
1,987 changed files
with
136,722 additions
and
132,567 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
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.