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.
- Loading branch information
1 parent
17b94a0
commit 2cdbc58
Showing
175 changed files
with
8,039 additions
and
83 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
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
12 changes: 12 additions & 0 deletions
12
DB/src/main/java/io/deephaven/db/tables/OperationsToTableImpl.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,12 @@ | ||
package io.deephaven.db.tables; | ||
|
||
import io.deephaven.qst.TableCreation.OperationsToTable; | ||
|
||
enum OperationsToTableImpl implements OperationsToTable<Table, Table> { | ||
INSTANCE; | ||
|
||
@Override | ||
public final Table of(Table table) { | ||
return table; | ||
} | ||
} |
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
67 changes: 67 additions & 0 deletions
67
DB/src/main/java/io/deephaven/db/tables/TableCreationImpl.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,67 @@ | ||
package io.deephaven.db.tables; | ||
|
||
import io.deephaven.db.tables.utils.DBDateTime; | ||
import io.deephaven.db.tables.utils.DBTimeUtils; | ||
import io.deephaven.db.tables.utils.TableTools; | ||
import io.deephaven.db.v2.InMemoryTable; | ||
import io.deephaven.qst.TableCreation; | ||
import io.deephaven.qst.table.EmptyTable; | ||
import io.deephaven.qst.table.NewTable; | ||
import io.deephaven.qst.table.TableSpec; | ||
import io.deephaven.qst.table.TimeProvider; | ||
import io.deephaven.qst.table.TimeProviderSystem; | ||
import io.deephaven.qst.table.TimeTable; | ||
|
||
import java.util.Collection; | ||
import java.util.Objects; | ||
|
||
enum TableCreationImpl implements TableCreation<Table> { | ||
INSTANCE; | ||
|
||
public static Table create(TableSpec table) { | ||
return TableCreation.create(INSTANCE, TableToOperationsImpl.INSTANCE, OperationsToTableImpl.INSTANCE, table); | ||
} | ||
|
||
@Override | ||
public final Table of(NewTable newTable) { | ||
return InMemoryTable.from(newTable); | ||
} | ||
|
||
@Override | ||
public final Table of(EmptyTable emptyTable) { | ||
return TableTools.emptyTable(emptyTable.size()); | ||
} | ||
|
||
@Override | ||
public final Table of(TimeTable timeTable) { | ||
final io.deephaven.db.v2.utils.TimeProvider provider = TimeProviderAdapter | ||
.of(timeTable.timeProvider()); | ||
final DBDateTime firstTime = timeTable.startTime().map(DBDateTime::of).orElse(null); | ||
return TableTools.timeTable(provider, firstTime, timeTable.interval().toNanos()); | ||
} | ||
|
||
@Override | ||
public final Table merge(Collection<Table> tables) { | ||
return TableTools.merge(tables); | ||
} | ||
|
||
static class TimeProviderAdapter implements TimeProvider.Visitor { | ||
|
||
public static io.deephaven.db.v2.utils.TimeProvider of(TimeProvider provider) { | ||
return provider.walk(new TimeProviderAdapter()).getOut(); | ||
} | ||
|
||
private static final io.deephaven.db.v2.utils.TimeProvider SYSTEM_PROVIDER = DBTimeUtils::currentTime; | ||
|
||
private io.deephaven.db.v2.utils.TimeProvider out; | ||
|
||
public io.deephaven.db.v2.utils.TimeProvider getOut() { | ||
return Objects.requireNonNull(out); | ||
} | ||
|
||
@Override | ||
public void visit(TimeProviderSystem system) { | ||
out = SYSTEM_PROVIDER; | ||
} | ||
} | ||
} |
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
12 changes: 12 additions & 0 deletions
12
DB/src/main/java/io/deephaven/db/tables/TableToOperationsImpl.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,12 @@ | ||
package io.deephaven.db.tables; | ||
|
||
import io.deephaven.qst.TableCreation.TableToOperations; | ||
|
||
enum TableToOperationsImpl implements TableToOperations<Table, Table> { | ||
INSTANCE; | ||
|
||
@Override | ||
public final Table of(Table table) { | ||
return table; | ||
} | ||
} |
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.