-
Notifications
You must be signed in to change notification settings - Fork 80
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Add withRecomputeOnModifiedRow to SelectColumn. (#6339)
- Loading branch information
Showing
8 changed files
with
338 additions
and
99 deletions.
There are no files selected for viewing
44 changes: 44 additions & 0 deletions
44
...c/main/java/io/deephaven/engine/table/impl/select/RecomputeOnModifiedRowSelectColumn.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,44 @@ | ||
// | ||
// Copyright (c) 2016-2024 Deephaven Data Labs and Patent Pending | ||
// | ||
package io.deephaven.engine.table.impl.select; | ||
|
||
import io.deephaven.api.ColumnName; | ||
import io.deephaven.api.expression.Expression; | ||
import io.deephaven.engine.rowset.TrackingRowSet; | ||
import io.deephaven.engine.table.ColumnDefinition; | ||
import io.deephaven.engine.table.ColumnSource; | ||
import io.deephaven.engine.table.WritableColumnSource; | ||
import io.deephaven.engine.table.impl.BaseTable; | ||
import io.deephaven.engine.table.impl.MatchPair; | ||
import io.deephaven.engine.table.impl.QueryCompilerRequestProcessor; | ||
import org.jetbrains.annotations.NotNull; | ||
|
||
import java.util.List; | ||
import java.util.Map; | ||
|
||
/** | ||
* {@link SelectColumn} implementation that wraps another {@link SelectColumn} and makes it report that values should be | ||
* recomputed when the row is modified via {@link #recomputeOnModifiedRow()}. | ||
*/ | ||
class RecomputeOnModifiedRowSelectColumn extends WrappedSelectColumn { | ||
|
||
RecomputeOnModifiedRowSelectColumn(@NotNull final SelectColumn inner) { | ||
super(inner); | ||
} | ||
|
||
@Override | ||
public SelectColumn copy() { | ||
return new RecomputeOnModifiedRowSelectColumn(inner.copy()); | ||
} | ||
|
||
@Override | ||
public boolean recomputeOnModifiedRow() { | ||
return true; | ||
} | ||
|
||
@Override | ||
public SelectColumn withRecomputeOnModifiedRow() { | ||
return copy(); | ||
} | ||
} |
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
134 changes: 134 additions & 0 deletions
134
engine/table/src/main/java/io/deephaven/engine/table/impl/select/WrappedSelectColumn.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,134 @@ | ||
// | ||
// Copyright (c) 2016-2024 Deephaven Data Labs and Patent Pending | ||
// | ||
package io.deephaven.engine.table.impl.select; | ||
|
||
import io.deephaven.api.ColumnName; | ||
import io.deephaven.api.expression.Expression; | ||
import io.deephaven.engine.rowset.TrackingRowSet; | ||
import io.deephaven.engine.table.ColumnDefinition; | ||
import io.deephaven.engine.table.ColumnSource; | ||
import io.deephaven.engine.table.WritableColumnSource; | ||
import io.deephaven.engine.table.impl.BaseTable; | ||
import io.deephaven.engine.table.impl.MatchPair; | ||
import io.deephaven.engine.table.impl.QueryCompilerRequestProcessor; | ||
import org.jetbrains.annotations.NotNull; | ||
|
||
import java.util.List; | ||
import java.util.Map; | ||
|
||
/** | ||
* {@link SelectColumn} implementation that wraps another {@link SelectColumn}. | ||
*/ | ||
abstract class WrappedSelectColumn implements SelectColumn { | ||
|
||
/** | ||
* The select column that is being wrapped. | ||
*/ | ||
protected final SelectColumn inner; | ||
|
||
WrappedSelectColumn(@NotNull final SelectColumn inner) { | ||
this.inner = inner; | ||
} | ||
|
||
@Override | ||
public List<String> initInputs( | ||
@NotNull final TrackingRowSet rowSet, | ||
@NotNull final Map<String, ? extends ColumnSource<?>> columnsOfInterest) { | ||
return inner.initInputs(rowSet, columnsOfInterest); | ||
} | ||
|
||
@Override | ||
public List<String> initDef(@NotNull final Map<String, ColumnDefinition<?>> columnDefinitionMap) { | ||
return inner.initDef(columnDefinitionMap); | ||
} | ||
|
||
@Override | ||
public List<String> initDef( | ||
@NotNull final Map<String, ColumnDefinition<?>> columnDefinitionMap, | ||
@NotNull final QueryCompilerRequestProcessor compilationRequestProcessor) { | ||
return inner.initDef(columnDefinitionMap, compilationRequestProcessor); | ||
} | ||
|
||
@Override | ||
public Class<?> getReturnedType() { | ||
return inner.getReturnedType(); | ||
} | ||
|
||
@Override | ||
public Class<?> getReturnedComponentType() { | ||
return inner.getReturnedComponentType(); | ||
} | ||
|
||
@Override | ||
public List<String> getColumns() { | ||
return inner.getColumns(); | ||
} | ||
|
||
@Override | ||
public List<String> getColumnArrays() { | ||
return inner.getColumnArrays(); | ||
} | ||
|
||
@Override | ||
@NotNull | ||
public ColumnSource<?> getDataView() { | ||
return inner.getDataView(); | ||
} | ||
|
||
@Override | ||
@NotNull | ||
public ColumnSource<?> getLazyView() { | ||
return inner.getLazyView(); | ||
} | ||
|
||
@Override | ||
public String getName() { | ||
return inner.getName(); | ||
} | ||
|
||
@Override | ||
public MatchPair getMatchPair() { | ||
return inner.getMatchPair(); | ||
} | ||
|
||
@Override | ||
public WritableColumnSource<?> newDestInstance(final long size) { | ||
return inner.newDestInstance(size); | ||
} | ||
|
||
@Override | ||
public WritableColumnSource<?> newFlatDestInstance(final long size) { | ||
return inner.newFlatDestInstance(size); | ||
} | ||
|
||
@Override | ||
public boolean isRetain() { | ||
return inner.isRetain(); | ||
} | ||
|
||
@Override | ||
public void validateSafeForRefresh(@NotNull final BaseTable<?> sourceTable) { | ||
inner.validateSafeForRefresh(sourceTable); | ||
} | ||
|
||
@Override | ||
public boolean isStateless() { | ||
return inner.isStateless(); | ||
} | ||
|
||
@Override | ||
public boolean recomputeOnModifiedRow() { | ||
return inner.recomputeOnModifiedRow(); | ||
} | ||
|
||
@Override | ||
public ColumnName newColumn() { | ||
return inner.newColumn(); | ||
} | ||
|
||
@Override | ||
public Expression expression() { | ||
return inner.expression(); | ||
} | ||
} |
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.